OSDN Git Service

netd: BandwidthController: support reading out tethering stats
authorJP Abgrall <jpa@google.com>
Sun, 18 Sep 2011 19:57:32 +0000 (12:57 -0700)
committerJP Abgrall <jpa@google.com>
Sun, 18 Sep 2011 19:57:32 +0000 (12:57 -0700)
commitdb7da58e8d2aa021060098057f944ef754be06e3
tree8be88691808cb148489ceff8a6b939bbe5f2490d
parent65969062a94e3a2d15a2536db297492f96a1f0aa
netd: BandwidthController: support reading out tethering stats

* Add
  ndc bandwidth gettetherstats <ifaceIn> <ifaceOut>
which returns
  221  ifaceIn ifaceOut rx_bytes rx_packets tx_bytes tx_packets
If the iface pair is not found it will fail.

221 is the new response code for TetheringStatsResult.
It gets the stats by looking at the iptables FORWARD chain's counters.

* Fixed return handling after some of the responses.
  - no need for errorno
  - after ResponseCode >= 200, don't return another.

* Correctly initialize the alert values on "bandwidth enable"

Bug: 5244846,5230066
Change-Id: I81c941441525fa4055ae270d5cad05e6c42b8f72
BandwidthController.cpp
BandwidthController.h
CommandListener.cpp
CommandListener.h
ResponseCode.h