Commit Graph

43645 Commits

Author SHA1 Message Date
Hungming Chen
6fb21144b8 [CLATJ#26] ClatCoordinator: reword clatd starting failure logging
Bug: 212345928
Test: build
Change-Id: Ie826477d27db26cc49d113ec8bfacaaa3006e26e
2022-01-26 12:23:45 +00:00
Hungming Chen
1ff914a543 [CLATJ#25] ClatCoordinator: stop clatd process gracefully
Send SIGTERM with timeout first, if fail, SIGKILL.

Bug: 212345928
Test: connect/disconnect to IPv6 only network and ping 8.8.8.8
      repeat 3 times
Change-Id: I5125a3ac7e8ab6d4e8ae7fc7134b8ac8e42ce5dd
2022-01-26 12:23:22 +00:00
Hungming Chen
358d582730 [CLATJ#24] ClatCoordinatorTest: add basic unit tests
Introduce ClatCoordinatorTest for unit tests of class ClatCoordinator.
Add the tests:
- testStartStopClatd
- testGetFwmark
- testAdjustMtu

Bug: 212345928
Test: atest FrameworksNetTests
Change-Id: I6908eac05b14077b450d51e1432d340c8a247eb1
2022-01-25 20:32:25 +08:00
Hungming Chen
d7b63f8f93 [CLATJ#23] Close the file descriptor manually
ParcelFileDescriptor rely on garbage collection to close handler.
When there is any error during starting clat or quick on/off
IPv6 only network, the file descriptor may not be able to be closed
before next clatStart is called. This may be problematic. For
example, the same v4- tun interface has not closed yet and clatStart
has been called again.

Test: connect/disconnect to IPv6 only network and ping 8.8.8.8
      repeat 10 times
Change-Id: I8e1c66206dc221827a039213ecc86d5cbd777dff
2022-01-25 20:32:11 +08:00
Hungming Chen
9d11ddfd5c [CLATJ#22] ClatCoordinator: stop clatd
provide clatd stop function which stops clatd by pid.

Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a follow commit.

Change-Id: Icd9c4f9038bf75113fbc5608f213145e58a061d9
2022-01-25 18:44:09 +08:00
Hungming Chen
9625caa8e5 [CLATJ#21] ClatCoordinator: start clatd
launch clatd with the given cli arguments.

Bug: 212345928
Test: flash and boot
- run "atest ClatCoordinatorTest" in a follow commit.
- manual test
  1. Connect to ipv6-only wifi.
  2. Try IPv4 traffic.
     $ ping 8.8.8.8

Change-Id: Ie57a7c7a9d3d77396e91fa9f94c02f1ad05487c1
2022-01-25 18:43:59 +08:00
Paul Hu
eead25d263 Merge "Add jarjar rules for service-connectivity-tiramisu-pre-jarjar" 2022-01-25 04:15:41 +00:00
Mark Chien
7586d33f22 Merge "Replace some netd calls in NetworkManagementService" 2022-01-25 03:34:54 +00:00
Mark Chien
f3cf7c00a6 Merge "Replace INetd#trafficSwapActiveStatsMap with ConnectivityManager API" 2022-01-25 03:34:14 +00:00
Junyu Lai
3f9584bfda Merge "[MS67.2] Modify tests for registerUsageCallback" 2022-01-25 01:23:45 +00:00
Maciej Żenczykowski
e04edee45f make clatd 0755 instead of 0555
Bug: 215897658
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4c5fa8b4cd07a6e2ca2128943336a7a5d05712d4
2022-01-24 19:27:15 +00:00
Maciej Żenczykowski
f807ec7da7 Merge changes from topic "configure_bpf_for_clat"
* changes:
  [CLATJ#20] ClatdCoordinator: stop bpf for clat
  [CLATJ#19] ClatdCoordinator: configure bpf for clat
  [CLATJ#18] libclat: move clat tc and bpf utilis from netd
  [CLATJ#17] bpf_connectivity_headers visible to libclat
2022-01-24 19:14:35 +00:00
Maciej Żenczykowski
d512ec646c Merge "Add unit test for BpfInterfaceMapUpdate" 2022-01-24 19:05:28 +00:00
Sooraj Sasindran
0311ea0bc6 Merge "Add support for Multiple enterprise slice" 2022-01-24 16:26:03 +00:00
junyulai
f8a1d3e5e6 [MS67.2] Modify tests for registerUsageCallback
Test: atest FrameworksNetTests
Bug: 204830222
Change-Id: Ia4ff535cd703807516d65b582727684cbb670360
2022-01-24 18:59:23 +08:00
Junyu Lai
4794105511 Merge changes from topics "ms56-historybuilder", "ms65.3"
* changes:
  [MS56.2] Add unit test for NetworkStatsHistory#Builder
  [MS65.4] Address comments at aosp/1954383
2022-01-24 05:41:10 +00:00
paulhu
824b001b74 Add jarjar rules for service-connectivity-tiramisu-pre-jarjar
- Add rule for modules-utils-statemachine lib.

Bug: 206893064
Test: m
Change-Id: Ia70a86be0f52f9aecddd9716d3a3a266aef35bc8
2022-01-24 10:56:29 +08:00
Wayne Ma
790c83e387 [NETD-TC#14] Add traffic controller JNI to tethering module
This CL provides native methods to access BPF maps via a native library.

Bug: 202086915
Test: m; flash; boot;
Change-Id: I2e5d03d0c2e31ba11996d1b28ead9b552397fe29
2022-01-24 00:22:26 +08:00
Wayne Ma
320b95dd6d Fix TEST_MAPPING format
Bug: N/A
Test: m
Change-Id: I16760dcea531ff3a20d53dace7b919c877c378b9
2022-01-23 23:45:11 +08:00
Treehugger Robot
a92465745c Merge "[NETD-TC#13] Make TrafficControllerTest as traffic_controller_unit_test" 2022-01-23 14:57:48 +00:00
Wayne Ma
7be6bce52d [NETD-TC#13] Make TrafficControllerTest as traffic_controller_unit_test
Delete tagSocket(), privilegedTagSocket() and untagSocket() revelant
test cases since thay are moved out of TrafficController in
aosp/1849156.

Bug: 202086915
Test: atest traffic_controller_unit_test passed
Change-Id: I605577ee4d7076f0c8ad75888a4d32bff90f6104
2022-01-23 21:26:09 +08:00
Junyu Lai
6d95db48d0 [MS56.2] Add unit test for NetworkStatsHistory#Builder
Test: atest NetworkStatsHistoryTest#testBuilder
Bug: 204830222
Change-Id: Id876340bcab7290d5e191dbdfcce7fb4d8ecf96c
2022-01-23 20:52:31 +08:00
Junyu Lai
84413a92c3 [MS65.4] Address comments at aosp/1954383
Test: atest NetworkIdentityTest#testBuilder
Bug: 204830222
Change-Id: I3d0f8175ee782c76839cbbdb5eb8a1219a61d874
2022-01-23 20:52:31 +08:00
Sooraj Sasindran
f4a58dcd45 Add support for Multiple enterprise slice
Bug: 194332512
Test: unit test
CTS-Coverage-Bug: 211133973
Change-Id: Ie8be08a7cfa9155168d1da146d02fd1643248bdc
2022-01-22 14:39:40 -08:00
Les Lee
c71f2d7425 wifi data usage: Update calling API name
Bug: 213387087
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c FrameworksWifiApiTests
Test: atest -c NetworkPolicyManagerServiceTest
Change-Id: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be
Merged-In: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be
2022-01-23 00:07:02 +08:00
Hungming Chen
fb676b58e0 [CLATJ#20] ClatdCoordinator: stop bpf for clat
Remove eBPF offload at clat stopping if possible.

Bug: 212345928
Test: build only
because need to test with clatd launched

Change-Id: I6ace77694c0e6fe68d16e80e3c8198aa41385fd2
2022-01-22 20:07:30 +08:00
Hungming Chen
b1d3ccbeb6 [CLATJ#19] ClatdCoordinator: configure bpf for clat
Configure eBPF offload at clat starting if possible.

Bug: 212345928
Test: connect to ipv6 only network and check bpf entries
$adb shell dumpsys netd --short | grep Clat -A10
  ClatdController
    Trackers: iif[iface] nat64Prefix v6Addr -> v4Addr v4iif[v4iface] [fwmark]
    BPF ingress map: iif(iface) nat64Prefix v6Addr -> v4Addr oif(iface)
      47(wlan0) 64:ff9b::/96 2a00:79e1:abc:6f02:b7aa:ff3c:9220:595c -> 192.0.0.4 52(v4-wlan0)
    BPF egress map: iif(iface) v4Addr -> v6Addr nat64Prefix oif(iface)
      52(v4-wlan0) 192.0.0.4 -> 2a00:79e1:abc:6f02:b7aa:ff3c:9220:595c 64:ff9b::/96 47(wlan0) ether

Change-Id: I8ff77a2e3e86bfe6dbf43f4181414e444ba0da32
2022-01-22 20:07:24 +08:00
Hungming Chen
8ebdb6f1fe [CLATJ#18] libclat: move clat tc and bpf utilis from netd
Move native functions from ClatdController and TcUtils to libclat
for jni ClatdCoordinator.

Bug: 212345928
Test: atest libclat_test
Change-Id: Ia4b344b07537d57c3e4ff1285b0e7b17e0c63c3e
2022-01-22 20:07:19 +08:00
Hungming Chen
99b9ae3787 [CLATJ#17] bpf_connectivity_headers visible to libclat
Needed because ClatdController and clatd binary are moved
into apex. libclat is used for accessing BPF map.

Bug: 212345928
Test: build
Change-Id: I1be5d4c9cc2c9865ac99f2595443e54e7334c843
2022-01-22 20:06:55 +08:00
Wayne Ma
a9716ffcb8 [NETD-TC#11] Make TrafficController as libtraffic_controller into
Tethering module.

Delete tagSocket(), privilegedTagSocket() and untagSocket() since
they are moved out of TrafficController in aosp/1849156.

Bug: 202086915
Test: m; flash; boot;
Change-Id: Ifeaeb060fbf1add9f06748e7846b9e11e0345bda
2022-01-22 12:33:49 +08:00
Treehugger Robot
29d5f0adbe Merge "bump tethering tc prio to make room for rate limiting" 2022-01-21 18:19:43 +00:00
Wayne Ma
0c155199c0 Merge changes from topic "clean_move_and_delete"
* changes:
  Delete dead codes within TrafficController in mainline module
  Move TrafficController relevant files from netd to mainline module
2022-01-21 17:10:07 +00:00
Sooraj Sasindran
a2e98bdc1a Merge "Ability to specify which all applications fall under enterprise slice." 2022-01-21 16:01:44 +00:00
Wayne Ma
92d80790d3 Delete dead codes within TrafficController in mainline module
Delete tagSocket(), privilegedTagSocket() and untagSocket() since
they are moved out of TrafficController in aosp/1849156.

Test: m
Change-Id: I6162c758446f597eb79734e00348dc8b1fe2d422
2022-01-21 15:45:09 +00:00
Wayne Ma
4d69233e63 Move TrafficController relevant files from netd to mainline module
git diff packages/modules/Connectivity/service/native/TrafficController.cpp system/netd/server/TrafficController.cpp
git diff packages/modules/Connectivity/service/native/TrafficControllerTest.cpp system/netd/server/TrafficControllerTest.cpp
git diff packages/modules/Connectivity/service/native/include/TrafficController.h system/netd/server/TrafficController.h

Test: m
No-Typo-Check: clean move
BYPASS_INCLUSIVE_LANGUAGE_REASON= clean move
Change-Id: I7c0200e28e5e4459477d370912277fa1281b786b
2022-01-21 15:37:34 +00:00
markchien
adf119a8ed Add unit test for BpfInterfaceMapUpdate
Bug: 215095957
Test: atest FrameworkNetTests

Change-Id: I92d45e5a606f466ce42504629cb3f87fd9e25d22
2022-01-21 23:34:25 +08:00
markchien
f243be2267 Replace some netd calls in NetworkManagementService
This is the corresponding test change with netd usage replacement
in NetworkManagementService.

Bug: 209935649
Test: atest NetworkManagementServiceTest

Change-Id: Id25f2d7d291eef7c8bb12a7fcf67b1619cce6da5
2022-01-21 17:49:29 +08:00
Junyu Lai
7f3f9c1be0 Merge "[MS65.2] Add unit test of NetworkIdentity#Builder" 2022-01-21 09:36:08 +00:00
Sooraj Sasindran
499117f279 Ability to specify which all applications fall under enterprise slice.
Bug: 194332512
Test: unit test
Change-Id: I94549a41aaa717add22b0a3e5035beacf6f1b8f2
2022-01-21 01:05:12 -08:00
Mark Chien
ceeebae37e Merge "Use new bluetooth API to enable/disable bt tethering after T" 2022-01-21 08:43:53 +00:00
Maciej Żenczykowski
6ce19fab40 Merge "move clatd.c bpf program to mainline" 2022-01-21 08:19:52 +00:00
Frank Li
413a3b1306 Merge "[DU03-2]Remove INetworkStatsService from BatteryStatsImpl" 2022-01-21 08:15:25 +00:00
markchien
daf30ef9a8 Replace INetd#trafficSwapActiveStatsMap with ConnectivityManager API
This is the corresponding test change with INetd#trafficSwapActiveStatsMap
usage replacement.

Bug: 209935649
Test: atest NetworkStatsFactoryTest
Change-Id: Ic5e29f6a928c4230322ed658fe8ddbd71d7ea56a
2022-01-21 16:02:26 +08:00
Treehugger Robot
38276f1b9c Merge "Add cts test suite in connectivity/cts deps" 2022-01-21 07:36:08 +00:00
Lorenzo Colitti
513180aae8 Merge changes from topic "connectivity-mainline-presubmit-defaults"
* changes:
  Add java defaults for mainline-presubmit as well.
  Run bpf_existence_test in mainline-postsubmit.
2022-01-21 07:07:41 +00:00
Wayne Ma
5314cc6590 Merge "[NETD-TC#10] Create BpfNetMaps class" 2022-01-21 07:06:09 +00:00
Chiachang Wang
b04664d7a6 Merge "Update the SDK for the tests with intended target in T+" 2022-01-21 06:34:29 +00:00
Wayne Ma
0ea3bdc88b [NETD-TC#10] Create BpfNetMaps class
BpfNetMaps provide interfaces and native methods for
manipulating BPF maps by calling jni library of traffic controller.

DO NOT TOUCH BpfNetMaps before aosp/1945136 and aosp/1948169 get merged.

Bug: 202086915
Test: build and flash
Change-Id: Iaff8ac71100b3f76b444f3b83616556d0ee6eadf
2022-01-21 13:19:29 +08:00
Maciej Żenczykowski
849b3aadc4 move clatd.c bpf program to mainline
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e88fcc34c21695e844d607836df4661790cba03
2022-01-20 21:00:22 -08:00
Junyu Lai
015e5690af Merge "[MS57.2] Prepare APIs for data migration utility" 2022-01-21 04:26:57 +00:00