diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-05-26 00:19:27 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-05-26 00:19:27 +0000 |
commit | 7a630c61a1ad5e3cb7f6895256e568ca5a292645 (patch) | |
tree | f797ed91953ee652853c0a02b81557510f7c91b1 /tshark.c | |
parent | 237eef2ae7c9c4bb8b75fac76d79d3c3ad76fc51 (diff) |
Add a -q flag to dumpcap, to squelch its reporting of the packet count,
and add support for SIGINFO, so, if your OS supports SIGINFO, you can
get the packet count by typing ^T.
svn path=/trunk/; revision=32958
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -762,7 +762,6 @@ main(int argc, char *argv[]) #else gboolean capture_option_specified = FALSE; #endif - gboolean quiet = FALSE; int out_file_type = WTAP_FILE_PCAP; gchar *cf_name = NULL, *rfilter = NULL; #ifdef HAVE_PCAP_OPEN_DEAD @@ -1018,6 +1017,7 @@ main(int argc, char *argv[]) #ifdef HAVE_PCAP_CREATE case 'I': /* Capture in monitor mode, if available */ #endif + case 'q': /* Don't print packet counts */ case 's': /* Set the snapshot (capture) length */ case 'w': /* Write to capture file x */ case 'y': /* Set the pcap data link type */ @@ -1154,9 +1154,6 @@ main(int argc, char *argv[]) break; } break; - case 'q': /* Quiet */ - quiet = TRUE; - break; case 'r': /* Read capture file x */ cf_name = g_strdup(optarg); break; @@ -1323,7 +1320,7 @@ main(int argc, char *argv[]) if (!global_capture_opts.saving_to_file) { /* We're not saving the capture to a file; if "-q" wasn't specified, we should print packet information */ - if (!quiet) + if (!global_capture_opts.quiet) print_packet_info = TRUE; } else { /* We're saving to a file; if we're writing to the standard output. @@ -1666,7 +1663,7 @@ main(int argc, char *argv[]) show_print_file_io_error(err); return err; } - } else if (!quiet) { + } else if (!global_capture_opts.quiet) { /* * We're not printing information for each packet, and the user * didn't ask us not to print a count of packets as they arrive, @@ -2071,9 +2068,9 @@ capture_input_new_packets(capture_options *capture_opts, int to_read) #ifdef SIGINFO /* - * Prevent a SIGINFO handler from writing to stdout while we're - * doing so; instead, have it just set a flag telling us to print - * that information when we're done. + * Prevent a SIGINFO handler from writing to the standard error while + * we're doing so or writing to the standard output; instead, have it + * just set a flag telling us to print that information when we're done. */ infodelay = TRUE; #endif /* SIGINFO */ |