eBPF for Windows
bpf.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation
2 // SPDX-License-Identifier: MIT
3 
4 #ifdef __doxygen
5 
24 int
25 bpf_link_detach(int link_fd);
26 
38 int
40 
52 int
53 bpf_link_get_next_id(__u32 start_id, __u32* next_id);
54 
77 int
78 bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, int max_entries, __u32 map_flags);
79 
91 int
92 bpf_create_map_xattr(const struct bpf_create_map_attr* create_attr);
93 
107 int
108 bpf_map_delete_elem(int fd, const void* key);
109 
121 int
123 
135 int
136 bpf_map_get_next_id(__u32 start_id, __u32* next_id);
137 
155 int
156 bpf_map_get_next_key(int fd, const void* key, void* next_key);
157 
174 int
175 bpf_map_lookup_elem(int fd, const void* key, void* value);
176 
190 int
191 bpf_map_update_elem(int fd, const void* key, const void* value, __u64 flags);
192 
206 int
207 bpf_obj_get(const char* pathname);
208 
228 int
229 bpf_obj_get_info_by_fd(int bpf_fd, void* info, __u32* info_len);
230 
241 int
242 bpf_obj_pin(int fd, const char* pathname);
243 
262 int
264 
276 int
277 bpf_prog_get_next_id(__u32 start_id, __u32* next_id);
278 
281 #else
282 #pragma warning(push)
283 #include "../external/libbpf/src/bpf.h"
284 #pragma warning(pop)
285 #endif
bpf_link_detach
int bpf_link_detach(int link_fd)
Detach a link.
bpf_obj_pin
int bpf_obj_pin(int fd, const char *pathname)
Pin an eBPF program or map referred to by fd to the provided pathname.
bpf_map_get_fd_by_id
int bpf_map_get_fd_by_id(__u32 id)
Get a file descriptor referring to a map with a given ID.
bpf_link_get_fd_by_id
int bpf_link_get_fd_by_id(__u32 id)
Get a file descriptor referring to a link with a given ID.
bpf_obj_get_info_by_fd
int bpf_obj_get_info_by_fd(int bpf_fd, void *info, __u32 *info_len)
Obtain information about the eBPF object referred to by bpf_fd. This function populates up to info_le...
bpf_map_update_elem
int bpf_map_update_elem(int fd, const void *key, const void *value, __u64 flags)
Create or update an element (key/value pair) in a specified map.
bpf_map_lookup_elem
int bpf_map_lookup_elem(int fd, const void *key, void *value)
Look up an element by key in a specified map and return its value.
__u32
uint32_t __u32
Definition: bpf_helpers_platform.h:18
bpf_map_type
bpf_map_type
Definition: ebpf_structs.h:13
bpf_create_map
int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, int max_entries, __u32 map_flags)
Create a new map.
bpf_obj_get
int bpf_obj_get(const char *pathname)
Get a file descriptor for a pinned object by pin path.
bpf_map_get_next_key
int bpf_map_get_next_key(int fd, const void *key, void *next_key)
Look up an element by key in a map and get the next key. If the specific key is not found,...
bpf_prog_get_fd_by_id
int bpf_prog_get_fd_by_id(__u32 id)
Get a file descriptor referring to a program with a given ID.
bpf_link_get_next_id
int bpf_link_get_next_id(__u32 start_id, __u32 *next_id)
Look for the next link ID greater than a given ID.
bpf_prog_get_next_id
int bpf_prog_get_next_id(__u32 start_id, __u32 *next_id)
Look for the next program ID greater than a given ID.
bpf_map_get_next_id
int bpf_map_get_next_id(__u32 start_id, __u32 *next_id)
Look for the next map ID greater than a given ID.
bpf_create_map_xattr
int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr)
Create a new map.
__u64
uint64_t __u64
Definition: bpf_helpers_platform.h:20
bpf_map_delete_elem
int bpf_map_delete_elem(int fd, const void *key)
Look up and delete an element by key in a specified map.