Daniel Borkmann | 6256f8c | 2015-04-01 17:57:44 +0200 | [diff] [blame] | 1 | #ifndef __BPF_ELF__ |
| 2 | #define __BPF_ELF__ |
| 3 | |
| 4 | #include <asm/types.h> |
| 5 | |
| 6 | /* Note: |
| 7 | * |
| 8 | * Below ELF section names and bpf_elf_map structure definition |
| 9 | * are not (!) kernel ABI. It's rather a "contract" between the |
| 10 | * application and the BPF loader in tc. For compatibility, the |
| 11 | * section names should stay as-is. Introduction of aliases, if |
| 12 | * needed, are a possibility, though. |
| 13 | */ |
| 14 | |
| 15 | /* ELF section names, etc */ |
| 16 | #define ELF_SECTION_LICENSE "license" |
| 17 | #define ELF_SECTION_MAPS "maps" |
| 18 | #define ELF_SECTION_CLASSIFIER "classifier" |
| 19 | #define ELF_SECTION_ACTION "action" |
| 20 | |
| 21 | #define ELF_MAX_MAPS 64 |
| 22 | #define ELF_MAX_LICENSE_LEN 128 |
| 23 | |
Daniel Borkmann | 32e93fb | 2015-11-13 00:39:29 +0100 | [diff] [blame] | 24 | /* Object pinning settings */ |
| 25 | #define PIN_NONE 0 |
| 26 | #define PIN_OBJECT_NS 1 |
| 27 | #define PIN_GLOBAL_NS 2 |
| 28 | |
Daniel Borkmann | 6256f8c | 2015-04-01 17:57:44 +0200 | [diff] [blame] | 29 | /* ELF map definition */ |
| 30 | struct bpf_elf_map { |
| 31 | __u32 type; |
| 32 | __u32 size_key; |
| 33 | __u32 size_value; |
| 34 | __u32 max_elem; |
Daniel Borkmann | 4dd3f50 | 2016-04-09 00:32:05 +0200 | [diff] [blame] | 35 | __u32 flags; |
Daniel Borkmann | 6256f8c | 2015-04-01 17:57:44 +0200 | [diff] [blame] | 36 | __u32 id; |
Daniel Borkmann | f6793ee | 2015-11-26 15:38:44 +0100 | [diff] [blame] | 37 | __u32 pinning; |
Daniel Borkmann | 6256f8c | 2015-04-01 17:57:44 +0200 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | #endif /* __BPF_ELF__ */ |