mirror of
https://github.com/aya-rs/aya.git
synced 2026-05-31 11:18:53 +02:00
aya: add Program::name() and make ::prog_type() public
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user