Expand description
Shared AF_PACKET infrastructure for raw Ethernet faces.
Contains socket helpers and the TPACKET_V2 mmap’d ring buffer used by both
NamedEtherFace (unicast) and MulticastEtherFace.
MacAddr is re-exported from ndn-transport — it is the shared canonical
type used across the whole stack. Defining a second copy here caused a
type-mismatch on Linux when passing MACs to NeighborUpdate::AddFace.
Structs§
- MacAddr
- A 6-byte IEEE 802 MAC address.
- Packet
Ring - Mmap’d
PACKET_RX_RING+PACKET_TX_RINGfor zero-copy packet I/O.
Functions§
- get_
ifindex - Look up the interface index for
ifaceviaSIOCGIFINDEX. - get_
interface_ mac - Query the hardware (MAC) address of
ifaceviaSIOCGIFHWADDR. - make_
sockaddr_ ll - Build a
sockaddr_llforbindorsendto. - open_
packet_ socket - Create an
AF_PACKET + SOCK_DGRAMsocket bound toifindex, filtering only frames with ethertypeprotocol. Returns a non-blockingOwnedFd. - setsockopt_
val - Generic
setsockoptwrapper for a value of typeT. - setup_
packet_ ring - Configure TPACKET_V2, create RX + TX rings, and mmap them.