aya: add Program::name() and make ::prog_type() public

pull/1/head
Alessandro Decina 4 years ago
parent 0199e4b297
commit 286e117fe0

@ -94,7 +94,7 @@ impl Program {
load_program(self.prog_type(), self.data_mut())
}
fn prog_type(&self) -> bpf_prog_type {
pub fn prog_type(&self) -> bpf_prog_type {
use crate::generated::bpf_prog_type::*;
match self {
Program::KProbe(_) => BPF_PROG_TYPE_KPROBE,
@ -124,6 +124,10 @@ impl Program {
Program::Xdp(p) => &mut p.data,
}
}
pub fn name(&self) -> &str {
&self.data().name
}
}
#[derive(Debug)]

Loading…
Cancel
Save