1#ifndef WIRED_SRVXDPBPF_SRVXDPBPF_H
2#define WIRED_SRVXDPBPF_SRVXDPBPF_H
15#define WIRED_SRVXDPBPF_MAP_ENTRIES 64u
i64 wired_srvxdpbpf_open(wired_srvxdpbpf *b, u32 ifindex, u16 port, u32 attach_flags)
Create the XSKMAP (WIRED_SRVXDPBPF_MAP_ENTRIES slots), build and load the redirect-filter program aro...
i64 wired_srvxdpbpf_register(wired_srvxdpbpf *b, u32 queue_id, u32 xsk_fd)
Point the map's queue_id slot at an XSK socket fd, so frames arriving on that NIC queue are redirecte...
void wired_srvxdpbpf_close(wired_srvxdpbpf *b)
Close the link, program and map fds in that order (negative fds are skipped) and reset each to -1.
The three kernel objects backing one interface's redirect filter.
Definition srvxdpbpf.h:18
i64 map_fd
XSKMAP fd: rx_queue_index -> XSK socket fd.
Definition srvxdpbpf.h:20
i64 link_fd
BPF link fd attaching the program to the interface.
Definition srvxdpbpf.h:24
i64 prog_fd
loaded redirect-filter program fd
Definition srvxdpbpf.h:22
unsigned int u32
unsigned 32-bit integer
Definition types.h:15
long i64
signed 64-bit integer
Definition types.h:14
unsigned short u16
unsigned 16-bit integer
Definition types.h:17