Type Alias libbpf_rs::OpenProgramMut

source ·
pub type OpenProgramMut<'obj> = OpenProgramImpl<'obj, Mut>;
Expand description

A mutable parsed but not yet loaded BPF program.

Aliased Type§

struct OpenProgramMut<'obj> { /* private fields */ }

Implementations§

source§

impl<'obj> OpenProgramMut<'obj>

source

pub fn new_mut(prog: &'obj mut bpf_program) -> Self

Create a new [OpenProgram] from a ptr to a libbpf_sys::bpf_program.

source

pub fn set_prog_type(&mut self, prog_type: ProgramType)

source

pub fn set_attach_type(&mut self, attach_type: ProgramAttachType)

source

pub fn set_ifindex(&mut self, idx: u32)

source

pub fn set_log_level(&mut self, log_level: u32)

Set the log level for the bpf program.

The log level is interpreted by bpf kernel code and interpretation may change with newer kernel versions. Refer to the kernel source code for details.

In general, a value of 0 disables logging while values > 0 enables it.

source

pub fn set_autoload(&mut self, autoload: bool)

Set whether a bpf program should be automatically loaded by default when the bpf object is loaded.

source

pub fn set_attach_target( &mut self, attach_prog_fd: i32, attach_func_name: Option<String>, ) -> Result<()>

source

pub fn set_flags(&mut self, flags: u32)

Trait Implementations§

source§

impl<'obj> Deref for OpenProgramMut<'obj>

§

type Target = OpenProgramImpl<'obj>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.