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_flow.c File Reference

Flow service: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_flow_register() (ADR-005). See rte_netlink.c for the pattern this follows. More...

Include dependency graph for rte_flow.c:

Go to the source code of this file.

Functions

static bool oflags_select_exactly_one_role (uint32_t oflags)
 Exactly one of PUBLISHER/SUBSCRIBER/REQUESTER/RESPONDER must be set - a Flow has one, unambiguous role for its whole lifetime.
rte_status_t rte_osadapter_flow_register (const rte_osadapter_flow_t *osadapter)
 Registers the OSAdapter Flow implementation.
rte_status_t rte_flow_open (rte_flow_storage_t *storage, const rte_flow_config_t *config, rte_flow_handle_t *out_handle)
 Opens (joins/registers/subscribes to, per OCORA's own fl_open() doc) a named Flow.
rte_status_t rte_flow_send (rte_flow_handle_t handle, const void *data, size_t data_size, rte_flow_channel_t channel, rte_duration_ms_t timeout_ms)
 Sends one fixed-size message on the given channel, blocking at most timeout_ms.
rte_status_t rte_flow_receive (rte_flow_handle_t handle, void *out_data, size_t buffer_size, rte_flow_channel_t *out_channel, rte_duration_ms_t timeout_ms)
 Receives one fixed-size message, blocking at most timeout_ms.
rte_status_t rte_flow_close (rte_flow_handle_t handle)
 Closes (leaves/unregisters/unsubscribes from) a Flow.
rte_status_t rte_flow_getattr (rte_flow_handle_t handle, rte_flow_attr_t *out_attr)
 Reads this Flow's current (static and dynamic) attributes.
rte_status_t rte_flow_setattr (rte_flow_handle_t handle, const rte_flow_attr_t *new_attr, rte_flow_attr_t *out_old_attr)
 Sets this Flow's mutable (dynamic) attributes.

Variables

static const rte_osadapter_flow_t * s_osadapter = NULL
 Currently registered OSAdapter, or NULL if none (ADR-005).

Detailed Description

Flow service: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_flow_register() (ADR-005). See rte_netlink.c for the pattern this follows.

Definition in file rte_flow.c.

Function Documentation

◆ oflags_select_exactly_one_role()

bool oflags_select_exactly_one_role ( uint32_t oflags)
static

Exactly one of PUBLISHER/SUBSCRIBER/REQUESTER/RESPONDER must be set - a Flow has one, unambiguous role for its whole lifetime.

Global variables declarations Local function declarations

Local functions

Parameters
oflagsThe rte_flow_oflag_t bitmask to check.
Returns
true if exactly one role bit is set; false otherwise.

Definition at line 30 of file rte_flow.c.

◆ rte_osadapter_flow_register()

rte_status_t rte_osadapter_flow_register ( const rte_osadapter_flow_t * adapter)

Registers the OSAdapter Flow implementation.

Global functions

Parameters
adapterPointer to flow operations vtable.
Returns
RTE_STATUS_OK on success, RTE_STATUS_INVALID_PARAM if adapter is NULL, or RTE_STATUS_INVALID_STATE if the setup phase is already locked (REQ-LIFECYCLE-001, ADR-026; the previous registration, if any, is kept).

Definition at line 39 of file rte_flow.c.

Variable Documentation

◆ s_osadapter

const rte_osadapter_flow_t* s_osadapter = NULL
static

Currently registered OSAdapter, or NULL if none (ADR-005).

Local makros Local types declarations Local variables declarations

Definition at line 18 of file rte_flow.c.