RTRlib
Loading...
Searching...
No Matches
RTR socket

An RTR socket implements the RPKI-RTR protocol scheme. More...

Data Structures

struct  rtr_socket
 A RTR socket. More...
 

Typedefs

typedef void(* rtr_connection_state_fp) (const struct rtr_socket *rtr_socket, const enum rtr_socket_state state, void *connection_state_fp_param_config, void *connection_state_fp_param_group)
 A function pointer that is called if the state of the rtr socket has changed.
 

Enumerations

enum  rtr_rtvals { RTR_SUCCESS = 0 , RTR_ERROR = -1 , RTR_INVALID_PARAM = -2 }
 
enum  rtr_interval_mode { RTR_INTERVAL_MODE_IGNORE_ANY , RTR_INTERVAL_MODE_ACCEPT_ANY , RTR_INTERVAL_MODE_DEFAULT_MIN_MAX , RTR_INTERVAL_MODE_IGNORE_ON_FAILURE }
 These modes let the user configure how received intervals should be handled. More...
 
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 , RTR_CLOSED
}
 States of the RTR socket. More...
 

Functions

const char * rtr_state_to_str (enum rtr_socket_state state)
 Converts a rtr_socket_state to a String.
 
void rtr_set_interval_mode (struct rtr_socket *rtr_socket, enum rtr_interval_mode option)
 Set the interval option to the desired one.
 
enum rtr_interval_mode rtr_get_interval_mode (struct rtr_socket *rtr_socket)
 Get the current interval mode.
 

Detailed Description

An RTR socket implements the RPKI-RTR protocol scheme.

One rtr_socket communicates with a single RPKI-RTR server.

Typedef Documentation

◆ rtr_connection_state_fp

typedef void(* rtr_connection_state_fp) (const struct rtr_socket *rtr_socket, const enum rtr_socket_state state, void *connection_state_fp_param_config, void *connection_state_fp_param_group)

#include <rtrlib/rtr/rtr.h>

A function pointer that is called if the state of the rtr socket has changed.

Enumeration Type Documentation

◆ rtr_interval_mode

#include <rtrlib/rtr/rtr.h>

These modes let the user configure how received intervals should be handled.

Enumerator
RTR_INTERVAL_MODE_IGNORE_ANY 

Ignore appliance of interval values at all.

RTR_INTERVAL_MODE_ACCEPT_ANY 

Accept any interval values, even if outside of range.

RTR_INTERVAL_MODE_DEFAULT_MIN_MAX 

If interval value is outside of range, apply min (if below range) or max (if above range).

RTR_INTERVAL_MODE_IGNORE_ON_FAILURE 

Ignore any interval values that are outside of range.

◆ rtr_rtvals

enum rtr_rtvals

#include <rtrlib/rtr/rtr.h>

Enumerator
RTR_SUCCESS 
RTR_ERROR 
RTR_INVALID_PARAM 

◆ rtr_socket_state

#include <rtrlib/rtr/rtr.h>

States of the RTR socket.

Enumerator
RTR_CONNECTING 

Socket is establishing the transport connection.

RTR_ESTABLISHED 

Connection is established, socket is waiting for a Serial Notify or expiration of the refresh_interval timer.

RTR_RESET 

Resetting RTR connection.

RTR_SYNC 

Receiving validation records from the RTR server.


RTR_FAST_RECONNECT 

Reconnect without any waiting period.

RTR_ERROR_NO_DATA_AVAIL 

No validation records are available on the RTR server.

RTR_ERROR_NO_INCR_UPDATE_AVAIL 

Server was unable to answer the last serial or reset query.

RTR_ERROR_FATAL 

Fatal protocol error occurred.

RTR_ERROR_TRANSPORT 

Error on the transport socket occurred.

RTR_SHUTDOWN 

RTR Socket was started, but now has shut down.

RTR_CLOSED 

RTR Socket has not been started yet.

Initial state after rtr_init

Function Documentation

◆ rtr_get_interval_mode()

enum rtr_interval_mode rtr_get_interval_mode ( struct rtr_socket rtr_socket)

#include <rtrlib/rtr/rtr.h>

Get the current interval mode.

Parameters
[in]rtr_socketThe target socket.
Returns
The value of the interval_option variable.

◆ rtr_set_interval_mode()

void rtr_set_interval_mode ( struct rtr_socket rtr_socket,
enum rtr_interval_mode  option 
)

#include <rtrlib/rtr/rtr.h>

Set the interval option to the desired one.

It's either RTR_INTERVAL_MODE_IGNORE_ANY, RTR_INTERVAL_MODE_APPLY_ANY, RTR_INTERVAL_MODE_DEFAULT_MIN_MAX or RTR_INTERVAL_MODE_IGNORE_ON_FAILURE.

Parameters
[in]rtr_socketThe target socket.
[in]optionThe new interval option that should be applied.

◆ rtr_state_to_str()

const char * rtr_state_to_str ( enum rtr_socket_state  state)

#include <rtrlib/rtr/rtr.h>

Converts a rtr_socket_state to a String.

Parameters
[in]statestate to convert to a string
Returns
NULL If state isn't a valid rtr_socket_state
!=NULL The rtr_socket_state as String.