RTRlib
Loading...
Searching...
No Matches
trie-pfx.h
Go to the documentation of this file.
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
23#ifndef RTR_TRIE_PFX
24#define RTR_TRIE_PFX
25
26#include "rtrlib/lib/ip.h"
27
28#include <pthread.h>
29#include <stdbool.h>
30#include <stdint.h>
31
32struct pfx_table;
33
42struct pfx_record {
43 uint32_t asn;
45 uint8_t min_len;
46 uint8_t max_len;
47 const struct rtr_socket *socket;
48};
49
56typedef void (*pfx_update_fp)(struct pfx_table *pfx_table, const struct pfx_record record, const bool added);
57
65struct pfx_table {
66 struct trie_node *ipv4;
67 struct trie_node *ipv6;
69 pthread_rwlock_t lock;
70};
71
72#endif
void(* pfx_update_fp)(struct pfx_table *pfx_table, const struct pfx_record record, const bool added)
A function pointer that is called if an record was added to the pfx_table or was removed from the pfx...
Definition trie-pfx.h:56
The lrtr_ip_addr struct stores a IPv4 or IPv6 address in host byte order.
Definition ip.h:38
pfx_record.
Definition trie-pfx.h:42
uint32_t asn
Definition trie-pfx.h:43
const struct rtr_socket * socket
Definition trie-pfx.h:47
struct lrtr_ip_addr prefix
Definition trie-pfx.h:44
uint8_t max_len
Definition trie-pfx.h:46
uint8_t min_len
Definition trie-pfx.h:45
pfx_table.
Definition trie-pfx.h:65
pthread_rwlock_t lock
Definition trie-pfx.h:69
pfx_update_fp update_fp
Definition trie-pfx.h:68
struct trie_node * ipv4
Definition trie-pfx.h:66
struct trie_node * ipv6
Definition trie-pfx.h:67
A RTR socket.
Definition rtr.h:117
trie_node
Definition trie_private.h:29