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
32
struct
pfx_table
;
33
42
struct
pfx_record
{
43
uint32_t
asn
;
44
struct
lrtr_ip_addr
prefix
;
45
uint8_t
min_len
;
46
uint8_t
max_len
;
47
const
struct
rtr_socket
*
socket
;
48
};
49
56
typedef
void (*
pfx_update_fp
)(
struct
pfx_table
*
pfx_table
,
const
struct
pfx_record
record, const bool added);
57
65
struct
pfx_table
{
66
struct
trie_node
*
ipv4
;
67
struct
trie_node
*
ipv6
;
68
pfx_update_fp
update_fp
;
69
pthread_rwlock_t
lock
;
70
};
71
72
#endif
pfx_update_fp
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
ip.h
lrtr_ip_addr
The lrtr_ip_addr struct stores a IPv4 or IPv6 address in host byte order.
Definition
ip.h:38
pfx_record
pfx_record.
Definition
trie-pfx.h:42
pfx_record::asn
uint32_t asn
Definition
trie-pfx.h:43
pfx_record::socket
const struct rtr_socket * socket
Definition
trie-pfx.h:47
pfx_record::prefix
struct lrtr_ip_addr prefix
Definition
trie-pfx.h:44
pfx_record::max_len
uint8_t max_len
Definition
trie-pfx.h:46
pfx_record::min_len
uint8_t min_len
Definition
trie-pfx.h:45
pfx_table
pfx_table.
Definition
trie-pfx.h:65
pfx_table::lock
pthread_rwlock_t lock
Definition
trie-pfx.h:69
pfx_table::update_fp
pfx_update_fp update_fp
Definition
trie-pfx.h:68
pfx_table::ipv4
struct trie_node * ipv4
Definition
trie-pfx.h:66
pfx_table::ipv6
struct trie_node * ipv6
Definition
trie-pfx.h:67
rtr_socket
A RTR socket.
Definition
rtr.h:117
trie_node
trie_node
Definition
trie_private.h:29
rtrlib
pfx
trie
trie-pfx.h
Generated on Sat Jul 19 2025 17:27:35 for RTRlib by
1.9.8