RTRlib
Loading...
Searching...
No Matches
aspa.h File Reference
#include "rtrlib/aspa/aspa_array/aspa_array.h"
#include "rtrlib/lib/alloc_utils_private.h"
#include "rtrlib/rtr/rtr.h"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Data Structures

struct  aspa_record
 ASPA Record Customer (Customer Autonomous Systen, CAS) authorizes a set of provider AS numbers. More...
 
struct  aspa_table
 ASPA Table. More...
 

Typedefs

typedef 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 aspa_table.
 

Enumerations

enum  aspa_status { ASPA_SUCCESS = 0 , ASPA_ERROR = -1 , ASPA_DUPLICATE_RECORD = -2 , ASPA_RECORD_NOT_FOUND = -3 }
 Possible return values for aspa_* functions. More...
 
enum  aspa_direction { ASPA_UPSTREAM , ASPA_DOWNSTREAM }
 
enum  aspa_verification_result { ASPA_AS_PATH_UNKNOWN , ASPA_AS_PATH_INVALID , ASPA_AS_PATH_VALID }
 AS_PATH verification result. More...
 

Functions

enum __attribute__ ((__packed__)) aspa_operation_type
 An enum describing the type of operation the ASPA table should perform using any given ASPA record.
 
void aspa_table_init (struct aspa_table *aspa_table, aspa_update_fp update_fp)
 Initializes the aspa_table struct.
 
void aspa_table_free (struct aspa_table *aspa_table, bool notify)
 Frees the memory associated with the aspa_table.
 
enum aspa_status aspa_table_src_remove (struct aspa_table *aspa_table, struct rtr_socket *rtr_socket, bool notify)
 Removes all records in the aspa_table that originated from the socket.
 
enum aspa_verification_result aspa_verify_as_path (struct aspa_table *aspa_table, uint32_t as_path[], size_t len, enum aspa_direction direction)
 Verifies an AS_PATH .
 
size_t aspa_collapse_as_path (uint32_t as_path[], size_t len)
 Collapses an AS_PATH in-place, replacing in-series repetitions with single occurences.