summaryrefslogtreecommitdiff
path: root/services/net/java/android/net/ip
AgeCommit message (Collapse)Author
2021-06-21Remove most of the NetworkStack dependencies on frameworks/base.Lorenzo Colitti
Most of these files are being moved to the networkstack-client library in packages/modules/NetworkStack, with the exception of DhcpResultsCompatUtil which is unused and is being deleted. Test: m Bug: 151052811 Original-Change: https://android-review.googlesource.com/1734913 Merged-In: I72ec43987faf9138cd68dc47c6bf2abe8c67aa38 Change-Id: I72ec43987faf9138cd68dc47c6bf2abe8c67aa38
2020-12-15Add TcpKeepalivePacketData to SystemApi am: 103ec4aa8d am: a232c68028 am: ↵Remi NGUYEN VAN
40190840bb Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494038 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1aa9deefefcaf75959463e8a8a87bfeefb98f0ee
2020-12-14Add TcpKeepalivePacketData to SystemApiRemi NGUYEN VAN
This is consistent with NattKeepalivePacketData, which is also a subclass of KeepalivePacketData. TcpKeepalivePacketData is already used by the wifi module, but statically linked. Bug: 172789687 Test: m Change-Id: I6aee1ae205987521bea4a3838bbece279ffa0e37
2020-10-07Tighten up Binder.clearCallingIdentity() usage.Jeff Sharkey
This is a third CL in a chain that adjusts existing malformed code to follow AndroidFrameworkBinderIdentity best-practices. Specifically, if a thread clears an identity they need to restore it to avoid obscure security vulnerabilities. In addition, the relevant "try" block must start immediately after the identity is cleared to ensure that its restored if/when any exceptions are thrown. Bug: 155703208 Test: make Exempt-From-Owner-Approval: trivial refactoring Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
2020-08-07Revert "Revert "Move Inet[4]AddressUtils to libs/net""Chalard Jean
This patch is still needed and should go in now that the error is fixed. The patch was submitted into rvc-dev and is already in rvc-dev-plus-aosp (patch in in ag/11923559, revert skipped in ag/12072199). A follow-up will remove the unused services.net-module-wifi target. Test: originally tested in aosp/1324109 Test: m; manual: flashed, wifi and telephony working Test: atest NetworkStackCoverageTests Change-Id: I1074eedb0b0f156a1135e11210ec102de15ea674 Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
2020-07-02Revert "Move Inet[4]AddressUtils to libs/net"Chalard Jean
This reverts commit 57d68e3c55176083ba40947be8f335534d958006. Reason for revert: Breaks the build b/160390899 Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44
2020-07-02Move Inet[4]AddressUtils to libs/netRemi NGUYEN VAN
The classes should not be picked up from frameworks/base, as they are part of several mainline modules. Also refine comments in DhcpResults following feedback in previous change. (cherry-pick from internal branch skipping wifi classes; no other conflict) Bug: 151052811 Test: m; manual: flashed, wifi and telephony working Test: atest NetworkStackCoverageTests Merged-In: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-12Move Inet[4]AddressUtils to libs/netRemi NGUYEN VAN
The classes should not be picked up from frameworks/base, as they are part of several mainline modules. Also refine comments in DhcpResults following feedback in previous change. Bug: 151052811 Test: m; manual: flashed, wifi and telephony working Test: atest NetworkStackCoverageTests Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-11Remove IpClientCallbacks dependency on DhcpResultsRemi NGUYEN VAN
DhcpResults should only be used inside the NetworkStack: modules are expected to use DhcpResultsParcelable instead. Add a compat utility so current users of DhcpResults can do the conversion (wifi in AOSP in particular). The utility can be removed when changes to stop depending on DhcpResults are merged in AOSP. Bug: 149403767 Test: built, flashed, WiFi working Original-Change: https://android-review.googlesource.com/1277608 Merged-In: I5b85c1a541ecdf9dd3e9403b9fb1c2b5aba98dd8 Change-Id: I5b85c1a541ecdf9dd3e9403b9fb1c2b5aba98dd8
2020-06-09Remove IpClientCallbacks dependency on DhcpResultsRemi NGUYEN VAN
DhcpResults should only be used inside the NetworkStack: modules are expected to use DhcpResultsParcelable instead. Add a compat utility so current users of DhcpResults can do the conversion (wifi in AOSP in particular). The utility can be removed when changes to stop depending on DhcpResults are merged in AOSP. Bug: 149403767 Test: built, flashed, WiFi working Change-Id: I5b85c1a541ecdf9dd3e9403b9fb1c2b5aba98dd8
2020-04-02Add new method to update Layer2 information when L2 roaming happens.Xiao Ma
Bug: 131797393 Test: atest FrameworksNetTests Merged-In: I171bd5e22b5afd5c62029392af627d7bdfe32161 (cherry picked from commit 1083b27f7c30d6ccfd8a6f4402788b4b4789ef60) Change-Id: I23019658acfec18d342d38e8c189dcfaeb7b6f4a
2020-03-31Merge "Add new method to update Layer2 information when L2 roaming happens."Xiao Ma
2020-03-12services.net: Use the new ModuleNetworkStackClientRoshan Pius
Use the new ModuleNetworkStackClient to retrieve instances IpMemoryStore & IpClient. Bug: 145825329 Test: Compiles Change-Id: I065525fdbd64b9509ef0f47bb35954d267c65fd2 Merged-In: I065525fdbd64b9509ef0f47bb35954d267c65fd2
2020-03-12services.net: Use the new ModuleNetworkStackClientRoshan Pius
Use the new ModuleNetworkStackClient to retrieve instances IpMemoryStore & IpClient. Bug: 145825329 Test: Compiles Change-Id: I065525fdbd64b9509ef0f47bb35954d267c65fd2
2020-03-05Add new method to update Layer2 information when L2 roaming happens.Xiao Ma
Bug: 131797393 Test: atest FrameworksNetTests Change-Id: I72f2752f73be9df693996c4b23115937c4bcadb3
2020-01-29Add implementation of getInterfaceHash()Paul Trautrim
Exempt-From-Owner-Approval: cherry-pick from internal Bug: 136065010 Test: m Change-Id: I314f19aeca82cc8653eab71c9526ea7a208e6b50 Merged-In: I314f19aeca82cc8653eab71c9526ea7a208e6b50
2020-01-28Add implementation of getInterfaceHash()Paul Trautrim
Bug: 136065010 Test: m Change-Id: I314f19aeca82cc8653eab71c9526ea7a208e6b50
2020-01-10Add IpClientCallbacks.onNewDhcpResults(DhcpResultsParcelable)Chiachang Wang
Add new callback to replace old one. Target to remove onNewDhcpResults(Dhcpresults). The previous onNewDhcpResults callback will be removed after clients are migrated. Bug: 135998869 Test: build Test: atest FrameworksNetTests NetworkStackTests Change-Id: Id6c72228560dc3c387755c27adacaa9aece6309a
2019-12-17Add services-stubs for in-process APIs in services.jarJiyong Park
services-stubs is a stubs library for services.jar. It provides the in-process APIs that's available inside the system server process running services.jar. Currently, all APIs in the jar are hidden by annotating com.android.server package with @android.annotation.Hide. To add some APIs, 1) remove package-info.java for com.android.server 2) add package-info.java for other sub packages 3) annotate them with @android.annotation.Hide except for the package where the newly added APIs are in This change also added android.annotation.Hide class which can be used to hide an API without using the @hide javadoc tag. This opens up the possibility of running metalava over the compiled jar, which is expected to be much faster than when ran with source files. Bug: 139391334 Test: m Test: m services-stubs Exempt-From-Owner-Approval: cherry-pick from internal Merged-In: I027b8a22b3e7533f6203aabb9dc3f690e4e842a6 (cherry picked from commit abc72e45c647d6f617ce90b7a5d4a3121c0aa87d) Change-Id: I027b8a22b3e7533f6203aabb9dc3f690e4e842a6
2019-12-03Add DHCP Rapid Commit FILS support.Xiao Ma
Bug: 140223017 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Test: manual Change-Id: Ia73e92058f30acee16eff27e05ec53d2eb0e7110
2019-11-20Move shared packages to NetworkStack projectRemi NGUYEN VAN
Both were already statically linked both in the NetworkStack module and the framework, so this change only reorganizes the file locations. It makes more sense to have the library files in the NetworkStack module folder, as changes to these files will be released with the same cadence as the module, not the framework. Bug: 139106271 Test: built, flashed, WiFi working Change-Id: Ifaa882b53d1084ef32db6b27d35b56eb226c468f
2019-10-24[Tether03] Migrate IpServer into modulemarkchien
Add IpServer which is used to serve ip configuration, dhcp, dns proxy and nat for downstream interface. Bug: 136040414 Test: -build, flash, boot -atest TetheringTests -atest FrameworksNetTests Change-Id: I23652ae0b9509abe7d38da96d523eb22ab00a343
2019-10-18Merge "p2p: mirgrate p2p into tethering modes"Jimmy Chen
2019-10-08p2p: mirgrate p2p into tethering modesJimmy Chen
Bug: 137602441 Bug: 139783330 Test: atest FrameworksNetTests Test: atest FrameworksWifiTests Test: CtsVerifier - Wi-Fi Direct Test: Enable hotspot when P2P GO is running * P2P GO is terminated * hotspot is running Test: Enable P2P GO when hotspot is running * hotspot is intact * P2P GO could not be launched Test: Verify P2P functions with legacy WifiP2pService Change-Id: Icb2e2b106ae52b19af29b7a1ebc55d3cdf80db9c
2019-09-05Move NetworkStack AIDLs to NetworkStack folderRemi NGUYEN VAN
The AIDLs and ipmemorystore-client were already statically linked libraries, so their location in the source tree does not change anything (they were already built into the NetworkStack module and the framework). It makes more sense to have them in the NetworkStack module folder however, as changes to these files will be released with the same cadence as the module, not the framework. Bug: 139106271 Test: built, flashed, WiFi working Change-Id: I886acae850a5e8a9a7bc3ca8aac8690d681ca2cd
2019-06-24Fix leak of DhcpServer on tethering stop errorRemi NGUYEN VAN
Tactical, minimal fix to make sure the DhcpServer is stopped when disabling tethering. The current code may throw if the interface is gone when calling mNMService.setInterfaceConfig() on teardown. Make sure DHCP is stopped regardless of what happens. A longer term fix will be to figure out the right flow to teardown the interface and avoid errors on setInterfaceConfig(). Bug: 124520692 Test: Manual: no more socket leaked when stopping USB tethering Change-Id: Ib87d89a2e5fdb64b8f3dfae48d82c970f3ae6161
2019-06-04Fix cannot create Nat-T keepalive on mobile datajunyulai
Currently phone process fail to unparcel NattKeepalivePacketData since it is not in framework. Moves NattKeepalivePacketData to framework to make it can be utilized by telephony. This change also removes the error feedback triggered by calling add keepalive packet filter to an unsupported network agent. This is misinterpreted by KeepaliveTracker that start keepalive is failing. Bug: 134048171 Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony 2. atest android.net.cts.ConnectivityManagerTest 3. atest FrameworksNetTests 4. atest FrameworksTelephonyTests Change-Id: If630d5b339aa722717258c721daa8ead8c431e2d
2019-05-09Add a simple wrapper for IpClient.Lorenzo Colitti
This takes care of boilerplate tasks such as clearing calling identity, catching RemoteExceptions, and converting to stable parcelable objects. Bug: 131206163 Test: builds, boots, wifi works Test: atest FrameworksNetTests Change-Id: I7cbe5fc105503d0983cba2bf77fb0097bd20d9ba
2019-04-29Support adding NATT keepalive packet filterAaron Huang
Support adding NATT keepalive packet filter to APF filter. Generating APF program will be addressed in another CL. Bug: 33530442 Test: - atest NetworkStackTests - atest FrameworksNetTests Change-Id: I4961d5da343d8700600269632787c28112f0f9f1
2019-04-23Freeze the networkstack-aidl-interfaces interfaceRemi NGUYEN VAN
This freezes the interface as of the latest beta build, not the tip of tree. IIpClient#setL2KeyAndGroupHint is not in the frozen definition in particular. Generated with: m networkstack-aidl-interfaces-freeze-api \ ipmemorystore-aidl-interfaces-freeze-api Test: flashed, booted, WiFi and captive portal working Bug: 128803828 Change-Id: Ideabe73fc93bbefca2d624ee9ca190cf31419424
2019-04-17Move TrafficStats tags for the network stack constantsChalard Jean
As per API council feedback, these constants should live in a place that is private to the network stack, only with a range defined in system API. Bug: 129433383 Test: m Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086 Merged-In: I4882686a86e7c6d42f4b0619b921d02619ed6d4c Merged-In: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-05Move the latest AIDL update to the bottomChalard Jean
Test: m Change-Id: I3818eb8abb5a410663a6da633d5516cef4ecad8e
2019-04-05Add a mechanism to pass the L2Key and group hint to IpClientChalard Jean
Test: IpClientTest Change-Id: I399b20ce29a385a74971b7a7248a48cb4d66deb6
2019-03-22Merge changes I2e8c2ad9,Ic4f4c7d2Lorenzo Colitti
* changes: Move the networkstack AIDL interfaces to services/net. Remove the framework dependency on networkstack-aidl-framework.
2019-03-21Move the networkstack AIDL interfaces to services/net.Lorenzo Colitti
Nothing in the framework uses these, so there is no point in having the build be in frameworks/base/Android.bp. Fix: 128804404 Test: builds, boots Test: atest FrameworksNetTests Change-Id: I2e8c2ad9ea8bfcd3668a83e4c044de10389a8a22
2019-03-21Fix Automated API Review issues.paulhu
1. Some API's argument/return value must be marked either @NonNull or @Nullable. 2. Change some system APIs to public APIs. 3. Modify the method name Bug: 126700123 Bug: 126702339 Bug: 126699682 Bug: 118296575 Bug: 126699216 Bug: 126699675 Bug: 126699429 Bug: 126699193 Bug: 123586045 Test: atest FrameworksNetTests Change-Id: Iaa2832cdcf83758ed0fec81b954a0c63bc5a7bf6
2019-03-16Remove aidl wrappers for framework parcelablesRemi NGUYEN VAN
The new @JavaOnlyStableParcelable annotation allows using the framework parcelables directly, which removes a lot of boilerplate. Includes new copy constructors for IpPrefix and LinkAddress so they can be copied easily as-is into parcelables. Test: atest FrameworksNetTests Test: booted, WiFi works Bug: 126477266 Change-Id: Icac8afe498d0b5ebf9a0d0b9eceb14d64a29b381
2019-03-08IPv6: enable IPv6 link local routing for local networkJimmy Chen
IPv6 link local is an automatically configured address. The routing should be activated regardless of the DHCP service. Bug: 126063997 Test: Unit tests - atest FrameworksNetTests Test: Unit tests - atest FrameworksWifiTests Test: * DUT1 enables hotspot * DUT2 associates to DUT1 * use ping6 to verify the local link on both side Test: * DUT1 creates a P2P group * DUT2 joins this group as a legacy client * use ping6 to verify the local link on both side Change-Id: I102bf29e8da14808097e43c840d74d41b6b3758f
2019-02-22Merge "Fix RouterAdvertisementDaemon thread leakage problem"Lorenzo Colitti
2019-02-21Fix RouterAdvertisementDaemon thread leakage problemIris Chang
[Prerequisites] Default value of mRaLength is 0, so getNextMulticastTransmitDelaySec() returns DAY_IN_SECONDS (1 day) in this scenario. [Issue Details] Examine MulticastTransmitter.run() for detail: 676 public void run() { 677 while (isSocketValid()) { 678 try { 679 Thread.sleep(getNextMulticastTransmitDelayMs()); Invoke RouterAdvertisementDaemon.stop() here. Since MulticastTransmitter is in a sleep, this thread will pend 1 day until the next check of isSocketValid() triggers the quit action, which causes thread leakage during Wi-Fi Hotspot on/off stress test. 680 } catch (InterruptedException ignored) { [Solution] Invoke maybeNotifyMulticastTransmitter() after closing socket in RouterAdvertisementDaemon.stop() to interrupt MulticastTransmitter from waiting. Bug: 123491872 Test: FrameworksNetTests adb shell am instrument -w com.android.frameworks.tests.net Test: CTS - CtsNetTestCases ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m CtsNetTestCases Test: CTS - CtsNetTestCasesLegacyApi22 ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m CtsNetTestCasesLegacyApi22 Test: CTS - CtsNetTestCasesLegacyPermission22 ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m CtsNetTestCasesLegacyPermission22 Change-Id: I0c0d63b43a88e1026aaecfc1853309ad63f62268
2019-02-15Fix framework and NetworkStack classes conflictsRemi NGUYEN VAN
Classes that are used in framework.jar cannot be linked in NetworkStack, as the framework takes precedence in the classpath. This prevents the networkstack from using these classes due to the hidden API usage detection. Do the following: - jarjar any shared source file between framework and NetworkStack, so the version in the NetworkStack uses a different package. - Move any shared class not used in the NetworkStack to services.net The CL uses jarjar on the app copy and not the framework classes, as the framework cannot be updated without an OTA, and non-network stack specific classes should not be renamed because of the network stack. Test: atest FrameworksNetTests NetworkStackTests Test: flashed svelte build, WiFi works Bug: 124033493 Change-Id: I85d888b756adc28c36638913632bfdfdbf0e0486
2019-02-15Move NetworkStack to services.netRemi NGUYEN VAN
NetworkStack is only used in services.net or clients of services.net. It cannot stay in framework.jar because it needs to depend on AIDL interfaces, which would conflict with app implementations if they were in framework.jar. Test: atest FrameworksNetTests NetworkStackTests Bug: 124033493 Change-Id: Ib1d08a3669983640119d008db7e2990fa798724f Merged-In: I501b125a388c1100c2182bde4670944c2f0d7a02
2019-01-30Remove last NetworkStack usage of hidden APIsRemi NGUYEN VAN
Includes various small changes to stop using hidden APIs Test: make NetworkStack Test: flashed, booted, WiFi and tethering working Bug: 112869080 Change-Id: Id2830795a444f484b377ed6437435a1cd833697a
2019-01-25Remove IpClient wrapperRemi NGUYEN VAN
The wrapper was useful to help clients migrate out of the old API, but all clients are now migrated. It also conflicts with IpClient in the NetworkStack on Go devices. Test: Flashed, booted, WiFI works Bug: 123371264 Change-Id: Ibf04ad9371a07d2c66c478547539ba41c540116f
2019-01-23Create a wrapper for IpClientRemi NGUYEN VAN
The wrapper allows migrating clients of the IpClient in the NetworkStack independently. Test: atest FrameworksNetTests NetworkStackTests FrameworksWifiTests Bug: 112869080 Change-Id: I1250730c07166298bee2816f05351ba95416994a
2019-01-23Move IpClient to NetworkStackRemi NGUYEN VAN
Test: atest FrameworksNetTests NetworkStackTests Bug: b/112869080 Change-Id: I7d00848c052382cd1b6ce458868bed6a1e9e8ec5
2019-01-22Add getAvoidBadWifi system APIRemi NGUYEN VAN
This helps remove the dependency on MultinetworkPolicyTracker from IpClient. Test: atest FrameworksNetTests NetworkStackTests Bug: 112869080 Change-Id: If56791dbed564772f25a859f301b8b52d84e38a3
2019-01-22Merge "Remove InterfaceController dependency on NMS"Remi NGUYEN VAN
2019-01-22Merge changes Ieef54d84,Ica3e88c2Remi NGUYEN VAN
* changes: Remove NetworkStack dependencies on hidden members Expose ServiceSpecificException as @SystemApi.
2019-01-22Merge "Add SystemApi utility for raw sockets."Remi NGUYEN VAN