|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
See rte_site_role_policy.h. Moved unchanged from RBC_GP's ab_gp_site_role.c and the generic part of ab_gp_standby_policy.c (ADR-040 step 1); only the names changed. More...
Go to the source code of this file.
Functions | |
| static bool | peer_answering (const rte_site_role_input_t *in) |
| static bool | pair_ready_to_promote (const rte_site_role_input_t *in) |
| rte_site_role_decision_t | rte_site_role_decide (const rte_site_role_input_t *in) |
| Decides this cycle's role action. Rules are evaluated in this order and the first that applies wins: | |
| const char * | rte_site_role_reason_text (rte_site_role_reason_t reason) |
| const char * | rte_site_role_reason_token (rte_site_role_reason_t reason) |
| bool | rte_site_role_standby_sync_due (bool sync_enabled, bool is_online, bool link_up, bool healthy, uint32_t cycle, uint32_t last_try) |
| Whether ONLINE should attempt the pre-commit standby sync this cycle. | |
| bool | rte_site_role_standby_data_stale (bool sync_enabled, bool is_online, bool have_snapshot, uint32_t cycle, uint32_t last_rx_cycle) |
| Whether STANDBY's held snapshot is stale and must be dropped (STANDBY goes cold). | |
| bool | rte_site_role_takeover_allowed (bool is_online, bool own_faulted, bool peer_unresponsive, bool confirmed, uint32_t cycle, uint32_t confirm_cycle) |
| Whether a STANDBY channel may promote itself because its counterpart stopped responding. Silence alone never promotes: the dispatcher must have confirmed, within RTE_SITE_ROLE_TAKEOVER_CONFIRM_VALID_CYCLES, that the other site is not ONLINE. | |
| bool | rte_site_role_both_standby_tiebreak (uint32_t both_standby_cycles, bool is_west, bool sibling_online) |
| Negotiation tie-break for "both sites STANDBY": a channel whose A/B sibling is already ONLINE joins it at once; otherwise WEST promotes after RTE_SITE_ROLE_BOTH_STANDBY_CYCLES. Both sites compute the same answer from the same link, so this is a negotiation outcome, not a unilateral promotion. | |
See rte_site_role_policy.h. Moved unchanged from RBC_GP's ab_gp_site_role.c and the generic part of ab_gp_standby_policy.c (ADR-040 step 1); only the names changed.
Definition in file rte_site_role_policy.c.
|
static |
The counterpart answered within the last 2 cycles.
Definition at line 9 of file rte_site_role_policy.c.
|
static |
The A/B pair may promote: this channel is ready and its sibling is ONLINE, ready, or not there.
Definition at line 15 of file rte_site_role_policy.c.
| rte_site_role_decision_t rte_site_role_decide | ( | const rte_site_role_input_t * | in | ) |
Decides this cycle's role action. Rules are evaluated in this order and the first that applies wins:
A promotion is only carried out when this channel is ready AND its A/B sibling is ONLINE already, or confirms it is ready, or cannot be reached (single channel). Otherwise the answer is WAIT.
| in | facts; must not be NULL |
Definition at line 20 of file rte_site_role_policy.c.
| const char * rte_site_role_reason_text | ( | rte_site_role_reason_t | reason | ) |
Definition at line 101 of file rte_site_role_policy.c.
| const char * rte_site_role_reason_token | ( | rte_site_role_reason_t | reason | ) |
Definition at line 141 of file rte_site_role_policy.c.
| bool rte_site_role_standby_sync_due | ( | bool | sync_enabled, |
| bool | is_online, | ||
| bool | link_up, | ||
| bool | healthy, | ||
| uint32_t | cycle, | ||
| uint32_t | last_try ) |
Whether ONLINE should attempt the pre-commit standby sync this cycle.
| sync_enabled | true when standby_mode is warm or hot |
| is_online | this channel is ONLINE |
| link_up | the inter-site link is open |
| healthy | STANDBY answered the last sync |
| cycle | current cycle number |
| last_try | cycle of the last sync attempt made while unhealthy |
Definition at line 181 of file rte_site_role_policy.c.
| bool rte_site_role_standby_data_stale | ( | bool | sync_enabled, |
| bool | is_online, | ||
| bool | have_snapshot, | ||
| uint32_t | cycle, | ||
| uint32_t | last_rx_cycle ) |
Whether STANDBY's held snapshot is stale and must be dropped (STANDBY goes cold).
Definition at line 202 of file rte_site_role_policy.c.
| bool rte_site_role_takeover_allowed | ( | bool | is_online, |
| bool | own_faulted, | ||
| bool | peer_unresponsive, | ||
| bool | confirmed, | ||
| uint32_t | cycle, | ||
| uint32_t | confirm_cycle ) |
Whether a STANDBY channel may promote itself because its counterpart stopped responding. Silence alone never promotes: the dispatcher must have confirmed, within RTE_SITE_ROLE_TAKEOVER_CONFIRM_VALID_CYCLES, that the other site is not ONLINE.
Definition at line 216 of file rte_site_role_policy.c.
| bool rte_site_role_both_standby_tiebreak | ( | uint32_t | both_standby_cycles, |
| bool | is_west, | ||
| bool | sibling_online ) |
Negotiation tie-break for "both sites STANDBY": a channel whose A/B sibling is already ONLINE joins it at once; otherwise WEST promotes after RTE_SITE_ROLE_BOTH_STANDBY_CYCLES. Both sites compute the same answer from the same link, so this is a negotiation outcome, not a unilateral promotion.
Definition at line 229 of file rte_site_role_policy.c.