Libbpf userspace function bpf_program__attach_freplace
Attach a BPF_PROG_TYPE_EXT
program to a global eBPF function, thereby replacing it.
Definition
struct bpf_link * bpf_program__attach_freplace(const struct bpf_program *prog, int target_fd, const char *attach_func_name);
Parameters
prog
: BPF program to attachtarget_fd
: file descriptor of the eBPF program containing the global function to replaceattach_func_name
: name of the global function to replace
Return
Reference to the newly created BPF link; or NULL
is returned on error, error code is stored in errno
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome