eBPF for Windows
Data Fields
bpf_attr Union Reference

Parameters used by the bpf() API. More...

#include <bpf.h>

Data Fields

struct {
   enum bpf_map_type   map_type
 Type of map to create. More...
 
   uint32_t   key_size
 Size in bytes of keys. More...
 
   uint32_t   value_size
 Size in bytes of values. More...
 
   uint32_t   max_entries
 Maximum number of entries in the map. More...
 
   uint32_t   map_flags
 Flags (currently 0). More...
 
}; 
 Attributes used by BPF_MAP_CREATE. More...
 
struct {
   uint32_t   map_fd
 File descriptor of map. More...
 
   uint64_t   key
 Pointer to key to look up. More...
 
   union {
      uint64_t   value
 Pointer to value. More...
 
      uint64_t   next_key
 Pointer to next key. More...
 
   } 
 
   uint64_t   flags
 Flags (currently 0). More...
 
}; 
 Attributes used by BPF_MAP_LOOKUP_ELEM, BPF_MAP_UPDATE_ELEM, BPF_MAP_DELETE_ELEM, and BPF_MAP_GET_NEXT_KEY. More...
 
struct {
   enum bpf_prog_type   prog_type
 Program type to use for loading the program. More...
 
   uint64_t   insns
 Array of instructions. More...
 
   uint32_t   insn_cnt
 Number of instructions in the array. More...
 
   uint64_t   license
 Optional pointer to a string specifying the license (currently ignored on Windows). More...
 
   uint32_t   log_level
 Logging level (currently ignored on Windows). More...
 
   uint64_t   log_buf
 Pointer to a buffer in which log info can be written. More...
 
   uint32_t   log_size
 Size in bytes of the log buffer. More...
 
   uint32_t   kern_version
 Kernel version (currently ignored on Windows). More...
 
}; 
 Attributes used by BPF_PROG_LOAD. More...
 
struct {
   uint32_t   target_fd
 eBPF target to attach/detach to/from. More...
 
   uint32_t   attach_bpf_fd
 File descriptor of program to attach to. More...
 
   enum bpf_attach_type   attach_type
 Type of program to attach/detach to/from. More...
 
   uint32_t   attach_flags
 Flags affecting the attach operation. More...
 
}; 
 Attributes used by BPF_PROG_ATTACH/DETACH. More...
 
struct {
   uint64_t   pathname
 Path name for pinning. More...
 
   uint32_t   bpf_fd
 File descriptor referring to the program or map. More...
 
}; 
 Attributes used by BPF_OBJ_PIN and BPF_OBJ_GET. More...
 
struct {
   uint32_t   start_id
 ID to look for an ID after. The start_id need not exist. More...
 
   uint32_t   next_id
 On return, contains the next ID. More...
 
}; 
 Attributes used by BPF_PROG_GET_NEXT_ID, BPF_MAP_GET_NEXT_ID, and BPF_LINK_GET_NEXT_ID. More...
 
uint32_t map_id
 ID of map for BPF_MAP_GET_FD_BY_ID to find. More...
 
uint32_t prog_id
 ID of program for BPF_PROG_GET_FD_BY_ID to find. More...
 
uint32_t link_id
 ID of link for BPF_LINK_GET_FD_BY_ID to find. More...
 
bpf_obj_info_attr_t info
 Attributes used by BPF_OBJ_GET_INFO_BY_FD. More...
 
bpf_link_detach_attr_t link_detach
 Attributes used by BPF_LINK_DETACH. More...
 
bpf_prog_bind_map_attr_t prog_bind_map
 Attributes used by BPF_PROG_BIND_MAP. More...
 
struct {
   uint32_t   prog_fd
 File descriptor of program to run. More...
 
   uint32_t   retval
 On return, contains the return value of the program. More...
 
   uint32_t   data_size_in
 Size in bytes of input data. More...
 
   uint32_t   data_size_out
 Size in bytes of output data. More...
 
   uint64_t   data_in
 Pointer to input data. More...
 
   uint64_t   data_out
 Pointer to output data. More...
 
   uint32_t   repeat
 Number of times to repeat the program. More...
 
   uint32_t   duration
 Duration in milliseconds to run the program. More...
 
   uint32_t   ctx_size_in
 Size in bytes of input context. More...
 
   uint32_t   ctx_size_out
 Size in bytes of output context. More...
 
   uint64_t   ctx_in
 Pointer to input context. More...
 
   uint64_t   ctx_out
 Pointer to output context. More...
 
   uint32_t   flags
 Flags (currently 0). More...
 
   uint32_t   cpu
 CPU to run the program on. More...
 
