pub type Program<'obj> = ProgramImpl<'obj>;Expand description
An immutable loaded BPF program.
Aliased Type§
struct Program<'obj> { /* private fields */ }Implementations§
source§impl<'obj> Program<'obj>
impl<'obj> Program<'obj>
sourcepub fn new(prog: &'obj bpf_program) -> Self
pub fn new(prog: &'obj bpf_program) -> Self
Create a [Program] from a [libbpf_sys::bpf_program]
sourcepub fn prog_type(&self) -> ProgramType
pub fn prog_type(&self) -> ProgramType
Retrieve the type of the program.
sourcepub fn get_fd_by_id(id: u32) -> Result<OwnedFd>
pub fn get_fd_by_id(id: u32) -> Result<OwnedFd>
Returns program fd by id
sourcepub fn get_id_by_fd(fd: BorrowedFd<'_>) -> Result<u32>
pub fn get_id_by_fd(fd: BorrowedFd<'_>) -> Result<u32>
Returns program id by fd
sourcepub fn attach_type(&self) -> ProgramAttachType
pub fn attach_type(&self) -> ProgramAttachType
Retrieve the attach type of the program.
sourcepub fn autoload(&self) -> bool
pub fn autoload(&self) -> bool
Return true if the bpf program is set to autoload, false otherwise.