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