1 /* 2 * This file is part of RTRlib. 3 * 4 * This file is subject to the terms and conditions of the MIT license. 5 * See the file LICENSE in the top level directory for more details. 6 * 7 * Website: http://rtrlib.realmv6.org/ 8 */ 9 #ifndef RTR_HT_SPKITABLE_PRIVATE_H 10 #define RTR_HT_SPKITABLE_PRIVATE_H 11 12 #include "rtrlib/spki/spkitable_private.h" 13 #include "rtrlib/spki/hashtable/tommyds-1.8/tommy.h" 14 15 typedef int (*hash_cmp_fp)(const void *arg, const void *obj); 16 17 /** 18 * @brief spki_table. 19 * @param hashtable Linear hashtable 20 * @param list List that holds the same entries as hashtable, used to iterate. 21 * @param cmp_fp Compare function used to find entries in the hashtable 22 * @param update_fp Update function, called when the hashtable changes 23 * @param lock Read-Write lock to prevent data races 24 */ 25 struct spki_table { 26 tommy_hashlin hashtable; 27 tommy_list list; 28 hash_cmp_fp cmp_fp; 29 spki_update_fp update_fp; 30 pthread_rwlock_t lock; 31 }; 32 33 #endif 34