diff options
author | Jakub Sitnicki <jakub@cloudflare.com> | 2020-05-31 10:28:40 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-01 15:21:03 -0700 |
commit | d60d81acc2c180e33244857e35ef60072573b000 (patch) | |
tree | 11247584ab1f2753c51c2a968a49c7933ff73c7b /tools/lib/bpf/libbpf.h | |
parent | 0c047ecbb7bab4c1d2136f5f04bb47a66a9a12b8 (diff) | |
download | linux-d60d81acc2c180e33244857e35ef60072573b000.tar.gz linux-d60d81acc2c180e33244857e35ef60072573b000.tar.bz2 linux-d60d81acc2c180e33244857e35ef60072573b000.zip |
libbpf: Add support for bpf_link-based netns attachment
Add bpf_program__attach_nets(), which uses LINK_CREATE subcommand to create
an FD-based kernel bpf_link, for attach types tied to network namespace,
that is BPF_FLOW_DISSECTOR for the moment.
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200531082846.2117903-7-jakub@cloudflare.com
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index 8528a02d5af8..334437af3014 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -253,6 +253,8 @@ LIBBPF_API struct bpf_link * bpf_program__attach_lsm(struct bpf_program *prog); LIBBPF_API struct bpf_link * bpf_program__attach_cgroup(struct bpf_program *prog, int cgroup_fd); +LIBBPF_API struct bpf_link * +bpf_program__attach_netns(struct bpf_program *prog, int netns_fd); struct bpf_map; |