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
345 B
Rust
20 lines
345 B
Rust
4 years ago
|
use core::ffi::c_void;
|
||
|
|
||
|
use crate::{bindings::__sk_buff, BpfContext};
|
||
|
|
||
|
pub struct SkSkbContext {
|
||
|
skb: *mut __sk_buff,
|
||
|
}
|
||
|
|
||
|
impl SkSkbContext {
|
||
|
pub fn new(skb: *mut __sk_buff) -> SkSkbContext {
|
||
|
SkSkbContext { skb }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl BpfContext for SkSkbContext {
|
||
|
fn as_ptr(&self) -> *mut c_void {
|
||
|
self.skb as *mut _
|
||
|
}
|
||
|
}
|