Dumpcap: Fix writing SHBs and IDBs.
authorGerald Combs <gerald@wireshark.org>
Mon, 8 Oct 2018 20:25:36 +0000 (13:25 -0700)
committerGerald Combs <gerald@wireshark.org>
Fri, 16 Nov 2018 19:28:11 +0000 (19:28 +0000)
commitf300676beca0a6358a7e1ca0349b7160f7cf6de5
tree106109e36e559c23cc33a8b5098aeb48a4a28861
parent377f5d0de76628371b7ef436783c6720de36b588
Dumpcap: Fix writing SHBs and IDBs.

If we have a single capture source and that capture source is pcapng and
we're writing a pcapng file, do the following:

- Pass its SHB and IDBs through unmodified. Don't save or write command
  line interface IDBs.

- Save the most recent SHB and IDBs so that we can write them when we're
  writing multiple output files.

If we have multiple capture sources, do the following:

- Write Dumpcap's SHB.

- Keep a global list of IDBs, consisting of both command line interfaces
  and IDBs read from pcapng sources.

- When reading an EPB or ISB, remap its local interface number to its
  corresponding global number.

Add Dumpcap pcapng section tests. Make the application IDs in the
"many_interfaces" captures unique.

Change-Id: I2005934c1f83d839727421960005f106d6c682dd
Reviewed-on: https://code.wireshark.org/review/30085
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
dumpcap.c
test/captures/many_interfaces.pcapng.1
test/captures/many_interfaces.pcapng.2
test/captures/many_interfaces.pcapng.3
test/subprocesstest.py
test/suite_capture.py