37#ifndef RTE_SAFECHANNEL_H
38#define RTE_SAFECHANNEL_H
57#define RTE_SAFECHANNEL_MAX_LINKS 4U
60typedef enum rte_safechannel_type_e
71typedef enum rte_safechannel_link_status_e
82typedef struct rte_safechannel_endpoint_s
94typedef struct rte_safechannel_dual_config_s
115typedef struct rte_safechannel_vital_config_s
142typedef struct rte_safechannel_config_s
160typedef struct rte_safechannel_s
void(*) rte_dual_channel_status_callback_t(rte_dual_channel_status_t new_status, rte_dual_channel_status_t old_status, void *user_ctx)
Optional callback invoked whenever rte_dual_channel_get_status()'s value changes (ADR-020 section 2's...
rte_netlink_role_t
Which side of the connection this link instance plays.
struct rte_netlink_impl_s * rte_netlink_handle_t
Opaque handle to an established link, returned by rte_netlink_open().
rte_status_t rte_safechannel_receive(rte_safechannel_t *channel, uint8_t *out_payload, size_t max_size, rte_duration_ms_t timeout_ms, size_t *out_size)
Returns the most recent inbound payload, actively polling the underlying channel if nothing was alrea...
rte_status_t rte_safechannel_send(rte_safechannel_t *channel, const uint8_t *payload, size_t payload_size)
Sends payload on the underlying channel - broadcast-with-ACK- wait for DUAL_REDUNDANT (rte_dual_chann...
rte_status_t rte_safechannel_open(rte_safechannel_t *channel, const rte_safechannel_config_t *config)
Opens a channel: opens every configured endpoint via the registered rte_netlink OSAdapter,...
rte_safechannel_link_status_t rte_safechannel_get_status(const rte_safechannel_t *channel)
Aggregate status across every configured endpoint - DOWN before the first send/receive.
rte_status_t rte_safechannel_close(rte_safechannel_t *channel)
Closes every endpoint this instance opened and releases the wrapped channel. Safe to call on an alrea...
rte_safechannel_type_t
Which underlying channel implementation a rte_safechannel_t wraps.
#define RTE_SAFECHANNEL_MAX_LINKS
Maximum number of redundant endpoints one rte_safechannel_t may be configured with,...
rte_safechannel_link_status_t
Aggregate link status, uniform across both wrapped types.
@ RTE_SAFECHANNEL_TYPE_VITAL_VOTED
@ RTE_SAFECHANNEL_TYPE_DUAL_REDUNDANT
@ RTE_SAFECHANNEL_LINK_DEGRADED
@ RTE_SAFECHANNEL_LINK_FULL
@ RTE_SAFECHANNEL_LINK_DOWN
rte_status_t
Common result/status codes.
uint32_t rte_duration_ms_t
rte_channel_storage_t rte_channel_t
Opaque handle to a vital channel instance.
rte_voter_storage_t rte_voter_t
Opaque handle to a voter instance.
rte_voting_strategy_t
Voting strategy: how many registered channels must agree.
rte_voting_result_t
Outcome of one rte_voter_receive() call.
A single redundant "channel": an opaque transport handle plus send/receive callbacks,...
"DualChannel" layer of ADR-020: wraps 1..N redundant rte_dual_msgchannel_t links for fault-tolerant,...
OS Abstraction Layer - Point-to-point network link service.
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...
N-way voting across registered rte_channel_t links (2oo2/2oo3/NMR).
One rte_dual_channel_t instance's state. Caller-owned storage; every field is private - reach it only...
Configuration for rte_safechannel_open().
rte_safechannel_type_t type
Configuration specific to RTE_SAFECHANNEL_TYPE_DUAL_REDUNDANT.
void * status_callback_ctx
rte_dual_channel_status_callback_t status_callback
rte_safechannel_endpoint_t endpoints[RTE_SAFECHANNEL_MAX_LINKS]
rte_duration_ms_t connect_timeout_ms
rte_duration_ms_t ack_timeout_ms
uint32_t expected_peer_id
One remote endpoint to open internally - replaces a caller- supplied rte_netlink_handle_t (ADR-022 se...
rte_channel_t channels[RTE_SAFECHANNEL_MAX_LINKS]
Caller-owned storage for one rte_safechannel_t instance. Every field is private - reach it only throu...
rte_netlink_storage_t links[RTE_SAFECHANNEL_MAX_LINKS]
Configuration specific to RTE_SAFECHANNEL_TYPE_VITAL_VOTED.
rte_safechannel_endpoint_t endpoints[RTE_SAFECHANNEL_MAX_LINKS]
rte_duration_ms_t channel_timeout_ms
rte_duration_ms_t connect_timeout_ms
rte_voting_strategy_t voting_strategy
void(*) on_disagreement(void *context, rte_voting_result_t result)