diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2017-09-04 13:30:59 +0900 |
|---|---|---|
| committer | Lorenzo Colitti <lorenzo@google.com> | 2017-09-05 12:50:42 +0900 |
| commit | 5192bf770acad258e24bfcf8984e16734a2839dd (patch) | |
| tree | 321bad542b220c588f48544479b2fbd49b48a89c /server/TetherController.cpp | |
| parent | 9a8a9ff53dae3196517928e58cf884449b6588f3 (diff) | |
Remove the gettetherstats command.
Bug: 32163131
Bug: 64995262
Test: netd_{unit,integration}_test pass
Test: tethering data usage UI reflects actual data usage
Change-Id: I1722f64cf775e73d71df997f6bae4820133e67bf
Diffstat (limited to 'server/TetherController.cpp')
| -rw-r--r-- | server/TetherController.cpp | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/server/TetherController.cpp b/server/TetherController.cpp index 334da2e0..3f6efe92 100644 --- a/server/TetherController.cpp +++ b/server/TetherController.cpp @@ -714,16 +714,9 @@ int TetherController::addForwardChainStats(TetherStatsList& statsList, return 0; } -std::string TetherController::TetherStats::getStatsLine() const { - std::string msg; - StringAppendF(&msg, "%s %s %" PRId64" %" PRId64" %" PRId64" %" PRId64, intIface.c_str(), - extIface.c_str(), rxBytes, rxPackets, txBytes, txPackets); - return msg; -} - -StatusOr<TetherController::TetherStatsList> TetherController::getTetherStats( - std::string& extraProcessingInfo) { +StatusOr<TetherController::TetherStatsList> TetherController::getTetherStats() { TetherStatsList statsList; + std::string parsedIptablesOutput; for (const IptablesTarget target : {V4, V6}) { std::string statsString; @@ -732,30 +725,15 @@ StatusOr<TetherController::TetherStatsList> TetherController::getTetherStats( target, ret)); } - if (int ret = addForwardChainStats(statsList, statsString, extraProcessingInfo)) { + if (int ret = addForwardChainStats(statsList, statsString, parsedIptablesOutput)) { return statusFromErrno(-ret, StringPrintf("failed to parse %s tether stats:\n%s", target == V4 ? "IPv4": "IPv6", - extraProcessingInfo.c_str())); + parsedIptablesOutput.c_str())); } } return statsList; } -int TetherController::getTetherStats(SocketClient *cli, std::string &extraProcessingInfo) { - StatusOr<TetherStatsList> statsList = getTetherStats(extraProcessingInfo); - if (!isOk(statsList)) { - return -1; - } - - for (const auto& stats: statsList.value()) { - cli->sendMsg(ResponseCode::TetheringStatsListResult, - stats.getStatsLine().c_str(), false); - } - cli->sendMsg(ResponseCode::CommandOkay, "Tethering stats list completed", false); - - return 0; -} - } // namespace net } // namespace android |
