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_common.h
Go to the documentation of this file.
1
#ifndef RTE_EXAMPLE_GATEWAY_C_COMMON_H
2
#define RTE_EXAMPLE_GATEWAY_C_COMMON_H
3
4
5
#ifdef __cplusplus
6
extern
"C"
{
7
#endif
22
23
#include "rte/app/appmanager/rte_appmanager.h"
24
#include "rte/oal/timer/rte_timer.h"
25
#include "rte/utils/status/rte_status.h"
26
27
#include "
common/site_config.h
"
28
#include "
gateway_c_types.h
"
29
35
typedef
struct
gateway_c_service_def_s
36
{
39
const
char
*
app_name
;
41
const
char
*
log_tag
;
42
45
rte_status_t (*
handler_init
)(
gateway_c_context_t
*ctx);
46
void (*
handler_execute
)(
gateway_c_context_t
*ctx, uint32_t cycle);
47
void (*
handler_shutdown
)(void);
48
bool (*
handler_check_link_down
)(rte_timestamp_ms_t threshold_ms, rte_timestamp_ms_t now_ms,
49
char
*out_which,
size_t
which_size);
50
53
void (*
pre_execute_hook
)(
gateway_c_context_t
*ctx);
54
59
const
char
*
broker_channel
;
62
uint8_t
status_src_id
;
67
void (*
idle_hook
)(
gateway_c_context_t
*ctx);
68
}
gateway_c_service_def_t
;
69
81
int
gateway_c_main
(
int
argc,
char
**argv,
const
gateway_c_service_def_t
*svc);
82
86
void
gateway_c_dedup_init
(
gateway_c_dedup_t
*dedup);
87
93
bool
gateway_c_dedup_check_and_record
(
gateway_c_dedup_t
*dedup,
const
uint8_t *bytes,
size_t
size);
94
95
#ifdef __cplusplus
96
}
/* extern "C" */
97
#endif
98
99
#endif
/* RTE_EXAMPLE_GATEWAY_C_COMMON_H */
gateway_c_main
int gateway_c_main(int argc, char **argv, const gateway_c_service_def_t *svc)
Full process entry for a Role C gateway service: prints the version banner, parses argv[1] as {WEST|E...
Definition
gateway_c_common.c:376
gateway_c_dedup_init
void gateway_c_dedup_init(gateway_c_dedup_t *dedup)
Initialize a first-arrival deduplication tracker.
Definition
gateway_c_common.c:430
gateway_c_dedup_check_and_record
bool gateway_c_dedup_check_and_record(gateway_c_dedup_t *dedup, const uint8_t *bytes, size_t size)
Check if bytes was already forwarded within the expiry window. If not seen, records bytes with curren...
Definition
gateway_c_common.c:438
gateway_c_types.h
Shared wire-format constants and gateway_c_context_t.
site_config.h
West/East site identity and the per-site config derived from it (ports, container host lookup) - see ...
gateway_c_context_t
One gateway_c_context_t instance's state.
Definition
gateway_c_types.h:58
gateway_c_dedup_t
Definition
gateway_c_types.h:49
gateway_c_service_def_t
One gateway service's identity and its single handler's entry points - a pure-literal table each main...
Definition
gateway_c_common.h:36
gateway_c_service_def_t::handler_check_link_down
bool(*) handler_check_link_down(rte_timestamp_ms_t threshold_ms, rte_timestamp_ms_t now_ms, char *out_which, size_t which_size)
Definition
gateway_c_common.h:48
gateway_c_service_def_t::handler_execute
void(*) handler_execute(gateway_c_context_t *ctx, uint32_t cycle)
Definition
gateway_c_common.h:46
gateway_c_service_def_t::pre_execute_hook
void(*) pre_execute_hook(gateway_c_context_t *ctx)
Definition
gateway_c_common.h:53
gateway_c_service_def_t::app_name
const char * app_name
Definition
gateway_c_common.h:39
gateway_c_service_def_t::status_src_id
uint8_t status_src_id
Definition
gateway_c_common.h:62
gateway_c_service_def_t::handler_init
rte_status_t(*) handler_init(gateway_c_context_t *ctx)
Definition
gateway_c_common.h:45
gateway_c_service_def_t::broker_channel
const char * broker_channel
Definition
gateway_c_common.h:59
gateway_c_service_def_t::idle_hook
void(*) idle_hook(gateway_c_context_t *ctx)
Definition
gateway_c_common.h:67
gateway_c_service_def_t::log_tag
const char * log_tag
Definition
gateway_c_common.h:41
gateway_c_service_def_t::handler_shutdown
void(*) handler_shutdown(void)
Definition
gateway_c_common.h:47
src
application
C
gateway_c_common.h
Generated by
1.18.0