24 #include "rtrlib/pfx/pfx.h"
25 #include "rtrlib/transport/transport.h"
27 #define RTR_DBG(fmt, ...) lrtr_dbg("RTR Socket: " fmt, ## __VA_ARGS__)
28 #define RTR_DBG1(a) lrtr_dbg("RTR Socket: " a)
30 static const uint8_t RTR_PROTOCOL_VERSION_0 = 0;
31 static const uint8_t RTR_PROTOCOL_VERSION_1 = 1;
33 static const uint8_t RTR_PROTOCOL_MIN_SUPPORTED_VERSION = 0;
34 static const uint8_t RTR_PROTOCOL_MAX_SUPPORTED_VERSION = 1;
39 RTR_INVALID_PARAM = -2
104 unsigned int refresh_interval;
106 unsigned int expire_interval;
107 unsigned int retry_interval;
110 bool request_session_id;
111 uint32_t serial_number;
115 void *connection_state_fp_param;
116 unsigned int version;
117 bool has_received_pdus;
118 struct spki_table *spki_table;
142 struct spki_table *spki_table,
const unsigned int refresh_interval,
143 const unsigned int expire_interval,
const unsigned int retry_interval,
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:95
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:82
pfx_table.
Definition: lpfst-pfx.h:39
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:99
rtr_socket_state
States of the RTR socket.
Definition: rtr.h:45
A RTR socket.
Definition: rtr.h:102
void rtr_stop(struct rtr_socket *rtr_socket)
Stops the RTR connection and terminate the transport connection.
Definition: rtr.c:232
int rtr_init(struct rtr_socket *rtr_socket, struct tr_socket *tr, struct pfx_table *pfx_table, struct spki_table *spki_table, const unsigned int refresh_interval, const unsigned int expire_interval, const unsigned int retry_interval, rtr_connection_state_fp fp, void *fp_param)
Initializes a rtr_socket.
Definition: rtr.c:55
const char * rtr_state_to_str(enum rtr_socket_state state)
Converts a rtr_socket_state to a String.
Definition: rtr.c:246