You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/bpf/aya-bpf/src/programs/sock.rs

20 lines
345 B
Rust

use core::ffi::c_void;
use crate::{bindings::bpf_sock, BpfContext};
pub struct SockContext {
pub sock: *mut bpf_sock,
}
impl SockContext {
pub fn new(sock: *mut bpf_sock) -> SockContext {
SockContext { sock }
}
}
impl BpfContext for SockContext {
fn as_ptr(&self) -> *mut c_void {
self.sock as *mut _
}
}