|
RTRlib
|
Data Structures | |
| struct | rtr_socket |
Macros | |
| #define | RTR_DBG(fmt,...) dbg("RTR Socket: " fmt, ## __VA_ARGS__) |
| #define | RTR_DBG1(a) dbg("RTR Socket: " a) |
Typedefs | |
| typedef void(* | rtr_connection_state_fp )(const struct rtr_socket *rtr_socket, const enum rtr_socket_state state, void *connection_state_fp_param) |
Enumerations | |
| enum | rtr_rtvals { RTR_SUCCESS = 0, RTR_ERROR = -1 } |
| enum | rtr_socket_state { RTR_CONNECTING, RTR_ESTABLISHED, RTR_RESET, RTR_SYNC, RTR_FAST_RECONNECT, RTR_ERROR_NO_DATA_AVAIL, RTR_ERROR_NO_INCR_UPDATE_AVAIL, RTR_ERROR_FATAL, RTR_ERROR_TRANSPORT, RTR_SHUTDOWN } |
Functions | |
| void | rtr_init (struct rtr_socket *rtr_socket, struct tr_socket *tr_socket, struct pfx_table *pfx_table, struct spki_table *spki_table, const unsigned int refresh_interval, const unsigned int expire_interval, rtr_connection_state_fp fp, void *fp_data) |
| int | rtr_start (struct rtr_socket *rtr_socket) |
| const char * | rtr_state_to_str (enum rtr_socket_state state) |
| void | rtr_stop (struct rtr_socket *rtr_socket) |
One rtr_socket communicates with a single RPKI-RTR server.
| enum rtr_socket_state |
States of the RTR socket.
| void rtr_init | ( | struct rtr_socket * | rtr_socket, |
| struct tr_socket * | tr_socket, | ||
| struct pfx_table * | pfx_table, | ||
| struct spki_table * | spki_table, | ||
| const unsigned int | refresh_interval, | ||
| const unsigned int | expire_interval, | ||
| rtr_connection_state_fp | fp, | ||
| void * | fp_data | ||
| ) |
Initializes a rtr_socket.
| [out] | rtr_socket | Pointer to the allocated rtr_socket that will be initialized. |
| [in] | tr_socket | Pointer to a tr_socket that will be used for the transport connection. If NULL the tr_socket element of the rtr_socket won't be changed. |
| [in] | pfx_table | pfx_table that stores the validation records obtained from the connected rtr server. |
| [in] | spki_table | spki_table that stores the router keys obtained from the connected rtr server. |
| [in] | refresh_interval | Interval in seconds between serial queries that are sent to the server. Must be <= 3600 |
| [in] | expire_interval | Stored validation records will be deleted if cache was unable to refresh data for this period. The default value is twice the refresh_interval. |
| [in] | fp | A callback function that is executed when the state of the socket changes. |
| [in] | fp_data | Parameter that is passed to the connection_state_fp callback. |
References RTR_SHUTDOWN.
Referenced by rtr_mgr_init().
| int rtr_start | ( | struct rtr_socket * | rtr_socket | ) |
Starts the RTR protocol state machine in a pthread. Connection to the rtr_server will be established and the pfx_records will be synced.
| [in] | rtr_socket | rtr_socket that will be used. |
| const char* rtr_state_to_str | ( | enum rtr_socket_state | state | ) |
Converts a rtr_socket_state to a String.
| [in] | state | state to convert to a string |
| void rtr_stop | ( | struct rtr_socket * | rtr_socket | ) |
Stops the RTR connection and terminate the transport connection.
| [in] | rtr_socket | rtr_socket that will be used. |
References RTR_SHUTDOWN.
Referenced by rtr_mgr_stop().
1.8.6