summaryrefslogtreecommitdiff
path: root/service/native/TrafficController.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add 3rd deny firewall chain for OEMMotomu Utsumi2022-06-071-0/+12
| | | | | | | | | | | Bug: 208371987 Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking ConnectivityServiceTest Change-Id: Ib521fa02f6a19270cb88a3d85321bda822516c78 (cherry picked from commit 1d9054ba5fbbf86c821e0a74a5a2f9d3c9865e67) Merged-In: Ib521fa02f6a19270cb88a3d85321bda822516c78
* Add deny firewall chain for OEMMotomu Utsumi2022-06-031-0/+24
| | | | | | | | | | | | Bug: 207773349 Bug: 208371987 Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testFirewallBlocking --iterations 50 && atest ConnectivityServiceTest --iterations 10 Change-Id: I60d5540821abcced03356f366775f16ee369d7f9 (cherry picked from commit d980149817948d11de0631caee8aee3172e4e159) Merged-In: I60d5540821abcced03356f366775f16ee369d7f9
* Support more than 8 firewall chains / match types.Lorenzo Colitti2022-06-011-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | In the BPF code, per-UID network access (e.g., for doze mode, standby, etc.) is stored in UidOwnerValue structures. Each of these stores that UID's rules in a 32-bit bitmask of UidOwnerMatchType values, so the code can support ~31 match types. However, which match types are enabled is stored in configuration_map at index UID_RULES_CONFIGURATION_KEY, and configuration_map only stores 8-bit values. So it's not possible to define more than 7 match types. Widen configuration_map to from 8 to 32 bits to match the width of UidOwnerValue.rule. This doesn't impact memory because configuration_map only has 2 entries. Bug: 208371987 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I7e1eee2daedd66d27965a2dd4ce6b4c3667892f7 (cherry picked from commit 60cbed385dcf3c640674c48b7cd4d60967047cf0) Merged-In: I7e1eee2daedd66d27965a2dd4ce6b4c3667892f7
* Block incoming packets in VPN Lockdown mode.Motomu Utsumi2022-05-171-8/+8
| | | | | | | | | | | | | | | Currently, even when VPN Lockdown mode is enabled, incoming packets are not dropped if VPN is not connected. This commit fixed this issue. After this commit, If VPN Lockdown mode is enabled, incoming packets are dropped regardless of the VPN connectivity. Bug: 206482423 Test: atest TrafficControllerTest ConnectivityServiceTest PermissionMonitorTest Change-Id: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d (cherry picked from commit b08654ca0450d021da709a762ab509a8d4f87d40) Merged-In: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d
* Support 32 match types in UidOwnerValue ruleMotomu Utsumi2022-05-171-4/+4
| | | | | | | | | | | | | Match type is also used in configuration_map at index UID_RULES_CONFIGURATION_KEY. However, this commit does not extend configuration_map and we can not still use more than 8 match type in configuration_map. Bug: 206482423 Test: m Change-Id: I0f20cc8034551806b5cb3da322a0ea7861983095 (cherry picked from commit 42edc60627899989335dafa568f6bf724ea1a104) Merged-In: I0f20cc8034551806b5cb3da322a0ea7861983095
* Remove redundant "using" statementYi Kong2022-02-221-1/+0
| | | | | | Test: presubmit Bug: 219872355 Change-Id: Ie4fc87e5231e31799644c26943bbc13000091e92
* Support "dumpsys connectivity trafficcontroller"Ken Chen2022-02-171-1/+3
| | | | | | | | | | 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
* Remove unused BpfNetMap jni functionmarkchien2022-02-111-94/+0
| | | | | | | | native_deleteTagData and native_setCounterSet is replaced as BpfMap java implementation inside NetworkStatsService.java Test: atest traffic_controller_unit_test Change-Id: Ic33ca9d9887380d39becbd0dc3a0e159b3dc82a2
* Add Low Power Standby support to TrafficControllerRobert Horvath2022-02-021-0/+12
| | | | | | Bug: 190822356 Test: atest TrafficControllerTest Change-Id: I84a95081ab6e6a86543fe2cddf0efdab16c90d72
* Remove libutils dependency from libservice-connectivityPatrick Rohr2022-01-311-2/+0
| | | | | | | Remove libutils dependency. Test: m Change-Id: I857e40c984bcce2931b5068b3b96d2c9dd69693c
* Rename libnetdbpf to libnetworkstatsKen Chen2022-01-241-0/+1
| | | | | | | | | | | | Two reason for renaming: 1. Avoid module name collision in sc-mainline-prod branch. 2. The libnetdbpf was misnamed before. Bug: 202086915 Test: atest libnetworkstats_test FrameworksNetTests ConnectivityCoverageTests FrameworksNetSmokeTests CtsAppOpsTestCases Change-Id: I87fcf4b1a9d58780a45743a9aa91b9b936e54266
* [NETD-TC#11] Make TrafficController as libtraffic_controller intoWayne Ma2022-01-221-24/+17
| | | | | | | | | | | 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
* Delete dead codes within TrafficController in mainline moduleWayne Ma2022-01-211-159/+0
| | | | | | | | Delete tagSocket(), privilegedTagSocket() and untagSocket() since they are moved out of TrafficController in aosp/1849156. Test: m Change-Id: I6162c758446f597eb79734e00348dc8b1fe2d422
* Move TrafficController relevant files from netd to mainline moduleWayne Ma2022-01-211-0/+1069
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