Loading...
Searching...
No Matches
trie-pfx.h
/*
* This file is part of RTRlib.
*
* This file is subject to the terms and conditions of the MIT license.
* See the file LICENSE in the top level directory for more details.
*
* Website: http://rtrlib.realmv6.org/
*/
#ifndef RTR_TRIE_PFX
#define RTR_TRIE_PFX
#include "rtrlib/lib/ip.h"
#include <pthread.h>
#include <stdbool.h>
#include <stdint.h>
struct pfx_table;
struct pfx_record {
uint32_t asn;
struct lrtr_ip_addr prefix;
uint8_t min_len;
uint8_t max_len;
const struct rtr_socket *socket;
};
typedef void (*pfx_update_fp)(struct pfx_table *pfx_table, const struct pfx_record record, const bool added);
struct pfx_table {
struct trie_node *ipv4;
struct trie_node *ipv6;
pfx_update_fp update_fp;
pthread_rwlock_t lock;
};
#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
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_table
pfx_table.
Definition trie-pfx.h:65
rtr_socket
A RTR socket.
Definition rtr.h:116