summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rohr <prohr@google.com>2024-04-12 13:13:30 -0700
committerPatrick Rohr <prohr@google.com>2024-04-12 14:25:07 -0700
commitbe4fc0cc9c50bea1869132db2d6cb02bbf5788f1 (patch)
tree94681c979132ef7a81bdb1fc1df9f1e626a77aa4
parentc558faea1e192636842dd2155e4092a3653d3283 (diff)
downloadnetd-be4fc0cc9c50bea1869132db2d6cb02bbf5788f1.tar.gz
Remove support for setSharedAlert / removeSharedAlert
This functionality is not called anywhere, so delete it. Test: TH Change-Id: I6c489bab6df7d7428ddab8a077e7e83e4a740d6f
-rw-r--r--server/BandwidthController.cpp24
-rw-r--r--server/BandwidthController.h4
2 files changed, 1 insertions, 27 deletions
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp
index 6be59224..967bd301 100644
--- a/server/BandwidthController.cpp
+++ b/server/BandwidthController.cpp
@@ -279,7 +279,7 @@ int BandwidthController::enableBandwidthControl() {
mSharedQuotaIfaces.clear();
mQuotaIfaces.clear();
mGlobalAlertBytes = 0;
- mSharedQuotaBytes = mSharedAlertBytes = 0;
+ mSharedQuotaBytes = 0;
flushCleanTables(false);
@@ -408,12 +408,6 @@ int BandwidthController::removeInterfaceSharedQuota(const std::string& iface) {
mSharedQuotaIfaces.erase(it);
if (mSharedQuotaIfaces.empty()) {
mSharedQuotaBytes = 0;
- if (mSharedAlertBytes) {
- res = removeSharedAlert();
- if (res == 0) {
- mSharedAlertBytes = 0;
- }
- }
}
return res;
@@ -602,22 +596,6 @@ int BandwidthController::removeGlobalAlert() {
return res;
}
-int BandwidthController::setSharedAlert(int64_t bytes) {
- if (!mSharedQuotaBytes) {
- ALOGE("Need to have a prior shared quota set to set an alert");
- return -1;
- }
- if (!bytes) {
- ALOGE("Invalid bytes value. 1..max_int64.");
- return -1;
- }
- return setCostlyAlert("shared", bytes, &mSharedAlertBytes);
-}
-
-int BandwidthController::removeSharedAlert() {
- return removeCostlyAlert("shared", &mSharedAlertBytes);
-}
-
int BandwidthController::setInterfaceAlert(const std::string& iface, int64_t bytes) {
if (!isIfaceName(iface)) {
ALOGE("setInterfaceAlert: Invalid iface \"%s\"", iface.c_str());
diff --git a/server/BandwidthController.h b/server/BandwidthController.h
index 2a3b4bd1..aeccc255 100644
--- a/server/BandwidthController.h
+++ b/server/BandwidthController.h
@@ -55,9 +55,6 @@ public:
int setGlobalAlertInForwardChain();
int removeGlobalAlertInForwardChain();
- int setSharedAlert(int64_t bytes);
- int removeSharedAlert();
-
int setInterfaceAlert(const std::string& iface, int64_t bytes);
int removeInterfaceAlert(const std::string& iface);
@@ -123,7 +120,6 @@ public:
static const char *jumpToString(IptJumpOp jumpHandling);
int64_t mSharedQuotaBytes = 0;
- int64_t mSharedAlertBytes = 0;
int64_t mGlobalAlertBytes = 0;
std::map<std::string, QuotaInfo> mQuotaIfaces;