OSDN Git Service

netd: tethering stats: persistent + list-all support
authorJP Abgrall <jpa@google.com>
Tue, 25 Jun 2013 16:44:10 +0000 (09:44 -0700)
committerJP Abgrall <jpa@google.com>
Tue, 25 Jun 2013 16:44:10 +0000 (09:44 -0700)
commitbaeccc455b293c2c83dbe6463f56b741177bd612
tree48226d35bba1893f6eb833c102d57a93a5d0fbbc
parenteb648acc30c3b04823c8ee533b12ae56d772ce47
netd: tethering stats: persistent + list-all support

* Persistent stats
Previously we would parse the iptables counters out of the FORWARD
rules used for tethering. Those rules could come an go before they
were parsed, which would cause us to incorrectly count traffic.
Now we have separate counting rules (and quota2 counters) which
persist beyond tethering.

* Rename the iface0/iface1
Match NatControllers notions for tethering ifaces during enable.
Detect weird call from userspace (until b/9565268 gets fixed),
or else it leaves an ugly iptables state.

* The commands affected:
 - ndc bandwidth gettetheringstats intIface extIface
  . no change from before: return a single stats line
 - ndc bandwidth gettetheringstats
  . return a list of results showing all tethered stats
 - ndc bandwidth gettetheringstats "" extIface
 - ndc bandwidth gettetheringstats intIface
   . return a list of results matching the tethering on
     the given interface.

Bug: 9565268
Bug: 5868832
Change-Id: I8559d9a184abcffaf65998fb3cc8c9c50d46bf06
BandwidthController.cpp
BandwidthController.h
CommandListener.cpp
NatController.cpp
NatController.h
ResponseCode.h