18#include "libbpf/src/libbpf_common.h"
19#undef LIBBPF_DEPRECATED
20#define LIBBPF_DEPRECATED(x)
29#define __SIZEOF_SIZE_T__ 8
30#define __SIZEOF_LONG_LONG__ 8
57#define SYS_BPF_OBJ_NAME_LEN 16U
87#pragma warning(default : 4820)
This file contains eBPF definitions common to eBPF programs, core execution engine as well as eBPF AP...
bpf_prog_type
Definition ebpf_structs.h:173
bpf_link_type
Definition ebpf_structs.h:249
enum bpf_map_type ebpf_map_type_t
uint32_t ebpf_id_t
Definition ebpf_structs.h:95
bpf_attach_type
Definition ebpf_structs.h:263
bpf_map_type
Definition ebpf_structs.h:18
int32_t __s32
Definition bpf.h:32
uint32_t __u32
Definition bpf.h:35
uint64_t u64
Definition bpf.h:26
bpf_func_id
Definition bpf.h:40
@ BPF_FUNC_ID_UNKNOWN
Definition bpf.h:41
uint8_t __u8
Definition bpf.h:34
uint32_t pid_t
Definition bpf.h:37
uint8_t u8
Definition bpf.h:24
bpf_cmd_id
Definition bpf.h:60
@ BPF_MAP_LOOKUP_AND_DELETE_ELEM
Definition bpf.h:77
@ BPF_PROG_RUN
Definition bpf.h:82
@ BPF_MAP_CREATE
Definition bpf.h:61
@ BPF_OBJ_GET
Definition bpf.h:68
@ BPF_PROG_LOAD
Definition bpf.h:66
@ BPF_PROG_DETACH
Definition bpf.h:70
@ BPF_PROG_GET_NEXT_ID
Definition bpf.h:72
@ BPF_PROG_ATTACH
Definition bpf.h:69
@ BPF_OBJ_PIN
Definition bpf.h:67
@ BPF_MAP_GET_FD_BY_ID
Definition bpf.h:75
@ BPF_LINK_GET_NEXT_ID
Definition bpf.h:79
@ BPF_LINK_DETACH
Definition bpf.h:80
@ BPF_PROG_TEST_RUN
Definition bpf.h:71
@ BPF_PROG_BIND_MAP
Definition bpf.h:81
@ BPF_MAP_GET_NEXT_KEY
Definition bpf.h:65
@ BPF_LINK_GET_FD_BY_ID
Definition bpf.h:78
@ BPF_PROG_GET_FD_BY_ID
Definition bpf.h:74
@ BPF_OBJ_GET_INFO_BY_FD
Definition bpf.h:76
@ BPF_MAP_GET_NEXT_ID
Definition bpf.h:73
@ BPF_MAP_UPDATE_ELEM
Definition bpf.h:63
@ BPF_MAP_LOOKUP_ELEM
Definition bpf.h:62
@ BPF_MAP_DELETE_ELEM
Definition bpf.h:64
#define SYS_BPF_OBJ_NAME_LEN
Definition bpf.h:57
uint64_t __u64
Definition bpf.h:36
int bpf(int cmd, union bpf_attr *attr, unsigned int size)
int32_t s32
Definition bpf.h:23
bpf_stats_type
Definition bpf.h:45
@ BPF_STATS_TYPE_UNKNOWN
Definition bpf.h:46
uint32_t u32
Definition bpf.h:25
Attributes used by BPF_LINK_DETACH.
Definition bpf.h:231
uint32_t link_fd
File descriptor of link to detach.
Definition bpf.h:232
ebpf_id_t id
Link ID.
Definition bpf.h:225
enum bpf_link_type type
Link type.
Definition bpf.h:224
ebpf_id_t prog_id
Program ID.
Definition bpf.h:226
Attributes used by BPF_MAP_CREATE.
Definition bpf.h:92
uint32_t value_size
Size in bytes of values.
Definition bpf.h:95
uint32_t max_entries
Maximum number of entries in the map.
Definition bpf.h:96
uint32_t map_ifindex
Not supported, must be zero.
Definition bpf.h:101
uint32_t numa_node
Not supported, must be zero.
Definition bpf.h:99
uint32_t key_size
Size in bytes of keys.
Definition bpf.h:94
uint32_t map_flags
Not supported, must be zero.
Definition bpf.h:97
uint32_t inner_map_fd
File descriptor of inner map.
Definition bpf.h:98
enum bpf_map_type map_type
Type of map to create.
Definition bpf.h:93
uint32_t map_fd
File descriptor of map.
Definition bpf.h:115
uint64_t key
Pointer to key to delete.
Definition bpf.h:117
uint32_t _pad0
Definition bpf.h:116
ebpf_id_t id
Map ID.
Definition bpf.h:198
uint32_t map_flags
Map flags.
Definition bpf.h:202
uint32_t max_entries
Maximum number of entries allowed in the map.
Definition bpf.h:201
uint32_t value_size
Size in bytes of a map value.
Definition bpf.h:200
ebpf_map_type_t type
Type of map.
Definition bpf.h:197
uint32_t key_size
Size in bytes of a map key.
Definition bpf.h:199
uint32_t map_fd
File descriptor of map.
Definition bpf.h:106
uint64_t key
Pointer to key to look up.
Definition bpf.h:108
uint64_t flags
Not supported, must be zero.
Definition bpf.h:110
uint32_t _pad0
Definition bpf.h:107
uint64_t value
Pointer to value.
Definition bpf.h:109
uint32_t start_id
ID to look for an ID after. The start_id need not exist.
Definition bpf.h:130
uint32_t next_id
On return, contains the next ID.
Definition bpf.h:131
uint64_t key
Pointer to key to look up.
Definition bpf.h:124
uint32_t _pad0
Definition bpf.h:123
uint32_t map_fd
File descriptor of map.
Definition bpf.h:122
uint64_t next_key
Pointer to next key.
Definition bpf.h:125
Attributes used by BPF_OBJ_GET_INFO_BY_FD.
Definition bpf.h:185
uint32_t info_len
On input, contains the maximum number of bytes to write into the info. On output, contains the actual...
Definition bpf.h:191
uint32_t bpf_fd
File descriptor referring to an eBPF object.
Definition bpf.h:186
uint64_t info
Pointer to memory in which to write the info obtained.
Definition bpf.h:192
uint32_t flags
Not supported, must be zero.
Definition bpf.h:180
uint32_t bpf_fd
File descriptor referring to the program or map.
Definition bpf.h:179
uint64_t pathname
Path name for pinning.
Definition bpf.h:178
uint32_t attach_flags
Flags affecting the attach operation.
Definition bpf.h:153
enum bpf_attach_type attach_type
Type of program to attach/detach to/from.
Definition bpf.h:152
uint32_t target_fd
eBPF target to attach/detach to/from.
Definition bpf.h:150
uint32_t attach_bpf_fd
File descriptor of program to attach to.
Definition bpf.h:151
Attributes used by BPF_PROG_BIND_MAP.
Definition bpf.h:237
uint32_t map_fd
File descriptor of map to bind.
Definition bpf.h:239
uint32_t flags
Flags affecting the bind operation.
Definition bpf.h:240
uint32_t prog_fd
File descriptor of program to bind map to.
Definition bpf.h:238
enum bpf_prog_type type
Program type.
Definition bpf.h:208
uint64_t jited_prog_insns
Not supported.
Definition bpf.h:213
uint32_t jited_prog_len
Not supported.
Definition bpf.h:211
uint32_t nr_map_ids
Number of maps associated with this program.
Definition bpf.h:217
uint32_t created_by_uid
Not supported.
Definition bpf.h:216
uint64_t map_ids
Pointer to caller-allocated array to fill map IDs into.
Definition bpf.h:218
uint64_t xlated_prog_insns
Not supported.
Definition bpf.h:214
ebpf_id_t id
Program ID.
Definition bpf.h:209
uint32_t xlated_prog_len
Not supported.
Definition bpf.h:212
uint64_t load_time
Not supported.
Definition bpf.h:215
uint32_t insn_cnt
Number of instructions in the array.
Definition bpf.h:137
uint64_t log_buf
Pointer to a buffer in which log info can be written.
Definition bpf.h:142
uint64_t license
Optional pointer to a string specifying the license (currently ignored on Windows).
Definition bpf.h:139
uint32_t log_level
Logging level (currently ignored on Windows).
Definition bpf.h:140
uint32_t kern_version
Kernel version (currently ignored on Windows).
Definition bpf.h:143
enum bpf_prog_type prog_type
Program type to use for loading the program.
Definition bpf.h:136
uint32_t log_size
Size in bytes of the log buffer.
Definition bpf.h:141
uint32_t prog_flags
Not supported, must be zero.
Definition bpf.h:144
uint64_t insns
Array of instructions.
Definition bpf.h:138
uint32_t repeat
Number of times to repeat the program.
Definition bpf.h:164
uint64_t ctx_in
Pointer to input context.
Definition bpf.h:168
uint32_t data_size_in
Size in bytes of input data.
Definition bpf.h:160
uint64_t ctx_out
Pointer to output context.
Definition bpf.h:169
uint32_t flags
Flags (currently 0).
Definition bpf.h:170
uint32_t duration
Duration in milliseconds to run the program.
Definition bpf.h:165
uint32_t retval
On return, contains the return value of the program.
Definition bpf.h:159
uint32_t ctx_size_in
Size in bytes of input context.
Definition bpf.h:166
uint64_t data_in
Pointer to input data.
Definition bpf.h:162
uint32_t batch_size
Number of times to run the program in a batch.
Definition bpf.h:172
uint64_t data_out
Pointer to output data.
Definition bpf.h:163
uint32_t prog_fd
File descriptor of program to run.
Definition bpf.h:158
uint32_t ctx_size_out
Size in bytes of output context.
Definition bpf.h:167
uint32_t _pad0
Definition bpf.h:173
uint32_t data_size_out
Size in bytes of output data.
Definition bpf.h:161
uint32_t cpu
CPU to run the program on.
Definition bpf.h:171
Parameters used by the bpf() API.
Definition bpf.h:245
sys_bpf_prog_load_attr_t prog_load
Attributes used by BPF_PROG_LOAD.
Definition bpf.h:261
uint32_t map_id
ID of map for BPF_MAP_GET_FD_BY_ID to find.
Definition bpf.h:278
sys_bpf_obj_pin_attr_t obj_pin
Definition bpf.h:269
sys_bpf_map_lookup_attr_t map_update
Attributes used by BPF_MAP_LOOKUP_ELEM, BPF_MAP_UPDATE_ELEM and.
Definition bpf.h:252
sys_bpf_obj_pin_attr_t obj_get
Attributes used by BPF_OBJ_PIN and BPF_OBJ_GET.
Definition bpf.h:269
uint32_t prog_id
ID of program for BPF_PROG_GET_FD_BY_ID to find.
Definition bpf.h:281
sys_bpf_map_next_id_attr_t prog_get_next_id
Definition bpf.h:274
sys_bpf_prog_bind_map_attr_t prog_bind_map
Attributes used by BPF_PROG_BIND_MAP.
Definition bpf.h:293
sys_bpf_obj_info_attr_t info
Attributes used by BPF_OBJ_GET_INFO_BY_FD.
Definition bpf.h:287
uint32_t link_id
ID of link for BPF_LINK_GET_FD_BY_ID to find.
Definition bpf.h:284
sys_bpf_map_lookup_attr_t map_lookup
Definition bpf.h:251
sys_bpf_map_next_id_attr_t map_get_next_id
Definition bpf.h:274
sys_bpf_map_next_id_attr_t link_get_next_id
Attributes used by BPF_PROG_GET_NEXT_ID, BPF_MAP_GET_NEXT_ID, and BPF_LINK_GET_NEXT_ID.
Definition bpf.h:275
sys_bpf_map_delete_attr_t map_delete
Attributes used by BPF_MAP_DELETE_ELEM.
Definition bpf.h:258
sys_bpf_prog_attach_attr_t prog_attach
Definition bpf.h:265
sys_bpf_link_detach_attr_t link_detach
Attributes used by BPF_LINK_DETACH.
Definition bpf.h:290
sys_bpf_prog_attach_attr_t prog_detach
Attributes used by BPF_PROG_ATTACH/DETACH.
Definition bpf.h:265
sys_bpf_map_next_key_attr_t map_get_next_key
Attributes used by BPF_MAP_GET_NEXT_KEY.
Definition bpf.h:255
sys_bpf_map_create_attr_t map_create
Attributes used by BPF_MAP_CREATE.
Definition bpf.h:247
sys_bpf_prog_run_attr_t test
Attributes used by BPF_PROG_TEST_RUN.
Definition bpf.h:296