#include <zlib.h> /* to get the libz version number */
#endif
-#include "wtap.h"
+#include <wiretap/wtap.h>
#ifndef HAVE_GETOPT_LONG
#include "wsutil/wsgetopt.h"
FrameRecord_t *prevFrame = NULL;
int opt;
-DIAG_OFF(cast-qual)
static const struct option long_options[] = {
- {(char *)"help", no_argument, NULL, 'h'},
- {(char *)"version", no_argument, NULL, 'v'},
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
-DIAG_ON(cast-qual)
int file_count;
char *infile;
- char *outfile;
+ const char *outfile;
/* Get the compile-time version information string */
comp_info_str = get_compiled_version_info(NULL, get_reordercap_compiled_info);
case 'h':
printf("Reordercap (Wireshark) %s\n"
"Reorder timestamps of input file frames into output file.\n"
- "See http://www.wireshark.org for more information.\n",
+ "See https://www.wireshark.org for more information.\n",
get_ws_vcs_version_info());
print_usage(stdout);
exit(0);
}
exit(1);
}
- DEBUG_PRINT("file_type_subtype is %u\n", wtap_file_type_subtype(wth));
+ DEBUG_PRINT("file_type_subtype is %d\n", wtap_file_type_subtype(wth));
shb_hdr = 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) */
- pdh = wtap_dump_open_ng(outfile, wtap_file_type_subtype(wth), wtap_file_encap(wth),
- 65535, FALSE, shb_hdr, idb_inf, nrb_hdr, &err);
+ 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);
+ 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);
+ }
g_free(idb_inf);
idb_inf = NULL;