* Struct.java is removed from net-utils-device-common-bpf and
net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
net-utils-device-common-struct in service-connectivity
Bug: 323503345
Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59
This commit removes the unused library visibility.
The "frameworks/base/packages/Connectivity" folder is the
temporary folder for modulizing the connectivity codes. There is
no such need now.
Test: m
Change-Id: Ia2890fe64c1bc369fcb90be645263bc56c98a7b2
To use the java struct definitions for multicast routing in connectivity
service, a new lib is defined and included in
service-connectivity-pre-jarjar.
Bug: 323503345
Test: presubmit
Change-Id: I664602fd0fa0a5da136ea28fd3c4d9068c5b46ab
The android framework has android.annotation.RequiresApi, which is a
copy of androidx.annotation.RequiresApi. However it was added with
source retention instead of class retention like androidx's version
has. This causes it to be missed if you compiled a library and then
used that library to compile something else, that library's public
methods won't have @RequiresApi on them when using that library's
compiled jar file.
To make @RequiresApi have class retention, we need to baseline the
NewApi issues that it would cause. These baselines also require
us to disable strict_updatability_linting in some places.
Bug: 323366771
Test: m lint-check
Change-Id: I0c984e3ba39e357ce102be442568f2d77a4f9034
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.
For more details please refer to the link below,
<add g3 doc link>
Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5
This change includes:
1. Refactor the logic in Tethering#dump into utils class.
2. Move the utils class to a common place which could be referenced
from other sub-modules.
3. Add @MonitorThreadLeak annotation to enforce
there is no thread leak problem.
Test: atest FrameworksNetTests NetworkStaticLibTests
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.TetheringTest#testDumpTetheringLog
Test: adb shell dumpsys tethering (with hardcoded exception)
Fix: 312669345
Change-Id: Ia6fdfeeec2110afa0ec9e056e9db3843748845c3
This java library is available to the following
1. NetworkStack, a platform app
2. TetheringNext, an app in com.android.tethering
The availability to (2) was done implicitly using a baseline map in
build/soong/apex/apex.go. Make this explicit in Android.bp
Bug: 281077552
Test: m nothing
Change-Id: I5738ef1fc153e7ef9ccdde512e61310b0fd1ddbb
- Change class names to start with Xfrm or StructXfrm for consistency
with other messages and structs
- Create xfrm sub-folder for xfrm messages
- Add "finals" to input parameters
Bug: 308011229
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink
(new tests added)
Change-Id: Id6d34b4549bbc1890b3f4dd9f1638977f66e3236
DnsSvcbPacket will be used to parse DNS packet of type SVCB.
Bug: 240259333
Test: will add some tests in a follow-up change
Change-Id: Icb13d50f2d95a898b3b7ea373db876f41690723a
This change is an initial implementation of DNS SVCB Record. It
can parse an SVCB Record in wire format.
The RDATA field of a SVCB Record is formatted as follows:
- SvcPriority: 2-byte field
- TargetName: a domain name that follows RFC1035 section 5.1
- SvcParams (optional): a list of SvcParam
This initial implementation focuses on the SvcParams related to DDR,
including alpn, port, ipv4hint, ipv6hint, and dohpath. For the other
SvcParams, such as mandatory and ech, this change doesn't check
whether their value is valid.
Bug: 240259333
Test: atest ConnectivityCoverageTests
Test: No test for DnsSvcbRecord for now. will add some tests in a
follow-up change
Change-Id: Icfe9b623eda8390c40b106123a718cdd2af3af99
A helper class to *read* java BpfMaps. This is designed to
provide direct bpf access in the caller process through
ConnectivityManager APIs.
The change also removes any statical link to
net-utils-device-common-struct from service-connectivity.
This is because net-utils-device-common-struct is already
included in framework-connectivity. Including it again in
service-connectivity would create a r8 build fail by circular
dependency.
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Bug: 297836825
Change-Id: I7a6d2eb816d0dc7343167bddd672806b199f44fe
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0f06ace921db6c79d63c0048bdb73d167ff606cf
Maciej Żenczykowskicommited 2023-09-19 23:22:58 +00:00
Add isFeatureSupported helper method to check whether
a specific feature is supported. This is useful when a specific
module version is required on a cross module feature, e.g.
a connectivity feauture requires to work with a older
networkstack module.
This commit also adds isTetheringFeatureForceDisabled() method
as a method that refers to DeviceConfig which can be controlled
to explicitly disabled.
Bug: 291870956
Test: atest FrameworksNetTests NetworkStaticLibTests
Change-Id: I511d00663e2378c36b4ca017db4b88d88f650852
Both encode and deocde methods support message compression which is
described in RFC1035 section 4.1.4. We can leverage both methods in
a follow-up CL to parse DHCPv4 option 119 and DNSSL RA option.
This cl also adds maxLabelCount argument for DnsRecordParser#parseName
to prevent the potential recursion from overflowing the stack.
Bug: 189865016
Test: atest NetworkStaticLibTests
Change-Id: I624649c224f141848a475ac85c56012d138c5224
fqjc86authored and Xiao Macommited 2023-07-11 18:04:18 +09:00
Enable error-prone checking in the net-utils-framework-common to
catch NullablePrimitive errors during build time.
Also fix any NullablePrimitive errors that are found in the
library classes.
Bug: 256991804
Test: Enable error-prone checking and check if the build fails
with any NullablePrimitive errors. If it does, fix the
errors and build again.
Change-Id: I7e1508d166f258f5232ff39388ac984fbdc6169e
mdns may be imported in other non-AOSP projects as a library, along with
its dependencies from net-utils-device-common. While all of
net-utils-device-common may not build against system API, this requires
the files used by mdns to build against system API.
Add a library to allow checking that the dependencies can still build
against system API.
Test: m
Bug: 272392042
Change-Id: I468f53b47ef55c23137594a79599b148084f4535
SocketUtils in the framework should be better to move to shared
lib since it's commonly used by modules. But it is exposed in
API surface, so it cannnot simply move from framework to shared
lib. Create a SocketUtils in libs to deprecate the usage of
the original SocketUtils so that adding extra socket utils will
not be restricted by API release.
Test: m
Change-Id: Idf57071a4bd89a6114dda9a9c9c19fd0e5db54c5
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp.
Test: m
bug: 253019048
Change-Id: Id35bec32e9b46ef6589034d442a767ce1a4aaac8
This re-submit aosp/1387135 but define TYPE_CNAME locally to
prevent from using non-finalize API.
Bug: 139774492
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.DnsPacketUtilsTest
Change-Id: Ib2e98292be994ca09845c6857b8884f9bcdaba80
Revert "[ST02.1] Add TYPE_CNAME constant to DnsResolver"
Revert submission 1387135-st02
Reason for revert: Usage of TYPE_CNAME in a library shared among
modules does not interact well with current module release process
Reverted Changes:
Ib5616c65c:[ST02.2] Use the getters of DnsHeader
I5e58f99b0:[ST02.1] Add TYPE_CNAME constant to DnsResolver
I0c1547cbc:[ST02] Add methods for synthesizing DNS packets
Change-Id: I9f8de47c9ba9fb4db7cf3695966f222f68a9a290
Move the NetworkMonitorUtils class from NetworkStack module to
frameworks/libs/net, then we can remove the filegroups defined
in NetworkStack module which are shared with Connectivity module.
Import the net-utils-device-common lib instead.
Update the NetworkMonitorUtils#isValidationRequired() first param type
to make the migration easier, change the NetworkAgentConfigShim type
param to boolean, which can be passed by the caller directly such as in
ConnectivityServiceTest or NetworkMonitor, then we don't need to add
static lib to support NetworkAgentConfigShim, not easy to support.
Bug: 238960524
Test: m
Change-Id: I72dfb5902dea0e7ddb2c33a08f874fe36adcbeec
Move base64 related bpf map function and constant from BpfCoordinator.
This is preparation for testing BPF map in ClatCoordinator.
Test: atest NetworkStaticLibTests
Change-Id: I3a23393abe5b108cdb8d621e99b74fd20847474e
Hungming Chenauthored and Nucca Chencommited 2022-07-06 04:34:34 +00:00
This was done via the hard-coded list in build/soong.
Bug: 158059172
Test: m
Merged-In: Icae85d5f4564ee3f04bacb0d3dad7a80d70ee443
Change-Id: Icae85d5f4564ee3f04bacb0d3dad7a80d70ee443
(cherry picked from commit 6e043e136d3390f44e84bb57e4a8eeb4ec25d838)
Needed because these struct classes should not be exposed.
Only used for the connectivity module and its integration test.
Bug: 234160319
Test: atest ConnectivityCoverageTests
Change-Id: I7ad2a711807d2ee0bb95d9be1d038c6b07143052
net-utils-device-common-bpf is design for connectivity module only,
change the visibility to avoid someone outside of the module use it inadvertently.
Bug: 234160319
Change-Id: I3c7c48b60414f19bad8be0bda38ea5af3dc99c86
Test: TH
The library in frameworks/base now uses the java_library defined here.
Whilst here, also mark the library as available to wifi.
Test: m com.android.wifi
Change-Id: I36047413c749df3cabb7b284444a6f60494d3bb1
The module availability to Bluetooth is currently hard-coded in apex.go.
We are in the process of cleaning the apex.go by adding the availability
in each required module
Test: Build + TH + boot phone & use bluetooth
Bug: 216433795
Change-Id: I7b9e2a95e9fda0f25786e113d78bca81a4406abf
William Escandecommited 2022-03-18 18:39:18 +01:00
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
Generic bitmap class for use with bpf programs. Internally
uses bpfMap with key/value.
Test: atest BpfBitmapTest
Change-Id: Ica912b080849b50614e30ee168992c9ada74068c
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 Chenauthored and Nucca Chencommited 2022-02-09 07:58:39 +00:00