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>
impl<'obj> OpenProgramMut<'obj>
sourcepub fn new_mut(prog: &'obj mut bpf_program) -> Self
pub fn new_mut(prog: &'obj mut bpf_program) -> Self
Create a new [OpenProgram
] from a ptr to a libbpf_sys::bpf_program
.
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)
sourcepub fn set_log_level(&mut self, log_level: u32)
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.
sourcepub fn set_autoload(&mut self, autoload: bool)
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.