24 #include "rtrlib/pfx/pfx.h"
25 #include "rtrlib/transport/transport.h"
27 #define RTR_DBG(fmt, ...) dbg("RTR Socket: " fmt, ## __VA_ARGS__)
28 #define RTR_DBG1(a) 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;
103 unsigned int refresh_interval;
105 unsigned int expire_interval;
106 unsigned int retry_interval;
109 bool request_session_id;
110 uint32_t serial_number;
114 void *connection_state_fp_param;
115 unsigned int version;
116 struct spki_table *spki_table;
141 int rtr_start(
struct rtr_socket *rtr_socket);
147 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:81
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:77
rtr_socket_state
States of the RTR socket.
Definition: rtr.h:44
A RTR socket.
Definition: rtr.h:101
void rtr_stop(struct rtr_socket *rtr_socket)
Stops the RTR connection and terminate the transport connection.
Definition: rtr.c:203
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:54
const char * rtr_state_to_str(enum rtr_socket_state state)
Converts a rtr_socket_state to a String.
Definition: rtr.c:213