Libbpf userspace function bpf_program__attach_netns
Attach a BPF_PROG_TYPE_SK_LOOKUP or BPF_PROG_TYPE_FLOW_DISSECTOR program to a network namespace.
Definition
struct bpf_link * bpf_program__attach_netns(const struct bpf_program *prog, int netns_fd);
Parameters
prog: BPF program to attachnetns_fd: file descriptor of the network namespace to attach the program to
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