Expand description
Unified network stack for TGOSKits systems.
ax-net provides the socket-facing API used by kernels and syscall layers, while delegating TCP/IP protocol mechanics to smoltcp. The crate exposes TCP, UDP, raw IPv4/IPv6 sockets, Unix domain sockets, optional vsock, DNS, DHCP helpers, readiness polling, and interface/control-plane queries.
§Architecture
The stack intentionally uses one smoltcp Interface and one global
SocketSet. Multiple physical or virtual devices are aggregated below that
protocol core by router::Router, which acts as a multi-device smoltcp
Device. This keeps socket ownership, port tables, listen queues, and
routing decisions centralized instead of duplicating socket state per NIC.
§Execution Model
A unique CPU-pinned protocol executor owns every smoltcp poll. Socket methods
publish generations with request_poll() and then rely on poll/waker
readiness; they never synchronously become a second protocol owner. Separate
CPU-pinned queue executors own hard-IRQ continuation, DMA reclaim/refill, and
bounded queue polling. Preallocated SPSC rings transfer move-only frame tokens
between those two ownership domains.
§Main Modules
service: owns the smoltcp interface and control plane.poll_runtime: owns generation-based protocol scheduling.queue_runtime: owns IRQ affinity domains and queue executors.router: aggregates protocol ports, route lookup, and loopback.socket,tcp,udp,raw: POSIX-like IP socket surface.listen_table,orphan,wrapper: side tables around smoltcp sockets.unixandvsock: local transports outside the smoltcp IP path.
Modules§
- options
- Socket option types and the
Configurabletrait. Socket option data structures and dispatch traits. - raw
- Raw socket implementation. Raw IP socket implementation for ICMP-style traffic.
- tcp
- TCP socket implementation. TCP socket implementation.
- udp
- UDP socket implementation. UDP socket implementation.
- unix
- Unix domain socket implementation. Unix domain socket facade.
Structs§
- ArpEntry
- Device
Binding - Ordinary socket interface binding.
- Interface
Config - Per-interface network configuration.
- Interface
Flags - Runtime interface flags.
- Interface
Id - Stable network interface identifier.
- Interface
Info - Public snapshot of a network interface.
- Ipv4
Interface Config - Runtime IPv4 configuration of a network interface.
- NetDev
Stats - Per-interface cumulative RX/TX byte and packet counters.
- NetQueue
Stats - Observable queue statistics used by SMP contract tests.
- Network
Config - Network initialization configuration.
- Network
Device Input - One prepared device and its complete, resolved IRQ source map.
- Network
Queue Runtime - Live queue runtime. Dropping it masks IRQs before stopping executors.
- Network
Runtime Builder - Builder for an all-at-once network queue runtime.
- Pinned
NetIrq Action - Move-only callback installed by the OS IRQ adapter.
- Recv
Flags - Flags for receiving data from a socket.
- Recv
Options - Options for receiving data from a socket.
- Resolved
NetIrq Source - Resolved driver source-id to physical IRQ mapping.
- Route
Info - Public route snapshot.
- Send
Flags - Flags for sending data to a socket.
- Send
Options - Options for sending data to a socket.
- Socket
Wait Policy - OS-facing policy for driving one task-neutral socket future.
- Static
IpConfig - Static IP configuration.
- Wifi
Link Policy - Wireless link policy a device reports for itself, so the protocol stack can apply it without any Wi-Fi/SoftAP-specific knowledge.
- Wifi
Transaction - One atomic wireless reconfiguration transaction.
- Wpa2Pmk
- One owned wireless control operation.
Enums§
- Connect
Status - Progress of a connection attempt whose completion is readiness-driven.
- Interface
Kind - Network interface kind.
- Interface
Matcher - Interface matching rule for explicit configuration.
- IpCmsg
- IP ancillary data reported through
recvmsg. - NetDevice
Error - NetError
- Errors owned by the network and socket domain.
- Network
Runtime Error - Runtime initialization or lifecycle error.
- Pinned
NetIrq Error - OS-specific fixed-affinity IRQ registration error.
- Pinned
NetIrq Outcome - Result of a bounded hard-IRQ callback.
- Shutdown
- Kind of shutdown operation to perform on a socket.
- Socket
- Network socket abstraction.
- Socket
Addr Ex - Extended socket address supporting IP, Unix, and vsock address families.
- Socket
Cmsg - Transport-independent socket-level ancillary data reported through
recvmsg. - TxQueue
Discipline - Protocol-side transmit queue policy for one network device.
- Wifi
Operation
Traits§
- Ethernet
Frame Port - Device-level protocol endpoint backed by one or more queue-group SPSC pipelines.
- Pinned
NetIrq Registrar - OS adapter that accepts fixed affinity only.
- Pinned
NetIrq Registration - Move-only registration lease. It is created disabled.
- Socket
Ops - Operations that can be performed on a socket.
Functions§
- arp_
entries - Returns ARP/neighbor entries collected from all devices.
- default_
routes - Returns public snapshots of configured IPv4 default routes.
- dns_
query - Resolves an A record using the default DNS timeout.
- dns_
query_ timeout - Resolves an A record using the configured DNS servers and timeout.
- dns_
servers - Returns the list of configured DNS servers.
- init_
network - Initializes the network subsystem by NIC devices.
- interface_
by_ id - Looks up an interface snapshot by stable interface id.
- interface_
by_ name - Looks up an interface snapshot by name.
- interfaces
- Returns a snapshot of all configured network interfaces.
- ipv4_
config - Returns the IPv4 configuration for an interface by name.
- net_
dev_ stats - Returns per-interface RX/TX byte and packet counters for
/proc/net/dev. - poll_
socket_ io - Repeats one non-blocking operation after race-free readiness registration.
- reconfigure_
wifi - Atomically reconfigures one wireless interface through its fixed-CPU queue owner, then commits the matching protocol-side IP/DHCP role.
- remove_
interface_ ipv4 - Removes a configured IPv4 address from an interface at runtime.
- request_
poll - Request network polling.
- set_
interface_ ipv4 - Assigns a static IPv4 address to an interface at runtime.
Type Aliases§
- CMsg
Data - Type alias for ancillary control message data.
- Ethernet
Frame Port List - Protocol endpoints handed to the unique smoltcp owner during startup.
- NetDevice
Result - NetResult
- A result returned by the network and socket domain.