Struct libbpf_rs::OpenProgram
source · [−]pub struct OpenProgram { /* private fields */ }
Expand description
Represents a parsed but not yet loaded BPF program.
This object exposes operations that need to happen before the program is loaded.
Implementations
sourceimpl OpenProgram
impl OpenProgram
pub fn set_prog_type(&mut self, prog_type: ProgramType)
pub fn set_attach_type(&mut self, attach_type: ProgramAttachType)
pub fn set_ifindex(&mut self, idx: u32)
pub fn set_autoload(&mut self, autoload: bool) -> Result<()>
pub fn set_attach_target(
&mut self,
attach_prog_fd: i32,
attach_func_name: Option<String>
) -> Result<()>
pub fn set_flags(&self, flags: u32) -> Result<()>
sourcepub fn insn_cnt(&self) -> usize
pub fn insn_cnt(&self) -> usize
Returns the number of instructions that form the program.
Note: Keep in mind, libbpf can modify the program’s instructions
and consequently its instruction count, as it processes the BPF object file.
So OpenProgram::insn_cnt
and Program::insn_cnt
may return different values.
Auto Trait Implementations
impl RefUnwindSafe for OpenProgram
impl !Send for OpenProgram
impl !Sync for OpenProgram
impl Unpin for OpenProgram
impl UnwindSafe for OpenProgram
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more