Commit graph

1,275 commits

Message SHA1
Make net-utils-services-common visible to service-connectivity-tiramisu.
Ethernet service sources are moving to Connectivity module, which has
dependency on the NetworkFactory class such as EthernetNetworkFactory.
Import this lib in service-connectivity-tiramisu-pre-jarjar to fix this
dependency.

Bug: 202086915
Test: m
Change-Id: I2f92479f56af110d89c9fa95eca725af7132b66f

Xiao Ma   commited 2022-03-07 10:09:21 +00:00
2bbc2f79de
Merge "BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros"
Ken Chen   authored and   Gerrit Code Review   commited 2022-03-02 08:53:01 +00:00
c434f7fa6e
Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t"
Paul Hu   authored and   Gerrit Code Review   commited 2022-03-02 07:11:24 +00:00
9958830fc1
Merge "Bpf Util Lib in Common Location"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-03-02 07:01:41 +00:00
ffbe23ba37
BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros
patch the missing commit I3acb47a432378f257418f81b26516e18d6ff3780.

Test: TreeHugger, atest libbpf_android_test netd_unit_test
netd_integration_test

Change-Id: I6b7114584759c0689e0d6b852387b93a799f663f

Ken Chen   commited 2022-03-02 03:19:49 +00:00
0a31b342a1
Bpf Util Lib in Common Location
Add bpf lib to load and attach BPF programs in commonly accesible
location.

Bug: 179733303

Change-Id: I17b68abb14e816e7210bc603ffda44e10fb73d2f

Tyler Wear   commited 2022-03-01 09:09:36 -08:00
e48ee4a864
Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: Ie4c0ae97435457ea46b7c41be86a896b552d9bd8
Change-Id: Ie4c0ae97435457ea46b7c41be86a896b552d9bd8

paulhu   authored and   Paul Hu   commited 2022-03-01 01:27:48 +00:00
cdb069ed43
Merge "Add support for unknown Network to expectCallback"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-28 21:57:29 +00:00
798eebdade
Merge "remove unused import from BpfMap"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-20 03:49:54 +00:00
bb99f69ec6
Merge "Change TestBpfMap to use ConcurrentHashMap"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-19 20:20:24 +00:00
0a7883f994
Merge "Allow of expectAvailableCallbacks when validation state is unknown."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-18 17:04:27 +00:00
0a0877006d
remove unused import from BpfMap
Test: m
Change-Id: Iebdb14ad2ae917c5f1e2e23ea2619106fb092caf

Patrick Rohr   commited 2022-02-18 12:14:29 +01:00
74112b549d
Change TestBpfMap to use ConcurrentHashMap
IBpfMap#forEach allows concurrent map access (deleting from the map
while iterating), so we should allow this in TestBpfMap as well.

Test: builds
Change-Id: I89dc7e4daf1d0cfc1aac57cad4ea7f1e50f5f20c

Patrick Rohr   commited 2022-02-18 11:59:43 +01:00
aeff1238bb
Merge "Add BpfBitmap Class"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-18 01:55:43 +00:00
66c443a64c
Allow of expectAvailableCallbacks when validation state is unknown.
Currently, expectAvailableCallbacks requires that the caller know
in advance what the validation state is. This CL allows the
caller to pass in validated = null to indicate that it does not
matter whether the network is validated or not.

Test: modified CTS test in other CL in topic
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: Ie54806a4a1d907de630819e11f9e34602cc55ef4

Lorenzo Colitti   commited 2022-02-17 17:45:05 +09:00
5fec18b980
Merge "Remove dependency on compatibility-device-util-axt"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-17 06:14:47 +00:00
48ce320ad3
Add BpfBitmap Class
Generic bitmap class for use with bpf programs. Internally
uses bpfMap with key/value.

Test: atest BpfBitmapTest
Change-Id: Ica912b080849b50614e30ee168992c9ada74068c

Tyler Wear   commited 2022-02-16 14:48:33 -08:00
92f3c24e90
Remove dependency on compatibility-device-util-axt
The library pulls a lot of dependencies, which end up in code coverage
reports, because code coverage looks at code inside the test package
unless excluded.

Just use the existing TestPermissionUtil in the same library instead,
avoiding the need to exclude many test utilities and making the test
smaller.

Test: atest android.net.cts.ConnectivityManagerTest#testDump
Change-Id: I3ba2121ef034872acf077578644ac9e8aa92c7ef

Remi NGUYEN VAN   commited 2022-02-16 18:52:32 +09:00
675cdf6d99
Add ThrowingBiConsumer to IBpfMap
Converting BiConsumer to ThrowingBiconsumer allows an
exception to correctly be thrown from the BiConsumer action
in forEach() from BpfMap.

Change-Id: I34363c5aa8b07c4cbd703e899381a95062d2b75b

Tyler Wear   commited 2022-02-15 15:35:54 -08:00
8e377130c9
Merge "Utils : Collections.containsAll, containsAny, Permissions.getGrantedPermissions"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-12 11:56:36 +00:00
10ac4dd700
Merge "Fix wrong nla_type for matchall"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-11 20:42:35 +00:00
4f8654ce07
Fix wrong nla_type for matchall
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

Patrick Rohr   commited 2022-02-11 13:24:51 +01:00
20dcaf5f70
Merge "expose bpf_syscall_wrappers to art apex"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-10 23:26:49 +00:00
62b3d9fbb2
Merge "switch from libbpf_android to bpf_headers"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-10 19:03:33 +00:00
4395ff6815
Merge "bpf_headers/bpf_syscall_wrappers - remove visibility restrictions"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-10 19:03:15 +00:00
2645d2374b
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

