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
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
impl<'a> RefUnwindSafe for ProgramArray<'a>
impl<'a> Send for ProgramArray<'a>
impl<'a> Sync for ProgramArray<'a>
impl<'a> Unpin for ProgramArray<'a>
impl<'a> UnwindSafe for ProgramArray<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
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