bpf_asm
Python BPF Assembler.
Based on the BPF assembler in Linux sources.
-
class bpf_asm.BpfDumpType(*values)
-
DEFAULT = 0
-
MULTILINE = 1
-
C_ARRAY = 2
-
exception bpf_asm.Error
Raised when there is an error assembling BPF.
-
bpf_asm.assemble(str: str) → List[Tuple[int, int, int, int]]
Assemble BPF str.
-
bpf_asm.dumps(bpf: List[Tuple[int, int, int, int]], format=BpfDumpType.DEFAULT) → str
Dump bpf to a str in format.