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

A program used to inspect or filter network activity for a given cgroup.

CgroupSkb programs can be used to inspect or filter network activity generated on all the sockets belonging to a given cgroup. They can be attached to both ingress and egress.

Minimum kernel version

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

Examples

use std::fs::File;
use std::convert::TryInto;
use aya::programs::{CgroupSkb, CgroupSkbAttachType};

let file = File::open("/sys/fs/cgroup/unified")?;
let egress: &mut CgroupSkb = bpf.program_mut("egress_filter").unwrap().try_into()?;
egress.load()?;
egress.attach(file, CgroupSkbAttachType::Egress)?;

Implementations

Loads the program inside the kernel.

See also Program::load.

Returns the expected attach type of the program.

CgroupSkb programs can specify the expected attach type in their ELF section name, eg cgroup_skb/ingress or cgroup_skb/egress. This method returns None for programs defined with the generic section cgroup/skb.

Attaches the program to the given cgroup.

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.