Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2023 Isovalent */
3#include <stdbool.h>
4#include <linux/bpf.h>
5#include <bpf/bpf_helpers.h>
6
7char LICENSE[] SEC("license") = "GPL";
8
9bool seen_tc1;
10bool seen_tc2;
11bool seen_tc3;
12bool seen_tc4;
13bool seen_tc5;
14bool seen_tc6;
15
16SEC("tc/ingress")
17int tc1(struct __sk_buff *skb)
18{
19 seen_tc1 = true;
20 return TCX_NEXT;
21}
22
23SEC("tc/egress")
24int tc2(struct __sk_buff *skb)
25{
26 seen_tc2 = true;
27 return TCX_NEXT;
28}
29
30SEC("tc/egress")
31int tc3(struct __sk_buff *skb)
32{
33 seen_tc3 = true;
34 return TCX_NEXT;
35}
36
37SEC("tc/egress")
38int tc4(struct __sk_buff *skb)
39{
40 seen_tc4 = true;
41 return TCX_NEXT;
42}
43
44SEC("tc/egress")
45int tc5(struct __sk_buff *skb)
46{
47 seen_tc5 = true;
48 return TCX_PASS;
49}
50
51SEC("tc/egress")
52int tc6(struct __sk_buff *skb)
53{
54 seen_tc6 = true;
55 return TCX_PASS;
56}