eBPF for Windows
Data Structures | Macros | Typedefs | Enumerations | Functions
bpf.h File Reference
#include "ebpf_structs.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  sys_bpf_map_create_attr_t
 Attributes used by BPF_MAP_CREATE. More...
 
struct  sys_bpf_map_lookup_attr_t
 
struct  sys_bpf_map_delete_attr_t
 
struct  sys_bpf_map_next_key_attr_t
 
struct  sys_bpf_map_next_id_attr_t
 
struct  sys_bpf_prog_load_attr_t
 
struct  sys_bpf_prog_attach_attr_t
 
struct  sys_bpf_prog_run_attr_t
 
struct  sys_bpf_obj_pin_attr_t
 
struct  sys_bpf_obj_info_attr_t
 Attributes used by BPF_OBJ_GET_INFO_BY_FD. More...
 
struct  sys_bpf_map_info_t
 
struct  sys_bpf_prog_info_t
 
struct  sys_bpf_link_info_t
 
struct  sys_bpf_link_detach_attr_t
 Attributes used by BPF_LINK_DETACH. More...
 
struct  sys_bpf_prog_bind_map_attr_t
 Attributes used by BPF_PROG_BIND_MAP. More...
 
union  bpf_attr
 Parameters used by the bpf() API. More...
 

Macros

#define __SIZEOF_SIZE_T__   8 /* only x64 is supported */
 
#define __SIZEOF_LONG_LONG__   8 /* only x64 is supported */
 
#define SYS_BPF_OBJ_NAME_LEN   16U
 

Typedefs

typedef int32_t s32
 
typedef uint8_t u8
 
typedef uint32_t u32
 
typedef uint64_t u64
 
typedef int32_t __s32
 
typedef uint8_t __u8
 
typedef uint32_t __u32
 
typedef uint64_t __u64
 
typedef uint32_t pid_t
 

Enumerations

enum  bpf_func_id { BPF_FUNC_ID_UNKNOWN }
 
enum  bpf_stats_type { BPF_STATS_TYPE_UNKNOWN }
 
enum  bpf_cmd_id {
  BPF_MAP_CREATE , BPF_MAP_LOOKUP_ELEM , BPF_MAP_UPDATE_ELEM , BPF_MAP_DELETE_ELEM ,
  BPF_MAP_GET_NEXT_KEY , BPF_PROG_LOAD , BPF_OBJ_PIN , BPF_OBJ_GET ,
  BPF_PROG_ATTACH , BPF_PROG_DETACH , BPF_PROG_TEST_RUN , BPF_PROG_GET_NEXT_ID ,
  BPF_MAP_GET_NEXT_ID , BPF_PROG_GET_FD_BY_ID , BPF_MAP_GET_FD_BY_ID , BPF_OBJ_GET_INFO_BY_FD ,
  BPF_MAP_LOOKUP_AND_DELETE_ELEM = 21 , BPF_LINK_GET_FD_BY_ID = 30 , BPF_LINK_GET_NEXT_ID , BPF_LINK_DETACH = 34 ,
  BPF_PROG_BIND_MAP = 35 , BPF_PROG_RUN = BPF_PROG_TEST_RUN
}
 

Functions

int bpf (int cmd, union bpf_attr *attr, unsigned int size)
 

Macro Definition Documentation

◆ __SIZEOF_LONG_LONG__

#define __SIZEOF_LONG_LONG__   8 /* only x64 is supported */

◆ __SIZEOF_SIZE_T__

#define __SIZEOF_SIZE_T__   8 /* only x64 is supported */

◆ SYS_BPF_OBJ_NAME_LEN

#define SYS_BPF_OBJ_NAME_LEN   16U

Typedef Documentation

◆ __s32

typedef int32_t __s32

◆ __u32

typedef uint32_t __u32

◆ __u64

typedef uint64_t __u64

◆ __u8

typedef uint8_t __u8

◆ pid_t

typedef uint32_t pid_t

◆ s32

typedef int32_t s32

◆ u32

typedef uint32_t u32

◆ u64

typedef uint64_t u64

◆ u8

typedef uint8_t u8

Enumeration Type Documentation

◆ bpf_cmd_id

enum bpf_cmd_id
Enumerator
BPF_MAP_CREATE 
BPF_MAP_LOOKUP_ELEM 
BPF_MAP_UPDATE_ELEM 
BPF_MAP_DELETE_ELEM 
BPF_MAP_GET_NEXT_KEY 
BPF_PROG_LOAD 
BPF_OBJ_PIN 
BPF_OBJ_GET 
BPF_PROG_ATTACH 
BPF_PROG_DETACH 
BPF_PROG_TEST_RUN 
BPF_PROG_GET_NEXT_ID 
BPF_MAP_GET_NEXT_ID 
BPF_PROG_GET_FD_BY_ID 
BPF_MAP_GET_FD_BY_ID 
BPF_OBJ_GET_INFO_BY_FD 
BPF_MAP_LOOKUP_AND_DELETE_ELEM 
BPF_LINK_GET_FD_BY_ID 
BPF_LINK_GET_NEXT_ID 
BPF_LINK_DETACH 
BPF_PROG_BIND_MAP 
BPF_PROG_RUN 

◆ bpf_func_id

Enumerator
BPF_FUNC_ID_UNKNOWN 

◆ bpf_stats_type

Enumerator
BPF_STATS_TYPE_UNKNOWN 

Function Documentation

◆ bpf()

int bpf ( int  cmd,
union bpf_attr attr,
unsigned int  size 
)