Commit Graph

2102 Commits

Author SHA1 Message Date
Treehugger Robot
124a10d374 Merge "Add tethering IPv4 UDP forwarding test" am: 76bc75f0a2 am: 8003834727 am: 3b8bd6eca7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1843121

Change-Id: I8d73c62fb77ebd10135b8e1ef2fa43b683d87afa
2022-01-03 14:11:54 +00:00
Hungming Chen
bb8e9dae7f Add tethering IPv4 UDP forwarding test
This is a preparation for testing IPv4 BPF offload.
- Add an ARP responder.
- Add a basic UDP forwarding test.

Test: atest EthernetTetheringTest
Change-Id: I720a5a2c4b97493eb6a5570cecd73dfc1eabf5cd
2022-01-03 07:16:16 +00:00
Maciej Żenczykowski
cad5920d8c Merge "Add bpf jni into connectivity module" am: 577c46a185 am: 74b4a89337 am: bc13d619fb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1888502

Change-Id: Ib2410bcc02d1c024d9f2e6ba73e4fd730e497c26
2021-12-23 19:40:50 +00:00
Maciej Żenczykowski
577c46a185 Merge "Add bpf jni into connectivity module" 2021-12-23 18:44:48 +00:00
markchien
8fb75e3916 Add bpf jni into connectivity module
This is the preparing CL for connectivity module to use bpf.

Bug: 179733303
Bug: 205088391
Test: atest ConnectivityCoverageTests
Change-Id: Ibe49d7f671b5050461e2c63c080d9457ad76c26c
2021-12-23 14:33:01 +08:00
Treehugger Robot
231485f7f0 Merge "Support testing upload/download packets" am: 139f43509e am: 911bd90d33 am: 8d8cf85d5c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1903463

Change-Id: I1664ffa4b8a3ecdfc7177c198636cafb13548b24
2021-12-23 05:22:42 +00:00
TreeHugger Robot
40f9455d6d Merge "Dexopt service-connectivity." into stage-aosp-master am: 78a1e45e95 am: 7d1f3e501f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/16521718

Change-Id: I875edcd01e6e6ae43d60f3000c9a523a0710cae5
2021-12-23 04:42:16 +00:00
Treehugger Robot
139f43509e Merge "Support testing upload/download packets" 2021-12-23 04:22:59 +00:00
Jiakai Zhang
ce3bd3a768 Dexopt service-connectivity.
`service-connectivity` is a jar that system_server loads dynamically.
Such jars can be dexopted now. This CL adds `service-connectivity` to a
`systemserverclasspath_fragment`, which does not actually add the jar to
the classpath, but tells the build system to dexopt it.

NOTE: The corresponding `exported_systemserverclasspath_fragments` needs
to be added to the `prebuilt_apex` once a new prebuilt is dropped.

Bug: 203198541
Test: m com.android.tethering
Change-Id: I53745baaf1bc7142cc12a1e6cd8d84c9b338ac9d
Merged-In: I5a9b68172c38dd0b9f7a8f88bee738043ed3a96f
(cherry picked from commit 9ecc66ddba)
2021-12-22 19:36:39 +00:00
Jiakai Zhang
86c139aedb Dexopt service-connectivity.
`service-connectivity` is a jar that system_server loads dynamically.
Such jars can be dexopted now. This CL adds `service-connectivity` to a
`systemserverclasspath_fragment`, which does not actually add the jar to
the classpath, but tells the build system to dexopt it.

NOTE: The corresponding `exported_systemserverclasspath_fragments` needs
to be added to the `prebuilt_apex` once a new prebuilt is dropped.

Bug: 203198541
Test: m com.android.tethering
Change-Id: I53745baaf1bc7142cc12a1e6cd8d84c9b338ac9d
Merged-In: I53745baaf1bc7142cc12a1e6cd8d84c9b338ac9d
Merged-In: I9a009493fe0482967ab1f92516514715cfd457d6
2021-12-21 09:36:33 +00:00
Mark Chien
1290047da0 Merge "Reuse BluetoothPan object and use it under tethering handler thread" am: 5c4010e196 am: b823c10754 am: ba1285c1d1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908683

Change-Id: I7fcd2c91384546b87a01e536470e709381aa6e19
2021-12-16 09:33:37 +00:00
markchien
1e020903cc Reuse BluetoothPan object and use it under tethering handler thread
1. Instead of create BluetoothPan every time when tethering need to use
it, store it with mBluetoothPan and resue it.
2. Call BluetoothPan function under tethering handler thread.

Bug: 190438212
Test: atest TetheringTests

