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
85 #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:171
bpf_attach_type
Definition: ebpf_structs.h:261
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:58
@ BPF_MAP_LOOKUP_AND_DELETE_ELEM
Definition: bpf.h:75
@ BPF_PROG_RUN
Definition: bpf.h:80
@ BPF_MAP_CREATE
Definition: bpf.h:59
@ BPF_OBJ_GET
Definition: bpf.h:66
@ BPF_PROG_LOAD
Definition: bpf.h:64
@ BPF_PROG_DETACH
Definition: bpf.h:68
@ BPF_PROG_GET_NEXT_ID
Definition: bpf.h:70
@ BPF_PROG_ATTACH
Definition: bpf.h:67
@ BPF_OBJ_PIN
Definition: bpf.h:65
@ BPF_MAP_GET_FD_BY_ID
Definition: bpf.h:73
@ BPF_LINK_GET_NEXT_ID
Definition: bpf.h:77
@ BPF_LINK_DETACH
Definition: bpf.h:78
@ BPF_PROG_TEST_RUN
Definition: bpf.h:69
@ BPF_PROG_BIND_MAP
Definition: bpf.h:79
@ BPF_MAP_GET_NEXT_KEY
Definition: bpf.h:63
@ BPF_LINK_GET_FD_BY_ID
Definition: bpf.h:76
@ BPF_PROG_GET_FD_BY_ID
Definition: bpf.h:72
@ BPF_OBJ_GET_INFO_BY_FD
Definition: bpf.h:74
@ BPF_MAP_GET_NEXT_ID
Definition: bpf.h:71
@ BPF_MAP_UPDATE_ELEM
Definition: bpf.h:61
@ BPF_MAP_LOOKUP_ELEM
Definition: bpf.h:60
@ BPF_MAP_DELETE_ELEM
Definition: bpf.h:62
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:191
uint32_t link_fd
File descriptor of link to detach.
Definition: bpf.h:192
Attributes used by BPF_MAP_CREATE.
Definition: bpf.h:90
uint32_t value_size
Size in bytes of values.
Definition: bpf.h:93
uint32_t max_entries
Maximum number of entries in the map.
Definition: bpf.h:94
uint32_t key_size
Size in bytes of keys.
Definition: bpf.h:92
uint32_t map_flags
Not supported, must be zero.
Definition: bpf.h:95
uint32_t inner_map_fd
File descriptor of inner map.
Definition: bpf.h:96
uint32_t map_fd
File descriptor of map.
Definition: bpf.h:110
uint64_t key
Pointer to key to delete.
Definition: bpf.h:112
uint32_t _pad0
Definition: bpf.h:111
uint32_t map_fd
File descriptor of map.
Definition: bpf.h:101
uint64_t key
Pointer to key to look up.
Definition: bpf.h:103
uint64_t flags
Not supported, must be zero.
Definition: bpf.h:105
uint32_t _pad0
Definition: bpf.h:102
uint64_t value
Pointer to value.
Definition: bpf.h:104
uint32_t start_id
ID to look for an ID after. The start_id need not exist.
Definition: bpf.h:125
uint32_t next_id
On return, contains the next ID.
Definition: bpf.h:126
uint64_t key
Pointer to key to look up.
Definition: bpf.h:119
uint32_t _pad0
Definition: bpf.h:118
uint32_t map_fd
File descriptor of map.
Definition: bpf.h:117
uint64_t next_key
Pointer to next key.
Definition: bpf.h:120
Attributes used by BPF_OBJ_GET_INFO_BY_FD.
Definition: bpf.h:179
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:185
uint32_t bpf_fd
File descriptor referring to an eBPF object.
Definition: bpf.h:180
uint64_t info
Pointer to memory in which to write the info obtained.
Definition: bpf.h:186
uint32_t flags
Not supported, must be zero.
Definition: bpf.h:174
uint32_t bpf_fd
File descriptor referring to the program or map.
Definition: bpf.h:173
uint64_t pathname
Path name for pinning.
Definition: bpf.h:172
uint32_t attach_flags
Flags affecting the attach operation.
Definition: bpf.h:147
uint32_t target_fd
eBPF target to attach/detach to/from.
Definition: bpf.h:144
uint32_t attach_bpf_fd
File descriptor of program to attach to.
Definition: bpf.h:145
Attributes used by BPF_PROG_BIND_MAP.
Definition: bpf.h:197
uint32_t map_fd
File descriptor of map to bind.
Definition: bpf.h:199
uint32_t flags
Flags affecting the bind operation.
Definition: bpf.h:200
uint32_t prog_fd
File descriptor of program to bind map to.
Definition: bpf.h:198
uint32_t insn_cnt
Number of instructions in the array.
Definition: bpf.h:132
uint64_t log_buf
Pointer to a buffer in which log info can be written.
Definition: bpf.h:137
uint64_t license
Optional pointer to a string specifying the license (currently ignored on Windows).
Definition: bpf.h:134
uint32_t log_level
Logging level (currently ignored on Windows).
Definition: bpf.h:135
uint32_t kern_version
Kernel version (currently ignored on Windows).
Definition: bpf.h:138
uint32_t log_size
Size in bytes of the log buffer.
Definition: bpf.h:136
uint32_t prog_flags
Not supported, must be zero.
Definition: bpf.h:139
uint64_t insns
Array of instructions.
Definition: bpf.h:133
uint32_t repeat
Number of times to repeat the program.
Definition: bpf.h:158
uint64_t ctx_in
Pointer to input context.
Definition: bpf.h:162
uint32_t data_size_in
Size in bytes of input data.
Definition: bpf.h:154
uint64_t ctx_out
Pointer to output context.
Definition: bpf.h:163
uint32_t flags
Flags (currently 0).
Definition: bpf.h:164
uint32_t duration
Duration in milliseconds to run the program.
Definition: bpf.h:159
uint32_t retval
On return, contains the return value of the program.
Definition: bpf.h:153
uint32_t ctx_size_in
Size in bytes of input context.
Definition: bpf.h:160
uint64_t data_in
Pointer to input data.
Definition: bpf.h:156
uint32_t batch_size
Number of times to run the program in a batch.
Definition: bpf.h:166
uint64_t data_out
Pointer to output data.
Definition: bpf.h:157
uint32_t prog_fd
File descriptor of program to run.
Definition: bpf.h:152
uint32_t ctx_size_out
Size in bytes of output context.
Definition: bpf.h:161
uint32_t _pad0
Definition: bpf.h:167
uint32_t data_size_out
Size in bytes of output data.
Definition: bpf.h:155
uint32_t cpu
CPU to run the program on.
Definition: bpf.h:165
Parameters used by the bpf() API.
Definition: bpf.h:205
sys_bpf_prog_load_attr_t prog_load
Attributes used by BPF_PROG_LOAD.
Definition: bpf.h:221
uint32_t map_id
ID of map for BPF_MAP_GET_FD_BY_ID to find.
Definition: bpf.h:238
sys_bpf_obj_pin_attr_t obj_pin
Definition: bpf.h:229
sys_bpf_map_lookup_attr_t map_update
Attributes used by BPF_MAP_LOOKUP_ELEM, BPF_MAP_UPDATE_ELEM and.
Definition: bpf.h:212
sys_bpf_obj_pin_attr_t obj_get
Attributes used by BPF_OBJ_PIN and BPF_OBJ_GET.
Definition: bpf.h:229
uint32_t prog_id
ID of program for BPF_PROG_GET_FD_BY_ID to find.
Definition: bpf.h:241
sys_bpf_map_next_id_attr_t prog_get_next_id
Definition: bpf.h:234
sys_bpf_prog_bind_map_attr_t prog_bind_map
Attributes used by BPF_PROG_BIND_MAP.
Definition: bpf.h:253
sys_bpf_obj_info_attr_t info
Attributes used by BPF_OBJ_GET_INFO_BY_FD.
Definition: bpf.h:247
uint32_t link_id
ID of link for BPF_LINK_GET_FD_BY_ID to find.
Definition: bpf.h:244
sys_bpf_map_lookup_attr_t map_lookup
Definition: bpf.h:211
sys_bpf_map_next_id_attr_t map_get_next_id
Definition: bpf.h:234
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:235
sys_bpf_map_delete_attr_t map_delete
Attributes used by BPF_MAP_DELETE_ELEM.
Definition: bpf.h:218
sys_bpf_prog_attach_attr_t prog_attach
Definition: bpf.h:225
sys_bpf_link_detach_attr_t link_detach
Attributes used by BPF_LINK_DETACH.
Definition: bpf.h:250
sys_bpf_prog_attach_attr_t prog_detach
Attributes used by BPF_PROG_ATTACH/DETACH.
Definition: bpf.h:225
sys_bpf_map_next_key_attr_t map_get_next_key
Attributes used by BPF_MAP_GET_NEXT_KEY.
Definition: bpf.h:215
sys_bpf_map_create_attr_t map_create
Attributes used by BPF_MAP_CREATE.
Definition: bpf.h:207
sys_bpf_prog_run_attr_t test
Attributes used by BPF_PROG_TEST_RUN.
Definition: bpf.h:256