summaryrefslogtreecommitdiff
path: root/reordercap.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-05-30 23:42:41 -0400
committerMichael Mann <mmann78@netscape.net>2016-06-01 14:33:23 +0000
commit6fa77a6acb7955c804ec73a571177163ad022623 (patch)
tree29ca6bfacc3ad843a6a81615bd593c4cab872d0b /reordercap.c
parentbd932bb2e11f90c3f95b135ccaeaab7d57623963 (diff)
downloadwireshark-6fa77a6acb7955c804ec73a571177163ad022623.tar.gz
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 <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'reordercap.c')
-rw-r--r--reordercap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/reordercap.c b/reordercap.c
index 2bcc77ac12..38c1db57ea 100644
--- a/reordercap.c
+++ b/reordercap.c
@@ -178,7 +178,7 @@ main(int argc, char *argv[])
guint wrong_order_count = 0;
gboolean write_output_regardless = TRUE;
guint i;
- wtap_optionblock_t shb_hdr = NULL;
+ GArray *shb_hdrs = NULL;
wtapng_iface_descriptions_t *idb_inf = NULL;
wtap_optionblock_t nrb_hdr = NULL;
@@ -289,18 +289,18 @@ main(int argc, char *argv[])
}
DEBUG_PRINT("file_type_subtype is %d\n", wtap_file_type_subtype(wth));
- shb_hdr = wtap_file_get_shb_for_new_file(wth);
+ 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);
/* 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_hdr, idb_inf, nrb_hdr, &err);
+ 65535, FALSE, shb_hdrs, idb_inf, nrb_hdr, &err);
outfile = "standard output";
} else {
pdh = wtap_dump_open_ng(outfile, wtap_file_type_subtype(wth), wtap_file_encap(wth),
- 65535, FALSE, shb_hdr, idb_inf, nrb_hdr, &err);
+ 65535, FALSE, shb_hdrs, idb_inf, nrb_hdr, &err);
}
g_free(idb_inf);
idb_inf = NULL;
@@ -308,7 +308,7 @@ main(int argc, char *argv[])
if (pdh == NULL) {
fprintf(stderr, "reordercap: Failed to open output file: (%s) - error %s\n",
outfile, wtap_strerror(err));
- wtap_optionblock_free(shb_hdr);
+ wtap_optionblock_array_free(shb_hdrs);
wtap_optionblock_free(nrb_hdr);
exit(1);
}
@@ -382,11 +382,11 @@ main(int argc, char *argv[])
if (!wtap_dump_close(pdh, &err)) {
fprintf(stderr, "reordercap: Error closing %s: %s\n", outfile,
wtap_strerror(err));
- wtap_optionblock_free(shb_hdr);
+ wtap_optionblock_array_free(shb_hdrs);
wtap_optionblock_free(nrb_hdr);
exit(1);
}
- wtap_optionblock_free(shb_hdr);
+ wtap_optionblock_array_free(shb_hdrs);
wtap_optionblock_free(nrb_hdr);
/* Finally, close infile */