eBPF for Windows
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
libbpf_legacy.h
Go to the documentation of this file.
1// Copyright (c) eBPF for Windows contributors
2// SPDX-License-Identifier: MIT
3#pragma once
4
27__declspec(deprecated("Use bpf_xdp_attach() instead.")) int
28bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags);
29
49__declspec(deprecated("Use bpf_object__next_map() instead.")) struct bpf_map*
50bpf_map__next(const struct bpf_map* map, const struct bpf_object* obj);
51
64__declspec(deprecated("Use bpf_object__prev_map() instead.")) struct bpf_map*
65bpf_map__prev(const struct bpf_map* map, const struct bpf_object* obj);
66
75{
76 struct bpf_object* obj;
78 const char* target_btf_path;
79};
80
98__declspec(deprecated("Use bpf_object__load() instead.")) int
100
110__declspec(deprecated("Track bpf_objects in application code instead.")) struct bpf_object*
111bpf_object__next(struct bpf_object* prev);
112
113#define bpf_object__for_each_safe(pos, tmp) \
114 for ((pos) = bpf_object__next(NULL), (tmp) = bpf_object__next(pos); (pos) != NULL; \
115 (pos) = (tmp), (tmp) = bpf_object__next(tmp))
116
131__declspec(deprecated("Use bpf_object__close() instead.")) int
132bpf_object__unload(struct bpf_object* obj);
133
167__declspec(deprecated("Use bpf_object__open() and bpf_object__load() instead.")) int
168bpf_prog_load_deprecated(const char* file, enum bpf_prog_type type, struct bpf_object** pobj, int* prog_fd);
169
182__declspec(deprecated("Use bpf_object__next_program() instead.")) struct bpf_program*
183bpf_program__next(struct bpf_program* prog, const struct bpf_object* obj);
184
197__declspec(deprecated("Use bpf_object__prev_program() instead.")) struct bpf_program*
198bpf_program__prev(struct bpf_program* prog, const struct bpf_object* obj);
199
209__declspec(deprecated("Use bpf_program__insn_cnt() instead.")) size_t
210bpf_program__size(const struct bpf_program* prog);
211
#define bpf_map
Definition bpf_helpers_platform.h:16
bpf_prog_type
Definition ebpf_structs.h:178
int bpf_object__load(struct bpf_object *obj)
Load all the programs in a given object.
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.
struct bpf_object * bpf_object__open(const char *path)
Open a file without loading the programs.
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_program * bpf_object__prev_program(const struct bpf_object *obj, struct bpf_program *prog)
Get the previous eBPF program for a given eBPF object.
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.
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.
size_t bpf_program__size(const struct bpf_program *prog)
Get the eBPF program size in bytes.
struct bpf_object * bpf_object__next(struct bpf_object *prev)
Get the next eBPF object opened by the calling process.
int bpf_object__unload(struct bpf_object *obj)
Unload all the programs in a given object.
struct bpf_map * bpf_map__prev(const struct bpf_map *map, const struct bpf_object *obj)
Get the previous map for a given eBPF object.
int bpf_prog_load_deprecated(const char *file, enum bpf_prog_type type, struct bpf_object **pobj, int *prog_fd)
Load (but do not attach) eBPF maps and programs from an ELF file.
int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags)
Attach an XDP program to a given interface.
struct bpf_program * bpf_program__next(struct bpf_program *prog, const struct bpf_object *obj)
Get the next program for a given eBPF object.
struct bpf_program * bpf_program__prev(struct bpf_program *prog, const struct bpf_object *obj)
Get the previous eBPF program for a given eBPF object.
struct bpf_map * bpf_map__next(const struct bpf_map *map, const struct bpf_object *obj)
Get the next map for a given eBPF object.
int bpf_object__load_xattr(struct bpf_object_load_attr *attr)
Load all the programs in a given object.
Definition libbpf_legacy.h:75
struct bpf_object * obj
Definition libbpf_legacy.h:76
int log_level
Definition libbpf_legacy.h:77
const char * target_btf_path
Definition libbpf_legacy.h:78
uint32_t __u32
Definition types.h:6