RTRlib
Loading...
Searching...
No Matches
spkitable_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
18#ifndef RTR_SPKI_PRIVATE_H
19#define RTR_SPKI_PRIVATE_H
20
22
23#include <stdint.h>
24
41
48
54
60
70
81int spki_table_get_all(struct spki_table *spki_table, uint32_t asn, uint8_t *ski, struct spki_record **result,
82 unsigned int *result_size);
83
93int spki_table_search_by_ski(struct spki_table *spki_table, uint8_t *ski, struct spki_record **result,
94 unsigned int *result_size);
95
105
113int spki_table_src_remove(struct spki_table *spki_table, const struct rtr_socket *socket);
114
123int spki_table_copy_except_socket(struct spki_table *src, struct spki_table *dest, struct rtr_socket *socket);
124
132void spki_table_notify_diff(struct spki_table *new_table, struct spki_table *old_table,
133 const struct rtr_socket *socket);
134
140void spki_table_swap(struct spki_table *a, struct spki_table *b);
141
142#endif
void spki_table_notify_diff(struct spki_table *new_table, struct spki_table *old_table, const struct rtr_socket *socket)
Notify client about changes between two spki tables regarding one specific socket.
int spki_table_copy_except_socket(struct spki_table *src, struct spki_table *dest, struct rtr_socket *socket)
Copy spki table except entries from the given socket.
int spki_table_add_entry(struct spki_table *spki_table, struct spki_record *spki_record)
Adds a spki_record to a spki_table.
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 spki_table_free(struct spki_table *spki_table)
Frees the memory associated with the spki_table.
void spki_table_swap(struct spki_table *a, struct spki_table *b)
tommy_hashlin and tommy_list of the argument tables
void spki_table_init(struct spki_table *spki_table, spki_update_fp update_fp)
Initializes the spki_table struct.
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.
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.
spki_rtvals
Possible return values for some spki_table_ functions.
Definition spkitable_private.h:28
int spki_table_remove_entry(struct spki_table *spki_table, struct spki_record *spki_record)
Removes spki_record from 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)
Returns all spki_record whose ASN and SKI matches.
void spki_table_free_without_notify(struct spki_table *spki_table)
Frees the memory associated with the spki_table without calling the update callback.
@ SPKI_ERROR
Error occurred.
Definition spkitable_private.h:33
@ SPKI_RECORD_NOT_FOUND
spki_record wasn't found in the spki_table.
Definition spkitable_private.h:39
@ SPKI_DUPLICATE_RECORD
The supplied spki_record already exists in the spki_table.
Definition spkitable_private.h:36
@ SPKI_SUCCESS
Operation was successful.
Definition spkitable_private.h:30
uint8_t ski[SKI_SIZE]
Definition rtr_pdus.h:5
uint32_t asn
Definition rtr_pdus.h:6
A RTR socket.
Definition rtr.h:117
spki_record.
Definition spkitable.h:38
spki_table.
Definition ht-spkitable_private.h:27