Commit Graph

14 Commits

Author SHA1 Message Date
Patrick Rohr
93312c998e bpf_headers: Make bpf_headers available to libsysutils
So KernelUtils.h can be used in NetlinkEvent.cpp.

Test: builds
Change-Id: If7a6a28e735ee19dc6b7a72330a97a8a01bcecd5
2023-05-18 14:39:14 -07:00
Ryan Zuklie
ccd5eb9359 Add skeleton BPF ring buffer integration test
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
2022-12-12 10:02:18 -08:00
Stephane Lee
4806feb3a5 Allow use of shared bpf headers by recovery
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
2022-03-09 14:16:41 -08:00
Maciej Żenczykowski
c805004f6d switch from libbpf_android to bpf_headers
Test: TreeHugger, atest libbpf_android_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I215ac3c5d4820bfef94a48024d511ea86012eb0f
2022-02-09 19:33:20 -08:00
Maciej Żenczykowski
6b1d684059 bpf_headers/bpf_syscall_wrappers - remove visibility restrictions
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
2022-02-09 19:33:20 -08:00
Steven Moreland
b0df1895d5 bpf_headers for vendor.
For waitForProgsLoaded.

Bug: 162057235
Test: build, load bpf program from vendor
Change-Id: Ib670aada0a98249fed21beb72879326286b2f4c2
2022-02-08 22:30:07 +00:00
Hungming Chen
51fecf19e2 libclat: Use space indentation instead of tab
Correct the indentation style of libclat in the follows
bpf_headers/Android.bp
bpf_syscall_wrappers/Android.bp

Test: build
Change-Id: I7cdd354141124fa8f7b4a864ddd937bef4676302
2022-01-25 20:09:09 +08:00
Maciej Żenczykowski
4772d859a7 Merge changes from topic "configure_bpf_for_clat"
* changes:
  make bpf_headers visible to libclat
  make bpf_syscall_wrappers visible to libclat
2022-01-24 19:14:35 +00:00
Ken Chen
945c8b2638 Clean up bpf_headers visibility
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
2022-01-23 15:57:25 +08:00
Hungming Chen
cd3f28f35d make bpf_headers visible to libclat
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
2022-01-16 13:52:45 +08:00
Ken Chen
a973c0be7d Add bpf_headers visibility for CtsNativeNetPlatformTestCases
The CtsNativeNetPlatformTestCases uses BpfUtils.h in bpf_headers.

Bug: 29761778
Bug: 202086915
Test: atest CtsNativeNetPlatformTestCases on signed user build
Change-Id: Ibbb10392a283b88328ae17d9aa54322f50878e76
2022-01-15 02:27:22 +08:00
Wayne Ma
67a69e7396 [NETD-TC#12] Fix dependency on libtraffic_controller
1. Add visibility for libtraffic_control
2. Add com.android.tethering into apex_available statement

Bug: 202086915
Test: m; flash; boot
Change-Id: I817e22c24dd205f09ef62a2a7ff85b2a970f6d3a
2022-01-14 12:24:13 +08:00
Maciej Żenczykowski
15d8ebee41 bpf_connectivity_headers -> bpf_headers -> bpf_syscall_wrappers
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idf158fa33670522b43e34c67a77087648b8b97a4
2021-12-28 17:56:27 -08:00
Ken Chen
0f1ee4ca81 Rename bpf_map_utils to bpf_headers
Use a generic name so that it can contain more bpf related headers.

Bug: 202086915
Test: build
Change-Id: I5a76948db394d8d7bb6eaedb570a2ca5bc99a289
2021-12-21 16:16:20 +08:00