35 #include "rtrlib/pfx/pfx.h"
36 #include "rtrlib/rtr/rtr.h"
37 #include "rtrlib/spki/spkitable.h"
65 unsigned int sockets_len;
70 typedef void (*rtr_mgr_status_fp)(
const struct rtr_mgr_group *,
75 struct rtr_mgr_config {
78 pthread_mutex_t mutex;
79 rtr_mgr_status_fp status_fp;
123 const unsigned int groups_len,
124 const unsigned int refresh_interval,
125 const unsigned int expire_interval,
126 const unsigned int retry_interval,
129 const rtr_mgr_status_fp status_fp,
130 void *status_fp_data);
179 const uint8_t mask_len,
196 unsigned int *result_count);
void rtr_mgr_free(struct rtr_mgr_config *config)
Frees all resources that were allocated from the rtr_mgr.
Definition: rtr_mgr.c:403
int rtr_mgr_get_spki(struct rtr_mgr_config *config, const uint32_t asn, uint8_t *ski, struct spki_record **result, unsigned int *result_count)
Returns all SPKI records which match the given ASN and SKI.
Definition: rtr_mgr.c:429
rtr_mgr_status
Status of a rtr_mgr_group.
Definition: rtr_mgr.h:42
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:88
int rtr_mgr_init(struct rtr_mgr_config **config_out, struct rtr_mgr_group groups[], const unsigned int groups_len, const unsigned int refresh_interval, const unsigned int expire_interval, const unsigned int retry_interval, const pfx_update_fp update_fp, const spki_update_fp spki_update_fp, const rtr_mgr_status_fp status_fp, void *status_fp_data)
Initializes a rtr_mgr_config.
Definition: rtr_mgr.c:282
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:80
void rtr_mgr_for_each_ipv4_record(struct rtr_mgr_config *config, pfx_for_each_fp fp, void *data)
Iterates over all IPv4 records in the pfx_table.
spki_record.
Definition: spkitable.h:54
int rtr_mgr_validate(struct rtr_mgr_config *config, const uint32_t asn, const struct lrtr_ip_addr *prefix, const uint8_t mask_len, enum pfxv_state *result)
Validates the origin of a BGP-Route.
Definition: rtr_mgr.c:418
pfxv_state
Validation states returned from pfx_validate_origin.
Definition: pfx.h:46
The lrtr_ip_addr struct stores a IPv4 or IPv6 address in host byte order.
Definition: ip.h:32
A RTR socket.
Definition: rtr.h:106
void rtr_mgr_for_each_ipv6_record(struct rtr_mgr_config *config, pfx_for_each_fp fp, void *data)
Iterates over all IPv6 records in the pfx_table.
int rtr_mgr_start(struct rtr_mgr_config *config)
Establishes rtr_socket connections.
Definition: rtr_mgr.c:381
void(* spki_update_fp)(struct spki_table *spki_table, const struct spki_record record, const bool added)
A function pointer that is called if an record was added to the spki_table or was removed from the sp...
Definition: spkitable.h:68
A set of RTR sockets.
Definition: rtr_mgr.h:63
void rtr_mgr_stop(struct rtr_mgr_config *config)
Terminates rtr_socket connections.
Definition: rtr_mgr.c:439
const char * rtr_mgr_status_to_str(enum rtr_mgr_status status)
Converts a rtr_mgr_status to a String.
Definition: rtr_mgr.c:448
bool rtr_mgr_conf_in_sync(struct rtr_mgr_config *config)
Check if rtr_mgr_group is fully synchronized with at least one group.
Definition: rtr_mgr.c:387