Expand description
Self-contained eBPF XSK redirect driver and map loader.
Provides a zero-dependency Linux eBPF/XDP driver using direct bpf(2) syscalls
to direct incoming tunnel UDP datagrams straight into AF_XDP rings (BPF_MAP_TYPE_XSKMAP)
at the NIC driver layer, bypassing sk_buff allocations.
All raw syscalls and pointer manipulations are quarantined within this module,
with explicit // SAFETY: justifications on every unsafe block.
Structs§
- BpfInsn
- 8-byte eBPF instruction binary layout matching Linux kernel ABI (
struct bpf_insn). - BpfLink
Create Attr - BpfMap
Create Attr - BpfMap
Elem Attr - BpfProg
Load Attr - XdpRedirect
Filter - RAII container for loaded eBPF redirect map and XDP program.
Enums§
- BpfFilter
Status - Operational status of the opportunistic eBPF XDP filter attachment.
Constants§
- BPF_ADD
- BPF_
ALU64 - BPF_AND
- BPF_B
- BPF_
CALL - BPF_DW
- BPF_
EXIT - BPF_
FUNC_ REDIRECT_ MAP - BPF_H
- BPF_IMM
- BPF_JA
- BPF_JEQ
- BPF_JGT
- BPF_JMP
- BPF_JNE
- BPF_K
- BPF_LD
- BPF_LDX
- BPF_
LINK_ CREATE - BPF_LSH
- BPF_
MAP_ CREATE - BPF_
MAP_ TYPE_ XSKMAP - BPF_
MAP_ UPDATE_ ELEM - BPF_MEM
- BPF_MOV
- BPF_
PROG_ LOAD - BPF_
PROG_ TYPE_ XDP - BPF_
PSEUDO_ MAP_ FD - BPF_W
- BPF_X
- BPF_XDP
- R0
- R1
- R2
- R3
- R4
- R5
- R6
- XDP_
PASS
Functions§
- bpf_
attach_ xdp - Attaches an XDP program to the network interface specified by
ifindex. - bpf_
map_ create_ xsk - Creates a
BPF_MAP_TYPE_XSKMAPmap holding up tomax_entriesAF_XDP socket descriptors. - bpf_
map_ update_ xsk - Updates an entry in an XSK map mapping
queue_idtoxsk_fd. - bpf_
prog_ assemble_ xdp - Assembles the dual-stack outer UDP eBPF XDP filter bytecode.
- bpf_
prog_ load_ xdp - Compiles and loads an eBPF XDP filter redirecting dual-stack UDP traffic for
listen_porttoxsk_map_fd. - sys_bpf⚠
- Raw syscall wrapper for Linux
bpf(2).
Unions§
- BpfAttr
- Linux
union bpf_attrrepresentation, 152 bytes.