RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
Loading...
Searching...
No Matches
gateway_c_common.h File Reference

Shared skeleton for the three Role C gateway service binaries (rte_gateway_c_train / _il / _ctc - ADR-037). Role C was one binary with three independent, zero-shared-state handlers (Train/IL/CTC relay); it is now three separate processes, one per client type, so the Train service can be the clean sole owner of per-train demux when ADR-036's multiplexing lands. Everything that was boilerplate in the old gateway_c.c - the appmanager ops, the cyclic timer + cycle_ticks pacing, the channel resolver, the channel-down self-reboot - lives here; each service supplies only a gateway_c_service_def_t naming its one handler. More...

#include "rte/app/appmanager/rte_appmanager.h"
#include "rte/oal/timer/rte_timer.h"
#include "rte/utils/status/rte_status.h"
#include "common/site_config.h"
#include "gateway_c_types.h"
Include dependency graph for gateway_c_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gateway_c_service_def_t
 One gateway service's identity and its single handler's entry points - a pure-literal table each main_c_<svc>.c defines and passes to gateway_c_main(). More...

Functions

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|EAST}, runs app_main_common_init(), then rte_appmanager_run() with a config built from svc. Call once from main().
void gateway_c_dedup_init (gateway_c_dedup_t *dedup)
 Initialize a first-arrival deduplication tracker.
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 current monotonic timestamp.

Detailed Description

Shared skeleton for the three Role C gateway service binaries (rte_gateway_c_train / _il / _ctc - ADR-037). Role C was one binary with three independent, zero-shared-state handlers (Train/IL/CTC relay); it is now three separate processes, one per client type, so the Train service can be the clean sole owner of per-train demux when ADR-036's multiplexing lands. Everything that was boilerplate in the old gateway_c.c - the appmanager ops, the cyclic timer + cycle_ticks pacing, the channel resolver, the channel-down self-reboot - lives here; each service supplies only a gateway_c_service_def_t naming its one handler.

Definition in file gateway_c_common.h.

Function Documentation

◆ 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|EAST}, runs app_main_common_init(), then rte_appmanager_run() with a config built from svc. Call once from main().

Parameters
argcFrom main().
argvFrom main(); argv[1] must be "WEST" or "EAST".
svcThis service's definition. Must not be NULL; all its mandatory function-pointer fields must be set.
Returns
Process exit code (0 on clean shutdown, 1 on any setup failure).

Definition at line 376 of file gateway_c_common.c.

◆ gateway_c_dedup_init()

void gateway_c_dedup_init ( gateway_c_dedup_t * dedup)

Initialize a first-arrival deduplication tracker.

Definition at line 430 of file gateway_c_common.c.

◆ 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 current monotonic timestamp.

Returns
true if duplicate (drop it); false if first arrival (forward it).

Definition at line 438 of file gateway_c_common.c.