Skip to main content

Module raw_ethernet

Module raw_ethernet 

Source
Expand description

Raw Ethernet backend. Linux AF_PACKET is privilege-gated; others fail closed.

In-process loopback is a codec/queue test double (InProcessLoop). A successful AF_PACKET open is AfPacketAttempt. PhysicalLink is reserved for two-host harnesses and is never returned from these constructors.

EtherType 0x4242 (DEV_ETHERTYPE) is a development value, not an IANA assignment. Production must use an assigned EtherType or an administered encapsulation. There is no silent Internet, DNS, or IP fallback (silent_ip_fallback() == false). Windows, WASM, and other non-Linux hosts remain QdnfError::PlatformUnsupported via unsupported.rs.

Structs§

EthernetLoop
One end of a same-process Ethernet-II loop. Evidence level is InProcessLoop.
RawEthernet
TwoHostProbe
Observed two-host gates. veth_created is never set by this probe.

Enums§

EthernetEvidence
Honesty labels for Ethernet demonstrations. Unit tests never emit PhysicalLink.
TwoHostProbeReason
Why two-host physical Ethernet is not qualified in this process.

Constants§

DEV_ETHERTYPE
Development EtherType for QDNF (not IANA-assigned). Production must use an assigned EtherType or an administered encapsulation.

Functions§

decapsulate_ethernet
Strip an Ethernet-II header. Observed locators are not taken from here; callers copy src_mac into RecvMeta only when the adapter supplied it.
encapsulate_ethernet
Encode an Ethernet-II header around a QFrame for capture tests and AF_PACKET.
ethernet_loop_pair
Two ends that encapsulate on send and decapsulate on recv through a shared bounded slot. This is not a physical Ethernet demonstration.
physical_two_host_qualified
Two-host physical Ethernet has not been demonstrated in this process.
probe_two_host
Probe CapEff, ip, and AF_PACKET. Does not create veth or claim success.
probe_veth_namespace
Capability probe for veth + netns qualification. Does not change this process’s namespace. EPERM/ENOSYS/clone failure is QdnfError::PlatformUnsupported. A successful child unshare is still not two-process Ethernet evidence (veth_namespace_qualified stays false).
silent_ip_fallback
Native Ethernet never falls back to IP, DNS, or Internet sockets.
veth_namespace_qualified
veth + network-namespace two-process delivery has not been qualified. A CAP_NET_ADMIN probe in this environment returns EPERM.