summaryrefslogtreecommitdiff
path: root/server/IptablesBaseTest.cpp
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2017-08-24 13:28:19 +0900
committerLorenzo Colitti <lorenzo@google.com>2017-08-31 16:24:31 +0900
commita93126d6a1fb762537916adf2f103f893689e50f (patch)
tree7a80f6e4726f5bcd36d62cf16e861b9c993b2920 /server/IptablesBaseTest.cpp
parente2e18f0400f9b5ef5a1329cbdddfb447d72910f5 (diff)
downloadnetd-a93126d6a1fb762537916adf2f103f893689e50f.tar.gz
Move all tethering functionality into TetherController.
This includes the entirety of NatController and relevant parts of BandwidthController (specifically, getTetherStats and its dependencies). This will make the code easier to understand and allow netd to privide a simpler API to the framework (e.g., by providing higher-level methods that perform what today are multiple operations from the framework's point of view). It will also reduce duplication of state (e.g., interface pairs kept by NatController partially overlap with downstream interfaces kept by TetherController) and avoid dependencies between controllers. This CL makes no functional changes. The only code changes are the ones necessary for compilation. Specifically: - Move some methods into IptablesBaseTest.cpp so they can be used from two test classes. - Change TetherController::iptablesRestoreFunction to the three-argument used by the erstwhile BandwidthController tests. Where appropriate, variable names have been changed, but strings that actually appear on device, such as iptables rule names, are left as is and will be changed in a future CL. Bug: 32163131 Bug: 64995262 Test: bullhead builds, boots Test: netd_{unit,integration}_test pass Change-Id: Idc80bfd424ce011826305f84b1cc98e741698601
Diffstat (limited to 'server/IptablesBaseTest.cpp')
-rw-r--r--server/IptablesBaseTest.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/server/IptablesBaseTest.cpp b/server/IptablesBaseTest.cpp
index c9bf67b2..f0a6d2c1 100644
--- a/server/IptablesBaseTest.cpp
+++ b/server/IptablesBaseTest.cpp
@@ -41,7 +41,7 @@ IptablesBaseTest::IptablesBaseTest() {
int IptablesBaseTest::fake_android_fork_exec(int argc, char* argv[], int *status, bool, bool) {
std::string cmd = argv[0];
for (int i = 1; i < argc; i++) {
- if (argv[i] == NULL) break; // NatController likes to pass in invalid argc values.
+ if (argv[i] == NULL) break;
cmd += " ";
cmd += argv[i];
}
@@ -113,10 +113,6 @@ void IptablesBaseTest::expectIptablesRestoreCommands(const ExpectedIptablesComma
sRestoreCmds.clear();
}
-void IptablesBaseTest::setReturnValues(const std::deque<int>& returnValues) {
- sReturnValues = returnValues;
-}
-
std::vector<std::string> IptablesBaseTest::sCmds = {};
IptablesBaseTest::ExpectedIptablesCommands IptablesBaseTest::sRestoreCmds = {};
std::deque<std::string> IptablesBaseTest::sPopenContents = {};