⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module socket

Module socket 

Source
Expand description

Socket API implementation

Provides BSD-style socket interface for TCP and UDP communication. Supports stream (TCP) and datagram (UDP) sockets with standard bind, listen, accept, connect, send, and receive operations.

Structs§

PendingConnection
Incoming connection for accept queue
Socket
Generic socket handle
SocketOptions
Socket options
SocketSummary
Summary of a socket’s state for display purposes.

Enums§

SocketDomain
Socket domain (address family)
SocketOption
Socket option values
SocketProtocol
Socket protocol
SocketState
Socket state
SocketType
Socket type

Functions§

close_socket
Close a socket by ID
create_socket
Create a new socket and return its ID
getpeername
Get the remote address of a connected socket.
getsockname
Get the local address of a socket.
getsockopt
Get a socket option.
init
Initialize socket subsystem
list_sockets
List all sockets with their current state.
queue_pending_connection
Queue a new connection to a listening socket (called by TCP layer)
recvfrom
Receive data with sender address.
sendto
Send data to a specific address (for UDP sockets).
setsockopt
Set a socket option.
with_socket
Execute a closure with a socket by ID (immutable access)
with_socket_mut
Execute a closure with a socket by ID (mutable access)