18#ifndef RTE_OSADAPTER_SOCKET_H
19#define RTE_OSADAPTER_SOCKET_H
33#define RTE_OS_SOCKET_INVALID_HANDLE ((intptr_t)(-1))
41typedef enum rte_os_socket_type_e
50typedef enum rte_os_socket_event_e
60typedef struct rte_os_socket_ops_s
113 const char *host, uint16_t port,
size_t *out_sent);
135 char *out_host,
size_t host_len, uint16_t *out_port,
size_t *out_recv);
const rte_os_socket_ops_t * rte_osadapter_get_socket_ops(void)
Retrieves the active OSAdapter's raw socket operations.
rte_os_socket_type_t
Socket transport type.
intptr_t rte_os_socket_handle_t
Socket handle representation (pointer or file descriptor).
rte_status_t rte_osadapter_register_socket_ops(const rte_os_socket_ops_t *ops)
Registers the active OSAdapter's raw socket operations.
rte_os_socket_event_t
Polling events bitmask.
@ RTE_OS_SOCKET_EVENT_ERROR
@ RTE_OS_SOCKET_EVENT_WRITE
@ RTE_OS_SOCKET_EVENT_READ
rte_status_t
Common result/status codes.
uint32_t rte_duration_ms_t
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...
Vtable of low-level OS socket operations implemented by an OSAdapter.
rte_status_t(*) open(rte_os_socket_type_t type, rte_os_socket_handle_t *out_handle)
Creates a raw socket of the specified type, non-blocking from creation (REQ-OAL-SOCKET-001,...
rte_status_t(*) recv(rte_os_socket_handle_t handle, void *buf, size_t len, size_t *out_recv)
Receives data from a connected socket.
rte_status_t(*) sendto(rte_os_socket_handle_t handle, const void *buf, size_t len, const char *host, uint16_t port, size_t *out_sent)
Sends a datagram to a specific remote host and port.
rte_status_t(*) recvfrom(rte_os_socket_handle_t handle, void *buf, size_t len, char *out_host, size_t host_len, uint16_t *out_port, size_t *out_recv)
Receives a datagram and captures sender endpoint.
rte_status_t(*) set_nonblocking(rte_os_socket_handle_t handle, bool nonblocking)
Configures non-blocking mode on socket.
rte_status_t(*) connect(rte_os_socket_handle_t handle, const char *host, uint16_t port)
Connects a socket to a remote host and port.
rte_status_t(*) bind(rte_os_socket_handle_t handle, const char *host, uint16_t port)
Binds a socket to a local host and port.
rte_status_t(*) poll(rte_os_socket_handle_t handle, uint32_t events, rte_duration_ms_t timeout_ms, uint32_t *out_revents)
Polls a socket for I/O readiness with timeout.
rte_status_t(*) send(rte_os_socket_handle_t handle, const void *buf, size_t len, size_t *out_sent)
Sends data on a connected socket.
rte_status_t(*) close(rte_os_socket_handle_t handle)
Closes a socket handle.