aya_ebpf/programs/device.rs
1use core::ffi::c_void;
2
3use crate::{bindings::bpf_cgroup_dev_ctx, EbpfContext};
4
5pub struct DeviceContext {
6 pub device: *mut bpf_cgroup_dev_ctx,
7}
8
9impl DeviceContext {
10 pub fn new(device: *mut bpf_cgroup_dev_ctx) -> DeviceContext {
11 DeviceContext { device }
12 }
13}
14
15impl EbpfContext for DeviceContext {
16 fn as_ptr(&self) -> *mut c_void {
17 self.device as *mut _
18 }
19}