This adds a BPF program with a ring buffer and an associated test that
ensures the program and ring buffer can be loaded by the bpf loader. In
the following changes, this foundation will be used to test the user
space ring buffer wrapper class.
Unlike BpfMap, userspace can't (easily) write to the ring buffer so the
most accurate way to test a userspace ring buffer implementation is to
write to it from a BPF program.
Note: the BPF program in this change is never actually attached to a
cgroup, it is only loaded. The program will be executed manually using
BPF_PROG_RUN which is "side-effect free" (it can have side effects on
BPF maps, but not on Kernel state, e.g. dropping packets).
Bug: 246985031
Test: atest libbpf_android_test
Change-Id: Ib9c591218188f5f358a755c8854bc6f87d26af12
This will allow healthd to filter uevent packets, if needed
Bug: 203462310
Test: Ensure that healthd can build if it uses bpf filters
Change-Id: I97bfe9509a6934444f656508176495bba38381be
this doesn't appear to make sense now that it's available to vendors
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If2d24fa8eccfb5c12832fb191a8560b024751db7
Correct the indentation style of libclat in the follows
bpf_headers/Android.bp
bpf_syscall_wrappers/Android.bp
Test: build
Change-Id: I7cdd354141124fa8f7b4a864ddd937bef4676302
The bpf_headers no need to explicitly specify visibility for
system/netd/libnetdbpf. The libnetdbpf depends on
bpf_connectivity_headers, which exports bpf_headers already.
Bug: 202086915
Test: m
Change-Id: I09a073b14dc74511ba9dc09a89ae6e89dff51f4d
Needed because ClatdController and clatd binary are moved
into apex. libclat is used for accessing BPF map.
Bug: 212345928
Test: manual test
1. Connect to ipv6-only wifi.
2. Try IPv4 traffic.
$ ping 8.8.8.8
Change-Id: If3fb00e12ef365ccf3ac782c4e6ecbfd01d2dd4c
The CtsNativeNetPlatformTestCases uses BpfUtils.h in bpf_headers.
Bug: 29761778
Bug: 202086915
Test: atest CtsNativeNetPlatformTestCases on signed user build
Change-Id: Ibbb10392a283b88328ae17d9aa54322f50878e76