TetherController: Process tether stats from bpf maps
Test: Manual test
1. Add two interface tether stats manually
2. Call getTetherStats() and check the content
Change-Id: I5bf7e57e67cf61829ef71fd7caccdb60d4c35213
diff --git a/server/TetherController.h b/server/TetherController.h
index 7bf8d32..7835cf6 100644
--- a/server/TetherController.h
+++ b/server/TetherController.h
@@ -70,8 +70,10 @@
int sendAllState(int daemonFd) const;
} mDnsmasqState{};
+ // BPF maps, initialized by maybeInitMaps.
bpf::BpfMap<TetherIngressKey, TetherIngressValue> mBpfIngressMap;
bpf::BpfMap<uint32_t, TetherStatsValue> mBpfStatsMap;
+ bpf::BpfMap<uint32_t, IfaceValue> mIfaceIndexNameMap;
public:
TetherController();
@@ -183,6 +185,7 @@
int setForwardRules(bool set, const char *intIface, const char *extIface);
int setTetherCountingRules(bool add, const char *intIface, const char *extIface);
+ void maybeInitMaps();
void maybeStartBpf(const char* extIface);
void maybeStopBpf(const char* extIface);