summaryrefslogtreecommitdiff
path: root/Tethering/src/android/net/util/TetheringUtils.java
Commit message (Collapse)AuthorAgeFilesLines
* Rename tethering util folder and its package namemarkchien2021-11-091-179/+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
* 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
* [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
* Fix some @hide usage in Tetheringmarkchien2020-01-071-0/+7
| | | | | | | | | | 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