pub struct SkSkb { /* private fields */ }
Expand description

A program used to intercept ingress socket buffers.

SkSkb programs are attached to socket maps, and can be used to inspect, redirect or filter incoming packet. See also SockMap and SockHash.

Minimum kernel version

The minimum kernel version required to use this feature is 4.14.

Examples

use std::convert::{TryFrom, TryInto};
use aya::maps::SockMap;
use aya::programs::SkSkb;

let intercept_ingress = SockMap::try_from(bpf.map_mut("INTERCEPT_INGRESS")?)?;
let prog: &mut SkSkb = bpf.program_mut("intercept_ingress_packet").unwrap().try_into()?;
prog.load()?;
prog.attach(&intercept_ingress)?;

Implementations

Loads the program inside the kernel.

See also Program::load.

Attaches the program to the given socket map.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the RawFd of the program if it has been loaded, or None

Returns the RawFd of the program if it has been loaded, or None

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.