RTE RBC 2oo2 Reference Application
0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Toggle main menu visibility
Loading...
Searching...
No Matches
gateway_c_config.h
Go to the documentation of this file.
1
#ifndef GATEWAY_C_CONFIG_H
2
#define GATEWAY_C_CONFIG_H
3
4
5
#ifdef __cplusplus
6
extern
"C"
{
7
#endif
12
13
#include <stdbool.h>
14
#include <stdint.h>
15
#include "rte/oal/netlink/rte_netlink.h"
16
#include "rte/utils/status/rte_status.h"
17
#include "
common/site_config.h
"
18
19
#define GATEWAY_C_MAX_CHANNELS 32U
20
21
typedef
struct
gateway_c_config_timers_s
22
{
23
uint32_t
report_period_ms
;
24
uint32_t
link_timeout_ms
;
25
uint32_t
connect_timeout_ms
;
26
uint32_t
reconnect_attempt_timeout_ms
;
27
}
gateway_c_config_timers_t
;
28
29
typedef
struct
gateway_c_config_channel_s
30
{
31
uint32_t
id
;
32
char
name
[32];
33
rte_netlink_role_t
role
;
34
char
host
[64];
35
uint16_t
port
;
36
uint32_t
message_size
;
37
uint32_t
connect_timeout_ms
;
40
uint32_t
rcvbuf_bytes
;
42
uint32_t
sndbuf_bytes
;
43
bool
is_configured
;
44
}
gateway_c_config_channel_t
;
45
46
typedef
struct
gateway_c_config_s
47
{
48
rte_example_site_t
site
;
49
gateway_c_config_timers_t
timers
;
50
gateway_c_config_channel_t
channels
[
GATEWAY_C_MAX_CHANNELS
];
51
uint8_t
channel_count
;
52
}
gateway_c_config_t
;
53
54
rte_status_t
gateway_c_config_init_defaults
(
rte_example_site_t
site,
gateway_c_config_t
*out_cfg);
55
rte_status_t
gateway_c_config_load_file
(
const
char
*filepath,
gateway_c_config_t
*out_cfg);
56
rte_status_t
gateway_c_config_find_channel
(
const
gateway_c_config_t
*cfg,
const
char
*channel_name,
57
rte_netlink_config_t *out_netlink_cfg);
58
rte_status_t
gateway_c_config_find_channel_by_id
(
const
gateway_c_config_t
*cfg, uint32_t channel_id,
59
rte_netlink_config_t *out_netlink_cfg);
60
61
#ifdef __cplusplus
62
}
/* extern "C" */
63
#endif
64
65
#endif
/* GATEWAY_C_CONFIG_H */
gateway_c_config_find_channel
rte_status_t gateway_c_config_find_channel(const gateway_c_config_t *cfg, const char *channel_name, rte_netlink_config_t *out_netlink_cfg)
Definition
gateway_c_config.c:491
gateway_c_config_init_defaults
rte_status_t gateway_c_config_init_defaults(rte_example_site_t site, gateway_c_config_t *out_cfg)
Definition
gateway_c_config.c:122
gateway_c_config_find_channel_by_id
rte_status_t gateway_c_config_find_channel_by_id(const gateway_c_config_t *cfg, uint32_t channel_id, rte_netlink_config_t *out_netlink_cfg)
Definition
gateway_c_config.c:522
gateway_c_config_load_file
rte_status_t gateway_c_config_load_file(const char *filepath, gateway_c_config_t *out_cfg)
Definition
gateway_c_config.c:435
GATEWAY_C_MAX_CHANNELS
#define GATEWAY_C_MAX_CHANNELS
Definition
gateway_c_config.h:19
site_config.h
West/East site identity and the per-site config derived from it (ports, container host lookup) - see ...
rte_example_site_t
rte_example_site_t
Definition
site_config.h:20
gateway_c_config_channel_t
Definition
gateway_c_config.h:30
gateway_c_config_channel_t::name
char name[32]
Definition
gateway_c_config.h:32
gateway_c_config_channel_t::role
rte_netlink_role_t role
Definition
gateway_c_config.h:33
gateway_c_config_channel_t::port
uint16_t port
Definition
gateway_c_config.h:35
gateway_c_config_channel_t::host
char host[64]
Definition
gateway_c_config.h:34
gateway_c_config_channel_t::sndbuf_bytes
uint32_t sndbuf_bytes
Definition
gateway_c_config.h:42
gateway_c_config_channel_t::message_size
uint32_t message_size
Definition
gateway_c_config.h:36
gateway_c_config_channel_t::is_configured
bool is_configured
Definition
gateway_c_config.h:43
gateway_c_config_channel_t::rcvbuf_bytes
uint32_t rcvbuf_bytes
Definition
gateway_c_config.h:40
gateway_c_config_channel_t::id
uint32_t id
Definition
gateway_c_config.h:31
gateway_c_config_channel_t::connect_timeout_ms
uint32_t connect_timeout_ms
Definition
gateway_c_config.h:37
gateway_c_config_t
Definition
gateway_c_config.h:47
gateway_c_config_t::channel_count
uint8_t channel_count
Definition
gateway_c_config.h:51
gateway_c_config_t::timers
gateway_c_config_timers_t timers
Definition
gateway_c_config.h:49
gateway_c_config_t::site
rte_example_site_t site
Definition
gateway_c_config.h:48
gateway_c_config_t::channels
gateway_c_config_channel_t channels[GATEWAY_C_MAX_CHANNELS]
Definition
gateway_c_config.h:50
gateway_c_config_timers_t
Definition
gateway_c_config.h:22
gateway_c_config_timers_t::reconnect_attempt_timeout_ms
uint32_t reconnect_attempt_timeout_ms
Definition
gateway_c_config.h:26
gateway_c_config_timers_t::link_timeout_ms
uint32_t link_timeout_ms
Definition
gateway_c_config.h:24
gateway_c_config_timers_t::connect_timeout_ms
uint32_t connect_timeout_ms
Definition
gateway_c_config.h:25
gateway_c_config_timers_t::report_period_ms
uint32_t report_period_ms
Definition
gateway_c_config.h:23
src
application
C
gateway_c_config.h
Generated by
1.18.0