|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
See site_config.h. More...
Go to the source code of this file.
Functions | |
| static uint16_t | site_port_base (rte_example_site_t site) |
| static uint16_t | relay_port_offset (rte_example_relay_kind_t kind, uint16_t train_base, uint16_t il_base, uint16_t ctc_base, uint16_t util_base) |
| bool | site_config_parse (const char *arg, rte_example_site_t *out_site) |
| Parses a site name argument ("WEST"/"EAST", case-insensitive). | |
| const char * | site_config_name (rte_example_site_t site) |
| uint16_t | site_config_ab_port (rte_example_site_t site) |
| uint16_t | site_config_ab_crosscompare_port (rte_example_site_t site) |
| uint16_t | site_config_c_port_for_a (rte_example_site_t site, rte_example_relay_kind_t kind) |
C's listen port for A's dedicated kind relay link, for this site (rte_example_relay_kind_t's own doc) - ONE real TCP link per {kind}, so routing between C and A/B is purely structural (which channel a byte arrived on), never by inspecting message content. ADR-036: Train and IL are no longer per-instance - every train's traffic multiplexes onto the one link and A/B route by the envelope's own train_id. | |
| uint16_t | site_config_c_port_for_b (rte_example_site_t site, rte_example_relay_kind_t kind) |
| uint16_t | site_config_c_port_for_train (rte_example_site_t site) |
| C's single listen port for the Train sim, for this site (ADR-036: one multiplexed connection carries every train, demuxed by the envelope's train_id). | |
| uint16_t | site_config_c_port_for_il (rte_example_site_t site) |
| uint16_t | site_config_c_port_for_ctc (rte_example_site_t site) |
| uint16_t | site_config_c_port_for_broker (rte_example_site_t site, rte_example_relay_kind_t gw_kind) |
| ADR-038: the status/broker service's LISTEN port for one local gateway service to CONNECT and publish status on. | |
| const char * | site_config_host (const char *env_var_name) |
| Resolves a CONNECT-role link's target host for this process. | |
See site_config.h.
Definition in file site_config.c.
|
static |
Local makros Local types declarations Local variables declarations Global variables declarations Local function declarations
Definition at line 130 of file site_config.c.
|
static |
Definition at line 136 of file site_config.c.
| bool site_config_parse | ( | const char * | arg, |
| rte_example_site_t * | out_site ) |
Parses a site name argument ("WEST"/"EAST", case-insensitive).
Global functions
| arg | Null-terminated argument string. Must not be NULL. |
| out_site | Receives the parsed site. Must not be NULL. |
Definition at line 33 of file site_config.c.
| const char * site_config_name | ( | rte_example_site_t | site | ) |
Definition at line 52 of file site_config.c.
| uint16_t site_config_ab_port | ( | rte_example_site_t | site | ) |
Definition at line 57 of file site_config.c.
| uint16_t site_config_ab_crosscompare_port | ( | rte_example_site_t | site | ) |
Definition at line 62 of file site_config.c.
| uint16_t site_config_c_port_for_a | ( | rte_example_site_t | site, |
| rte_example_relay_kind_t | kind ) |
C's listen port for A's dedicated kind relay link, for this site (rte_example_relay_kind_t's own doc) - ONE real TCP link per {kind}, so routing between C and A/B is purely structural (which channel a byte arrived on), never by inspecting message content. ADR-036: Train and IL are no longer per-instance - every train's traffic multiplexes onto the one link and A/B route by the envelope's own train_id.
Definition at line 67 of file site_config.c.
| uint16_t site_config_c_port_for_b | ( | rte_example_site_t | site, |
| rte_example_relay_kind_t | kind ) |
kind relay link, for this site - same contract as site_config_c_port_for_a(). Definition at line 76 of file site_config.c.
| uint16_t site_config_c_port_for_train | ( | rte_example_site_t | site | ) |
C's single listen port for the Train sim, for this site (ADR-036: one multiplexed connection carries every train, demuxed by the envelope's train_id).
| site | WEST or EAST. |
Definition at line 85 of file site_config.c.
| uint16_t site_config_c_port_for_il | ( | rte_example_site_t | site | ) |
Definition at line 90 of file site_config.c.
| uint16_t site_config_c_port_for_ctc | ( | rte_example_site_t | site | ) |
Definition at line 95 of file site_config.c.
| uint16_t site_config_c_port_for_broker | ( | rte_example_site_t | site, |
| rte_example_relay_kind_t | gw_kind ) |
ADR-038: the status/broker service's LISTEN port for one local gateway service to CONNECT and publish status on.
| gw_kind | RELAY_KIND_TRAIN / _IL / _CTC. Any other value -> the TRAIN broker port. |
Definition at line 100 of file site_config.c.
| const char * site_config_host | ( | const char * | env_var_name | ) |
Resolves a CONNECT-role link's target host for this process.
Every CONNECT-role endpoint in this example (B's own peer link to A, C-forwarding links, and each channel's own EAST->WEST inter-site negotiation link) used to hardcode RTE_EXAMPLE_LOCALHOST - fine when every role ran as a plain OS process on one host, not once A, B, and C become genuinely separate containers/machines. Each of this example's env vars (RTE_EXAMPLE_C_HOST_ENV etc. - see common_config.h) overrides ONE specific link's target host; unset (the default for etc/run_all.sh/.claude/skills/run-safeAPIRBC2oo2/ smoke.sh, both still fully localhost-based) falls back to RTE_EXAMPLE_LOCALHOST, so the existing local/manual launch path needs zero changes. Docker Compose sets these per-service to the peer container's own service-DNS name (see docker-compose.yml).
| env_var_name | Name of the environment variable to consult (one of the RTE_EXAMPLE_*_HOST_ENV constants). Must not be NULL. |
Definition at line 120 of file site_config.c.