github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/cmd/bpf2go/testdata/minimal.c (about)

     1  #include "../../../testdata/common.h"
     2  
     3  char __license[] __section("license") = "MIT";
     4  
     5  enum e { HOOPY, FROOD };
     6  
     7  typedef long long int longint;
     8  
     9  typedef struct {
    10  	longint bar;
    11  	_Bool baz;
    12  	enum e boo;
    13  } barfoo;
    14  
    15  struct {
    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  
    22  volatile const enum e my_constant = FROOD;
    23  
    24  volatile const barfoo struct_const;
    25  
    26  __section("socket") int filter() {
    27  	return my_constant + struct_const.bar;
    28  }