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
diff --git a/ResponseCode.h b/ResponseCode.h
index 85f183a..895c807 100644
--- a/ResponseCode.h
+++ b/ResponseCode.h
@@ -28,7 +28,7 @@
static const int TetherInterfaceListResult = 111;
static const int TetherDnsFwdTgtListResult = 112;
static const int TtyListResult = 113;
-
+ static const int TetheringStatsListResult = 114;
// 200 series - Requested action has been successfully completed
static const int CommandOkay = 200;