|
RTE RBC 2oo2 Reference Application 0.1.0 build 0006685
SIL 4 2oo2 Dual-Site Fault-Tolerant ERTMS Radio Block Centre Reference Architecture
|
See ab_gp_jru_forward.h. More...
#include "ab_gp_jru_forward.h"#include "../../common/rbc_util_frame.h"#include "../../common/rbc_util_jru_payload.h"#include "../../common/site_config.h"Go to the source code of this file.
Functions | |
| static rte_status_t | osadapter_init (void) |
| static void | osadapter_write (rte_log_level_t level, const char *tag, const char *message) |
| rte_status_t | ab_gp_jru_forward_install (const rte_osadapter_log_t *delegate) |
Wraps delegate (the real local log OSAdapter, e.g. rte_posix_osadapter_log()) and registers the wrapper as THE log OSAdapter (rte_osadapter_log_register()). Call once, right after the delegate would otherwise have been registered. | |
| void | ab_gp_jru_forward_set_channel (ab_gp_channel_handle_t handle, uint8_t source_id) |
| Attaches the open AB<->C relay channel: from this call on, write() also republishes INFO+ events to Gateway. Before this is called, write() only delegates locally (same as if forwarding were never installed) - there is no channel to publish over yet during app_main_common_init()'s early OSAdapter bring-up. | |
Variables | |
| static const rte_osadapter_log_t | s_forward_osadapter = { osadapter_init, osadapter_write } |
| static const rte_osadapter_log_t * | s_delegate |
| static ab_gp_channel_handle_t | s_handle |
| static uint8_t | s_source_id |
| static uint8_t | s_seq |
| static __thread bool | s_in_forward |
See ab_gp_jru_forward.h.
Definition in file ab_gp_jru_forward.c.
|
static |
Local makros Local types declarations Local function declarations
Definition at line 58 of file ab_gp_jru_forward.c.
|
static |
Definition at line 63 of file ab_gp_jru_forward.c.
| rte_status_t ab_gp_jru_forward_install | ( | const rte_osadapter_log_t * | delegate | ) |
Wraps delegate (the real local log OSAdapter, e.g. rte_posix_osadapter_log()) and registers the wrapper as THE log OSAdapter (rte_osadapter_log_register()). Call once, right after the delegate would otherwise have been registered.
Global variables declarations Global functions
| delegate | Non-NULL vtable to delegate every write() to. |
Definition at line 33 of file ab_gp_jru_forward.c.
| void ab_gp_jru_forward_set_channel | ( | ab_gp_channel_handle_t | handle, |
| uint8_t | source_id ) |
Attaches the open AB<->C relay channel: from this call on, write() also republishes INFO+ events to Gateway. Before this is called, write() only delegates locally (same as if forwarding were never installed) - there is no channel to publish over yet during app_main_common_init()'s early OSAdapter bring-up.
| handle | Channel opened by ab_gp_channel_open_link(). |
| source_id | RBC_UTIL_SRC_A or RBC_UTIL_SRC_B (rbc_util_frame.h). |
Definition at line 50 of file ab_gp_jru_forward.c.
|
static |
Local variables declarations
Definition at line 20 of file ab_gp_jru_forward.c.
|
static |
Definition at line 21 of file ab_gp_jru_forward.c.
|
static |
Definition at line 22 of file ab_gp_jru_forward.c.
|
static |
Definition at line 23 of file ab_gp_jru_forward.c.
|
static |
Definition at line 24 of file ab_gp_jru_forward.c.
|
static |
Per-thread reentrancy guard: forwarding sends over a relay channel, and that send can itself log (e.g. the lazy netlink open logs INFO), which would forward again without end (found live: unbounded recursion, one leaked socket per level, then a stack-overflow SIGSEGV).
Definition at line 28 of file ab_gp_jru_forward.c.