|
Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
Name-addressed publish/subscribe message endpoint (OCORA PI API Annex A.1). More...
Files | |
| file | src/oal/flow/rte_flow.c |
| 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. | |
Data Structures | |
| struct | rte_flow_attr_t |
| Flow attributes (OCORA PI API Annex A.1 leaves fl_attr's content as "to be defined" - this is this framework's own concrete, deliberately minimal choice of static+dynamic attributes, not a claim of OCORA-authored content). More... | |
| struct | rte_flow_config_t |
| Configuration for rte_flow_open(). More... | |
Typedefs | |
| typedef struct rte_flow_impl_s * | rte_flow_handle_t |
| Opaque handle to an opened Flow, returned by rte_flow_open(). | |
Enumerations | |
| enum | rte_flow_oflag_t { RTE_FLOW_O_REQUESTER = 1 , RTE_FLOW_O_RESPONDER = 2 , RTE_FLOW_O_PUBLISHER = 4 , RTE_FLOW_O_SUBSCRIBER = 8 , RTE_FLOW_O_NONBLOCK = 16 } |
| Open-mode bitmask, matching OCORA PI API Annex A.1's e_fl_oflags values exactly (so an integrator porting real OCORA-authored configuration data does not need to remap numeric flag values). More... | |
| enum | rte_flow_channel_t { RTE_FLOW_CHANNEL_USER = 1 , RTE_FLOW_CHANNEL_CTRL = 2 } |
| Message-channel discriminator, matching OCORA PI API Annex A.1's e_fl_channels: a Flow can carry ordinary application (user) traffic and platform control traffic on the same opened endpoint, distinguished per send/receive call. More... | |
Functions | |
| RTE_DECLARE_STORAGE (rte_flow_storage_t, 64U) | |
| Caller-owned, fixed-size storage backing one rte_flow_handle_t. | |
| 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_close (rte_flow_handle_t handle) |
| Closes (leaves/unregisters/unsubscribes from) a 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_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. | |
Name-addressed publish/subscribe message endpoint (OCORA PI API Annex A.1).
| typedef struct rte_flow_impl_s* rte_flow_handle_t |
Opaque handle to an opened Flow, returned by rte_flow_open().
Definition at line 71 of file rte_flow.h.
| enum rte_flow_oflag_t |
Open-mode bitmask, matching OCORA PI API Annex A.1's e_fl_oflags values exactly (so an integrator porting real OCORA-authored configuration data does not need to remap numeric flag values).
Definition at line 79 of file rte_flow.h.
| enum rte_flow_channel_t |
Message-channel discriminator, matching OCORA PI API Annex A.1's e_fl_channels: a Flow can carry ordinary application (user) traffic and platform control traffic on the same opened endpoint, distinguished per send/receive call.
| Enumerator | |
|---|---|
| RTE_FLOW_CHANNEL_USER | Application/user message. |
| RTE_FLOW_CHANNEL_CTRL | Platform control message. |
Definition at line 96 of file rte_flow.h.
| 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.
| storage | Caller-owned storage for the handle's state. Must not be NULL. |
| config | Flow configuration. Must not be NULL; config->name must not be NULL; config->message_size must be > 0; config->oflags must set exactly one of PUBLISHER/SUBSCRIBER/REQUESTER/RESPONDER. |
| out_handle | Receives the opened Flow's handle. Must not be NULL. |
Definition at line 58 of file rte_flow.c.
| rte_status_t rte_flow_close | ( | rte_flow_handle_t | handle | ) |
Closes (leaves/unregisters/unsubscribes from) a Flow.
| handle | Handle to close. Must not be NULL. Invalid to use after this call. |
Definition at line 132 of file rte_flow.c.
| 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.
| handle | Flow handle. Must not be NULL. |
| data | Message data to send. Must not be NULL. |
| data_size | Size of data in bytes; must be > 0. |
| channel | Which logical channel (user/control) this message is on. |
| timeout_ms | Maximum time to wait for the send to complete. |
Definition at line 86 of file rte_flow.c.
| 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.
| handle | Flow handle. Must not be NULL. |
| out_data | Destination buffer. Must not be NULL. |
| buffer_size | Usable size of out_data in bytes; must be > 0. |
| out_channel | Receives which logical channel the message arrived on. May be NULL if the caller does not need it. |
| timeout_ms | Maximum time to wait for a message to arrive. |
Definition at line 111 of file rte_flow.c.
| 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.
| handle | Flow handle. Must not be NULL. |
| out_attr | Receives the current attributes. Must not be NULL. |
Definition at line 149 of file rte_flow.c.
| 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.
| handle | Flow handle. Must not be NULL. |
| new_attr | Attributes to apply. Must not be NULL. Backend-defined which fields are actually mutable; immutable fields (e.g. message_size) are ignored, not rejected. |
| out_old_attr | Receives the attributes as they were before this call. May be NULL if the caller does not need it. |
Definition at line 166 of file rte_flow.c.