Use xt_bpf module to record the iface stats
To make interface packet accounting more accurately and persistent, the
xt_bpf module is implemented to record the total packets and bytes
tx/rx through each interface. The netd will load the bpf program and
set up iptable rules for the xt_bpf module at boot time and the
framework service will use them to get per interface networks stats on
supported devices. Add logcat support to bpfloader program.
Test: iface stats show up in maps. Iptable rules show up after boot.
Bug: 72111305
Change-Id: Ib33d2b165b64e130999931302dd67891c35a12e9
diff --git a/bpfloader/bpf_shared.h b/bpfloader/bpf_shared.h
index c314c2b..448867a 100644
--- a/bpfloader/bpf_shared.h
+++ b/bpfloader/bpf_shared.h
@@ -22,3 +22,4 @@
#define UID_COUNTERSET_MAP 0xbfdceeafffffffff
#define UID_STATS_MAP 0xbfdaafffffffffff
#define TAG_STATS_MAP 0xbfaaafffffffffff
+#define IFACE_STATS_MAP 0xbf1faceaafffffff