Go to the source code of this file.
◆ bpf_object__for_each_safe
#define bpf_object__for_each_safe |
( |
|
pos, |
|
|
|
tmp |
|
) |
| |
Value:
#define NULL
Definition: bpf_helpers.h:48
struct bpf_object * bpf_object__next(struct bpf_object *prev)
Get the next eBPF object opened by the calling process.
◆ bpf_map__next()
struct bpf_map* bpf_map__next |
( |
const struct bpf_map * |
map, |
|
|
const struct bpf_object * |
obj |
|
) |
| |
◆ bpf_map__prev()
struct bpf_map* bpf_map__prev |
( |
const struct bpf_map * |
map, |
|
|
const struct bpf_object * |
obj |
|
) |
| |
◆ bpf_object__load_xattr()
◆ bpf_object__next()
struct bpf_object* bpf_object__next |
( |
struct bpf_object * |
prev | ) |
|
Get the next eBPF object opened by the calling process.
- Parameters
-
[in] | prev | Previous object, or NULL to get the first object. |
- Returns
- Next object, or NULL if none.
- Deprecated:
- Track bpf_objects in application code instead.
◆ bpf_object__unload()
int bpf_object__unload |
( |
struct bpf_object * |
obj | ) |
|
◆ bpf_prog_load_deprecated()
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.
- Parameters
-
[in] | file | Path name to an ELF file. |
[in] | type | Program type to use for loading eBPF programs. If BPF_PROG_TYPE_UNKNOWN, the program type is derived from the section prefix in the ELF file. |
[out] | pobj | Pointer to where to store the eBPF object loaded. The caller is expected to call bpf_object__close() to free the object. |
[out] | prog_fd | Returns a file descriptor for the first program. The caller should not call _close() on the fd, but should instead use bpf_object__close() on the object returned. |
- Return values
-
0 | The operation was successful. |
<0 | An error occured, and errno was set. |
- Deprecated:
- Use bpf_object__open() and bpf_object__load() instead.
- Exceptions
-
EACCES | The program failed verification. |
EINVAL | One or more parameters are incorrect. |
ENOMEM | Out of memory. |
- See also
- bpf_load_program
-
bpf_load_program_xattr
-
bpf_object__close
-
bpf_program__attach
◆ bpf_program__next()
struct bpf_program* bpf_program__next |
( |
struct bpf_program * |
prog, |
|
|
const struct bpf_object * |
obj |
|
) |
| |
◆ bpf_program__prev()
struct bpf_program* bpf_program__prev |
( |
struct bpf_program * |
prog, |
|
|
const struct bpf_object * |
obj |
|
) |
| |
◆ bpf_program__size()
size_t bpf_program__size |
( |
const struct bpf_program * |
prog | ) |
|
◆ bpf_set_link_xdp_fd()
int bpf_set_link_xdp_fd |
( |
int |
ifindex, |
|
|
int |
fd, |
|
|
__u32 |
flags |
|
) |
| |
Attach an XDP program to a given interface.
- Parameters
-
[in] | ifindex | The interface index to attach to, or -1 to detach. |
[in] | fd | File descriptor of program to attach. |
[in] | flags | Flags. Use XDP_FLAGS_REPLACE to replace any program previously attached to the specified interface index. |
- Return values
-
0 | The operation was successful. |
<0 | An error occured, and errno was set. |
- Deprecated:
- Use bpf_xdp_attach() instead.
- See also
- bpf_program__attach_xdp
-
bpf_xdp_attach
-
bpf_xdp_detach