"See http://www.wireshark.org for more information.\n"
"\n"
"%s",
- svnversion, get_copyright_info());
+ wireshark_svnversion, get_copyright_info());
} else {
output = stderr;
}
fprintf(output, " -F <output file type> set the output file type, default is libpcap\n");
fprintf(output, " an empty \"-F\" option will list the file types\n");
fprintf(output, " -V add output of packet tree (Packet Details)\n");
+ fprintf(output, " -S display packets even when writing to a file\n");
fprintf(output, " -x add output of hex and ASCII dump (Packet Bytes)\n");
fprintf(output, " -T pdml|ps|psml|text output format of text output (def: text)\n");
- fprintf(output, " -t ad|a|r|d output format of time stamps (def: r: rel. to first)\n");
+ fprintf(output, " -t ad|a|r|d|e output format of time stamps (def: r: rel. to first)\n");
fprintf(output, " -l flush output after each packet\n");
fprintf(output, " -q be more quiet on stdout (e.g. when using statistics)\n");
fprintf(output, " -X <key>:<value> eXtension options, see the man page for details\n");
char badopt;
GLogLevelFlags log_flags;
int status;
+ int optind_initial;
-#define OPTSTRING_INIT "a:b:c:d:Df:F:hi:lLnN:o:pqr:R:s:St:T:vVw:xX:y:z:"
+#define OPTSTRING_INIT "a:b:c:d:Df:F:G:hi:lLnN:o:pqr:R:s:St:T:vVw:xX:y:z:"
#ifdef HAVE_LIBPCAP
#ifdef _WIN32
#define OPTSTRING_WIN32 "B:"
*/
get_credential_info();
+ /*
+ * Now attempt to get the pathname of the plugins.
+ */
+ init_plugin_dir();
+
+ /*
+ * In order to have the -X opts assigned before the wslua machine starts
+ * we need to call getopts before epan_init() gets called.
+ */
+ opterr = 0;
+ optind_initial = optind;
+
+ while ((opt = getopt(argc, argv, optstring)) != -1) {
+ switch (opt) {
+ case 'X':
+ ex_opt_add(optarg);
+ break;
+ default:
+ break;
+ }
+ }
+
+ optind = optind_initial;
+ opterr = 1;
+
/* nothing more than the standard GLib handler, but without a warning */
log_flags =
- G_LOG_LEVEL_ERROR|
- G_LOG_LEVEL_CRITICAL|
G_LOG_LEVEL_WARNING|
G_LOG_LEVEL_MESSAGE|
G_LOG_LEVEL_INFO|
- G_LOG_LEVEL_DEBUG|
- G_LOG_FLAG_FATAL|G_LOG_FLAG_RECURSION;
+ G_LOG_LEVEL_DEBUG;
g_log_set_handler(NULL,
log_flags,
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
- epan_init(PLUGIN_DIR,register_all_protocols,register_all_protocol_handoffs,
- failure_message,open_failure_message,read_failure_message);
+ epan_init(register_all_protocols, register_all_protocol_handoffs,
+ failure_message, open_failure_message, read_failure_message);
/* Register all tap listeners; we do this before we parse the arguments,
as the "-z" argument can specify a registered tap. */
timestamp_set_type(TS_ABSOLUTE_WITH_DATE);
else if (strcmp(optarg, "d") == 0)
timestamp_set_type(TS_DELTA);
+ else if (strcmp(optarg, "e") == 0)
+ timestamp_set_type(TS_EPOCH);
else {
cmdarg_err("Invalid time stamp type \"%s\"",
optarg);
"%s"
"\n"
"%s",
- svnversion, get_copyright_info(), comp_info_str->str,
+ wireshark_svnversion, get_copyright_info(), comp_info_str->str,
runtime_info_str->str);
exit(0);
break;
print_hex = TRUE;
break;
case 'X':
- ex_opt_add(optarg);
break;
case 'z':
/* We won't call the init function for the stat this soon
}
}
+#ifdef HAVE_LIBPCAP
if (!capture_opts.saving_to_file) {
/* We're not saving the capture to a file; if "-q" wasn't specified,
we should print packet information */
exit(1);
}
}
+#else
+ /* We're not saving the capture to a file; if "-q" wasn't specified,
+ we should print packet information */
+ if (!quiet)
+ print_packet_info = TRUE;
+#endif
#ifndef HAVE_LIBPCAP
if (capture_option_specified)
}
/* Process the packets in the file */
+#ifdef HAVE_LIBPCAP
err = load_cap_file(&cfile, capture_opts.save_file, out_file_type);
+#else
+ err = load_cap_file(&cfile, NULL, out_file_type);
+#endif
if (err != 0) {
epan_cleanup();
exit(2);
/** Report a new capture file having been opened. */
void
-report_new_capture_file(const char *filename)
+report_new_capture_file(const char *filename _U_)
{
/* shouldn't happen */
g_assert_not_reached();
/** Report a number of new packets captured. */
void
-report_packet_count(int packet_count)
+report_packet_count(int packet_count _U_)
{
/* shouldn't happen */
g_assert_not_reached();
/** Report the packet drops once the capture finishes. */
void
-report_packet_drops(int drops)
+report_packet_drops(int drops _U_)
{
/* shouldn't happen */
g_assert_not_reached();