17 typedef unsigned char uint8_t;
18 typedef unsigned int uint32_t;
19 typedef unsigned long long uint64_t;
22 #define BPF_ENUM_TO_STRING(X) #X
43 #define BPF_MAP_TYPE_PER_CPU(X) \
44 ((X) == BPF_MAP_TYPE_PERCPU_HASH || (X) == BPF_MAP_TYPE_PERCPU_ARRAY || (X) == BPF_MAP_TYPE_LRU_PERCPU_HASH)
46 static const char*
const _ebpf_map_type_names[] = {
63 static const char*
const _ebpf_map_display_names[] = {
95 static const char*
const _ebpf_pin_type_names[] = {
103 #define EBPF_ID_NONE UINT32_MAX
230 #define XDP_FLAGS_REPLACE 0x01
243 static const char*
const _ebpf_link_display_names[] = {
314 #pragma warning(push)
315 #pragma warning(disable : 4201)
346 #define BPF_OBJ_NAME_LEN 64
369 #define BPF_NOEXIST 0x1
370 #define BPF_EXIST 0x2
bpf_prog_type
Definition: ebpf_structs.h:170
@ BPF_PROG_TYPE_XDP
Program type for handling incoming packets as early as possible.
Definition: ebpf_structs.h:181
@ BPF_PROG_TYPE_BIND
Program type for handling socket bind() requests.
Definition: ebpf_structs.h:191
@ BPF_PROG_TYPE_CGROUP_SOCK_ADDR
Program type for handling various socket operations such as connect(), accept() etc.
Definition: ebpf_structs.h:205
@ BPF_PROG_TYPE_UNSPEC
Unspecified program type.
Definition: ebpf_structs.h:171
@ BPF_PROG_TYPE_SOCK_OPS
Program type for handling various socket event notifications such as connection established etc.
Definition: ebpf_structs.h:216
@ BPF_PROG_TYPE_SAMPLE
Program type for handling calls from the eBPF sample extension. Used for testing.
Definition: ebpf_structs.h:225
enum ebpf_map_option ebpf_map_option_t
bpf_link_type
Definition: ebpf_structs.h:236
@ BPF_LINK_TYPE_UNSPEC
Unspecified link type.
Definition: ebpf_structs.h:237
@ BPF_LINK_TYPE_PLAIN
No union members are used in bpf_link_info.
Definition: ebpf_structs.h:238
@ BPF_LINK_TYPE_CGROUP
cgroup struct is present in bpf_link_info.
Definition: ebpf_structs.h:239
@ BPF_LINK_TYPE_XDP
xdp struct is present in bpf_link_info.
Definition: ebpf_structs.h:240
enum bpf_prog_type bpf_prog_type_t
Definition: ebpf_structs.h:228
enum bpf_map_type ebpf_map_type_t
#define BPF_ENUM_TO_STRING(X)
Definition: ebpf_structs.h:22
struct _ebpf_map_definition_in_memory ebpf_map_definition_in_memory_t
eBPF Map Definition as it is stored in memory.
enum ebpf_pin_type ebpf_pin_type_t
ebpf_pin_type
Definition: ebpf_structs.h:88
@ PIN_CUSTOM_NS
Pinning with a custom path given as section parameter.
Definition: ebpf_structs.h:92
@ PIN_OBJECT_NS
Pinning that is local to an object.
Definition: ebpf_structs.h:90
@ PIN_GLOBAL_NS
Pinning with a global namespace.
Definition: ebpf_structs.h:91
@ PIN_NONE
Object is not pinned.
Definition: ebpf_structs.h:89
uint32_t ebpf_id_t
Definition: ebpf_structs.h:102
ebpf_helper_id_t
Definition: ebpf_structs.h:144
@ BPF_FUNC_trace_printk2
bpf_trace_printk2 (but use bpf_printk instead)
Definition: ebpf_structs.h:156
@ BPF_FUNC_tail_call
bpf_tail_call
Definition: ebpf_structs.h:149
@ BPF_FUNC_ktime_get_ns
bpf_ktime_get_ns
Definition: ebpf_structs.h:153
@ BPF_FUNC_get_smp_processor_id
bpf_get_smp_processor_id
Definition: ebpf_structs.h:152
@ BPF_FUNC_get_prandom_u32
bpf_get_prandom_u32
Definition: ebpf_structs.h:150
@ BPF_FUNC_trace_printk3
bpf_trace_printk3 (but use bpf_printk instead)
Definition: ebpf_structs.h:157
@ BPF_FUNC_map_lookup_and_delete_elem
bpf_map_lookup_and_delete_elem
Definition: ebpf_structs.h:148
@ BPF_FUNC_ringbuf_output
bpf_ringbuf_output
Definition: ebpf_structs.h:155
@ BPF_FUNC_trace_printk5
bpf_trace_printk5 (but use bpf_printk instead)
Definition: ebpf_structs.h:159
@ BPF_FUNC_is_current_admin
bpf_is_current_admin
Definition: ebpf_structs.h:165
@ BPF_FUNC_map_pop_elem
bpf_map_pop_elem
Definition: ebpf_structs.h:161
@ BPF_FUNC_map_update_elem
bpf_map_update_elem
Definition: ebpf_structs.h:146
@ BPF_FUNC_csum_diff
bpf_csum_diff
Definition: ebpf_structs.h:154
@ BPF_FUNC_map_delete_elem
bpf_map_delete_elem
Definition: ebpf_structs.h:147
@ BPF_FUNC_map_lookup_elem
bpf_map_lookup_elem
Definition: ebpf_structs.h:145
@ BPF_FUNC_trace_printk4
bpf_trace_printk4 (but use bpf_printk instead)
Definition: ebpf_structs.h:158
@ BPF_FUNC_map_peek_elem
bpf_map_peek_elem
Definition: ebpf_structs.h:162
@ BPF_FUNC_ktime_get_boot_ns
bpf_ktime_get_boot_ns
Definition: ebpf_structs.h:151
@ BPF_FUNC_get_current_logon_id
bpf_get_current_logon_id
Definition: ebpf_structs.h:164
@ BPF_FUNC_map_push_elem
bpf_map_push_elem
Definition: ebpf_structs.h:160
@ BPF_FUNC_get_current_pid_tgid
bpf_get_current_pid_tgid
Definition: ebpf_structs.h:163
bpf_attach_type
Definition: ebpf_structs.h:249
@ BPF_XDP
Attach type for handling incoming packets as early as possible.
Definition: ebpf_structs.h:256
@ BPF_CGROUP_INET6_CONNECT
Attach type for handling IPv6 TCP connect() or UDP send to a unique remote address/port tuple.
Definition: ebpf_structs.h:276
@ BPF_ATTACH_TYPE_UNSPEC
Unspecified attach type.
Definition: ebpf_structs.h:250
@ __MAX_BPF_ATTACH_TYPE
Definition: ebpf_structs.h:304
@ BPF_ATTACH_TYPE_BIND
Attach type for handling socket bind() requests.
Definition: ebpf_structs.h:262
@ BPF_CGROUP_INET6_RECV_ACCEPT
Attach type for handling IPv6 TCP accept() or on receiving the first unicast UDP packet from a unique...
Definition: ebpf_structs.h:290
@ BPF_ATTACH_TYPE_SAMPLE
Attach type implemented by eBPF Sample Extension driver, used for testing.
Definition: ebpf_structs.h:302
@ BPF_CGROUP_SOCK_OPS
Attach type for handling various socket event notifications.
Definition: ebpf_structs.h:296
@ BPF_CGROUP_INET4_RECV_ACCEPT
Attach type for handling IPv4 TCP accept() or on receiving the first unicast UDP packet from a unique...
Definition: ebpf_structs.h:283
@ BPF_CGROUP_INET4_CONNECT
Attach type for handling IPv4 TCP connect() or UDP send to a unique remote address/port tuple.
Definition: ebpf_structs.h:269
struct _ebpf_map_definition_in_file ebpf_map_definition_in_file_t
eBPF Map Definition as it appears in the maps section of an ELF file.
#define BPF_OBJ_NAME_LEN
Definition: ebpf_structs.h:346
enum bpf_attach_type bpf_attach_type_t
Definition: ebpf_structs.h:307
ebpf_map_option
Definition: ebpf_structs.h:81
@ EBPF_ANY
Create a new element or update an existing element.
Definition: ebpf_structs.h:82
@ EBPF_EXIST
Update an existing element.
Definition: ebpf_structs.h:84
@ EBPF_NOEXIST
Create a new element only when it does not exist.
Definition: ebpf_structs.h:83
bpf_map_type
Definition: ebpf_structs.h:25
@ BPF_MAP_TYPE_STACK
Stack.
Definition: ebpf_structs.h:39
@ BPF_MAP_TYPE_RINGBUF
Ring buffer.
Definition: ebpf_structs.h:40
@ BPF_MAP_TYPE_PERCPU_ARRAY
Per-CPU array.
Definition: ebpf_structs.h:32
@ BPF_MAP_TYPE_QUEUE
Queue.
Definition: ebpf_structs.h:37
@ BPF_MAP_TYPE_LRU_PERCPU_HASH
Per-CPU least-recently-used hash table.
Definition: ebpf_structs.h:38
@ BPF_MAP_TYPE_LPM_TRIE
Longest prefix match trie.
Definition: ebpf_structs.h:36
@ BPF_MAP_TYPE_HASH_OF_MAPS
Hash table, where the map value is another map.
Definition: ebpf_structs.h:33
@ BPF_MAP_TYPE_LRU_HASH
Least-recently-used hash table.
Definition: ebpf_structs.h:35
@ BPF_MAP_TYPE_PERCPU_HASH
Per-CPU hash table.
Definition: ebpf_structs.h:31
@ BPF_MAP_TYPE_ARRAY_OF_MAPS
Array, where the map value is another map.
Definition: ebpf_structs.h:34
@ BPF_MAP_TYPE_UNSPEC
Unspecified map type.
Definition: ebpf_structs.h:26
@ BPF_MAP_TYPE_ARRAY
Array, where the map key is the array index.
Definition: ebpf_structs.h:28
@ BPF_MAP_TYPE_PROG_ARRAY
Array of program fds usable with bpf_tail_call, where the map key is the array index.
Definition: ebpf_structs.h:29
@ BPF_MAP_TYPE_HASH
Hash table.
Definition: ebpf_structs.h:27
GUID ebpf_attach_type_t
Definition: ebpf_windows.h:44
GUID ebpf_program_type_t
Definition: ebpf_windows.h:43
eBPF Map Definition as it appears in the maps section of an ELF file.
Definition: ebpf_structs.h:122
uint32_t inner_id
Definition: ebpf_structs.h:140
uint32_t key_size
Size in bytes of a map key.
Definition: ebpf_structs.h:124
uint32_t max_entries
Maximum number of entries allowed in the map.
Definition: ebpf_structs.h:126
uint32_t inner_map_idx
Definition: ebpf_structs.h:132
ebpf_map_type_t type
Type of map.
Definition: ebpf_structs.h:123
uint32_t value_size
Size in bytes of a map value.
Definition: ebpf_structs.h:125
ebpf_pin_type_t pinning
Definition: ebpf_structs.h:133
uint32_t id
Definition: ebpf_structs.h:137
eBPF Map Definition as it is stored in memory.
Definition: ebpf_structs.h:109
ebpf_map_type_t type
Type of map.
Definition: ebpf_structs.h:110
uint32_t key_size
Size in bytes of a map key.
Definition: ebpf_structs.h:111
ebpf_id_t inner_map_id
Definition: ebpf_structs.h:114
uint32_t max_entries
Maximum number of entries allowed in the map.
Definition: ebpf_structs.h:113
ebpf_pin_type_t pinning
Definition: ebpf_structs.h:115
uint32_t value_size
Size in bytes of a map value.
Definition: ebpf_structs.h:112
eBPF link information. This structure can be retrieved by calling bpf_obj_get_info_by_fd on a link fd...
Definition: ebpf_structs.h:322
struct bpf_link_info::@23::@26 cgroup
ebpf_program_type_t program_type_uuid
Program type UUID.
Definition: ebpf_structs.h:328
uint8_t attach_data
Definition: ebpf_structs.h:339
ebpf_id_t prog_id
Program ID.
Definition: ebpf_structs.h:324
enum bpf_attach_type attach_type
Attach type.
Definition: ebpf_structs.h:326
uint32_t ifindex
Definition: ebpf_structs.h:333
enum bpf_link_type type
Link type.
Definition: ebpf_structs.h:325
struct bpf_link_info::@23::@25 xdp
ebpf_attach_type_t attach_type_uuid
Attach type UUID.
Definition: ebpf_structs.h:327
uint64_t cgroup_id
Definition: ebpf_structs.h:337
ebpf_id_t id
Link ID.
Definition: ebpf_structs.h:323
eBPF map information. This structure can be retrieved by calling bpf_obj_get_info_by_fd on a map fd.
Definition: ebpf_structs.h:353
uint32_t max_entries
Maximum number of entries allowed in the map.
Definition: ebpf_structs.h:359
char name[BPF_OBJ_NAME_LEN]
Null-terminated map name.
Definition: ebpf_structs.h:360
ebpf_map_type_t type
Type of map.
Definition: ebpf_structs.h:356
uint32_t key_size
Size in bytes of a map key.
Definition: ebpf_structs.h:357
ebpf_id_t id
Map ID.
Definition: ebpf_structs.h:355
uint32_t map_flags
Map flags.
Definition: ebpf_structs.h:361
uint32_t pinned_path_count
Number of pinned paths.
Definition: ebpf_structs.h:365
uint32_t value_size
Size in bytes of a map value.
Definition: ebpf_structs.h:358
ebpf_id_t inner_map_id
ID of inner map template.
Definition: ebpf_structs.h:364
eBPF program information. This structure can be retrieved by calling bpf_obj_get_info_by_fd on a prog...
Definition: ebpf_structs.h:377
ebpf_attach_type_t attach_type_uuid
Attach type UUID.
Definition: ebpf_structs.h:387
uint32_t pinned_path_count
Number of pinned paths.
Definition: ebpf_structs.h:388
uint32_t link_count
Number of attached links.
Definition: ebpf_structs.h:389
enum bpf_prog_type type
Program type, if a cross-platform type.
Definition: ebpf_structs.h:380
char name[BPF_OBJ_NAME_LEN]
Null-terminated program name.
Definition: ebpf_structs.h:383
uintptr_t map_ids
Pointer to caller-allocated array to fill map IDs into.
Definition: ebpf_structs.h:382
uint32_t nr_map_ids
Number of maps associated with this program.
Definition: ebpf_structs.h:381
ebpf_id_t id
Program ID.
Definition: ebpf_structs.h:379
ebpf_program_type_t type_uuid
Program type UUID.
Definition: ebpf_structs.h:386