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 
7 char LICENSE[] SEC("license") = "GPL";
8 
9 bool seen_tc1;
10 bool seen_tc2;
11 bool seen_tc3;
12 bool seen_tc4;
13 bool seen_tc5;
14 bool seen_tc6;
15 
16 SEC("tc/ingress")
tc1(struct __sk_buff * skb)17 int tc1(struct __sk_buff *skb)
18 {
19 	seen_tc1 = true;
20 	return TCX_NEXT;
21 }
22 
23 SEC("tc/egress")
tc2(struct __sk_buff * skb)24 int tc2(struct __sk_buff *skb)
25 {
26 	seen_tc2 = true;
27 	return TCX_NEXT;
28 }
29 
30 SEC("tc/egress")
tc3(struct __sk_buff * skb)31 int tc3(struct __sk_buff *skb)
32 {
33 	seen_tc3 = true;
34 	return TCX_NEXT;
35 }
36 
37 SEC("tc/egress")
tc4(struct __sk_buff * skb)38 int tc4(struct __sk_buff *skb)
39 {
40 	seen_tc4 = true;
41 	return TCX_NEXT;
42 }
43 
44 SEC("tc/egress")
tc5(struct __sk_buff * skb)45 int tc5(struct __sk_buff *skb)
46 {
47 	seen_tc5 = true;
48 	return TCX_PASS;
49 }
50 
51 SEC("tc/egress")
tc6(struct __sk_buff * skb)52 int tc6(struct __sk_buff *skb)
53 {
54 	seen_tc6 = true;
55 	return TCX_PASS;
56 }
57