Enum redbpf::Program[][src]

pub enum Program {
    KProbe(KProbe),
    KRetProbe(KProbe),
    UProbe(UProbe),
    URetProbe(UProbe),
    SocketFilter(SocketFilter),
    TracePoint(TracePoint),
    XDP(XDP),
    StreamParser(StreamParser),
    StreamVerdict(StreamVerdict),
}
Expand description

A BPF program defined in a Module.

Variants

KProbe

Tuple Fields of KProbe

0: KProbe
KRetProbe

Tuple Fields of KRetProbe

0: KProbe
UProbe

Tuple Fields of UProbe

0: UProbe
URetProbe

Tuple Fields of URetProbe

0: UProbe
SocketFilter

Tuple Fields of SocketFilter

0: SocketFilter
TracePoint

Tuple Fields of TracePoint

0: TracePoint
XDP

Tuple Fields of XDP

0: XDP
StreamParser

Tuple Fields of StreamParser

0: StreamParser
StreamVerdict

Tuple Fields of StreamVerdict

0: StreamVerdict

Implementations

Load the BPF program.

BPF programs need to be loaded before they can be attached. Loading will fail if the BPF verifier rejects the code.

Example

use redbpf::Module;
let mut module = Module::parse(&std::fs::read("file.elf").unwrap()).unwrap();
for program in module.programs.iter_mut() {
    program
        .load(module.version, module.license.clone()).unwrap()
}

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.