Skip to content

Commit

Permalink
ebpf: Don't use name in macros
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed Aug 1, 2023
1 parent c01c104 commit 1fc9639
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions examples/cgroup-skb-egress/cgroup-skb-egress-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ use cgroup_skb_egress_common::PacketLog;
mod bindings;
use bindings::iphdr;

#[map(name = "EVENTS")]
#[map]
static EVENTS: PerfEventArray<PacketLog> =
PerfEventArray::with_max_entries(1024, 0);

#[map(name = "BLOCKLIST")] // (1)
#[map] // (1)
static BLOCKLIST: HashMap<u32, u32> = HashMap::with_max_entries(1024, 0);

#[cgroup_skb(name = "cgroup_skb_egress")]
#[cgroup_skb]
pub fn cgroup_skb_egress(ctx: SkBuffContext) -> i32 {
match { try_cgroup_skb_egress(ctx) } {
Ok(ret) => ret,
Expand Down
2 changes: 1 addition & 1 deletion examples/kprobetcp/kprobetcp-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use aya_log_ebpf::info;
const AF_INET: u16 = 2;
const AF_INET6: u16 = 10;

#[kprobe(name = "kprobetcp")]
#[kprobe]
pub fn kprobetcp(ctx: ProbeContext) -> u32 {
match try_kprobetcp(ctx) {
Ok(ret) => ret,
Expand Down
2 changes: 1 addition & 1 deletion examples/tc-egress/tc-egress-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use network_types::{
#[map]
static BLOCKLIST: HashMap<u32, u32> = HashMap::with_max_entries(1024, 0);

#[classifier(name = "tc_egress")]
#[classifier]
pub fn tc_egress(ctx: TcContext) -> i32 {
match try_tc_egress(ctx) {
Ok(ret) => ret,
Expand Down
2 changes: 1 addition & 1 deletion examples/xdp-drop/xdp-drop-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
unsafe { core::hint::unreachable_unchecked() }
}

#[map(name = "BLOCKLIST")] // (1)
#[map] // (1)
static BLOCKLIST: HashMap<u32, u32> =
HashMap::<u32, u32>::with_max_entries(1024, 0);

Expand Down
2 changes: 1 addition & 1 deletion examples/xdp-hello/xdp-hello-ebpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use aya_bpf::{bindings::xdp_action, macros::xdp, programs::XdpContext};
use aya_log_ebpf::info;

#[xdp(name = "xdp_hello")] // (4)
#[xdp] // (4)
pub fn xdp_hello(ctx: XdpContext) -> u32 {
// (5)
match unsafe { try_xdp_hello(ctx) } {
Expand Down

0 comments on commit 1fc9639

Please sign in to comment.