xref: /dpdk/lib/table/rte_swx_keycmp.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
1da65740aSCristian Dumitrescu /* SPDX-License-Identifier: BSD-3-Clause
2da65740aSCristian Dumitrescu  * Copyright(c) 2022 Intel Corporation
3da65740aSCristian Dumitrescu  */
4da65740aSCristian Dumitrescu #ifndef __INCLUDE_RTE_SWX_KEYCMP_H__
5da65740aSCristian Dumitrescu #define __INCLUDE_RTE_SWX_KEYCMP_H__
6da65740aSCristian Dumitrescu 
7da65740aSCristian Dumitrescu /**
8da65740aSCristian Dumitrescu  * @file
9da65740aSCristian Dumitrescu  * RTE SWX Key Comparison Functions
10da65740aSCristian Dumitrescu  */
11da65740aSCristian Dumitrescu 
12da65740aSCristian Dumitrescu #include <stdint.h>
13da65740aSCristian Dumitrescu #include <string.h>
14da65740aSCristian Dumitrescu 
15*719834a6SMattias Rönnblom #ifdef __cplusplus
16*719834a6SMattias Rönnblom extern "C" {
17*719834a6SMattias Rönnblom #endif
18*719834a6SMattias Rönnblom 
19da65740aSCristian Dumitrescu /**
20da65740aSCristian Dumitrescu  * Key comparison function prototype
21da65740aSCristian Dumitrescu  *
22da65740aSCristian Dumitrescu  * @param[in] key1
23da65740aSCristian Dumitrescu  *   First key to compare. Must be non-NULL.
24da65740aSCristian Dumitrescu  * @param[in] key2
25da65740aSCristian Dumitrescu  *   Second key to compare. Must be non-NULL.
26da65740aSCristian Dumitrescu  * @param[in] key_size
27da65740aSCristian Dumitrescu  *   Key size in bytes.
28da65740aSCristian Dumitrescu  * @return
29da65740aSCristian Dumitrescu  *   0 when keys are different, 1 when keys are equal.
30da65740aSCristian Dumitrescu  */
31da65740aSCristian Dumitrescu typedef uint32_t
32da65740aSCristian Dumitrescu (*rte_swx_keycmp_func_t)(void *key1, void *key2, uint32_t key_size);
33da65740aSCristian Dumitrescu 
34da65740aSCristian Dumitrescu /**
35da65740aSCristian Dumitrescu  * Key comparison function get
36da65740aSCristian Dumitrescu  *
37da65740aSCristian Dumitrescu  * @param[in] key_size
38da65740aSCristian Dumitrescu  *   Key size in bytes.
39da65740aSCristian Dumitrescu  * @return
40da65740aSCristian Dumitrescu  *   Key comparison function for the given key size
41da65740aSCristian Dumitrescu  */
42da65740aSCristian Dumitrescu rte_swx_keycmp_func_t
43da65740aSCristian Dumitrescu rte_swx_keycmp_func_get(uint32_t key_size);
44da65740aSCristian Dumitrescu 
45da65740aSCristian Dumitrescu #ifdef __cplusplus
46da65740aSCristian Dumitrescu }
47da65740aSCristian Dumitrescu #endif
48da65740aSCristian Dumitrescu 
49da65740aSCristian Dumitrescu #endif
50