Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 // Copyright (c) 2020 Facebook
0003 #include <linux/bpf.h>
0004 #include <bpf/bpf_helpers.h>
0005 
0006 int calls = 0;
0007 int alt_calls = 0;
0008 
0009 SEC("cgroup_skb/egress")
0010 int egress(struct __sk_buff *skb)
0011 {
0012     __sync_fetch_and_add(&calls, 1);
0013     return 1;
0014 }
0015 
0016 SEC("cgroup_skb/egress")
0017 int egress_alt(struct __sk_buff *skb)
0018 {
0019     __sync_fetch_and_add(&alt_calls, 1);
0020     return 1;
0021 }
0022 
0023 char _license[] SEC("license") = "GPL";
0024