| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tested in pieces in aosp/master and it still successfully boots.
So the struct extension infrastructure works as desired.
This is a sqaush of 2 aosp/master commits:
64005dd91b0cf1722ccd1767f805e0524010920e
a5c641141ff74bba025a65451628308c6cbb7e0f
Ignore-AOSP-First: squash of 2 aosp/master patches
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7136253086eaccf79cf39e7a0143b425a1019390
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Really we need to fix the inheritance to make
BpfMapRO the parent class of BpfMap:
but that's a far more difficult thing to do,
so in the short term we punt like this.
This makes BpfMapRO a little bit more usable,
and allows a slow transition across the codebase...
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1c5112db70e9e523c113cba536fbe19422b4d3f3
(cherry picked from commit b54659706758641a0ff01770644cb189e3959b29)
Merged-In: I1c5112db70e9e523c113cba536fbe19422b4d3f3
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(by request from Lorenzo)
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I802d2aae8b103375d7cbe0ed5c35f0abf6c04ac9
(cherry picked from commit 974ee86ff71fdfaaa0305d1623efcef1d9a16b21)
Merged-In: I802d2aae8b103375d7cbe0ed5c35f0abf6c04ac9
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(beginning there of)
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie7cf8cd51b4e272fc76a281df6231ed27955ed3f
(cherry picked from commit 62315472e581ea119fb8f44d3a03b41a8ca80b3b)
Merged-In: Ie7cf8cd51b4e272fc76a281df6231ed27955ed3f
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
not perfect due to this being in a header file, so multiple copies
potentially exist, but it's really simple, and works nearly as well.
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id90c6933d57bc12f4dd640c8918fd0885c7474cf
(cherry picked from commit 9d481287aa69200a36c997200e71232b77234b0a)
Merged-In: Id90c6933d57bc12f4dd640c8918fd0885c7474cf
|
| |
|
|
|
|
|
|
|
|
|
| |
this way is more obviously not calling dup_with_cloexec
Bug: 218408035
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4e1ce3b0a42ccea638332ae451e291e025d57895
(cherry picked from commit 703e4682444dcab121f9657dc5c1605a7bcce65e)
Merged-In: I4e1ce3b0a42ccea638332ae451e291e025d57895
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
to replace less safe uses of BpfMap.reset(create(type, keysize, valuesize, entries, flags))
Meant to be used in tests only.
Bug: 235286176
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I869f1f935bcf5d00702c42bc46d6094ea552addc
(cherry picked from commit d2dec08c73b2bc1dd2a3969ccb504a59e9cb223f)
Merged-In: I869f1f935bcf5d00702c42bc46d6094ea552addc
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We switch back to int from ParcelFileDescriptor,
and eliminate all calls to close(). Bpf Map FDs
now live till process exit.
Bug: 230880517
Test: TreeHugger, atest com.android.networkstack.tethering.BpfMapTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I89b6dc88ea56cb1e50695f8daf54ed79bce3fba2
(cherry picked from commit 8888c198daa8141988ee806adcf54b43e68b1076)
Merged-In: I89b6dc88ea56cb1e50695f8daf54ed79bce3fba2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ParcelFileDescriptor has implemented finalize(). Wrap native fd into
ParcelFileDescriptor which helps to release fd automatically.
Bug: 230880517
Test: manual test
Steps:
1. Connect to IPv6 only wifi and clat maps are created
$ adb shell cmd wifi set-wifi-enabled enabled
05-12 13:53:41.182 1793 2031 W BpfMap : open /sys/fs/bpf/net_shared/map_clatd_clat_ingress6_map..: 493
05-12 13:53:41.182 1793 2031 W BpfMap : open /sys/fs/bpf/net_shared/map_clatd_clat_egress4_map..: 546
$ adb shell ls -all proc/1793/fd | grep bpf
.. system system 64 2022-05-12 13:55:35 .. 493 -> anon_inode:bpf-map
.. system system 64 2022-05-12 13:55:35 .. 546 -> anon_inode:bpf-map
$ adb shell dumpsys connectivity
Forwarding rules:
BPF ingress map: iif nat64Prefix v6Addr -> v4Addr oif
47 /64:ff9b::/96 /2a00:79e1:abc:6f02:6efd:1d4b:f05e:25bd -> /192.0.0.4 54
BPF egress map: iif v4Addr -> v6Addr nat64Prefix oif
54 /192.0.0.4 -> /2a00:79e1:abc:6f02:6efd:1d4b:f05e:25bd /64:ff9b::/96 47 ether
2. Disconnect from IPv6 only wifi, force GC and clat map fds are released
$ adb shell cmd wifi set-wifi-enabled disabled
$ adb shell kill -10 1793
$ adb shell ls -all proc/1793/fd | grep bpf
(fd 493 and 546 are removed)
Change-Id: I26bbafbd73eccab6f4ae2c71690ecad12bbef7df
(cherry picked from commit ef5e791312fbed4ead02809893039d8e21b43a03)
Merged-In: I26bbafbd73eccab6f4ae2c71690ecad12bbef7df
|
| |
|
|
|
| |
Test: TH
Change-Id: I71943cfd2fb72dca8a7ffd5d063860b89be47ca1
|
| |
|
|
|
|
|
|
| |
Support tc command:
$ tc qdisc add dev .. clsact
Test: TreeHugger
Change-Id: I98abcb59418ab12b6e4de0f42a18ded4677ddbfc
|
| |
|
|
|
|
|
|
| |
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
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
patch the missing commit I3acb47a432378f257418f81b26516e18d6ff3780.
Test: TreeHugger, atest libbpf_android_test netd_unit_test
netd_integration_test
Change-Id: I6b7114584759c0689e0d6b852387b93a799f663f
|
| |/
|
|
|
|
|
|
|
| |
Add bpf lib to load and attach BPF programs in commonly accesible
location.
Bug: 179733303
Change-Id: I17b68abb14e816e7210bc603ffda44e10fb73d2f
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
TCA_U32_ACT was missed when converting from the u32 filter to matchall.
Interestingly, cls_matchall does not seem to validate this type as the
kernel happily accepted this configuration (which absolutely should not
happen as TCA_U32_ACT is greater than __TCA_MATCHALL_MAX).
Bug: 218840346
Test: atest CtsNetTestCases:RateLimitTest
Change-Id: Ia24683cbd5fbd10084163db6e6a4415ec03f6f3f
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |\| | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Test: TreeHugger, atest libbpf_android_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I215ac3c5d4820bfef94a48024d511ea86012eb0f
|
| |\| | |
|
| | |/
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Attach bpf program to cgroup with flags, support 'BPF_F_ALLOW_OVERRIDE'
and 'BPF_F_ALLOW_MULTI'; corresponding to detach a single bpf program in
a cgroup.
Test: m
Signed-off-by: KaiWen Zheng <zhengkaiwen5@xiaomi.corp-partner.google.com>
Change-Id: I9a4d2dcb249c6c628e3f1287d7d5d1879b722bd6
|
| | |
| |
| |
| |
| |
| |
| |
| | |
For waitForProgsLoaded.
Bug: 162057235
Test: build, load bpf program from vendor
Change-Id: Ib670aada0a98249fed21beb72879326286b2f4c2
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This way, users of libnet_utils_device_common_bpfjni do not also have to
separately list the required libtcutils.
Test: build, boots
Change-Id: Id40863de83b6c40b79f38d638299626f7e025810
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added SPDX-license-identifier-Apache-2.0 to:
common/native/nettestutils/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Change-Id: If5fcd4735fe82f336227626a443bba1d74201722
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Correct the indentation style of libclat in the follows
bpf_headers/Android.bp
bpf_syscall_wrappers/Android.bp
Test: build
Change-Id: I7cdd354141124fa8f7b4a864ddd937bef4676302
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
BPF_ANNOTATE_KV_PAIR is used by libbpf to associate each map with its
BTF information. This is ignored for programs compiled without BTF
information.
Bug: 203823368
Test: build & boot; confirm all bpf progs load successfully
Test: compile time_in_state.o with -g; confirm BTF is loaded
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I45f294945d48106d39d1d105ac4f49311459a19d
|
| |\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
* changes:
make bpf_headers visible to libclat
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: If3fb00e12ef365ccf3ac782c4e6ecbfd01d2dd4c
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* changes:
Decouple "net-utils-framework-common" from "net-utils-device-common-bpf"
Add visibility for use bpfmap by BpfInterfaceMapUpdater
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Bug: 215095957
Test: m
Change-Id: Idbb8e3cbf520a29444ccdfd2d1c42553c886a7f0
|
| |/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* changes:
Move logging helper to own file
Add tc police support in TcUtils.java
Add tc police support to jni lib
Add functionality to attach tc-police action to ingress qdisc
Add tests for adding / deleting bpf filter
Add support to attach / replace / detach clsact qdisc to libtcutils
Add tests for libtcutils
Fix kernelversion.h
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
And rename to ALOGE to be in line with liblog.
Test: builds
Change-Id: I6c33f78a0649b273f75ebf05ea5ba3689beabc24
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Bug: 157552970
Test: TreeHugger
Change-Id: I63b4324bbb8d20b7d401921dad1f8e73ccc26a39
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is used for go/bandwidth-limiting.
Bug: 157552970
Test: atest LibTcUtilsTest
Change-Id: Ic8e4d8dc016b14a6d4fc8ddbb3949941e9ef95af
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Bug: 202086915
Bug: 157552970
Test: atest LibTcUtilsTest
Change-Id: I8adcb3df29e4b3e0c558714f90b2840698e40cb9
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Bug: 202086915
Bug: 157552970
Test: atest LibTcUtilsTest
Change-Id: I2f2e2f66acb7590e8951ac6e178c5893ba635597
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add tests for isEthernet(). Before I can add tests for the other
functions, I need to move tcQdiscAddDevClsact into libtcutils.
Bug: 202086915
Bug: 157552970
Test: atest LibTcUtilsTest
Change-Id: Id51e87bb76bc42a055f71027c94c51fcb76be209
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add missing pragma once and static inline all functions.
Bug: 202086915
Bug: 157552970
Test: builds
Change-Id: I8aca683e9e60c33bf5a5ac45cc20c2e59c8eecde
|
| | |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The library provides a helper function that can retrieve dumpsys
results from a specific service. It can also take dumpsys arguments.
Bug: 29761778
Bug: 202086915
Test: test in Ib4aeb385ab80187feb39b659274a0aee20a4a5ed
Change-Id: Ib2ab8b6e4136bd3cbc52b025e53a1fa0c4e91709
|
| |/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The CtsNativeNetPlatformTestCases uses BpfUtils.h in bpf_headers.
Bug: 29761778
Bug: 202086915
Test: atest CtsNativeNetPlatformTestCases on signed user build
Change-Id: Ibbb10392a283b88328ae17d9aa54322f50878e76
|
| |\ \ \ |
|
| | |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
1. Add visibility for libtraffic_control
2. Add com.android.tethering into apex_available statement
Bug: 202086915
Test: m; flash; boot
Change-Id: I817e22c24dd205f09ef62a2a7ff85b2a970f6d3a
|