summaryrefslogtreecommitdiff
path: root/Tethering/src/android/net/util
Commit message (Collapse)AuthorAgeFilesLines
* Rename tethering util folder and its package namemarkchien2021-11-095-450/+0
| | | | | | | | | | | | | | Move tethering util files from android.net.util into com.android.networkstack.tethering.util. The goal is move all of tethering internal files into its own namespace com.android.networkstack.tethering.util. Bug: 205088391 Test: atest TetheringTests atest CtsTetheringTest atest TetheringPrivilegedTests Change-Id: I6559fb4f873b3cad5b210b10e49df1b6c6914a70
* Allow callers of startTethering to choose local-only mode.Lorenzo Colitti2021-04-191-1/+2
| | | | | | | | | | | This is useful for OEMs that want to use RNDIS or NCM as a local-only link that is directly connected to some other host. This can be used to implement USB tethering using NCM, which currently only supports local-only mode. Bug: 175090447 Test: TetheringIntegrationTests:EthernetTetheringTest#testLocalOnlyTethering Change-Id: I0ffaa46e4640e5b235340a15d25909106ceb0c07
* Load JNI in all classes that have native methods.Lorenzo Colitti2021-02-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The tethering module uses JNI in various classes, but only calls System.loadLibrary in TetheringService#makeTethering. This means that: 1. Any test that uses a class that uses JNI must load the library itself. 2. Any code that runs before TetheringService#makeTethering could potentially crash if it uses JNI. We may never have such code though. Instead, make every class that has a native method load the JNI library itself at static initialization time. This guarantees that the class will have the JNI code available in any context (production, test, etc.) System.loadLibrary is documented not to do anything if called more than once with the same library name: https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#loadLibrary(java.lang.String) and the implementation has a lock so it is safe to call from multiple threads concurrently. Test: builds, boots, tethering starts Test: atest TetheringCoverageTests Change-Id: I9c0147ae9a28877f416aaff387b426d304ae552d
* [NFCT.TETHER.3] Migrate tetherOffloadGetStats from netd to mainlineHungming Chen2021-01-151-0/+9
| | | | | | | A preparation for updating BPF map in mainline module. Test: TetheringCoverageTests Change-Id: Ie73f7b4d9b191e62cfdfe2cfa3360cc7210f17e8
* Move BaseNetdUnsolicitedEventListener to frameworks/libs/netlucaslin2021-01-081-75/+0
| | | | | | | | | | | Move BaseNetdUnsolicitedEventListener to frameworks/libs/net and create a new library - netd-client for using. Also remove netd_aidl_interface-unstable-java since netd-client links to the stable one. Bug: 174837473 Test: Manual test and check the log. Change-Id: Id65142b8c13a6cccbfe387d4ab757967497546e6
* tethering: DAD Proxy DaemonTyler Wear2020-09-221-0/+33
| | | | | | | DAD proxy daemon responsible for forwarding NS/NA between tethered iface and upstream iface. Change-Id: I2e58e10e7fa7dba6a6f63ad03b000549f3afc37e
* Update language to comply with Android's inclusive language guidanceChiachang Wang2020-07-291-1/+1
| | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference. Test: m ; atest TetheringTests Bug: 161896447 Change-Id: Idc58697c72fb00896bee00185fefc50c1a24dd35
* [BOT.1] Add a class ForwardedStats in TetheringUtilsHungming Chen2020-05-291-1/+76
| | | | | | | | Used to record offload transmitted/received forwarded bytes/packets. Bug: 150736748 Test: new test BpfTetheringCoordinatorTest Change-Id: Ie8725f95c3ddd5fb3811d479de32d2c1f7dcb493
* Support static address configurationmarkchien2020-03-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Application can specify static ipv4 server and client address to setup tethering and this is one shot configuration. Tethering service would not save the configuration and the configuration would be reset when tethering stop or start failure. When startTethering callback fired, it just mean tethering is requested successful. Therefore, callers may call startTethering again if startTethering successful but do not receive following tethering active notification for a while. Tethering service never actually does anything synchronously when startTethering is called: -startProvisioningIfNeeded just posts a message to the handler thread. -enableTetheringInternal doesn't do anything synchronously, it just asks the downstreams to get their interfaces ready and waits for callbacks. If tethering is already enabled with a different request, tethering would be disabled and re-enabled. Bug: 141256482 Test: -build, flash, boot -atest TetheringTests -atest CtsTetheringTest Change-Id: I0399917e7cefa1547d617e688225544c4fc1a231
* Move offload config hidl usage from native to javamarkchien2020-02-101-8/+0
| | | | | | | | | | | | TetheringUtil JNI is too big that it statically linking hidl and its dependency library. To remove these static libraries, calling hidl in java directly instead of using JNI. Bug: 148984662 Test: -build, flash, boot -manually ON/OFF tethering Change-Id: Id5a9759eb453fddaf0c3b7a31da17224e35e963e
* Add implementation of getInterfaceHash()Paul Trautrim2020-01-291-0/+5
| | | | | | | | Exempt-From-Owner-Approval: cherry-pick from internal Bug: 136065010 Test: m Change-Id: I314f19aeca82cc8653eab71c9526ea7a208e6b50 Merged-In: I314f19aeca82cc8653eab71c9526ea7a208e6b50
* Fix some @hide usage in Tetheringmarkchien2020-01-072-0/+32
| | | | | | | | | | Using alternative way to replace some @hide API. Bug: 144814072 Test: build, flash, boot atest TetheringTests Change-Id: I1e12d69db1ad91dff553e142e17c6a70808e1639
* Change tetheroffloadjni to tetheringutilsjnimarkchien2020-01-071-0/+42
| | | | | | | | | | | | Rename tetheroffloadjni to tetheringutilsjni and move setupRaSocket jni method from NetUtils into tetheringutilsjni. Bug: 143195885 Test: -build, flash, boot -atest TetheringTests -Off/On hotspot with ipv6 upstream Change-Id: Ib68eb6999bbe2d3ca97e68712f22b105311ef800
* [Tether07] Migrate Tethering into modulemarkchien2019-11-302-0/+176
| | | | | | | | | | | | | | | | | | | | Now tethering would be run in dedicated service. TetheringManager is the interface used to communicate with TetheringService. The new call flow would be: ConnectivityManager -> ConnectivityService -> TetheringManager -> TetheringService. Note: the return value of #tether(), #untether() and #setUsbTethering() APIs would always be no error. Client can use #getLastTetherError() or #getTetheredIfaces or listen tether state change to check status of corresponding interface. Bug: 136040414 Bug: 144742179 Test: -build, flash, boot -atest TetheringTests -atest FrameworksNetTests Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3 Merged-In: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
* [Tether05] Migrate UpstreamNetworkMonitor into modulemarkchien2019-10-301-0/+88
| | | | | | | | | Bug: 136040414 Test: -build, flash, boot -atest TetheringTests -atest FrameworksNetTests Change-Id: Ic1d9deecb66aaba0a4264a57f2e6579ea491ac9b
* [Tether03] Migrate IpServer into modulemarkchien2019-10-241-0/+52
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