From 6fa77a6acb7955c804ec73a571177163ad022623 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Mon, 30 May 2016 23:42:41 -0400 Subject: Add data structures necessary to support multiple Section Header blocks. This doesn't try to use any data from multiple Section Header blocks, it just converts single Section Header block usage into a GArray, so the potential is there to then use/support multiple Section Header blocks within a file format (like pcapng) Change-Id: I6ad1f7b8daf4b1ad7ba0eb1ecf2e170421505486 Reviewed-on: https://code.wireshark.org/review/15636 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/tap_export_pdu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ui/tap_export_pdu.c') diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c index 37706ba718..a151e72567 100644 --- a/ui/tap_export_pdu.c +++ b/ui/tap_export_pdu.c @@ -103,6 +103,7 @@ exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, int fd, char *comment) /* pcapng defs */ wtap_optionblock_t shb_hdr; + GArray *shb_hdrs = g_array_new(FALSE, FALSE, sizeof(wtap_optionblock_t)); wtapng_iface_descriptions_t *idb_inf; wtap_optionblock_t int_data; wtapng_if_descr_mandatory_t *int_data_mand; @@ -148,9 +149,11 @@ exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, int fd, char *comment) g_array_append_val(idb_inf->interface_data, int_data); + g_array_append_val(shb_hdrs, shb_hdr); + /* Use a random name for the temporary import buffer */ exp_pdu_tap_data->wdh = wtap_dump_fdopen_ng(fd, WTAP_FILE_TYPE_SUBTYPE_PCAPNG, WTAP_ENCAP_WIRESHARK_UPPER_PDU, WTAP_MAX_PACKET_SIZE, FALSE, - shb_hdr, idb_inf, NULL, &err); + shb_hdrs, idb_inf, NULL, &err); if (exp_pdu_tap_data->wdh == NULL) { g_assert(err != 0); return err; -- cgit v1.2.3