Struct aya::programs::CgroupSkb[][src]

pub struct CgroupSkb { /* fields omitted */ }
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.

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")?.try_into()?;
egress.load()?;
egress.attach(file, CgroupSkbAttachType::Egress)?;

Implementations

Loads the program inside the kernel.

See also Program::load.

Returns the name of the program.

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

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

Performs the conversion.

Performs the conversion.

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.