mirror of https://github.com/aya-rs/aya
bpf: Support BPF_PROG_TYPE_SK_LOOKUP
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>pull/265/head
parent
2226b89ceb
commit
74704c3b28
@ -0,0 +1,19 @@
|
|||||||
|
use core::ffi::c_void;
|
||||||
|
|
||||||
|
use crate::{bindings::bpf_sk_lookup, BpfContext};
|
||||||
|
|
||||||
|
pub struct SkLookupContext {
|
||||||
|
pub lookup: *mut bpf_sk_lookup,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SkLookupContext {
|
||||||
|
pub fn new(lookup: *mut bpf_sk_lookup) -> SkLookupContext {
|
||||||
|
SkLookupContext { lookup }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BpfContext for SkLookupContext {
|
||||||
|
fn as_ptr(&self) -> *mut c_void {
|
||||||
|
self.lookup as *mut _
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue