Replace "-Q" with "WIRESHARK_QUIT_AFTER_CAPTURE" as discussed in bug 6256.

svn path=/trunk/; revision=38784
This commit is contained in:
Gerald Combs 2011-08-29 21:16:29 +00:00
parent df5fdf9e63
commit db240c2b5e
5 changed files with 38 additions and 39 deletions

View File

@ -93,7 +93,7 @@ capture_opts_init(capture_options *capture_opts, void *cf)
#endif
capture_opts->real_time_mode = TRUE;
capture_opts->show_info = TRUE;
capture_opts->quit_after_cap = FALSE;
capture_opts->quit_after_cap = getenv("WIRESHARK_QUIT_AFTER_CAPTURE") ? TRUE : FALSE;
capture_opts->restart = FALSE;
capture_opts->multi_files_on = FALSE;
@ -638,10 +638,6 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg_
case 'P': /* Use pcap format */
capture_opts->use_pcapng = FALSE;
break;
case 'Q': /* Quit after capture (just capture to file) */
capture_opts->quit_after_cap = TRUE;
*start_capture = TRUE; /*** -Q implies -k !! ***/
break;
#ifdef HAVE_PCAP_REMOTE
case 'r':
if (capture_opts->ifaces->len > 0) {

View File

@ -50,67 +50,70 @@
<example id="ChCustEx1">
<title>Help information available from Wireshark</title>
<programlisting>
Wireshark 1.3.2
Wireshark 1.7.0 (SVN Rev 38783 from /trunk)
Interactively dump and analyze network traffic.
See http://www.wireshark.org for more information.
Copyright 1998-2009 Gerald Combs &lt;gerald@wireshark.org> and contributors.
Copyright 1998-2011 Gerald Combs &lt;gerald@wireshark.org&gt; and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Usage: wireshark [options] ... [ &lt;infile> ]
Usage: wireshark [options] ... [ &lt;infile&gt; ]
Capture interface:
-i &lt;interface> name or idx of interface (def: first non-loopback)
-f &lt;capture filter> packet filter in libpcap filter syntax
-s &lt;snaplen> packet snapshot length (def: 65535)
-i &lt;interface&gt; name or idx of interface (def: first non-loopback)
-f &lt;capture filter&gt; packet filter in libpcap filter syntax
-s &lt;snaplen&gt; packet snapshot length (def: 65535)
-p don't capture in promiscuous mode
-k start capturing immediately (def: do nothing)
-Q quit Wireshark after capturing
-S update packet display when new packets are captured
-l turn on automatic scrolling while -S is in use
-B &lt;buffer size> size of kernel buffer (def: 1MB)
-y &lt;link type> link layer type (def: first appropriate)
-I capture in monitor mode, if available
-B &lt;buffer size&gt; size of kernel buffer (def: 1MB)
-y &lt;link type&gt; link layer type (def: first appropriate)
-D print list of interfaces and exit
-L print list of link-layer types of iface and exit
Capture stop conditions:
-c &lt;packet count> stop after n packets (def: infinite)
-a &lt;autostop cond.> ... duration:NUM - stop after NUM seconds
-c &lt;packet count&gt; stop after n packets (def: infinite)
-a &lt;autostop cond.&gt; ... duration:NUM - stop after NUM seconds
filesize:NUM - stop this file after NUM KB
files:NUM - stop after NUM files
Capture output:
-b &lt;ringbuffer opt.> ... duration:NUM - switch to next file after NUM secs
-b &lt;ringbuffer opt.&gt; ... duration:NUM - switch to next file after NUM secs
filesize:NUM - switch to next file after NUM KB
files:NUM - ringbuffer: replace after NUM files
Input file:
-r &lt;infile> set the filename to read from (no pipes or stdin!)
-r &lt;infile&gt; set the filename to read from (no pipes or stdin!)
Processing:
-R &lt;read filter> packet filter in Wireshark display filter syntax
-R &lt;read filter&gt; packet filter in Wireshark display filter syntax
-n disable all name resolutions (def: all enabled)
-N &lt;name resolve flags> enable specific name resolution(s): "mntC"
-N &lt;name resolve flags&gt; enable specific name resolution(s): "mntC"
User interface:
-C &lt;config profile> start with specified configuration profile
-g &lt;packet number> go to specified packet number after "-r"
-J &lt;jump filter> jump to the first packet matching the (display) filter
-C &lt;config profile&gt; start with specified configuration profile
-g &lt;packet number&gt; go to specified packet number after "-r"
-J &lt;jump filter&gt; jump to the first packet matching the (display)
filter
-j search backwards for a matching packet after "-J"
-m &lt;font> set the font name used for most text
-m &lt;font&gt; set the font name used for most text
-t ad|a|r|d|dd|e output format of time stamps (def: r: rel. to first)
-X &lt;key>:&lt;value> eXtension options, see man page for details
-z &lt;statistics> show various statistics, see man page for details
-u s|hms output format of seconds (def: s: seconds)
-X &lt;key&gt;:&lt;value&gt; eXtension options, see man page for details
-z &lt;statistics&gt; show various statistics, see man page for details
Output:
-w &lt;outfile|-> set the output filename (or '-' for stdout)
-w &lt;outfile|-&gt; set the output filename (or '-' for stdout)
Miscellaneous:
-h display this help and exit
-v display version info and exit
-P &lt;key>:&lt;path> persconf:path - personal configuration files
-P &lt;key&gt;:&lt;path&gt; persconf:path - personal configuration files
persdata:path - personal data files
-o &lt;name>:&lt;value> ... override preference or recent setting
-K &lt;keytab> keytab file to use for kerberos decryption
-o &lt;name&gt;:&lt;value&gt; ... override preference or recent setting
-K &lt;keytab&gt; keytab file to use for kerberos decryption
--display=DISPLAY X display to use
</programlisting>
</example>
@ -1723,5 +1726,3 @@ standard libpcap format.
</chapter>
<!-- End of WSUG Chapter Customizing -->

View File

@ -1155,7 +1155,6 @@ print_usage(gboolean print_ver) {
fprintf(output, " -s <snaplen> packet snapshot length (def: 65535)\n");
fprintf(output, " -p don't capture in promiscuous mode\n");
fprintf(output, " -k start capturing immediately (def: do nothing)\n");
fprintf(output, " -Q quit Wireshark after capturing\n");
fprintf(output, " -S update packet display when new packets are captured\n");
fprintf(output, " -l turn on automatic scrolling while -S is in use\n");
#ifdef HAVE_PCAP_CREATE
@ -2071,7 +2070,7 @@ main(int argc, char *argv[])
#define OPTSTRING_I ""
#endif
#define OPTSTRING "a:b:" OPTSTRING_B "c:C:Df:g:Hhi:" OPTSTRING_I "jJ:kK:lLm:nN:o:P:pQr:R:Ss:t:u:vw:X:y:z:"
#define OPTSTRING "a:b:" OPTSTRING_B "c:C:Df:g:Hhi:" OPTSTRING_I "jJ:kK:lLm:nN:o:P:pr:R:Ss:t:u:vw:X:y:z:"
static const char optstring[] = OPTSTRING;
@ -2452,7 +2451,6 @@ main(int argc, char *argv[])
#ifdef HAVE_PCAP_CREATE
case 'I': /* Capture in monitor mode, if available */
#endif
case 'Q': /* Quit after capture (just capture to file) */
case 's': /* Set the snapshot (capture) length */
case 'S': /* "Sync" mode: used for following file ala tail -f */
case 'w': /* Write to capture file xxx */

View File

@ -80,6 +80,9 @@ if [ "$WS_SYSTEM" != "Windows" ] && which mkfifo &>/dev/null ; then
TEST_FIFO=1
fi
# Tell Wireshark to quit after capuring packets.
export WIRESHARK_QUIT_AFTER_CAPTURE="True"
# Display our environment
##printf "\n ------- Info =-----------------\n"

View File

@ -386,8 +386,9 @@ capture_step_snapshot() {
}
wireshark_capture_suite() {
# Q: quit after cap, k: start capture immediately
DUT="$WIRESHARK -Q -k"
# k: start capture immediately
# WIRESHARK_QUIT_AFTER_CAPTURE needs to be set.
DUT="$WIRESHARK -k"
test_step_add "Capture 10 packets" capture_step_10packets
# piping to stdout doesn't work with Wireshark and capturing!
#test_step_add "Capture 10 packets using stdout: -w -" capture_step_10packets_stdout