Skip to main content

Program

Enum Program 

Source
pub enum Program {
Show 28 variants KProbe(KProbe), UProbe(UProbe), TracePoint(TracePoint), SocketFilter(SocketFilter), Xdp(Xdp), SkMsg(SkMsg), SkSkb(SkSkb), CgroupSockAddr(CgroupSockAddr), SockOps(SockOps), SchedClassifier(SchedClassifier), CgroupSkb(CgroupSkb), CgroupSysctl(CgroupSysctl), CgroupSockopt(CgroupSockopt), LircMode2(LircMode2), PerfEvent(PerfEvent), RawTracePoint(RawTracePoint), Lsm(Lsm), LsmCgroup(LsmCgroup), BtfTracePoint(BtfTracePoint), FEntry(FEntry), FExit(FExit), FlowDissector(FlowDissector), Extension(Extension), SkLookup(SkLookup), SkReuseport(SkReuseport), CgroupSock(CgroupSock), CgroupDevice(CgroupDevice), Iter(Iter),
}
Expand description

eBPF program type.

Variants§

§

KProbe(KProbe)

A KProbe program

§

UProbe(UProbe)

A UProbe program

§

TracePoint(TracePoint)

A TracePoint program

§

SocketFilter(SocketFilter)

A SocketFilter program

§

Xdp(Xdp)

A Xdp program

§

SkMsg(SkMsg)

A SkMsg program

§

SkSkb(SkSkb)

A SkSkb program

§

CgroupSockAddr(CgroupSockAddr)

A CgroupSockAddr program

§

SockOps(SockOps)

A SockOps program

§

SchedClassifier(SchedClassifier)

A SchedClassifier program

§

CgroupSkb(CgroupSkb)

A CgroupSkb program

§

CgroupSysctl(CgroupSysctl)

A CgroupSysctl program

§

CgroupSockopt(CgroupSockopt)

A CgroupSockopt program

§

LircMode2(LircMode2)

A LircMode2 program

§

PerfEvent(PerfEvent)

A PerfEvent program

§

RawTracePoint(RawTracePoint)

A RawTracePoint program

§

Lsm(Lsm)

A Lsm program

§

LsmCgroup(LsmCgroup)

A LsmCgroup program

§

BtfTracePoint(BtfTracePoint)

A BtfTracePoint program

§

FEntry(FEntry)

A FEntry program

§

FExit(FExit)

A FExit program

§

FlowDissector(FlowDissector)

A FlowDissector program

§

Extension(Extension)

A Extension program

§

SkLookup(SkLookup)

A SkLookup program

§

SkReuseport(SkReuseport)

A SkReuseport program

§

CgroupSock(CgroupSock)

A CgroupSock program

§

CgroupDevice(CgroupDevice)

A CgroupDevice program

§

Iter(Iter)

An Iter program

Implementations§

Source§

impl Program

Source

pub const fn prog_type(&self) -> ProgramType

Returns the program type.

Source

pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<(), PinError>

Pin the program to the provided path

Source

pub fn unload(self) -> Result<(), ProgramError>

Unloads the program from the kernel.

Source

pub fn fd(&self) -> Result<&ProgramFd, ProgramError>

Returns the file descriptor of a program.

Can be used to add a program to a crate::maps::ProgramArray or attach an Extension program.

Source

pub fn info(&self) -> Result<ProgramInfo, ProgramError>

Returns information about a loaded program with the ProgramInfo structure.

This information is populated at load time by the kernel and can be used to get kernel details for a given Program.

Trait Implementations§

Source§

impl Debug for Program

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> TryFrom<&'a Program> for &'a BtfTracePoint

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a BtfTracePoint, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a CgroupDevice

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a CgroupDevice, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a CgroupSkb

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a CgroupSkb, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a CgroupSock

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a CgroupSock, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a CgroupSockAddr

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a CgroupSockAddr, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a CgroupSockopt

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a CgroupSockopt, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a CgroupSysctl

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a CgroupSysctl, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a Extension

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a Extension, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a FEntry

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a FEntry, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a FExit

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a FExit, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a FlowDissector

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a FlowDissector, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a Iter

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a Iter, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a KProbe

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a KProbe, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a LircMode2

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a LircMode2, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a Lsm

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a Lsm, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a LsmCgroup

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a LsmCgroup, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a PerfEvent

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a PerfEvent, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a RawTracePoint

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a RawTracePoint, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SchedClassifier

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SchedClassifier, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SkLookup

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SkLookup, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SkMsg

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SkMsg, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SkReuseport

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SkReuseport, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SkSkb

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SkSkb, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SockOps

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SockOps, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a SocketFilter

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a SocketFilter, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a TracePoint

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a TracePoint, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a UProbe

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a UProbe, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Program> for &'a Xdp

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a Program) -> Result<&'a Xdp, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut BtfTracePoint

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut BtfTracePoint, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut CgroupDevice

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut CgroupDevice, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut CgroupSkb

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut CgroupSkb, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut CgroupSock

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut CgroupSock, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut CgroupSockAddr

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut CgroupSockAddr, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut CgroupSockopt

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut CgroupSockopt, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut CgroupSysctl

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut CgroupSysctl, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut Extension

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut Extension, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut FEntry

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut FEntry, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut FExit

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut FExit, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut FlowDissector

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut FlowDissector, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut Iter

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut Iter, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut KProbe

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut KProbe, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut LircMode2

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut LircMode2, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut Lsm

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut Lsm, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut LsmCgroup

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut LsmCgroup, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut PerfEvent

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut PerfEvent, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut RawTracePoint

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut RawTracePoint, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SchedClassifier

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut SchedClassifier, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SkLookup

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut SkLookup, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SkMsg

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut SkMsg, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SkReuseport

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut SkReuseport, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SkSkb

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut SkSkb, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SockOps

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut SockOps, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut SocketFilter

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut SocketFilter, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut TracePoint

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from( program: &'a mut Program, ) -> Result<&'a mut TracePoint, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut UProbe

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut UProbe, ProgramError>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut Program> for &'a mut Xdp

Source§

type Error = ProgramError

The type returned in the event of a conversion error.
Source§

fn try_from(program: &'a mut Program) -> Result<&'a mut Xdp, ProgramError>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.