brintos

brintos / linux-shallow public Read only

0
0
Text · 422 B · 4faba88 Raw
25 lines · c
1// SPDX-License-Identifier: GPL-2.02// Copyright (c) 2020 Facebook3#include <linux/bpf.h>4#include <bpf/bpf_helpers.h>5 6int calls = 0;7int alt_calls = 0;8 9SEC("cgroup_skb/egress")10int egress(struct __sk_buff *skb)11{12	__sync_fetch_and_add(&calls, 1);13	return 1;14}15 16SEC("cgroup_skb/egress")17int egress_alt(struct __sk_buff *skb)18{19	__sync_fetch_and_add(&alt_calls, 1);20	return 1;21}22 23char _license[] SEC("license") = "GPL";24 25