Commit Graph

18 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
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
a11e698749 expose bpf_syscall_wrappers to art apex
The art apex already has access to bpf_headers which includes bpf_syscall_wrappers,
but this extra line is needed to switch it away from needlessly linking libbpf_android.

Since these are header files only, this annotation is kind of pointless,
but it does turn out to be needed...

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9e4d3373cea488080304e31ed7c8708aec988933
2022-02-09 22:23:01 -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
Hungming Chen
37b2575137 make bpf_syscall_wrappers 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: I95a1c21927ba95f6094152e1013761d79c73e981
2022-01-16 13:50:34 +08:00
Wayne Ma
321a9f0719 Merge "[NETD-TC#12] Fix dependency on libtraffic_controller" 2022-01-14 10:44:52 +00: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
Patrick Rohr
a408d3cc06 Move BpfUtils -- make BpfSyscallWrappers visible to libtcutils
Bug: 202086915
Bug: 157552970
Test: atest TetheringTests
Change-Id: I698f492e30e4108037d1b72c5bebc7d6ab85e410
2022-01-12 21:34:48 +01: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
4bce28bc2a [NETD-BPF#25] Add bpf_syscall_wrappers visibility for libnetd_mainline
retrieveProgram() in bpf_syscall_wrappers is used by libnetd_mainline.

Bug: 202086915
Test: m; flash; boot
Change-Id: I69573a6925fd9f5fcd65935d681e7a340ee73f17
2021-12-07 02:42:32 +00:00
Alessio Balsini
9efcabc929 Allow MediaProvider to use BPF utilities
The FUSE daemon in MediaProvider needs to access the file descriptor of
its pinned BPF program.
The BPF syscall wrappers are handy and would avoid code duplication,
thus extend this project visibility to MediaProvider.

Bug: 202785178
Test: adb logcat FuseDaemon:V \*:S (in git_master)
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I406c760bb96d74597ca7d8f701cd12c3bd318f68
2021-12-03 01:54:31 +00:00
Tyler Wear
aafd9c18fb bpfmap: Move to Common Util Location
Multiple packages need access to bpf maps. Moving to common
location to allow access from all necessary packages.

Test: atest BpfMapTest
Bug: 179733303

Change-Id: Idae7b620c15c781b2e7980c3a3157f396cfaf66e
2021-10-29 12:38:05 -07:00
Tyler Wear
ae05481b9a export bpf headers to Connectivity Service
Export BPF headers to connectivity service for use with
VendorConnectivityService aidl.

Bug: 179733303
Change-Id: Ibc098facde54aeb621e53b73ac59eb6416ba9ebb
2021-10-20 01:02:31 +00:00
Suren Baghdasaryan
1bd069f24d Allow lmkd to use bpf_syscall_wrappers
LMKD needs access to map_gpu_mem_gpu_mem_total_map
BPF map to record the total size of GPU allocations
at the time of a kill. Change bpf_syscall_wrappers
visibility to allow lmkd to use bpf_syscall_wrappers
library.

Bug: 189366037
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia1f75852a853f62b504351271119714f3fd95232
2021-06-11 21:00:06 +00:00
Bob Badour
1b8c744bcd [LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  client-libs/Android.bp
  client-libs/tests/unit/Android.bp
  common/Android.bp
  common/native/bpf_syscall_wrappers/Android.bp
  common/native/netjniutils/Android.bp
  common/tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I2d4abaee12c1f20c39a7e2c9e02e2fccb96fa3ee
Merged-in: I6942c6844c89048f785f2b6eaa4bb33a24fa6f93
2021-02-17 17:22:02 -08:00
Maciej Żenczykowski
a728a70497 Wrap BPF system calls into a versioned module
This isn't new code, this is basically copied verbatim from
  //system/bpf/libbpf_android/include/bpf/BpfUtils.h

Test: atest BpfMapTest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I80523c9ee0c1e4431f3192eb409ad68c737390a6
2021-01-13 18:29:56 -08:00