908 ring_buffer__new(
int map_fd, ring_buffer_sample_fn sample_cb,
void* ctx,
const struct ring_buffer_opts* opts);
921 #pragma warning(push)
922 #pragma warning(disable : 4200)
923 #pragma warning(disable : 4201)
924 #include "libbpf/src/libbpf.h"
bpf_prog_type
Definition: ebpf_structs.h:171
bpf_link_type
Definition: ebpf_structs.h:247
bpf_attach_type
Definition: ebpf_structs.h:261
bpf_map_type
Definition: ebpf_structs.h:18
int bpf_prog_detach(int attachable_fd, enum bpf_attach_type type)
Detach eBPF program(s) from an attach point.
struct bpf_object * bpf_object__open_file(const char *path, const struct bpf_object_open_opts *opts)
Open a file without loading the programs.
int bpf_object__load(struct bpf_object *obj)
Load all the programs in a given object.
struct bpf_link * bpf_program__attach(const struct bpf_program *prog)
Attach an eBPF program to a hook associated with the program's expected attach type.
bool bpf_map__is_pinned(const struct bpf_map *map)
Determine whether a map is pinned.
int bpf_program__set_autoload(struct bpf_program *prog, bool autoload)
Set whether an eBPF program will be loaded when the object is loaded.
int bpf_xdp_attach(int ifindex, int prog_fd, __u32 flags, const struct bpf_xdp_attach_opts *opts)
Attach an XDP program to a given interface.
int bpf_program__set_expected_attach_type(struct bpf_program *prog, enum bpf_attach_type type)
Set the expected attach type for an eBPF program.
int libbpf_attach_type_by_name(const char *name, enum bpf_attach_type *attach_type)
libbpf_attach_type_by_name() converts the provided textual representation into an attach type value.
const char * bpf_program__section_name(const struct bpf_program *prog)
Gets the ELF section name of an eBPF program, if any.
const char * libbpf_bpf_attach_type_str(enum bpf_attach_type t)
libbpf_bpf_attach_type_str() converts the provided attach type value into a textual representation.
int bpf_object__unpin_maps(struct bpf_object *obj, const char *path)
Unpin all maps associated with an eBPF object from a specified path.
int bpf_program__unpin(struct bpf_program *prog, const char *path)
Unpin a program.
void bpf_object__close(struct bpf_object *object)
Close an eBPF object.
const char * libbpf_bpf_link_type_str(enum bpf_link_type t)
libbpf_bpf_link_type_str() converts the provided link type value into a textual representation.
size_t bpf_program__insn_cnt(const struct bpf_program *prog)
bpf_program__insn_cnt() returns number of struct bpf_insn's that form specified BPF program.
struct bpf_object * bpf_object__open(const char *path)
Open a file without loading the programs.
enum bpf_attach_type bpf_program__get_expected_attach_type(const struct bpf_program *prog)
Get the expected attach type for an eBPF program.
int bpf_prog_attach(int prog_fd, int attachable_fd, enum bpf_attach_type type, unsigned int flags)
Attach an eBPF program to an attach point.
__u32 bpf_map__value_size(const struct bpf_map *map)
Get the size of values in a given map.
const char * bpf_program__name(const struct bpf_program *prog)
Get the function name of an eBPF program.
void ring_buffer__free(struct ring_buffer *rb)
Frees a new ring buffer manager.
int libbpf_prog_type_by_name(const char *name, enum bpf_prog_type *prog_type, enum bpf_attach_type *expected_attach_type)
Get a program type and expected attach type by name.
__u32 bpf_map__key_size(const struct bpf_map *map)
Get the size of keys in a given map.
int bpf_object__pin_programs(struct bpf_object *obj, const char *path)
Pin all programs associated with an eBPF object to a specified path.
enum bpf_prog_type bpf_program__get_type(const struct bpf_program *prog)
Get the program type for an eBPF program.
long libbpf_get_error(const void *ptr)
Get a negative error code based on errno and a possibly null pointer.
void bpf_link__disconnect(struct bpf_link *link)
Release ownership of a link so that it is not detached when destroyed.
struct bpf_map * bpf_object__next_map(const struct bpf_object *obj, const struct bpf_map *map)
Get the next map for a given eBPF object.
int bpf_object__unpin_programs(struct bpf_object *obj, const char *path)
Unpin all programs associated with an eBPF object from a specified path.
int bpf_object__find_map_fd_by_name(const struct bpf_object *obj, const char *name)
Find a map with a given name among maps associated with an eBPF object.
int bpf_map__fd(const struct bpf_map *map)
Get a file descriptor that refers to a map.
enum bpf_prog_type bpf_program__type(const struct bpf_program *prog)
Get the program type for an eBPF program.
int bpf_object__pin(struct bpf_object *object, const char *path)
Pin an eBPF object to a specified path.
int bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type)
Set the program type for an eBPF program.
struct bpf_program * bpf_object__prev_program(const struct bpf_object *obj, struct bpf_program *prog)
Get the previous eBPF program for a given eBPF object.
int bpf_prog_detach2(int prog_fd, int attachable_fd, enum bpf_attach_type type)
Detach an eBPF program from an attach point.
int bpf_program__fd(const struct bpf_program *prog)
Get a file descriptor that refers to a program.
int bpf_xdp_detach(int ifindex, __u32 flags, const struct bpf_xdp_attach_opts *opts)
Detach an XDP program from a given interface.
int libbpf_num_possible_cpus(void)
Get the number of processors on the current system.
int bpf_link__fd(const struct bpf_link *link)
Get a file descriptor that refers to a link.
int bpf_link__unpin(struct bpf_link *link)
Unpin a link.
void bpf_program__unload(struct bpf_program *prog)
Unload a program.
struct bpf_map * bpf_object__find_map_by_name(const struct bpf_object *obj, const char *name)
Find a map with a given name among maps associated with an eBPF object.
int bpf_link__destroy(struct bpf_link *link)
Clean up a link.
const char * libbpf_bpf_map_type_str(enum bpf_map_type t)
libbpf_bpf_map_type_str() converts the provided map type value into a textual representation.
int libbpf_strerror(int err, char *buf, size_t size)
Get an error message.
const char * bpf_map__name(const struct bpf_map *map)
Get the name of an eBPF map.
struct bpf_program * bpf_object__next_program(const struct bpf_object *obj, struct bpf_program *prog)
Get the next program for a given eBPF object.
bool bpf_program__autoload(const struct bpf_program *prog)
Get whether an eBPF program will be loaded when the object is loaded.
const char * bpf_object__name(const struct bpf_object *obj)
Get the name of an eBPF object.
__u32 bpf_map__max_entries(const struct bpf_map *map)
Get the maximum number of entries allowed in a given map.
int bpf_xdp_query_id(int ifindex, int flags, __u32 *prog_id)
Get the XDP program id attached to a given interface index.
int bpf_link__pin(struct bpf_link *link, const char *path)
Pin a link to a specified path.
enum bpf_map_type bpf_map__type(const struct bpf_map *map)
Get the type of a map.
int bpf_map__unpin(struct bpf_map *map, const char *path)
Unpin a map.
struct bpf_program * bpf_object__find_program_by_name(const struct bpf_object *obj, const char *name)
Find a program with a given name among programs associated with an eBPF object.
struct bpf_link * bpf_program__attach_xdp(struct bpf_program *prog, int ifindex)
Attach an eBPF program to an XDP hook.
int bpf_object__pin_maps(struct bpf_object *obj, const char *path)
Pin all maps associated with an eBPF object to a specified path.
int bpf_map__pin(struct bpf_map *map, const char *path)
Pin a map to a specified path.
struct ring_buffer * ring_buffer__new(int map_fd, ring_buffer_sample_fn sample_cb, void *ctx, const struct ring_buffer_opts *opts)
Creates a new ring buffer manager.
struct bpf_map * bpf_object__prev_map(const struct bpf_object *obj, const struct bpf_map *map)
Get the previous map for a given eBPF object.
const char * libbpf_bpf_prog_type_str(enum bpf_prog_type t)
libbpf_bpf_prog_type_str() converts the provided program type value into a textual representation.
int bpf_program__pin(struct bpf_program *prog, const char *path)
Pin a program to a specified path.
uint32_t __u32
Definition: types.h:6