Change-Id: I40adece59960ec44a02dc438d6bd95483a0788af
2021-12-16 12:12:07 +08:00
Chiachang Wang
8e4530c439 Merge "Enable strict_updatability_linting in connectivity src" am: 81bc609550 am: e5c363a3bd am: 6a1c5dc295
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1902533

Change-Id: I30bcf47dc757cd3fa8672aa9bc775ba612daa65a
2021-12-08 03:29:53 +00:00
Chiachang Wang
81bc609550 Merge "Enable strict_updatability_linting in connectivity src" 2021-12-08 02:36:16 +00:00
Ken Chen
81b77bd051 Merge "[NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers" am: 5fabfd8dd0 am: 47790a1f63 am: ca19ff4dc9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1870273

Change-Id: I5d079078cc963eb59f7136c8b59fb13db6cfd52d
2021-12-02 14:00:25 +00:00
Ken Chen
5fabfd8dd0 Merge "[NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers" 2021-12-02 12:54:01 +00:00
markchien
13e5a48cb7 Support testing upload/download packets
This is a preparing CL to test the packets sent from clients and the
packets replied from remote side.

Bug: 183166581
Test: atest EthernetTetheringTest
Change-Id: I898de024c0d9ecf13d81023035242c4abf856702
2021-11-29 18:02:24 +08:00
Chiachang Wang
3bc5276568 Enable strict_updatability_linting in connectivity src
Bug: 188851968
Test: m lint-check
Change-Id: I3cd06ea16f05cb37d9369a48dd0285d8239fd764
2021-11-26 10:31:58 +08:00
Treehugger Robot
56abd1b417 Merge "better compatibility for unusual Qualcomm/Mediatek cellular ARPHRD_* values" am: edfb9232f0 am: 40cc2bdcf6 am: b207958f45
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1900813

Change-Id: I89becc7282d81876a1c881236f315cdefe4e5580
2021-11-26 02:10:48 +00:00
Treehugger Robot
edfb9232f0 Merge "better compatibility for unusual Qualcomm/Mediatek cellular ARPHRD_* values" 2021-11-26 01:25:13 +00:00
Maciej Żenczykowski
23ff703f7a better compatibility for unusual Qualcomm/Mediatek cellular ARPHRD_* values
see kernel/private/wembley/+/refs/heads/tm-4.19/include/uapi/linux/if_arp.h
which has #define ARPHRD_PUREIP 520 (and is a Mediatek based device)

or Qualcomm based Pixel 3 and older kernels (<=4.9) which #define ARPHRD_RAWIP 530
(unlike Pixel 4/5 which are 4.14/4.19 and use the upstream ARPHRD_RAWIP of 519)