   uint32_t   batch_size
 Number of times to run the program in a batch. More...
 
test
 Attributes used by BPF_PROG_TEST_RUN. More...
 

Detailed Description

Parameters used by the bpf() API.

Field Documentation

◆ 

struct { ... }

Attributes used by BPF_MAP_CREATE.

◆ 

struct { ... }

Attributes used by BPF_MAP_LOOKUP_ELEM, BPF_MAP_UPDATE_ELEM, BPF_MAP_DELETE_ELEM, and BPF_MAP_GET_NEXT_KEY.

◆ 

struct { ... }

Attributes used by BPF_PROG_LOAD.

◆ 

struct { ... }

Attributes used by BPF_PROG_ATTACH/DETACH.

◆ 

struct { ... }

Attributes used by BPF_OBJ_PIN and BPF_OBJ_GET.

◆ 

struct { ... }

Attributes used by BPF_PROG_GET_NEXT_ID, BPF_MAP_GET_NEXT_ID, and BPF_LINK_GET_NEXT_ID.

◆ attach_bpf_fd

uint32_t bpf_attr::attach_bpf_fd

File descriptor of program to attach to.

◆ attach_flags

uint32_t bpf_attr::attach_flags

Flags affecting the attach operation.

◆ attach_type

enum bpf_attach_type bpf_attr::attach_type

Type of program to attach/detach to/from.

◆ batch_size

uint32_t bpf_attr::batch_size

Number of times to run the program in a batch.

◆ bpf_fd

uint32_t bpf_attr::bpf_fd

File descriptor referring to the program or map.

◆ cpu

uint32_t bpf_attr::cpu

CPU to run the program on.

◆ ctx_in

uint64_t bpf_attr::ctx_in

Pointer to input context.

◆ ctx_out

uint64_t bpf_attr::ctx_out

Pointer to output context.

◆ ctx_size_in

uint32_t bpf_attr::ctx_size_in

Size in bytes of input context.

◆ ctx_size_out

uint32_t bpf_attr::ctx_size_out

Size in bytes of output context.

◆ data_in

uint64_t bpf_attr::data_in

Pointer to input data.

◆ data_out

uint64_t bpf_attr::data_out

Pointer to output data.

◆ data_size_in

uint32_t bpf_attr::data_size_in

Size in bytes of input data.

◆ data_size_out

uint32_t bpf_attr::data_size_out

Size in bytes of output data.

◆ duration

uint32_t bpf_attr::duration

Duration in milliseconds to run the program.

◆ flags [1/2]

uint64_t bpf_attr::flags

Flags (currently 0).

◆ flags [2/2]

uint32_t bpf_attr::flags

Flags (currently 0).

◆ info

bpf_obj_info_attr_t bpf_attr::info

Attributes used by BPF_OBJ_GET_INFO_BY_FD.

◆ insn_cnt

uint32_t bpf_attr::insn_cnt

Number of instructions in the array.

◆ insns

uint64_t bpf_attr::insns

Array of instructions.

◆ kern_version

uint32_t bpf_attr::kern_version

Kernel version (currently ignored on Windows).

◆ key

uint64_t bpf_attr::key

Pointer to key to look up.

◆ key_size

uint32_t bpf_attr::key_size

Size in bytes of keys.

◆ license

uint64_t bpf_attr::license

Optional pointer to a string specifying the license (currently ignored on Windows).

◆ link_detach

bpf_link_detach_attr_t bpf_attr::link_detach

Attributes used by BPF_LINK_DETACH.

◆ link_id

uint32_t bpf_attr::link_id

ID of link for BPF_LINK_GET_FD_BY_ID to find.

◆ log_buf

uint64_t bpf_attr::log_buf

Pointer to a buffer in which log info can be written.

◆ log_level

uint32_t bpf_attr::log_level

Logging level (currently ignored on Windows).

◆ log_size

uint32_t bpf_attr::log_size

Size in bytes of the log buffer.

◆ map_fd

uint32_t bpf_attr::map_fd

File descriptor of map.

◆ map_flags

uint32_t bpf_attr::map_flags

Flags (currently 0).

◆ map_id

uint32_t bpf_attr::map_id

ID of map for BPF_MAP_GET_FD_BY_ID to find.

◆ map_type

enum bpf_map_type bpf_attr::map_type

Type of map to create.

◆ max_entries

uint32_t bpf_attr::max_entries

Maximum number of entries in the map.

◆ next_id

uint32_t bpf_attr::next_id

On return, contains the next ID.

◆ next_key

uint64_t bpf_attr::next_key

Pointer to next key.

◆ pathname

uint64_t bpf_attr::pathname

Path name for pinning.

◆ prog_bind_map

bpf_prog_bind_map_attr_t bpf_attr::prog_bind_map

Attributes used by BPF_PROG_BIND_MAP.

◆ prog_fd

uint32_t bpf_attr::prog_fd

File descriptor of program to run.

◆ prog_id

uint32_t bpf_attr::prog_id

ID of program for BPF_PROG_GET_FD_BY_ID to find.

◆ prog_type

enum bpf_prog_type bpf_attr::prog_type

Program type to use for loading the program.

◆ repeat

uint32_t bpf_attr::repeat

Number of times to repeat the program.

◆ retval

uint32_t bpf_attr::retval

On return, contains the return value of the program.

◆ start_id

uint32_t bpf_attr::start_id

ID to look for an ID after. The start_id need not exist.

◆ target_fd

uint32_t bpf_attr::target_fd

eBPF target to attach/detach to/from.

◆ 

struct { ... } bpf_attr::test

Attributes used by BPF_PROG_TEST_RUN.

◆ value

uint64_t bpf_attr::value

Pointer to value.

◆ value_size

uint32_t bpf_attr::value_size

Size in bytes of values.


The documentation for this union was generated from the following file: