From 614d09af132be967b89103efb85721fa043929c9 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Wed, 1 Jun 2016 10:11:46 -0400 Subject: Add data structures necessary to support multiple Name Resolution blocks. This doesn't try to use any data from multiple Name Resolution blocks, it just converts single Name Resolution block usage into a GArray, so the potential is there to then use/support multiple Name Resolution blocks within a file format (like pcapng) Change-Id: Ib0b584af0bd263f183bd6d31ba18275ab0577d0c Reviewed-on: https://code.wireshark.org/review/15684 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- reordercap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'reordercap.c') diff --git a/reordercap.c b/reordercap.c index 38c1db57ea..ae1e013320 100644 --- a/reordercap.c +++ b/reordercap.c @@ -180,7 +180,7 @@ main(int argc, char *argv[]) guint i; GArray *shb_hdrs = NULL; wtapng_iface_descriptions_t *idb_inf = NULL; - wtap_optionblock_t nrb_hdr = NULL; + GArray *nrb_hdrs = NULL; GPtrArray *frames; FrameRecord_t *prevFrame = NULL; @@ -291,16 +291,16 @@ main(int argc, char *argv[]) shb_hdrs = wtap_file_get_shb_for_new_file(wth); idb_inf = wtap_file_get_idb_info(wth); - nrb_hdr = wtap_file_get_nrb_for_new_file(wth); + nrb_hdrs = wtap_file_get_nrb_for_new_file(wth); /* Open outfile (same filetype/encap as input file) */ if (strcmp(outfile, "-") == 0) { pdh = wtap_dump_open_stdout_ng(wtap_file_type_subtype(wth), wtap_file_encap(wth), - 65535, FALSE, shb_hdrs, idb_inf, nrb_hdr, &err); + 65535, FALSE, shb_hdrs, idb_inf, nrb_hdrs, &err); outfile = "standard output"; } else { pdh = wtap_dump_open_ng(outfile, wtap_file_type_subtype(wth), wtap_file_encap(wth), - 65535, FALSE, shb_hdrs, idb_inf, nrb_hdr, &err); + 65535, FALSE, shb_hdrs, idb_inf, nrb_hdrs, &err); } g_free(idb_inf); idb_inf = NULL; @@ -309,7 +309,7 @@ main(int argc, char *argv[]) fprintf(stderr, "reordercap: Failed to open output file: (%s) - error %s\n", outfile, wtap_strerror(err)); wtap_optionblock_array_free(shb_hdrs); - wtap_optionblock_free(nrb_hdr); + wtap_optionblock_array_free(nrb_hdrs); exit(1); } @@ -383,11 +383,11 @@ main(int argc, char *argv[]) fprintf(stderr, "reordercap: Error closing %s: %s\n", outfile, wtap_strerror(err)); wtap_optionblock_array_free(shb_hdrs); - wtap_optionblock_free(nrb_hdr); + wtap_optionblock_array_free(nrb_hdrs); exit(1); } wtap_optionblock_array_free(shb_hdrs); - wtap_optionblock_free(nrb_hdr); + wtap_optionblock_array_free(nrb_hdrs); /* Finally, close infile */ wtap_fdclose(wth); -- cgit v1.2.1