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 /** 8 * @file 9 * RTE SWX Key Comparison Functions 10 */ 11 12 #include <stdint.h> 13 #include <string.h> 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 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