RTRlib
Loading...
Searching...
No Matches
rtr_private.h
Go to the documentation of this file.
1/*
2 * This file is part of RTRlib.
3 *
4 * This file is subject to the terms and conditions of the MIT license.
5 * See the file LICENSE in the top level directory for more details.
6 *
7 * Website: http://rtrlib.realmv6.org/
8 */
9
10#ifndef RTR_PRIVATE_H
11#define RTR_PRIVATE_H
12#include "rtrlib/rtr/rtr.h"
13
14#include <pthread.h>
15#include <stdbool.h>
16#include <stdint.h>
17
18#define RTR_DBG(fmt, ...) lrtr_dbg("RTR Socket: " fmt, ##__VA_ARGS__)
19#define RTR_DBG1(a) lrtr_dbg("RTR Socket: " a)
20
21static const uint32_t RTR_EXPIRATION_MIN = 600; // ten minutes
22static const uint32_t RTR_EXPIRATION_MAX = 172800; // two days
23static const uint32_t RTR_EXPIRATION_DEFAULT = 7200; // two hours
24
25static const uint32_t RTR_REFRESH_MIN = 1; // one second
26static const uint32_t RTR_REFRESH_MAX = 86400; // one day
27static const uint32_t RTR_REFRESH_DEFAULT = 3600; // one hour
28
29static const uint32_t RTR_RETRY_MIN = 1; // one second
30static const uint32_t RTR_RETRY_MAX = 7200; // two hours
31static const uint32_t RTR_RETRY_DEFAULT = 600; // ten minutes
32
33static const uint8_t RTR_PROTOCOL_VERSION_0 = 0;
34static const uint8_t RTR_PROTOCOL_VERSION_1 = 1;
35static const uint8_t RTR_PROTOCOL_VERSION_2 = 2;
36
37static const uint8_t RTR_PROTOCOL_MIN_SUPPORTED_VERSION; // = 0
38
39static const uint8_t RTR_PROTOCOL_MAX_SUPPORTED_VERSION = 2;
40
42
44
71 struct spki_table *spki_table, struct aspa_table *aspa_table, const unsigned int refresh_interval,
72 const unsigned int expire_interval, const unsigned int retry_interval, enum rtr_interval_mode iv_mode,
73 rtr_connection_state_fp fp, void *fp_data_config, void *fp_data_group);
74
83
89
90#endif
rtr_interval_mode
These modes let the user configure how received intervals should be handled.
Definition rtr.h:28
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.
Definition rtr.h:87
static const uint32_t RTR_REFRESH_DEFAULT
Definition rtr_private.h:27
int rtr_start(struct rtr_socket *rtr_socket)
Starts the RTR protocol state machine in a pthread.
static const uint32_t RTR_EXPIRATION_DEFAULT
Definition rtr_private.h:23
static const uint8_t RTR_PROTOCOL_VERSION_2
Definition rtr_private.h:35
static const uint32_t RTR_REFRESH_MAX
Definition rtr_private.h:26
static const uint32_t RTR_RETRY_MIN
Definition rtr_private.h:29
static const uint8_t RTR_PROTOCOL_VERSION_0
Definition rtr_private.h:33
int rtr_init(struct rtr_socket *rtr_socket, struct tr_socket *tr_socket, struct pfx_table *pfx_table, struct spki_table *spki_table, struct aspa_table *aspa_table, const unsigned int refresh_interval, const unsigned int expire_interval, const unsigned int retry_interval, enum rtr_interval_mode iv_mode, rtr_connection_state_fp fp, void *fp_data_config, void *fp_data_group)
Initializes a rtr_socket.
static const uint8_t RTR_PROTOCOL_MAX_SUPPORTED_VERSION
Definition rtr_private.h:39
static const uint32_t RTR_REFRESH_MIN
Definition rtr_private.h:25
static const uint8_t RTR_PROTOCOL_VERSION_1
Definition rtr_private.h:34
static const uint32_t RTR_EXPIRATION_MIN
Definition rtr_private.h:21
static const uint32_t RTR_EXPIRATION_MAX
Definition rtr_private.h:22
rtr_interval_type
Definition rtr_private.h:43
@ RTR_INTERVAL_TYPE_REFRESH
Definition rtr_private.h:43
@ RTR_INTERVAL_TYPE_EXPIRATION
Definition rtr_private.h:43
@ RTR_INTERVAL_TYPE_RETRY
Definition rtr_private.h:43
void rtr_stop(struct rtr_socket *rtr_socket)
Stops the RTR connection and terminate the transport connection.
static const uint32_t RTR_RETRY_MAX
Definition rtr_private.h:30
rtr_interval_range
Definition rtr_private.h:41
@ RTR_ABOVE_INTERVAL_RANGE
Definition rtr_private.h:41
@ RTR_INSIDE_INTERVAL_RANGE
Definition rtr_private.h:41
@ RTR_BELOW_INTERVAL_RANGE
Definition rtr_private.h:41
static const uint8_t RTR_PROTOCOL_MIN_SUPPORTED_VERSION
Definition rtr_private.h:37
static const uint32_t RTR_RETRY_DEFAULT
Definition rtr_private.h:31
ASPA Table.
Definition aspa.h:83
pfx_table.
Definition trie-pfx.h:65
A RTR socket.
Definition rtr.h:117
spki_table.
Definition ht-spkitable_private.h:27
A transport socket datastructure.
Definition transport.h:102