Struct aya::programs::SockOps[][src]

pub struct SockOps { /* fields omitted */ }
Expand description

A program used to work with sockets.

SockOps programs can access or set socket options, connection parameters, watch connection state changes and more. They are attached to cgroups.

Minimum kernel version

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

Examples

use std::fs::File;
use std::convert::TryInto;
use aya::programs::SockOps;

let file = File::open("/sys/fs/cgroup/unified")?;
let prog: &mut SockOps = bpf.program_mut("intercept_active_sockets")?.try_into()?;
prog.load()?;
prog.attach(file)?;

Implementations

Loads the program inside the kernel.

See also Program::load.

Returns the name of the program.

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.