RTRlib
Loading...
Searching...
No Matches
aspa_private.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
90#ifndef RTR_ASPA_PRIVATE_H
91#define RTR_ASPA_PRIVATE_H
92
93#include "aspa.h"
95#include "rtrlib/rtr/rtr.h"
96
97#include <stdbool.h>
98#include <stdint.h>
99
100#define ASPA_NOTIFY_NO_OPS 0
101
102#define ASPA_DBG1(a) lrtr_dbg("ASPA: " a)
103
104// MARK: - Verification
105
107
112enum aspa_hop_result aspa_check_hop(struct aspa_table *aspa_table, uint32_t customer_asn, uint32_t provider_asn);
113
114// MARK: - Storage
127
139 bool notify_dst, bool notify_src);
140
141// MARK: - Updating
152 size_t index;
153 enum aspa_operation_type type;
156};
157
158// MARK: - Swap-In Update Mechanism
178
202 struct aspa_update_operation *operations, size_t count,
203 struct aspa_update **update);
204
212
220
221// MARK: - In-Place Update Mechanism
222
241 struct aspa_update_operation *operations, size_t count,
242 struct aspa_update_operation **failed_operation);
243
259 struct aspa_update_operation *operations, size_t count,
260 struct aspa_update_operation *failed_operation);
261
267void aspa_table_update_in_place_cleanup(struct aspa_update_operation **operations, size_t count);
268
269#endif /* RTR_ASPA_PRIVATE_H */
void aspa_table_update_swap_in_discard(struct aspa_update **update)
Discards the given update, releases memory allocated while computing the update and unlocks update lo...
aspa_status
Possible return values for aspa_* functions.
Definition aspa.h:93
enum aspa_hop_result aspa_check_hop(struct aspa_table *aspa_table, uint32_t customer_asn, uint32_t provider_asn)
Checks a hop in the given AS_PATH.
enum aspa_status aspa_table_update_swap_in_compute(struct aspa_table *aspa_table, struct rtr_socket *rtr_socket, struct aspa_update_operation *operations, size_t count, struct aspa_update **update)
Computes an update structure that can later be applied to the given ASPA table.
void aspa_table_update_swap_in_apply(struct aspa_update **update)
Applies the given update, as previously computed by aspa_table_update_swap_in_compute,...
aspa_hop_result
Definition aspa_private.h:106
void aspa_table_update_in_place_cleanup(struct aspa_update_operation **operations, size_t count)
Releases operations and unused provider arrays.
enum aspa_status aspa_table_update_in_place_undo(struct aspa_table *aspa_table, struct rtr_socket *rtr_socket, struct aspa_update_operation *operations, size_t count, struct aspa_update_operation *failed_operation)
Tries to undo operations up to failed_operation and then releases all operations.
enum aspa_status aspa_table_update_in_place(struct aspa_table *aspa_table, struct rtr_socket *rtr_socket, struct aspa_update_operation *operations, size_t count, struct aspa_update_operation **failed_operation)
Updates the given ASPA table.
enum aspa_status aspa_table_src_replace(struct aspa_table *dst, struct aspa_table *src, struct rtr_socket *rtr_socket, bool notify_dst, bool notify_src)
Replaces all ASPA records associated with the given socket with the records in the src table.
@ ASPA_NOT_PROVIDER_PLUS
Definition aspa_private.h:106
@ ASPA_PROVIDER_PLUS
Definition aspa_private.h:106
@ ASPA_NO_ATTESTATION
Definition aspa_private.h:106
Struct which is similar in function to std::vector from C++.
Definition aspa_array.h:27
ASPA Record Customer (Customer Autonomous Systen, CAS) authorizes a set of provider AS numbers.
Definition aspa.h:39
A linked list storing the bond between a rtr_socket and an aspa_array .
Definition aspa_private.h:122
struct aspa_store_node * next
Definition aspa_private.h:125
struct aspa_array * aspa_array
Definition aspa_private.h:123
struct rtr_socket * rtr_socket
Definition aspa_private.h:124
ASPA Table.
Definition aspa.h:83
A struct describing a specific type of operation that should be performed using the attached ASPA rec...
Definition aspa_private.h:151
struct aspa_record record
Definition aspa_private.h:154
bool is_no_op
Definition aspa_private.h:155
size_t index
Definition aspa_private.h:152
enum aspa_operation_type type
Definition aspa_private.h:153
Computed ASPA update.
Definition aspa_private.h:170
struct aspa_table * table
Definition aspa_private.h:171
struct aspa_update_operation * operations
Definition aspa_private.h:172
struct aspa_update_operation * failed_operation
Definition aspa_private.h:174
struct aspa_array * new_array
Definition aspa_private.h:176
struct aspa_store_node * node
Definition aspa_private.h:175
size_t operation_count
Definition aspa_private.h:173
A RTR socket.
Definition rtr.h:117