mirror of https://github.com/aya-rs/aya
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.
20 lines
400 B
Rust
20 lines
400 B
Rust
3 years ago
|
use core::ffi::c_void;
|
||
|
|
||
|
use crate::{bindings::bpf_sock_addr, BpfContext};
|
||
|
|
||
|
pub struct SockAddrContext {
|
||
|
pub sock_addr: *mut bpf_sock_addr,
|
||
|
}
|
||
|
|
||
|
impl SockAddrContext {
|
||
|
pub fn new(sock_addr: *mut bpf_sock_addr) -> SockAddrContext {
|
||
|
SockAddrContext { sock_addr }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl BpfContext for SockAddrContext {
|
||
|
fn as_ptr(&self) -> *mut c_void {
|
||
|
self.sock_addr as *mut _
|
||
|
}
|
||
|
}
|