wiretap: refactor common parameters for pcapng dump routines
authorPeter Wu <peter@lekensteyn.nl>
Sun, 11 Nov 2018 14:49:12 +0000 (15:49 +0100)
committerPeter Wu <peter@lekensteyn.nl>
Mon, 12 Nov 2018 23:00:44 +0000 (23:00 +0000)
commit1e76e1355ab2cafba517a1ba556450ded397d885
tree3a5f314fe1170be611080700655a7aab9f42fa17
parent791a9a9b8e1ad1c5f2ac31fd5fb830f6b4d30135
wiretap: refactor common parameters for pcapng dump routines

Four variants of wtap_dump_open_ng exists, each of them take the same
three parameters for the SHB, IDB and NRB blocks that has to be written
before packets are even written. Similarly, a lot of tools always create
these arguments based on an existing capture file session (wth).

Address the former duplication by creating a new data structure to hold
the arguments. Address the second issue by creating new helper functions
to initialize the parameters based on a wth. This refactoring should
make it easier to add the new Decryption Secrets Block (DSB).

No functional change intended.

Change-Id: I42c019dc1d48a476773459212ca213de91a55684
Reviewed-on: https://code.wireshark.org/review/30578
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
debian/libwiretap0.symbols
editcap.c
file.c
reordercap.c
tshark.c
ui/tap_export_pdu.c
wiretap/file_access.c
wiretap/merge.c
wiretap/nettrace_3gpp_32_423.c
wiretap/wtap.c
wiretap/wtap.h