Expand description
A permissive library for managing eBPF programs.
oxidebpf
allows a user to easily manage a pre-built eBPF object file, creating
groups of programs based on functionality and loading them as units.
For a quick getting-started, see the documentation for ProgramGroup
’s
new()
and load()
functions.
Note: by default, oxidebpf
will load BPF programs with logging disabled. If you
wish to enable logging, enable the log_buf
feature. If the
default log size (4096) is not large enough to hold the verifier’s logs, the load
will fail. If you need more space, oxidebpf
will pull a log size in bytes from the
LOG_SIZE
environment variable (e.g., LOG_SIZE=8192 ./my_program
).
Structs§
- Array
Map - BpfHash
Map - CapUser
Data - CapUser
Header - LOGGER
- The slog Logger for the oxidebpf library. You can change the destination
by accessing the drain control with
LOGGER.1.set(your_new_drain)
. - Program
- The description of an individual eBPF program. Note: This is not the same
as the eBPF program itself, the actual binary is loaded from a
ProgramBlueprint
. - Program
Blueprint - Structure that parses eBPF objects from an ELF object.
- Program
Group - A group of eBPF
ProgramVersion
s that a user wishes to load from a blueprint. The loader will attempt eachProgramVersion
in order until one successfully loads, or none do. - Program
Version - A group of eBPF
Program
s that a user wishes to load.
Enums§
- Debugfs
Mount Opts - Enum describing how a ProgramGroup handles auto-mounting debugfs.
- Oxidebpf
Error - Perf
Buffer Size - Determines how to set the size of the perf buffer
- Perf
Channel Message - Message format for messages sent back across the channel
- Program
Type - An enum of the different BPF program types.
- Scheduling
Policy - Different Linux scheduling policies, intended to be paired with a priority number in the
builder function
polling_thread_priority
ofProgramGroup
. - Section
Type - Enum which describes how the blueprint will parse sections not covered in our eBPF ABI.
Traits§
- RWMap
- This trait specifies a map that can be read from or written to (e.g., array types).
Functions§
- get_
capabilities - Return the current process capabilities header and set.
- get_
memlock_ limit - Return the current memlock limit.
- set_
memlock_ limit