pub struct SockOps { /* private fields */ }
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").unwrap().try_into()?;
prog.load()?;
prog.attach(file)?;
Implementations
sourceimpl SockOps
impl SockOps
sourcepub fn load(&mut self) -> Result<(), ProgramError>
pub fn load(&mut self) -> Result<(), ProgramError>
Loads the program inside the kernel.
See also Program::load
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SockOps
impl !Send for SockOps
impl !Sync for SockOps
impl Unpin for SockOps
impl !UnwindSafe for SockOps
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more