32 #include <sys/types.h>
33 #include "rtrlib/lib/ip.h"
34 #include "rtrlib/rtr/rtr.h"
123 int pfx_table_add(
struct pfx_table *pfx_table,
const struct pfx_record *pfx_record);
133 int pfx_table_remove(
struct pfx_table *pfx_table,
const struct pfx_record *pfx_record);
168 int pfx_table_validate_r(
struct pfx_table *pfx_table,
struct pfx_record **reason,
unsigned int *reason_len,
const uint32_t asn,
const struct ip_addr *prefix,
const uint8_t mask_len,
enum pfxv_state *result);
int pfx_table_remove(struct pfx_table *pfx_table, const struct pfx_record *pfx_record)
Removes a pfx_record from a pfx_table.
Definition: lpfst-pfx.c:212
One or more records that match the input prefix exists in the pfx_table but the prefix max_len or ASN...
Definition: pfx.h:66
void pfx_table_for_each_ipv4_record(struct pfx_table *pfx_table, pfx_for_each_fp fp, void *data)
Iterates over all IPv4 records in the pfx_table.
Definition: lpfst-pfx.c:459
The ip_addr struct stores a IPv4 or IPv6 address in host byte order.
Definition: ip.h:44
pfx_rtvals
Possible return values for pfx_ functions.
Definition: pfx.h:39
void(* pfx_for_each_fp)(const struct pfx_record *pfx_record, void *data)
A function pointer that is called for each record in the pfx_table.
Definition: pfx.h:100
void pfx_table_init(struct pfx_table *pfx_table, pfx_update_fp update_fp)
Initializes the pfx_table struct.
Definition: lpfst-pfx.c:57
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: pfx.h:92
void pfx_table_free(struct pfx_table *pfx_table)
Frees all memory associcated with the pfx_table.
Definition: lpfst-pfx.c:65
int pfx_table_add(struct pfx_table *pfx_table, const struct pfx_record *pfx_record)
Adds a pfx_record to a pfx_table.
Definition: lpfst-pfx.c:163
pfx_table.
Definition: lpfst-pfx.h:51
pfxv_state
Validation states returned from pfx_validate_origin.
Definition: pfx.h:58
int pfx_table_src_remove(struct pfx_table *pfx_table, const struct rtr_socket *socket)
Removes all entries in the pfx_table that match the passed socket_id value from a pfx_table...
Definition: lpfst-pfx.c:373
A RTR socket.
Definition: rtr.h:113
void pfx_table_for_each_ipv6_record(struct pfx_table *pfx_table, pfx_for_each_fp fp, void *data)
Iterates over all IPv6 records in the pfx_table.
Definition: lpfst-pfx.c:471
pfx_record.
Definition: pfx.h:78
No certificate for the route exists.
Definition: pfx.h:63
int pfx_table_validate_r(struct pfx_table *pfx_table, struct pfx_record **reason, unsigned int *reason_len, const uint32_t asn, const struct ip_addr *prefix, const uint8_t mask_len, enum pfxv_state *result)
Validates the origin of a BGP-Route and returns a list of pfx_record that decided the result...
Definition: lpfst-pfx.c:295
int pfx_table_validate(struct pfx_table *pfx_table, const uint32_t asn, const struct ip_addr *prefix, const uint8_t mask_len, enum pfxv_state *result)
Validates the origin of a BGP-Route.
Definition: lpfst-pfx.c:368