Skip to main content

Module tun

Module tun 

Source
Expand description

FIPS TUN Interface

Manages the TUN device for sending and receiving IPv6 packets. The TUN interface presents FIPS addresses to the local system, allowing standard socket applications to communicate over the mesh.

Platform-specific implementations:

  • Linux: Uses the tun crate with rtnetlink for interface configuration
  • macOS: Uses the tun crate with ifconfig/route for interface configuration
  • Windows: Uses the wintun crate for TUN device support

Structs§

TunDevice
FIPS TUN device wrapper.
TunWriter
Writer thread for TUN device.

Enums§

TunError
Errors that can occur with TUN operations.
TunState
TUN device state.

Functions§

log_ipv6_packet
Log basic information about an IPv6 packet at TRACE level.
run_tun_reader
TUN packet reader loop (Linux).
shutdown_tun_interface
Shutdown and delete a TUN interface by name.

Type Aliases§

PathMtuLookup
Read-only handle to the per-destination path MTU map. Populated by the discovery handler on LookupResponse; read by the TUN reader (outbound clamp) and writer (inbound clamp) at TCP MSS clamp time. Keyed by FipsAddress (16 bytes, the IPv6 form of a fips peer address).
TunOutboundRx
Channel receiver for outbound packets (consumed by Node’s RX loop).
TunOutboundTx
Channel sender for outbound packets from TUN reader to Node.
TunTx
Channel sender for packets to be written to TUN.