Dump BPF offload rules for upstream IPv4 and IPv6.

Add code to BpfCoordinator to dump upstream IPv4 and IPv6 rules.
For IPv4, currently only the upstream map is printed, because the
downstream map is expected to be symmetrical.

Example output:

=============
    21(21) -> 12(rmnet_data2) 86dd 00:00:00:00:00:00 00:00:00:00:00:00
    [wlan1]: iif(iface) oif(iface) v6addr srcmac dstmac
      12(rmnet_data2) 21(wlan1) /2001:240:2425:b5dc:21a9:995d:bc57:bc37 b2:b5:e0:24:21:c2 ca:06:8d:54:99:ad
    [IPv4]: iif(iface) oif(iface) src nat dst
      21(21) 12(rmnet_data2) 192.168.16.247:41544 -> 100.101.80.108:41544 -> 216.239.36.135:443
      21(21) 12(rmnet_data2) 192.168.16.247:42028 -> 100.101.80.108:42028 -> 8.8.4.4:853
      21(21) 12(rmnet_data2) 192.168.16.247:42032 -> 100.101.80.108:42032 -> 8.8.4.4:853
      21(21) 12(rmnet_data2) 192.168.16.247:42042 -> 100.101.80.108:42042 -> 8.8.4.4:853
      21(21) 12(rmnet_data2) 192.168.16.247:41816 -> 100.101.80.108:41816 -> 8.8.8.8:853
      21(21) 12(rmnet_data2) 192.168.16.247:42040 -> 100.101.80.108:42040 -> 8.8.4.4:853

=============

Also make it possible to do "dumpsys tethering bpf" and get only
the BPF dump.

Test: manual
Change-Id: I2aaa2fdda7d724994090c26feff585f24cd3283b
3 files changed
tree: 98e0a5c382e7cd1d343e552fd97777bf59beae7f
  1. framework/
  2. tests/
  3. Tethering/
  4. .gitignore
  5. OWNERS
  6. PREUPLOAD.cfg
  7. TEST_MAPPING