Maciej Żenczykowski   commited 2022-02-09 22:23:01 -08:00
a11e698749
Utils : Collections.containsAll, containsAny, Permissions.getGrantedPermissions
Introduces three new useful utilities into the static f/l/n common libraries.

Test: used in ConnectivityManagerTest CTS, atest ConnectivityManagerTest
Change-Id: I83aca0b105b6d697768d263db76e0c521667942e

Chalard Jean   commited 2022-02-10 13:27:02 +09:00
310cc18cc2
switch from libbpf_android to bpf_headers
Test: TreeHugger, atest libbpf_android_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I215ac3c5d4820bfef94a48024d511ea86012eb0f

Maciej Żenczykowski   commited 2022-02-09 19:33:20 -08:00
c805004f6d
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

Maciej Żenczykowski   commited 2022-02-09 19:33:20 -08:00
6b1d684059
Merge "Add attach bpf with flags and detach single bpf"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-10 02:26:56 +00:00
b751aee9ab
Merge "Move Tether4Key and Tether4Value to common libs"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-09 13:53:41 +00:00
e46975857c
Add attach bpf with flags and detach single bpf
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

KaiWen Zheng   commited 2022-02-09 19:27:58 +08:00
cfe2f2a1c9
Merge "Add framework-connectivity-t to net-utils"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-09 09:39:25 +00:00
fbf9e7740c
Move Tether4Key and Tether4Value to common libs
EthernetTetheringTest needs to parse BPF map content for IPv4
forwarding rule tests. Move the struct class files to common
libs.

Compare Tether4{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

Test: atest TetheringCoverageTests

Change-Id: I77142c784e20fd74d4aa5dd34858159e232abbe3

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 07:58:39 +00:00
f4302ece8f
bpf_headers for vendor.
For waitForProgsLoaded.

Bug: 162057235
Test: build, load bpf program from vendor
Change-Id: Ib670aada0a98249fed21beb72879326286b2f4c2

Steven Moreland   commited 2022-02-08 22:30:07 +00:00
b0df1895d5
Add support for unknown Network to expectCallback
This patch allows not passing a network to expectCallback
to allow receiving a callback when the network isn't known.
This is supported in other expect* methods but somehow was
missed in this one.

Test: Ikev2VpnRunnerTest, which uses this ability
Change-Id: Ifd20dd8789ff8b277bac3a73ddd23e2fe9febbca

Chalard Jean   commited 2022-02-09 03:22:43 +09:00
1a21b9a9db
Add framework-connectivity-t to net-utils
The dependency is necessary as it builds against module_current and uses
APIs moved there.

Ignore-AOSP-First: Avoiding conflicts, cherry-pick will follow
Bug: 197717846
Test: m
  (cherry-picked from ag/16770415)
Change-Id: I150adbdcc6ba48e0fade9f43242ef5d2f8d7cea0
Merged-In: I150adbdcc6ba48e0fade9f43242ef5d2f8d7cea0

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-08 18:49:16 +08:00
8c19182bcf
Merge "Adding bt apex"
Roopa Sattiraju   authored and   Gerrit Code Review   commited 2022-02-04 16:33:14 +00:00
88d7d17c7b
Merge "Turn TestBpfMap into a common utility class."
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-04 12:37:50 +00:00
a2a06e86cb
Adding bt apex
Bug: 206121418
Test: Compile
Change-Id: Ia117cc35a885ba74c98a67b061a648f96dd78228

Roopa Sattiraju   commited 2022-02-03 21:52:14 -08:00
98fa3bfdac
Merge "Include libtcutils inside libnet_utils_device_common_bpfjni"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-02 19:38:56 +00:00
417968e4cf
Turn TestBpfMap into a common utility class.
- Move it to frameworks/libs/net/common/testutils.
- Inherit from BpfMap, so the class can be used anywhere that
  uses a real BpfMap. For example, BpfCoordinatorTest uses
  BpfMap, not IBpfMap.

Test: atest BpfCoordinatorTest
Change-Id: I7ee65e47fa46ac6aafc831f5b1823b44267ba2a6

Lorenzo Colitti   commited 2022-02-02 00:25:40 +00:00
167102daab
Make the struct "not a subclass of Struct" error message clearer.
Test: treehugger
Change-Id: Ia281e186db258af3629c10b260971201380f33f4

Lorenzo Colitti   commited 2022-02-02 00:25:30 +00:00
f17790f661
Merge "Mark VisibleForTesting members as public"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-01 08:58:29 +00:00
35ef7bf5a0
Include libtcutils inside libnet_utils_device_common_bpfjni
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

Patrick Rohr   authored and   Maciej Żenczykowski   commited 2022-02-01 03:07:46 +00:00
23077d5a49
Mark VisibleForTesting members as public
Package-private members are not visible across jars; with the latest
refactoring of build and jarjar rules for connectivity, tests fail as
the utils are picked up from the on-device module rather than the test
package, and such members could not be found.

Bug: 204830222
Test: atest ConnectivityCoverageTests
Change-Id: Ia62b01e2e3123a2d8a432c061e3c576c86356df5

Remi NGUYEN VAN   commited 2022-01-31 21:55:43 +09:00
5c080dc85b
Merge "Use module API in common libraries"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-01-31 12:15:08 +00:00
7e5cf2c0c9
Merge "[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net"
Bob Badour   authored and   Gerrit Code Review   commited 2022-01-28 02:14:18 +00:00
ef3997c70e
Merge "Add Override for onDscpPolicyStatusUpdated"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-01-27 23:25:54 +00:00
e6cb32b01b
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
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

Bob Badour   commited 2022-01-27 10:46:23 -08:00
ae85125761