We stop supporting 520/530 starting with 5.11+ since those as GKI 2.0 only kernels
cannot be using non-upstream-ed constants (btw. this is probably true for 5.10-S
as well, but let's play it safe).  For pre-5.11 we're lucky because even now
(with 5.15 released) upstream has yet to define an ARPHRD_* for either one of
520 or 530, so there's no harm in 'squatting' on this unused space.

This approach also means there's absolutely no change in behaviour on
pre-launch-T devices, since they all are at most running 5.10 kernels.

We'll be able to get rid of this code in the far future once we stop shipping
mainline tethering updates to pre-5.10 Mediatek or pre-4.14 Qualcomm devices.
This will likely be many years.

Test: TreeHugger
Bug: 207057951
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I767b5fc56bc826e088507aea8ae7a30aa8aa424a
2021-11-25 11:03:58 +00:00
Mark Chien
be6dbdd299 Merge "Add defaults to enable/disable connectivity/tethering next" am: 0f56af4162 am: 000aaba95d am: a024dbebf1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895326

Change-Id: I89dcfb0881ed144434d0c8a796c47dcffbc6e00e
2021-11-24 07:53:31 +00:00
Mark Chien
0f56af4162 Merge "Add defaults to enable/disable connectivity/tethering next" 2021-11-24 07:05:00 +00:00
markchien
598a75ba8c Add defaults to enable/disable connectivity/tethering next
The defaults can be used to enable/disable connectivity next targets
depending on the branch, while minimizing merge conflicts.

The "next" target may use unstable APIs. It need to be disabled in the
branch which only have the last stable SDK available.

Also correct TetheringTestsLatestSdkLib which should use stable API.

Test: TH
Change-Id: I00d91bbd513277c1cedf67d18ac9f56cc4037309
2021-11-24 12:20:23 +08:00
Treehugger Robot
a4feab485a Merge "isEthernet() - ARPHRD_PPP does not require ethernet headers" am: 73b42b0f95 am: 3046820011 am: ca8500dcc2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1897432

Change-Id: I433ad51a05dbb11c61a63c4a4474e7b85d0171ec
2021-11-22 09:27:17 +00:00
Ken Chen
bb57fa9eec [NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers
The folder is currently used by tether offload only. Because we will
move netd.c and clatd.c to it, the folder should be moved to the upper
tier.

Also, rename bpf_tethering_headers to bpf_connectivity_headers so that
other connectivity code besides to tethering are justified to use it.

Bug: 202086915
Test: atest FrameworksNetTests
Change-Id: I95943c6e909f1fdca12604ef0c55d67c39ca686b
2021-11-20 18:31:08 +08:00
Maciej Żenczykowski
c8c36b9407 isEthernet() - ARPHRD_PPP does not require ethernet headers
(this is required to make ipv6 tethering work with at least S.LSI modems)

Test: TreeHugger
Bug: 207057951
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic178db928ec7f74f69d7d4739b3b8439ff026625
2021-11-18 23:31:56 -08:00
Maciej Żenczykowski
93873d956d explicitly specify that offload.o & test.o bpf programs are S+ am: a457bf7ea8 am: 961b290878 am: a93046a9d9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895606

Change-Id: I91436e8303e672455c11160390bda6597167717e
2021-11-18 05:51:39 +00:00
Maciej Żenczykowski
a457bf7ea8 explicitly specify that offload.o & test.o bpf programs are S+
Note: due to the release version of the Connectivity/Tethering mainline
module being built from sc-mainline-prod, this won't actually take effect
until system/bpf bpfloader at version 0.6+ is merged in to that tree.

This doesn't really matter, since currently things default to v0.0+.
But there is no mainline module updatable pre-v0.2 supported OS
anyway. BpfLoader v0.2 is what shipped in Android S Beta 4 through
Android S Final.

Before S there simply was no bpfloader support for mainline updatable
ebpf code, while S Beta 3 and earlier shipped v0.0 which is badly
incompatible with even the current version of the mainline module.

Additionally v0.0 doesn't even parse this field, while v0.1 which
does was very short lived [~3 days] and can thus be utterly ignored.

As such this change is effectively a no-op, and even post merge
of bpfloader v0.6+ into sc-mainline-prod will still be effectively
a no-op.

So why do it? I want to explicitly document that these programs are S+,
so that I can change the default in the future to be T+.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e5d0124700c7045abe16b1f3b504c9e88054ff2
2021-11-17 12:04:44 -08:00
Maciej Żenczykowski
83231e49df Merge changes from topics "rename-libbpfmapjni", "rename-libtetherutiljni" am: ff81692077 am: 694ecd1c53 am: 0a34b679f4 am: d8594a51fa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1886108

Change-Id: I4b623e87cbb13b797ea2e029250f0204e426175d
2021-11-11 14:31:21 +00:00
markchien
6c1659d26e Rename tethering jni and get the jni by its package name am: f967b11087 am: de93cf9aba am: 6d52305aa9 am: 7e7b752079
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1885530

Change-Id: Ie7aa98d74332eac0c38b6378764523574e84e650
2021-11-11 14:31:18 +00:00
markchien
de93cf9aba Rename tethering jni and get the jni by its package name am: f967b11087
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1885530

Change-Id: Icc18029f126a4845d6d2071d9e36458cbab4c313
2021-11-11 13:42:39 +00:00
Maciej Żenczykowski
ff81692077 Merge changes from topics "rename-libbpfmapjni", "rename-libtetherutiljni"
* changes:
  Rename libbpfmapjni and include bpf common util library
  Rename tethering jni and get the jni by its package name
2021-11-11 13:19:48 +00:00
markchien
782a56809b Rename libbpfmapjni and include bpf common util library
1. libbpfmapjni.so is rename to libnet_utils_device_common_bpf.so
2. net-utils-device-common-bpf.jar is separated from
   net-utils-device-common-netlink.jar

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests

Change-Id: If59b35b3429ebd597c18678499ff458183f89026
2021-11-11 13:49:15 +08:00
Mark Chien
52192a3b80 Merge "Rename tethering util folder and its package name" am: ea0cfd1897 am: e4235b83be am: 1738c7fda3 am: 1329691f70
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1879620

Change-Id: I6ed87541297b86ab629a1adc5e9bc8eefdc7dcbd
2021-11-10 07:12:37 +00:00
Mark Chien
ea0cfd1897 Merge "Rename tethering util folder and its package name" 2021-11-10 06:08:28 +00:00
markchien
f967b11087 Rename tethering jni and get the jni by its package name
tetherutiljni is renamed to com_android_networkstack_tethering_jni_util

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests
Change-Id: Ifd1f4473625e33d3ebe190c9f8a2b5d54aa1ff49
2021-11-10 14:07:24 +08:00
Remi NGUYEN VAN
eb96b60f67 Don't rematch all requests when adding new ones am: 959d2cb6bd am: b92f209a18 am: 0cd2be4ab9 am: c32b4e9ef3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1784387

Change-Id: I83a8fffbc81531b64aa8d945e264ead373b9733a
2021-11-10 05:12:15 +00:00
markchien
d02f9af918 Rename tethering util folder and its package name
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
2021-11-09 17:02:47 +08:00
Treehugger Robot
f83c080ea8 Merge "Add TetheredInterface{Request, Callback} interface" am: 7269fb17fd am: 5b6e2b3509 am: 12f02fa941 am: 0287eafe07
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1873874

Change-Id: I34b9fae1da161ae3db5d22f56334ea7c9c3b9278
2021-11-08 10:48:13 +00:00
Remi NGUYEN VAN
959d2cb6bd Don't rematch all requests when adding new ones
With the network selection rewrite in S, rematching a single request can
now easily be done; this can be used as an optimization in
handleRegisterNetworkRequests to avoid rematching all requests when
registering a new one.

This can be disabled by a flag that is unset by default,
REMATCH_ALL_REQUESTS_ON_REGISTER.

Test: atest ConnectivityServiceTest
Change-Id: If76f79b41ac88863974f7025624667134bea2570
2021-11-08 19:17:57 +09:00
Treehugger Robot
7269fb17fd Merge "Add TetheredInterface{Request, Callback} interface" 2021-11-08 09:54:54 +00:00
markchien
48e271bdcb Add TetheredInterface{Request, Callback} interface
Define interfaces that match the signature of the existing
EthernetManager.TetheredInterfaceRequest and TetheredInterfaceCallback
classes and make EthernetManager.TetheredInterfaceRequest and
TetheredInterfaceCallback implement/subinterface these interfaces. The
new bluetooth API could also implement these interfaces to make API surface
consistent.

Test: TH would test the existing tests that use the subclass.
Bug: 190438212
Change-Id: I093972c111cb1d921076782492716d5a046be8fc
2021-11-08 16:44:34 +08:00
Mark Chien
8515d8dd93 Merge "Separate tethering build target to Tethering and TetheringNext" am: 7509c7a67e am: ab61c4e42f am: 006c3f1e5e am: 9ef86b385f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1870417

Change-Id: Icdaf76296fa816f3895f33bb69552343f66f2e06
2021-11-08 08:31:41 +00:00
Mark Chien
7509c7a67e Merge "Separate tethering build target to Tethering and TetheringNext" 2021-11-08 07:29:55 +00:00
Maciej Żenczykowski
cda87b3540 Merge "Fix TetheringPrivilegedTests crash" am: 4e141d9514 am: f1dfa0e50b am: fc829880c3 am: 4e5f843665
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1879622

Change-Id: Ic2c46a4328e728f2a62644ee43c0f9e415318d62
2021-11-04 12:01:46 +00:00
markchien
5a8c806e55 Separate tethering build target to Tethering and TetheringNext
To avoid much code diverge between aosp and its downstream, we need to
separate the build target which build with latest stable sdk in release
branch and build with unfreeze sdk in dev branch. So we could use new
API with APIshim in dev branch without impacting release branch.

BYPASS_INCLUSIVE_LANGUAGE_REASON=the wording is the file name of
existing file.
Bug: 204265450
Test: m
Change-Id: I949fd83b1eed7461e0b381193b190cf15080bc1b
2021-11-04 08:53:12 +00:00
markchien
45dc794fb4 Fix TetheringPrivilegedTests crash
After separat BpfMap to a library, its package name is jarjar to
com.android.network.stack.util*. Also jarjar BpfMap of
TetheringPrivilegedTests to fix crash in jni registered.

Bug: 179733303
Test: atest TetheringPrivilegedTests
Change-Id: Ia9bc819a44fe26bf2ff7a46351ea60f2eeb02933
2021-11-04 16:40:18 +08:00
Maciej Żenczykowski
3e07ceec22 Merge "bpfmap: Move to Common Location" am: bb4c6073ec am: 97ae1b7dd6 am: c7e9e6e94c am: 40b2ac21f3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1863313

Change-Id: Ib7e3251a3056e86307e469d1d6571ff0f965b7ea
2021-11-04 02:54:59 +00:00
Maciej Żenczykowski
bb4c6073ec Merge "bpfmap: Move to Common Location" 2021-11-04 01:50:15 +00:00