Documentation
¶
Overview ¶
A wrapper for google/gopacket pcap compilation for use with xt_bpf
A library for marshaling xt_bpf structs for use with nftables
Index ¶
Constants ¶
View Source
const ( // https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/xt_bpf.h XtBpfModeBytecode = iota XtBpfModeFdPinned XtBpfModeFdElf )
Constants for designating the mode xt_bpf can run in
View Source
const ( XtBpfModePathPinned = XtBpfModeFdPinned XtBpfMaxNumInstr = 64 // sizeof(struct sock_filter) == 8 XtBpfPathMax = XtBpfMaxNumInstr * 8 // XT_ALIGN(sizeof(struct xt_bpf_info)) == 528 // the xt_bpf_info_v1 is expected to be aligned and padded to the max XtBpfInfoV1Size = 528 )
Constants for specifying bpf program lengths and attributes
Variables ¶
This section is empty.
Functions ¶
func CompileBpfForXtInfo ¶
func CompileBpfForXtInfo(filter string) ([]bpf.RawInstruction, error)
Compile a tcpdump-style filter string to bpf compatible with xtables
func MarshalBpfBytecode ¶
Marshal a tcpdump-style filter string into bytes compatible with xtables
func MarshalBpfFd ¶
Marshal a socket file descriptor into bytes compatible with xtables
func MarshalBpfPinned ¶
Marshal a pinned program path into bytes compatible with xtables
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.