|
|
@ -7,15 +7,12 @@ use std::{
|
|
|
|
use thiserror::Error;
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
use crate::{
|
|
|
|
generated::bpf_insn,
|
|
|
|
|
|
|
|
maps::{Map, MapError},
|
|
|
|
maps::{Map, MapError},
|
|
|
|
obj::{Object, ParseError, RelocationError},
|
|
|
|
obj::{Object, ParseError, RelocationError},
|
|
|
|
programs::{KProbe, Program, ProgramData, ProgramError, SocketFilter, TracePoint, UProbe, Xdp},
|
|
|
|
programs::{KProbe, Program, ProgramData, ProgramError, SocketFilter, TracePoint, UProbe, Xdp},
|
|
|
|
syscalls::bpf_map_update_elem_ptr,
|
|
|
|
syscalls::bpf_map_update_elem_ptr,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
unsafe impl object::Pod for bpf_insn {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub(crate) const BPF_OBJ_NAME_LEN: usize = 16;
|
|
|
|
pub(crate) const BPF_OBJ_NAME_LEN: usize = 16;
|
|
|
|
|
|
|
|
|
|
|
|
/* FIXME: these are arch dependent */
|
|
|
|
/* FIXME: these are arch dependent */
|
|
|
@ -45,8 +42,6 @@ pub(crate) struct bpf_map_def {
|
|
|
|
pub(crate) map_flags: u32,
|
|
|
|
pub(crate) map_flags: u32,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsafe impl object::Pod for bpf_map_def {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct Bpf {
|
|
|
|
pub struct Bpf {
|
|
|
|
maps: HashMap<String, RefCell<Map>>,
|
|
|
|
maps: HashMap<String, RefCell<Map>>,
|
|
|
|