36 #include "rtrlib/pfx/pfx.h"
37 #include "rtrlib/transport/transport.h"
39 #define RTR_DBG(fmt, ...) dbg("RTR Socket: " fmt, ## __VA_ARGS__)
40 #define RTR_DBG1(a) dbg("RTR Socket: " a)
42 static const uint8_t RTR_PROTOCOL_VERSION_0 = 0;
43 static const uint8_t RTR_PROTOCOL_VERSION_1 = 1;
45 static const uint8_t RTR_PROTOCOL_MIN_SUPPORTED_VERSION = 0;
46 static const uint8_t RTR_PROTOCOL_MAX_SUPPORTED_VERSION = 1;
115 unsigned int refresh_interval;
117 unsigned int expire_interval;
118 unsigned int retry_interval;
121 bool request_session_id;
122 uint32_t serial_number;
126 void *connection_state_fp_param;
127 unsigned int version;
128 struct spki_table *spki_table;
153 int rtr_start(
struct rtr_socket *rtr_socket);
159 void rtr_stop(
struct rtr_socket *rtr_socket);
A transport socket datastructure.
Definition: transport.h:107
void(* rtr_connection_state_fp)(const struct rtr_socket *rtr_socket, const enum rtr_socket_state state, void *connection_state_fp_param)
A function pointer that is called if the state of the rtr socket has changed.
Definition: rtr.h:93
pfx_table.
Definition: lpfst-pfx.h:51
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 ...
Definition: rtr.c:89
rtr_socket_state
States of the RTR socket.
Definition: rtr.h:56
A RTR socket.
Definition: rtr.h:113
void rtr_stop(struct rtr_socket *rtr_socket)
Stops the RTR connection and terminate the transport connection.
Definition: rtr.c:215
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.
Definition: rtr.c:66
const char * rtr_state_to_str(enum rtr_socket_state state)
Converts a rtr_socket_state to a String.
Definition: rtr.c:225