...
1#include "../../../testdata/common.h"
2
3char __license[] __section("license") = "MIT";
4
5enum e { HOOPY, FROOD };
6
7typedef long long int longint;
8
9typedef struct {
10 longint bar;
11 _Bool baz;
12 enum e boo;
13} barfoo;
14
15struct {
16 __uint(type, BPF_MAP_TYPE_HASH);
17 __type(key, enum e);
18 __type(value, barfoo);
19 __uint(max_entries, 1);
20} map1 __section(".maps");
21
22volatile const enum e my_constant = FROOD;
23
24volatile const barfoo struct_const;
25
26__section("socket") int filter() {
27 return my_constant + struct_const.bar;
28}
View as plain text