summaryrefslogtreecommitdiff
path: root/server/BandwidthController.h
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-06-22 20:33:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-06-22 20:33:54 +0000
commit453914f871e7c9fa4130a46a03e7defaf1bd7718 (patch)
treee62ba6ec8b05a2e945edd7133fb56a2acde731be /server/BandwidthController.h
parent7205b2fa010d68d8f310295c22b93707bda7a949 (diff)
parent95892f35e7aad3502ccb57d5243d7b34a398d209 (diff)
downloadnetd-453914f871e7c9fa4130a46a03e7defaf1bd7718.tar.gz
Merge "Use xt_bpf programs to do bandwidth control"android-p-preview-4android-n-iot-release-smart-display
Diffstat (limited to 'server/BandwidthController.h')
-rw-r--r--server/BandwidthController.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/BandwidthController.h b/server/BandwidthController.h
index adf64c8a..4b72f184 100644
--- a/server/BandwidthController.h
+++ b/server/BandwidthController.h
@@ -33,7 +33,7 @@ public:
BandwidthController();
int setupIptablesHooks();
- static bool getBpfStatsStatus();
+ static bool getBpfStatus();
int enableBandwidthControl(bool force);
int disableBandwidthControl();
@@ -69,6 +69,9 @@ public:
static const char LOCAL_RAW_PREROUTING[];
static const char LOCAL_MANGLE_POSTROUTING[];
+ enum IptJumpOp { IptJumpReject, IptJumpReturn, IptJumpNoAdd };
+ enum IptOp { IptOpInsert, IptOpDelete };
+
private:
struct QuotaInfo {
int64_t quota;
@@ -77,8 +80,6 @@ public:
enum IptIpVer { IptIpV4, IptIpV6 };
enum IptFullOp { IptFullOpInsert, IptFullOpDelete, IptFullOpAppend };
- enum IptJumpOp { IptJumpReject, IptJumpReturn, IptJumpNoAdd };
- enum IptOp { IptOpInsert, IptOpDelete };
enum QuotaType { QuotaUnique, QuotaShared };
enum RunCmdErrHandling { RunCmdFailureBad, RunCmdFailureOk };
#if LOG_NDEBUG
@@ -125,6 +126,8 @@ public:
static const char *opToString(IptOp op);
static const char *jumpToString(IptJumpOp jumpHandling);
+ bool mBpfSupported;
+
int64_t mSharedQuotaBytes = 0;
int64_t mSharedAlertBytes = 0;
int64_t mGlobalAlertBytes = 0;