46#ifndef RTE_DUAL_NEGOTIATOR_H
47#define RTE_DUAL_NEGOTIATOR_H
81typedef struct rte_dual_negotiator_s
88 void *state_change_callback_ctx;
90 uint64_t own_startup_timestamp_ms;
91 bool own_channel_degraded;
93 bool have_peer_startup_timestamp;
94 uint64_t peer_startup_timestamp_ms;
95 bool peer_channel_degraded;
100 bool have_last_peer_seen;
105typedef struct rte_dual_negotiator_config_s
rte_status_t rte_dual_negotiator_init(rte_dual_negotiator_t *negotiator, const rte_dual_negotiator_config_t *config)
Initializes a rte_dual_negotiator_t. Captures this instance's own startup timestamp once (rte_timer_n...
uint32_t rte_dual_negotiator_get_own_id(const rte_dual_negotiator_t *negotiator)
Returns this instance's own tie-break identifier (rte_dual_negotiator_config_t::own_id at init time)....
uint32_t rte_dual_negotiator_get_peer_id(const rte_dual_negotiator_t *negotiator)
Returns the expected peer's tie-break identifier (rte_dual_negotiator_config_t::peer_id at init time)...
rte_dual_state_t rte_dual_negotiator_get_peer_state(const rte_dual_negotiator_t *negotiator)
Returns this instance's last-known view of the peer's rte_dual_state_t.
rte_status_t rte_dual_negotiator_execute(rte_dual_negotiator_t *negotiator, rte_duration_ms_t receive_timeout_ms)
Drives one round of state negotiation: refreshes own_channel_degraded from the attached channel's cur...
void(*) rte_dual_negotiator_state_change_callback_t(rte_dual_state_t new_own_state, rte_dual_state_t old_own_state, rte_dual_state_t new_peer_state, rte_dual_state_t old_peer_state, void *user_ctx)
Optional callback invoked whenever either the own or the peer rte_dual_state_t changes,...
rte_dual_state_t
State of one instance in a dual (two-redundant-instance) relationship, as decided by rte_dual_negotia...
uint64_t rte_dual_negotiator_get_own_startup_timestamp_ms(const rte_dual_negotiator_t *negotiator)
Returns this instance's own startup timestamp (captured at rte_dual_negotiator_init() time,...
rte_dual_state_t rte_dual_negotiator_get_own_state(const rte_dual_negotiator_t *negotiator)
Returns this instance's own current rte_dual_state_t.
uint64_t rte_dual_negotiator_get_peer_startup_timestamp_ms(const rte_dual_negotiator_t *negotiator)
Returns this instance's last-known view of the peer's own startup timestamp (0/unset until the first ...
rte_status_t
Common result/status codes.
uint32_t rte_duration_ms_t
uint64_t rte_timestamp_ms_t
"DualChannel" layer of ADR-020: wraps 1..N redundant rte_dual_msgchannel_t links for fault-tolerant,...
Shared enums for the rte_dual module (ADR-020): dual-instance state negotiation and the redundant,...
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
One rte_dual_channel_t instance's state. Caller-owned storage; every field is private - reach it only...
Configuration for rte_dual_negotiator_init().
void * state_change_callback_ctx
rte_duration_ms_t peer_lost_timeout_ms
rte_dual_negotiator_state_change_callback_t state_change_callback
rte_dual_channel_t * channel
rte_dual_state_t resume_own_state
uint64_t resume_own_startup_timestamp_ms
One rte_dual_negotiator_t instance's state. Caller-owned storage; every field is private - reach it o...