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_netlink.h File Reference

OS Abstraction Layer - Point-to-point network link service. More...

Include dependency graph for rte_netlink.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

 Configuration for rte_netlink_open(). More...

Typedefs

typedef struct rte_netlink_impl_s * rte_netlink_handle_t
 Opaque handle to an established link, returned by rte_netlink_open().

Enumerations

enum  rte_netlink_role_t { RTE_NETLINK_ROLE_LISTEN = 0 , RTE_NETLINK_ROLE_CONNECT = 1 }
 Which side of the connection this link instance plays. More...

Functions

 RTE_DECLARE_STORAGE (rte_netlink_storage_t, 64U)
 Caller-owned, fixed-size storage backing one rte_netlink_handle_t.
rte_status_t rte_netlink_open (rte_netlink_storage_t *storage, const rte_netlink_config_t *config, rte_netlink_handle_t *out_handle)
 Establishes a point-to-point link: binds+accepts (LISTEN) or dials (CONNECT), per config->role.
rte_status_t rte_netlink_send (rte_netlink_handle_t handle, const void *message, size_t message_size, rte_duration_ms_t timeout_ms)
 Sends one fixed-size message, blocking at most timeout_ms.
rte_status_t rte_netlink_receive (rte_netlink_handle_t handle, void *out_message, size_t buffer_size, rte_duration_ms_t timeout_ms)
 Receives one fixed-size message, blocking at most timeout_ms.
rte_status_t rte_netlink_close (rte_netlink_handle_t handle)
 Closes a link.

Detailed Description

OS Abstraction Layer - Point-to-point network link service.

A sibling to rte_ipc (ADR-001 section 4, service 5), not a replacement: rte_ipc models a bounded local queue between two ends that already exist (e.g. a pipe created by one process for two of its own threads/tasks). rte_netlink models a connection-oriented link between two independent processes - possibly on separate machines - that must first find each other (one side listens, the other connects) before any data can flow. Distinct connection-establishment semantics is why this is a new service instead of new fields bolted onto rte_ipc_config_t (ADR-005's osadapter-agnostic config principle: a config struct should not carry fields that are meaningless for most OSAdapters of that service).

Framework ships the interface and validate-then-dispatch layer only; a concrete OSAdapter (e.g. POSIX TCP sockets) is integrator-supplied (ADR-005) and registered at startup - see Platform_OS_POSIX's src/rte_posix_osadapter_netlink.c for the reference POSIX implementation this header was designed alongside.

REQ-OAL-NETLINK-001: no dynamic allocation; caller supplies storage. REQ-OAL-NETLINK-002: rte_netlink_open() shall never block longer than config->connect_timeout_ms. REQ-OAL-NETLINK-003: send/receive shall accept an explicit timeout and shall never block indefinitely by default. REQ-OAL-NETLINK-014: this service provides no message ordering, deduplication, or delivery guarantee of its own - an OSAdapter may be built on an unreliable transport (e.g. UDP). Any such guarantee is the caller's responsibility (see Platform_RTE's rte_dual_msgchannel/rte_dual_channel for a reusable sequence+CRC+ACK layer, and ADR-027). REQ-OAL-NETLINK-015: a non-zero config->rcvbuf_bytes/sndbuf_bytes is applied before the link is handed out; a refusal fails the open; a confirmed size below the request is reported.

Definition in file rte_netlink.h.