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