Commit Graph

11 Commits

Author SHA1 Message Date
Maciej Żenczykowski
439bac2e56 tests: simplify BpfMap.reset(createMap()) -> BpfMap.resetMap()
BpfMap.reset(createMap()) is equivalent to newly added BpfMap.resetMap(),
except that the latter makes it impossible to screw up the Key/Value sizes.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I290986e9ae8660f3fc6f73b086d33f4ab93d6095
2022-05-31 07:35:04 -07:00
Maciej Żenczykowski
ced3531ad5 TrafficControllerTest - trivial simplification
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I25158126c968707f44f595f731547a8bd9bb503d
2022-05-31 07:35:04 -07:00
Maciej Żenczykowski
55ab87aa49 simplify bpf tests and check type correctness
We notice that:
  BpfMap.reset(dupFd_with_cloexec(BpfMap.getMap())
is equivalent to
  BpfMap = BpfMap
due to the current implementation of the BpfMap assignment operator.

Except the latter also verifies BpfMap<K,V> template types match.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I99fcf77bc6aa360b6a19e22c2cd58d67a1e62976
2022-05-31 07:35:03 -07:00
Maciej Żenczykowski
e0f5846897 remove spurious newlines on ALOG lines
(for consistency with rest of code base)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5660615f24daf4285e2b6cbacecb7cd99061c5f5
2022-05-23 20:53:12 +00:00
Motomu Utsumi
b08654ca04 Block incoming packets in VPN Lockdown mode.
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
2022-05-16 10:40:59 +00: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
Robert Horvath
d945bf0b4f Add Low Power Standby support to TrafficController
Bug: 190822356
Test: atest TrafficControllerTest
Change-Id: I84a95081ab6e6a86543fe2cddf0efdab16c90d72
2022-02-02 22:54:21 +01:00
Patrick Rohr
61e9467fa6 Move netlink_listener_test into TrafficControllerTest
netlink_listener_test tests the socket destroy listener, so it makes
sense to just merge it into the TrafficControllerTest.

Test: atest traffic_controller_unit_test
Change-Id: Ibc0b483203150aa2d7898a761fa4715dce6f4218
2022-02-01 21:13:30 +01: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
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