41#ifdef RTRLIB_BGPSEC_ENABLED
133 const unsigned int refresh_interval,
const unsigned int expire_interval,
134 const unsigned int retry_interval);
224 const uint8_t mask_len,
enum pfxv_state *result);
237 unsigned int *result_count);
307#ifdef RTRLIB_BGPSEC_ENABLED
void(* aspa_update_fp)(struct aspa_table *aspa_table, const struct aspa_record record, const struct rtr_socket *rtr_socket, const enum aspa_operation_type operation_type)
A function pointer that is called if an record was added to the aspa_table or was removed from the as...
Definition aspa.h:69
int rtr_mgr_bgpsec_generate_signature(const struct rtr_bgpsec *data, uint8_t *private_key, struct rtr_signature_seg **new_signature)
Signing function for a BGPsec_PATH.
struct rtr_bgpsec * rtr_mgr_bgpsec_new(uint8_t alg, uint8_t safi, uint16_t afi, uint32_t my_as, uint32_t target_as, struct rtr_bgpsec_nlri *nlri)
Initializes and returns a pointer to a rtr_bgpsec struct.
struct rtr_bgpsec_nlri * nlri
Definition bgpsec.h:135
int rtr_mgr_bgpsec_prepend_sig_seg(struct rtr_bgpsec *bgpsec, struct rtr_signature_seg *new_seg)
Prepend a given Signature Segment to rtr_bgpsec::sigs.
void rtr_mgr_bgpsec_nlri_free(struct rtr_bgpsec_nlri *nlri)
int rtr_mgr_bgpsec_has_algorithm_suite(uint8_t alg_suite)
Check, if an algorithm suite is supported by RTRlib.
uint32_t my_as
Definition bgpsec.h:129
uint8_t safi
Definition bgpsec.h:127
struct rtr_bgpsec_nlri * rtr_mgr_bgpsec_nlri_new(int nlri_len)
int rtr_mgr_bgpsec_append_sig_seg(struct rtr_bgpsec *bgpsec, struct rtr_signature_seg *new_seg)
void rtr_mgr_bgpsec_free(struct rtr_bgpsec *bgpsec)
Free a rtr_bgpsec struct and any Secure Path and Signature Segments it holds.
int rtr_mgr_bgpsec_get_algorithm_suites(const uint8_t **algs_arr)
Returns pointer to a list that holds all supported algorithm suites.
int rtr_mgr_bgpsec_get_version(void)
Returns the highest supported BGPsec version.
uint16_t afi
Definition bgpsec.h:128
void rtr_mgr_free_secure_path(struct rtr_secure_path_seg *seg)
Free a Secure Path Segment and any segments that are pointed to by rtr_secure_path_seg::next.
struct rtr_signature_seg * rtr_mgr_bgpsec_pop_signature_seg(struct rtr_bgpsec *bgpsec)
Retrieve a pointer to the last appended Signature Segment from a bgpsec struct.
uint32_t target_as
Definition bgpsec.h:130
uint8_t nlri_len
Definition bgpsec.h:108
struct rtr_secure_path_seg * rtr_mgr_bgpsec_pop_secure_path_seg(struct rtr_bgpsec *bgpsec)
Retrieve a pointer to the last appended Secure Path Segment from a bgpsec struct.
void rtr_mgr_bgpsec_add_spki_record(struct rtr_mgr_config *config, struct spki_record *record)
void rtr_mgr_bgpsec_prepend_sec_path_seg(struct rtr_bgpsec *bgpsec, struct rtr_secure_path_seg *new_seg)
Prepend a given Secure Path Segment to rtr_bgpsec::path.
uint8_t alg
Definition bgpsec.h:126
void rtr_mgr_bgpsec_append_sec_path_seg(struct rtr_bgpsec *bgpsec, struct rtr_secure_path_seg *new_seg)
uint8_t pcount
Definition bgpsec.h:76
uint16_t sig_len
Definition bgpsec.h:91
struct rtr_signature_seg * rtr_mgr_bgpsec_new_signature_seg(uint8_t *ski, uint16_t sig_len, uint8_t *signature)
Return an allocated and initialized Signature.
struct rtr_secure_path_seg * rtr_mgr_bgpsec_new_secure_path_seg(uint8_t pcount, uint8_t flags, uint32_t asn)
Return an allocated and initialized Secure Path Segment.
uint8_t * nlri
Definition bgpsec.h:109
uint8_t * signature
The signature of the segment.
Definition bgpsec.h:93
int rtr_mgr_bgpsec_validate_as_path(const struct rtr_bgpsec *data, struct rtr_mgr_config *config)
Validation function for AS path validation.
void rtr_mgr_bgpsec_free_signatures(struct rtr_signature_seg *seg)
Free a signature and any signatures that are pointed to.
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:65
pfxv_state
Validation states returned from pfx_validate_origin.
Definition pfx.h:46
struct aspa_table * aspa_table
Definition rtr_mgr.h:92
int rtr_mgr_setup_sockets(struct rtr_mgr_config *config, 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)
struct rtr_socket ** sockets
Definition rtr_mgr.h:73
void * status_fp_data
Definition rtr_mgr.h:89
void rtr_mgr_free(struct rtr_mgr_config *config)
Frees all resources that were allocated from the rtr_mgr.
uint8_t preference
Definition rtr_mgr.h:75
bool rtr_mgr_conf_in_sync(struct rtr_mgr_config *config)
Check if rtr_mgr_group is fully synchronized with at least one group.
int rtr_mgr_add_group(struct rtr_mgr_config *config, const struct rtr_mgr_group *group)
Adds a new rtr_mgr_group to the linked list of a initialized config.
int rtr_mgr_remove_group(struct rtr_mgr_config *config, unsigned int preference)
Removes an existing rtr_mgr_group from the linked list of config.
struct rtr_mgr_group * rtr_mgr_get_first_group(struct rtr_mgr_config *config)
Returns the first, thus active group.
rtr_mgr_status
Status of a rtr_mgr_group.
Definition rtr_mgr.h:51
int rtr_mgr_for_each_group(struct rtr_mgr_config *config, void(*fp)(const struct rtr_mgr_group *group, void *data), void *data)
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.
int rtr_mgr_add_aspa_support(struct rtr_mgr_config *config, const aspa_update_fp aspa_update_fp)
Sets up ASPA support.
void(* rtr_mgr_status_fp)(const struct rtr_mgr_group *, enum rtr_mgr_status, const struct rtr_socket *, void *)
Definition rtr_mgr.h:79
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.
unsigned int sockets_len
Definition rtr_mgr.h:74
void rtr_mgr_stop(struct rtr_mgr_config *config)
Terminates rtr_socket connections.
struct spki_table * spki_table
Definition rtr_mgr.h:91
unsigned int len
Definition rtr_mgr.h:86
enum rtr_mgr_status status
Definition rtr_mgr.h:76
int rtr_mgr_start(struct rtr_mgr_config *config)
Establishes rtr_socket connections.
struct tommy_list_wrapper * groups
Definition rtr_mgr.h:85
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.
rtr_mgr_status_fp status_fp
Definition rtr_mgr.h:88
int rtr_mgr_add_spki_support(struct rtr_mgr_config *config, const spki_update_fp spki_update_fp)
Sets up BGPSEC support.
struct pfx_table * pfx_table
Definition rtr_mgr.h:90
int rtr_mgr_add_roa_support(struct rtr_mgr_config *config, const pfx_update_fp pfx_update_fp)
Sets up ROA support.
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.
pthread_rwlock_t mutex
Definition rtr_mgr.h:87
int rtr_mgr_init(struct rtr_mgr_config **config_out, struct rtr_mgr_group groups[], const unsigned int groups_len, const rtr_mgr_status_fp status_fp, void *status_fp_data)
Initializes a rtr_mgr_config.
const char * rtr_mgr_status_to_str(enum rtr_mgr_status status)
Converts a rtr_mgr_status to a String.
@ RTR_MGR_ERROR
Error occurred on at least one RTR socket.
Definition rtr_mgr.h:59
@ RTR_MGR_ESTABLISHED
All RTR sockets of the group are synchronized with rtr servers.
Definition rtr_mgr.h:57
@ RTR_MGR_CONNECTING
RTR sockets trying to establish a connection.
Definition rtr_mgr.h:55
@ RTR_MGR_CLOSED
RTR sockets are disconnected.
Definition rtr_mgr.h:53
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:52
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
uint8_t ski[SKI_SIZE]
Definition rtr_pdus.h:5
uint8_t flags
Definition rtr_pdus.h:2
uint32_t asn
Definition rtr_pdus.h:6
ASPA Table.
Definition aspa.h:83
The lrtr_ip_addr struct stores a IPv4 or IPv6 address in host byte order.
Definition ip.h:38
pfx_table.
Definition trie-pfx.h:65
This struct contains the Network Layer Reachability Information (NLRI).
Definition bgpsec.h:105
The data that is passed to the rtr_mgr_bgpsec_validate_as_path function.
Definition bgpsec.h:125
A set of RTR sockets.
Definition rtr_mgr.h:72
A single Secure Path Segment.
Definition bgpsec.h:73
A single Signature Segment.
Definition bgpsec.h:88
A RTR socket.
Definition rtr.h:117
spki_record.
Definition spkitable.h:38
spki_table.
Definition ht-spkitable_private.h:27
Definition rtr_mgr_private.h:17