Struct redbpf::ProgramArray[][src]

pub struct ProgramArray<'a> { /* fields omitted */ }
Expand description

Program array map.

An array of eBPF programs that can be used as a jump table.

To use this from eBPF code, see redbpf_probes::maps::ProgramArray.

Implementations

Get the fd of the eBPF program at index.

Set the index entry to the given eBPF program fd.

To jump to a program from eBPF, see redbpf_probes::maps::ProgramArray::tail_call.

Example
pub const PROGRAM_PARSE_HTTP: u32 = 0;

use redbpf::{load::Loader, ProgramArray};
let mut loader = Loader::load_file("iotop.elf").expect("error loading probe");
let mut programs = ProgramArray::new(loader.map("program_map").unwrap()).unwrap();

programs.set(
    PROGRAM_PARSE_HTTP,
    loader.program("parse_http").unwrap().fd().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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more