summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rohr <prohr@google.com>2024-04-12 14:51:49 -0700
committerPatrick Rohr <prohr@google.com>2024-04-12 14:51:49 -0700
commitb1327e0f769e4fe6a684d855725e950fe4205384 (patch)
treec03bee037103417198f3a519f488d668544a7e85
parentc558faea1e192636842dd2155e4092a3653d3283 (diff)
downloadnetd-b1327e0f769e4fe6a684d855725e950fe4205384.tar.gz
Delete disableBandwidthControl since it is never called
Test: TH Change-Id: Iaf33fb8e615effe9742089ab0c4ae0259e342227
-rw-r--r--server/BandwidthController.cpp6
-rw-r--r--server/BandwidthController.h1
-rw-r--r--server/BandwidthControllerTest.cpp20
3 files changed, 0 insertions, 27 deletions
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp
index 6be59224..4186f039 100644
--- a/server/BandwidthController.cpp
+++ b/server/BandwidthController.cpp
@@ -287,12 +287,6 @@ int BandwidthController::enableBandwidthControl() {
return iptablesRestoreFunction(V4V6, commands, nullptr);
}
-int BandwidthController::disableBandwidthControl() {
-
- flushCleanTables(false);
- return 0;
-}
-
std::string BandwidthController::makeDataSaverCommand(IptablesTarget target, bool enable) {
std::string cmd;
const char *chainName = "bw_data_saver";
diff --git a/server/BandwidthController.h b/server/BandwidthController.h
index 2a3b4bd1..8e3e1ff4 100644
--- a/server/BandwidthController.h
+++ b/server/BandwidthController.h
@@ -34,7 +34,6 @@ public:
int setupIptablesHooks();
int enableBandwidthControl();
- int disableBandwidthControl();
int enableDataSaver(bool enable);
int setInterfaceSharedQuota(const std::string& iface, int64_t bytes);
diff --git a/server/BandwidthControllerTest.cpp b/server/BandwidthControllerTest.cpp
index 844681d0..546a738e 100644
--- a/server/BandwidthControllerTest.cpp
+++ b/server/BandwidthControllerTest.cpp
@@ -204,26 +204,6 @@ TEST_F(BandwidthControllerTest, TestEnableBandwidthControl) {
expectSetupCommands(expectedClean, expectedAccounting);
}
-TEST_F(BandwidthControllerTest, TestDisableBandwidthControl) {
- // Pretend some bw_costly_shared_<iface> rules already exist...
- addIptablesRestoreOutput(
- "-P OUTPUT ACCEPT\n"
- "-N bw_costly_rmnet_data0\n"
- "-N bw_costly_shared\n"
- "-N unrelated\n"
- "-N bw_costly_rmnet_data7\n");
-
- // ... and expect that they be flushed.
- std::string expectedCleanCmds =
- "*filter\n"
- ":bw_costly_rmnet_data0 -\n"
- ":bw_costly_rmnet_data7 -\n"
- "COMMIT\n";
-
- mBw.disableBandwidthControl();
- expectSetupCommands(expectedCleanCmds, "");
-}
-
TEST_F(BandwidthControllerTest, TestEnableDataSaver) {
mBw.enableDataSaver(true);
std::string expected4 =