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
OSAdapter Raw Socket Layer

OS-agnostic socket operations provided by OSAdapters. More...

Data Structures

struct  rte_os_socket_ops_t
 Vtable of low-level OS socket operations implemented by an OSAdapter. More...

Macros

#define RTE_OS_SOCKET_INVALID_HANDLE   ((intptr_t)(-1))
 Invalid socket handle sentinel.

Typedefs

typedef intptr_t rte_os_socket_handle_t
 Socket handle representation (pointer or file descriptor).

Enumerations

enum  rte_os_socket_type_t { RTE_OS_SOCKET_TYPE_UDP = 1 , RTE_OS_SOCKET_TYPE_TCP = 2 }
 Socket transport type. More...
enum  rte_os_socket_event_t { RTE_OS_SOCKET_EVENT_READ = 1U , RTE_OS_SOCKET_EVENT_WRITE = 2U , RTE_OS_SOCKET_EVENT_ERROR = 4U }
 Polling events bitmask. More...

Functions

rte_status_t rte_osadapter_register_socket_ops (const rte_os_socket_ops_t *ops)
 Registers the active OSAdapter's raw socket operations.
const rte_os_socket_ops_t * rte_osadapter_get_socket_ops (void)
 Retrieves the active OSAdapter's raw socket operations.

Detailed Description

OS-agnostic socket operations provided by OSAdapters.

Macro Definition Documentation

◆ RTE_OS_SOCKET_INVALID_HANDLE

#define RTE_OS_SOCKET_INVALID_HANDLE   ((intptr_t)(-1))

Invalid socket handle sentinel.

Definition at line 33 of file rte_osadapter_socket.h.

Typedef Documentation

◆ rte_os_socket_handle_t

typedef intptr_t rte_os_socket_handle_t

Socket handle representation (pointer or file descriptor).

Definition at line 36 of file rte_osadapter_socket.h.

Enumeration Type Documentation

◆ rte_os_socket_type_t

Socket transport type.

Enumerator
RTE_OS_SOCKET_TYPE_UDP 

Raw UDP datagram socket.

RTE_OS_SOCKET_TYPE_TCP 

Raw TCP stream socket.

Definition at line 41 of file rte_osadapter_socket.h.

◆ rte_os_socket_event_t

Polling events bitmask.

Enumerator
RTE_OS_SOCKET_EVENT_READ 

Socket is ready for reading without blocking.

RTE_OS_SOCKET_EVENT_WRITE 

Socket is ready for writing without blocking.

RTE_OS_SOCKET_EVENT_ERROR 

Error condition on socket.

Definition at line 50 of file rte_osadapter_socket.h.

Function Documentation

◆ rte_osadapter_register_socket_ops()

rte_status_t rte_osadapter_register_socket_ops ( const rte_os_socket_ops_t * ops)

Registers the active OSAdapter's raw socket operations.

Parameters
opsVtable of socket operations. Must not be NULL.
Returns
RTE_STATUS_OK on success, RTE_STATUS_INVALID_PARAM if ops is NULL.

Definition at line 12 of file rte_osadapter.c.

◆ rte_osadapter_get_socket_ops()

const rte_os_socket_ops_t * rte_osadapter_get_socket_ops ( void )

Retrieves the active OSAdapter's raw socket operations.

Returns
Pointer to registered ops, or NULL if none registered.

Definition at line 22 of file rte_osadapter.c.