Struct bcc::XDP[][src]

pub struct XDP { /* fields omitted */ }

An object that can run BPF code as an XDP program that runs on every packet at the driver level.

Implementations

impl XDP[src]

pub fn new() -> Self[src]

Create a new XDP object with the defaults. By default, the XDP program is run in generic mode [XDP_FLAGS_SKB_MODE] and will replace any already running program on the driver. Further initialization is required before attaching.

pub fn handler<T: AsRef<str>>(self, name: T) -> Self[src]

Specify the name of the XDP handler within the BPF code. This is a required configuration.

pub fn device<T: AsRef<str>>(self, name: T) -> Self[src]

Specify the name of the network device on which to run the BPF program. This is a required configuration.

pub fn mode(self, mode: Mode) -> Self[src]

Specify the XDP mode under which to run the BPF program.

pub fn attach(self, bpf: &mut BPF) -> Result<(), BccError>[src]

Load the configured handler as an XDP program onto the configured device and attach it to the BPF struct. The XDP program is unloaded from the device once the BPF struct goes out of scope.

Trait Implementations

impl Default for XDP[src]

Auto Trait Implementations

impl RefUnwindSafe for XDP

impl Send for XDP

impl Sync for XDP

impl Unpin for XDP

impl UnwindSafe for XDP

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.