this code is from kernel bpf selftests xdp synproxy, removed the
tc part for simplicity, shows an exmaple of using libxdp
to attach xdp synproxy program on network interface.
if port is not in allowed ports, the packet will be dropped
by xdp synproxy by default, this would break tcp connections
to ports that user does not want to do synproxy, change the
default to allow connection pass through.
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
The distro kernel UAPI headers evolve too slow.
Thus, maintain a mirror in headers/linux/ in this proj.
Libbpf been overly-eager to get features into their releases
and depend on kernel commit 6089fb325cf7 ("bpf: Add btf enum64 support"),
which have not been released in an official kernel release yet.
Thus, this headers/linux/btf.h update comes from bpf-next git.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Newer libbpf uses constants from the newer kernel header file, so
compilation breaks unless we have the newest version of the kernel header.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
This was added in kernel commit:
8fd886911a6a ("bpf: Add BTF_KIND_FLOAT to uapi") (Author: Ilya Leoshkevich)
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Fixes pull request #24
I had forgot to git add headers/vmlinux/vmlinux_arch.h in PR#24
which caused compile failures for ktrace-CO-RE.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
It is a bit strange we have this header file in this repo, but
it likely be very useful later.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This is included by linux/if_link.h. Thus, we need it here if the
distro doesn't provide this include file.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
The bpf_helper_defs.h is used by (ibbpf provided) bpf/bpf_helpers.h.
Thus, it doesn't belong under headers/ directory.
Remove file: headers/bpf/bpf_helper_defs.h
Fixes: f0fce8f62b ("Update kernel headers and libbpf version")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
When some bpf example use libxdp then these can be re-added, along
with description of why projects needs to include these files.
Files removed:
headers/xdp/libxdp.h
headers/xdp/prog_dispatcher.h
headers/xdp/xdp_helpers.h
Fixes: 4513664ca3 ("Initial import with encap-forward example")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>