Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_site_role_policy.h
Go to the documentation of this file.
1
22#ifndef RTE_SITE_ROLE_POLICY_H
23#define RTE_SITE_ROLE_POLICY_H
24
25#include <stdbool.h>
26#include <stdint.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
33#define RTE_SITE_ROLE_STANDBY_DATA_TIMEOUT_CYCLES 3U
34
36#define RTE_SITE_ROLE_STANDBY_SYNC_RETRY_CYCLES 10U
37
39#define RTE_SITE_ROLE_TAKEOVER_CONFIRM_VALID_CYCLES 120U
40
42#define RTE_SITE_ROLE_BOTH_STANDBY_CYCLES 6U
43
54
69
92
100
120
123
126
137bool rte_site_role_standby_sync_due(bool sync_enabled, bool is_online, bool link_up, bool healthy, uint32_t cycle,
138 uint32_t last_try);
139
145bool rte_site_role_standby_data_stale(bool sync_enabled, bool is_online, bool have_snapshot, uint32_t cycle,
146 uint32_t last_rx_cycle);
147
153bool rte_site_role_takeover_allowed(bool is_online, bool own_faulted, bool peer_unresponsive, bool confirmed,
154 uint32_t cycle, uint32_t confirm_cycle);
155
161bool rte_site_role_both_standby_tiebreak(uint32_t both_standby_cycles, bool is_west, bool sibling_online);
162
163#ifdef __cplusplus
164}
165#endif
166
167#endif /* RTE_SITE_ROLE_POLICY_H */
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).
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:
rte_site_role_reason_t
@ RTE_SITE_ROLE_REASON_DUAL_ONLINE
@ RTE_SITE_ROLE_REASON_WAITING_READY
@ RTE_SITE_ROLE_REASON_PEER_FAULTED
@ RTE_SITE_ROLE_REASON_BOTH_FAULTED
@ RTE_SITE_ROLE_REASON_DISPATCHER_CONFIRMED
@ RTE_SITE_ROLE_REASON_BOTH_STANDBY_SIBLING
@ RTE_SITE_ROLE_REASON_RECOVERED
@ RTE_SITE_ROLE_REASON_YIELD_TO_TAKEOVER
@ RTE_SITE_ROLE_REASON_BOTH_STANDBY_WEST
const char * rte_site_role_reason_text(rte_site_role_reason_t reason)
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 i...
rte_site_role_action_t
@ RTE_SITE_ROLE_ACTION_NONE
@ RTE_SITE_ROLE_ACTION_RENEGOTIATE
@ RTE_SITE_ROLE_ACTION_PROMOTE
@ RTE_SITE_ROLE_ACTION_DEMOTE
@ RTE_SITE_ROLE_ACTION_WAIT
@ RTE_SITE_ROLE_ACTION_ALARM
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....
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.
const char * rte_site_role_reason_token(rte_site_role_reason_t reason)