miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
net_sock Struct Reference

Kernel socket state. More...

#include <net_socket.h>

Collaboration diagram for net_sock:

Public Attributes

int proto
void * pcb
net_sock_rx_entry_t rx_ring [NET_SOCK_RX_RING_SLOTS]
uint8_t rx_head
uint8_t rx_tail
uint8_t _pad2 [2]
uint32_t rcvtimeo_ticks
int connected
int in_use
uint32_t poll_waiter_tid

Detailed Description

Kernel socket state.

One net_sock_t per open socket fd. Owns the lwIP PCB pointer and a 2-slot receive ring for RAW sockets (UDP/TCP use slot 0 only). No dynamic allocation beyond the static pool.

Member Data Documentation

◆ _pad2

uint8_t net_sock::_pad2[2]

◆ connected

int net_sock::connected

Non-zero after connect/accept

◆ in_use

int net_sock::in_use

Pool slot occupied flag

◆ pcb

void* net_sock::pcb

lwIP PCB: udp_pcb* or tcp_pcb*

◆ poll_waiter_tid

uint32_t net_sock::poll_waiter_tid

tid of thread sleeping in poll/select for this socket; 0 = none

◆ proto

int net_sock::proto

SOCK_PROTO_UDP, SOCK_PROTO_TCP, or SOCK_PROTO_RAW

◆ rcvtimeo_ticks

uint32_t net_sock::rcvtimeo_ticks

SO_RCVTIMEO as LAPIC ticks (10ms each); 0 = use 10s default

◆ rx_head

uint8_t net_sock::rx_head

Consumer index (monotonic uint8 wrap; mask with (NET_SOCK_RX_RING_SLOTS-1))

◆ rx_ring

2-slot RAW burst buffer; UDP/TCP use slot 0 only

◆ rx_tail

uint8_t net_sock::rx_tail

Producer index (monotonic uint8 wrap)


The documentation for this struct was generated from the following file: