linux/tools/lib/bpf
Daniel Borkmann 05c31b4ab2 libbpf: Add link-based API for netkit
This adds bpf_program__attach_netkit() API to libbpf. Overall it is very
similar to tcx. The API looks as following:

  LIBBPF_API struct bpf_link *
  bpf_program__attach_netkit(const struct bpf_program *prog, int ifindex,
                             const struct bpf_netkit_opts *opts);

The struct bpf_netkit_opts is done in similar way as struct bpf_tcx_opts
for supporting bpf_mprog control parameters. The attach location for the
primary and peer device is derived from the program section "netkit/primary"
and "netkit/peer", respectively.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20231024214904.29825-4-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-10-24 16:06:58 -07:00
..
.gitignore
bpf.c
bpf.h
bpf_core_read.h
bpf_endian.h
bpf_gen_internal.h
bpf_helpers.h
bpf_prog_linfo.c
bpf_tracing.h
btf.c
btf.h
btf_dump.c
Build
elf.c
gen_loader.c
hashmap.c
hashmap.h
libbpf.c
libbpf.h
libbpf.map
libbpf.pc.template
libbpf_common.h
libbpf_errno.c
libbpf_internal.h
libbpf_legacy.h
libbpf_probes.c
libbpf_version.h
linker.c
Makefile
netlink.c
nlattr.c
nlattr.h
relo_core.c
relo_core.h
ringbuf.c
skel_internal.h
str_error.c
str_error.h
strset.c
strset.h
usdt.bpf.h
usdt.c
zip.c
zip.h