Commit Graph

8 Commits

Author SHA1 Message Date
Ken Chen
e6d511f785 Support "dumpsys connectivity trafficcontroller"
Enable ConnectivityService to dump BPF maps from libtraffic_controller.

Bug: 202086915
Test: adb shell dumpsys connectivity trafficcontroller
Test: atest CtsNetTestCases:ConnectivityManagerTest#testDumpBpfNetMaps
Test: run CTS in I021789813f116940d581e2c4a1fd357ff47bfa08
Change-Id: Ib0e935ee2b714ac61daceba6d13fa7a20f97f68f
2022-02-17 16:58:47 +08:00
markchien
4dd5be6606 Remove unused BpfNetMap jni function
native_deleteTagData and native_setCounterSet is replaced as BpfMap java
implementation inside NetworkStatsService.java

Test: atest traffic_controller_unit_test
Change-Id: Ic33ca9d9887380d39becbd0dc3a0e159b3dc82a2
2022-02-11 08:04:55 +00:00
Patrick Rohr
216dfc82f6 Enable TrafficController in apex
Test: atest FrameworksNetTests FrameworksNetIntegrationTests
CtsNetTestCases:android.net.TrafficStatsTest NetworkUsageStatsTest
CtsHostsideNetworkTests

Change-Id: I03f70e3258bf121cbac69a3bb302871ac680c6fb
2022-02-01 17:39:11 +01:00
Ken Chen
f5f51339af Clean up BpfNetMaps
Cleans up BpfNetMaps.java before enabling mainline code path.

Bug: 202086915
Test: atest FrameworksNetTests
Change-Id: I28e5d63ed4624df540b1ca47b71899cff7321ded
2022-02-01 12:31:03 +01:00
Wayne Ma
2fde98c87b [NETD-TC#15] Make ConnectivityService and PermissionMonitor
calls BpfNetMaps on T

Since TrafficController moves to mainline module for T, so some netd binder
interfaces revelant to BPF are going to deprecated. Provide JNI APIs to
call TrafficController inside mainline module for T.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: Ib3b43cf2840e02806395af9f1e019ca6fccd032e
2022-01-31 09:19:08 +01:00
Wayne Ma
41c2448ff9 Correct some errno values before throw ServiceSpecificException
For those functions which return statusFromErrno() in TrafficController,
it would return positive errno so shouldn't construct with -errno.

Test: m
Change-Id: I94b9294c4e200c43e33f8280469dfad9e9fbf5ea
2022-01-27 11:55:24 +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
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