00001
00002
00003
00004
00005
00006
00007
00008
00009
00023 #ifndef RTR_TRIE_PFX
00024 #define RTR_TRIE_PFX
00025 #include <pthread.h>
00026 #include <stdbool.h>
00027 #include <stdint.h>
00028
00029 #include "rtrlib/lib/ip.h"
00030
00031 struct pfx_table;
00032
00041 struct pfx_record {
00042 uint32_t asn;
00043 struct lrtr_ip_addr prefix;
00044 uint8_t min_len;
00045 uint8_t max_len;
00046 const struct rtr_socket *socket;
00047 };
00048
00055 typedef void (*pfx_update_fp)(struct pfx_table *pfx_table, const struct pfx_record record, const bool added);
00056
00064 struct pfx_table {
00065 struct trie_node *ipv4;
00066 struct trie_node *ipv6;
00067 pfx_update_fp update_fp;
00068 pthread_rwlock_t lock;
00069 };
00070
00071 #endif
00072