BPF.Program (BPF v0.1.1)

View Source

A compiled BPF program.

Contains a list of instructions and optional metadata.

Summary

Functions

Encode the program to raw BPF bytecode.

Returns the number of instructions in the program.

Create a new BPF program from a list of instructions.

Types

t()

@type t() :: %BPF.Program{
  bindings: %{required(atom()) => non_neg_integer()},
  instructions: [BPF.Instruction.t()]
}

Functions

assemble(program)

Encode the program to raw BPF bytecode.

Returns a binary suitable for use with SO_ATTACH_FILTER.

length(program)

Returns the number of instructions in the program.

new(instructions, bindings \\ %{})

Create a new BPF program from a list of instructions.