eBPF for Windows
Loading...
Searching...
No Matches
bpf.h
Go to the documentation of this file.
1// Copyright (c) eBPF for Windows contributors
2// SPDX-License-Identifier: MIT
3
4#ifdef __doxygen
5
10
24int
25bpf_link_detach(int link_fd);
26
39int
41
53int
54bpf_link_get_next_id(__u32 start_id, __u32* next_id);
55
57
62
84int
86 enum bpf_map_type map_type,
87 const char* map_name,
88 __u32 key_size,
89 __u32 value_size,
90 __u32 max_entries,
91 const struct bpf_map_create_opts* opts);
92
106int
107bpf_map_delete_elem(int fd, const void* key);
108
121int
123
135int
136bpf_map_get_next_id(__u32 start_id, __u32* next_id);
137
155int
156bpf_map_get_next_key(int fd, const void* key, void* next_key);
157
174int
175bpf_map_lookup_elem(int fd, const void* key, void* value);
176
193int
194bpf_map_update_elem(int fd, const void* key, const void* value, __u64 flags);
195
225int
227 int fd,
228 void* in_batch,
229 void* out_batch,
230 void* keys,
231 void* values,
232 __u32* count,
233 const struct bpf_map_batch_opts* opts);
234
256int
258 int fd,
259 void* in_batch,
260 void* out_batch,
261 void* keys,
262 void* values,
263 __u32* count,
264 const struct bpf_map_batch_opts* opts);
265
302int
303bpf_map_update_batch(int fd, const void* keys, const void* values, __u32* count, const struct bpf_map_batch_opts* opts);
304
318int
319bpf_map_delete_batch(int fd, const void* keys, __u32* count, const struct bpf_map_batch_opts* opts);
320
322
327
336int
337bpf_obj_get(const char* pathname);
338
359int
360bpf_obj_get_info_by_fd(int bpf_fd, void* info, __u32* info_len);
361
372int
373bpf_obj_pin(int fd, const char* pathname);
374
376
381
392int
393bpf_prog_bind_map(int prog_fd, int map_fd, const struct bpf_prog_bind_opts* opts);
394
407int
409
421int
422bpf_prog_get_next_id(__u32 start_id, __u32* next_id);
423
447int
449 enum bpf_prog_type prog_type,
450 const char* prog_name,
451 const char* license,
452 const struct bpf_insn* insns,
453 size_t insn_cnt,
454 const struct bpf_prog_load_opts* opts);
455
457
458#else
459#pragma warning(push)
460#include "bpf_legacy.h"
461#include "libbpf/src/bpf.h"
462#pragma warning(pop)
463#endif
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,...
int bpf_prog_get_next_id(__u32 start_id, __u32 *next_id)
Look for the next program ID greater than a given ID.
int bpf_map_get_next_id(__u32 start_id, __u32 *next_id)
Look for the next map ID greater than a given ID.
int bpf_map_lookup_and_delete_batch(int fd, void *in_batch, void *out_batch, void *keys, void *values, __u32 *count, const struct bpf_map_batch_opts *opts)
bpf_map_lookup_and_delete_batch() allows for batch lookup and deletion of BPF map elements where each...
int bpf_link_get_next_id(__u32 start_id, __u32 *next_id)
Look for the next link ID greater than a given ID.
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...
int bpf_obj_get(const char *pathname)
Get a file descriptor for a pinned object by pin path.
int bpf_map_update_batch(int fd, const void *keys, const void *values, __u32 *count, const struct bpf_map_batch_opts *opts)
bpf_map_update_batch() updates multiple elements in a map by specifying keys and their corresponding ...
int bpf_map_create(enum bpf_map_type map_type, const char *map_name, __u32 key_size, __u32 value_size, __u32 max_entries, const struct bpf_map_create_opts *opts)
Create a new map.
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.
int bpf_link_detach(int link_fd)
Detach a link.
int bpf_map_get_fd_by_id(__u32 id)
Get a file descriptor referring to a map with a given ID.
int bpf_obj_pin(int fd, const char *pathname)
Pin an eBPF program or map referred to by fd to the provided pathname.
int bpf_prog_bind_map(int prog_fd, int map_fd, const struct bpf_prog_bind_opts *opts)
Bind a map to a program so that it holds a reference on the map.
int bpf_link_get_fd_by_id(__u32 id)
Get a file descriptor referring to a link with a given ID.
int bpf_prog_load(enum bpf_prog_type prog_type, const char *prog_name, const char *license, const struct bpf_insn *insns, size_t insn_cnt, const struct bpf_prog_load_opts *opts)
Load (but do not attach) an eBPF programs.
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.
int bpf_map_delete_elem(int fd, const void *key)
Look up and delete an element by key in a specified map.
int bpf_map_delete_batch(int fd, const void *keys, __u32 *count, const struct bpf_map_batch_opts *opts)
bpf_map_delete_batch() allows for batch deletion of multiple elements in a BPF map.
int bpf_map_lookup_batch(int fd, void *in_batch, void *out_batch, void *keys, void *values, __u32 *count, const struct bpf_map_batch_opts *opts)
bpf_map_lookup_batch() allows for batch lookup of BPF map elements.
int bpf_prog_get_fd_by_id(__u32 id)
Get a file descriptor referring to a program with a given ID.
bpf_prog_type
Definition ebpf_structs.h:203
bpf_map_type
Definition ebpf_structs.h:18
uint32_t __u32
Definition types.h:6
uint64_t __u64
Definition types.h:7