|
RTRlib
|
Data Structures | |
| struct | spki_record |
Macros | |
| #define | SKI_SIZE 20 |
| #define | SPKI_SIZE 91 |
Typedefs | |
| typedef void(* | spki_update_fp )(struct spki_table *spki_table, const struct spki_record record, const bool added) |
Enumerations | |
| enum | spki_rtvals { SPKI_SUCCESS = 0, SPKI_ERROR = -1, SPKI_DUPLICATE_RECORD = -2, SPKI_RECORD_NOT_FOUND = -3 } |
Functions | |
| int | spki_table_add_entry (struct spki_table *spki_table, struct spki_record *spki_record) |
| void | spki_table_free (struct spki_table *spki_table) |
| int | spki_table_get_all (struct spki_table *spki_table, uint32_t asn, uint8_t *ski, struct spki_record **result, unsigned int *result_size) |
| void | spki_table_init (struct spki_table *spki_table, spki_update_fp update_fp) |
| int | spki_table_remove_entry (struct spki_table *spki_table, struct spki_record *spki_record) |
| int | spki_table_search_by_ski (struct spki_table *spki_table, uint8_t *ski, struct spki_record **result, unsigned int *result_size) |
| int | spki_table_src_remove (struct spki_table *spki_table, const struct rtr_socket *socket) |
| typedef 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 spki_table.
| spki_table | which was updated. |
| record | spki_record that was modified. |
| added | True if the record was added, false if the record was removed. |
| enum spki_rtvals |
Possible return values for some spki_table_ functions.
| Enumerator | |
|---|---|
| SPKI_SUCCESS |
Operation was successfull. |
| SPKI_ERROR |
Error occured. |
| SPKI_DUPLICATE_RECORD |
The supplied spki_record already exists in the spki_table. |
| SPKI_RECORD_NOT_FOUND |
spki_record wasn't found in the spki_table. |
| int spki_table_add_entry | ( | struct spki_table * | spki_table, |
| struct spki_record * | spki_record | ||
| ) |
Adds a spki_record to a spki_table.
| [in] | spki_table | spki_table to use. |
| [in] | spki_record | spki_record that will be added. |
| void spki_table_free | ( | struct spki_table * | spki_table | ) |
Frees the memory associcated with the spki_table.
| [in] | spki_table | spki_table that will be initialized. |
Referenced by rtr_mgr_free().
| int spki_table_get_all | ( | struct spki_table * | spki_table, |
| uint32_t | asn, | ||
| uint8_t * | ski, | ||
| struct spki_record ** | result, | ||
| unsigned int * | result_size | ||
| ) |
Returns all spki_record whose ASN and SKI matches.
| [in] | spki_table | spki_table to use |
| [in] | asn | the AS number |
| [in] | ski | the 20 byte field which contains the SKI to search for |
| [out] | result | the result array. NULL if no records could be found |
| [out] | result_size | elment count of the result array |
Referenced by rtr_mgr_get_spki().
| void spki_table_init | ( | struct spki_table * | spki_table, |
| spki_update_fp | update_fp | ||
| ) |
Initializes the spki_table struct.
| [in] | spki_table | spki_table that will be initialized. |
| [in] | update_fp | Pointer to update function |
Referenced by rtr_mgr_init().
| int spki_table_remove_entry | ( | struct spki_table * | spki_table, |
| struct spki_record * | spki_record | ||
| ) |
Removes spki_record from spki_table.
| spki_table | spki_table to use |
| spki_record | spki_record to remove; |
| int spki_table_search_by_ski | ( | struct spki_table * | spki_table, |
| uint8_t * | ski, | ||
| struct spki_record ** | result, | ||
| unsigned int * | result_size | ||
| ) |
Returns all spki_record whose SKI number matches the given one.
| [in] | spki_table | spki_table to use |
| [in] | ski | the 20 byte field which contains the SKI to search for |
| [out] | result | the result array. NULL if no records could be found |
| [out] | result_size | elment count of the result array |
| int spki_table_src_remove | ( | struct spki_table * | spki_table, |
| const struct rtr_socket * | socket | ||
| ) |
Removes all entries in the spki_table that match the passed socket_id.
| [in] | spki_table | spki_table to use. |
| [in] | socket | origin socket of the record |
1.8.6