Fix a typo or two
[metze/wireshark/wip.git] / doc / tshark.pod
1 ic
2 =head1 NAME
3
4 tshark - Dump and analyze network traffic
5
6 =head1 SYNOPSIS
7
8 B<tshark>
9 S<[ B<-2> ]>
10 S<[ B<-a> E<lt>capture autostop conditionE<gt> ] ...>
11 S<[ B<-b> E<lt>capture ring buffer optionE<gt>] ...>
12 S<[ B<-B> E<lt>capture buffer sizeE<gt> ] >
13 S<[ B<-c> E<lt>capture packet countE<gt> ]>
14 S<[ B<-C> E<lt>configuration profileE<gt> ]>
15 S<[ B<-d> E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt> ]>
16 S<[ B<-D> ]>
17 S<[ B<-e> E<lt>fieldE<gt> ]>
18 S<[ B<-E> E<lt>field print optionE<gt> ]>
19 S<[ B<-f> E<lt>capture filterE<gt> ]>
20 S<[ B<-F> E<lt>file formatE<gt> ]>
21 S<[ B<-h> ]>
22 S<[ B<-H> E<lt>input hosts fileE<gt> ]>
23 S<[ B<-i> E<lt>capture interfaceE<gt>|- ]>
24 S<[ B<-I> ]>
25 S<[ B<-K> E<lt>keytabE<gt> ]>
26 S<[ B<-l> ]>
27 S<[ B<-L> ]>
28 S<[ B<-n> ]>
29 S<[ B<-N> E<lt>name resolving flagsE<gt> ]>
30 S<[ B<-o> E<lt>preference settingE<gt> ] ...>
31 S<[ B<-O> E<lt>protocolsE<gt> ]>
32 S<[ B<-p> ]>
33 S<[ B<-P> ]>
34 S<[ B<-q> ]>
35 S<[ B<-r> E<lt>infileE<gt> ]>
36 S<[ B<-R> E<lt>read (display) filterE<gt> ]>
37 S<[ B<-s> E<lt>capture snaplenE<gt> ]>
38 S<[ B<-S> E<lt>separatorE<gt> ]>
39 S<[ B<-t> ad|a|r|d|dd|e ]>
40 S<[ B<-T> pdml|psml|ps|text|fields ]>
41 S<[ B<-v> ]>
42 S<[ B<-V> ]>
43 S<[ B<-w> E<lt>outfileE<gt>|- ]>
44 S<[ B<-W> E<lt>file format optionE<gt>]>
45 S<[ B<-x> ]>
46 S<[ B<-X> E<lt>eXtension optionE<gt>]>
47 S<[ B<-y> E<lt>capture link typeE<gt> ]>
48 S<[ B<-z> E<lt>statisticsE<gt> ]>
49 S<[ E<lt>capture filterE<gt> ]>
50
51 B<tshark>
52 B<-G> [fields|fields2|fields3|protocols|values|decodes|defaultprefs|currentprefs]
53
54 =head1 DESCRIPTION
55
56 B<TShark> is a network protocol analyzer.  It lets you capture packet
57 data from a live network, or read packets from a previously saved
58 capture file, either printing a decoded form of those packets to the
59 standard output or writing the packets to a file.  B<TShark>'s native
60 capture file format is B<libpcap> format, which is also the format used
61 by B<tcpdump> and various other tools.
62
63 Without any options set, B<TShark> will work much like B<tcpdump>.  It will
64 use the pcap library to capture traffic from the first available network
65 interface and displays a summary line on stdout for each received packet.
66
67 B<TShark> is able to detect, read and write the same capture files that
68 are supported by B<Wireshark>.
69 The input file doesn't need a specific filename extension; the file
70 format and an optional gzip compression will be automatically detected.
71 Near the beginning of the DESCRIPTION section of wireshark(1) or
72 L<http://www.wireshark.org/docs/man-pages/wireshark.html>
73 is a detailed description of the way B<Wireshark> handles this, which is
74 the same way B<Tshark> handles this.
75
76 Compressed file support uses (and therefore requires) the zlib library.
77 If the zlib library is not present, B<TShark> will compile, but will
78 be unable to read compressed files.
79
80 If the B<-w> option is not specified, B<TShark> writes to the standard
81 output the text of a decoded form of the packets it captures or reads.
82 If the B<-w> option is specified, B<TShark> writes to the file
83 specified by that option the raw data of the packets, along with the
84 packets' time stamps.
85
86 When writing a decoded form of packets, B<TShark> writes, by
87 default, a summary line containing the fields specified by the
88 preferences file (which are also the fields displayed in the packet list
89 pane in B<Wireshark>), although if it's writing packets as it captures
90 them, rather than writing packets from a saved capture file, it won't
91 show the "frame number" field.  If the B<-V> option is specified, it
92 writes instead a view of the details of the packet, showing all the
93 fields of all protocols in the packet.  If the B<-O> option is specified,
94 it will only show the full protocols specified.  Use the output of
95 "B<tshark -G protocols>" to find the abbreviations of the protocols you can
96 specify.
97
98 If you want to write the decoded form of packets to a file, run
99 B<TShark> without the B<-w> option, and redirect its standard output to
100 the file (do I<not> use the B<-w> option).
101
102 When writing packets to a file, B<TShark>, by default, writes the
103 file in B<libpcap> format, and writes all of the packets it sees to the
104 output file.  The B<-F> option can be used to specify the format in which
105 to write the file.  This list of available file formats is displayed by
106 the B<-F> flag without a value.  However, you can't specify a file format
107 for a live capture.
108
109 Read filters in B<TShark>, which allow you to select which packets
110 are to be decoded or written to a file, are very powerful; more fields
111 are filterable in B<TShark> than in other protocol analyzers, and the
112 syntax you can use to create your filters is richer.  As B<TShark>
113 progresses, expect more and more protocol fields to be allowed in read
114 filters.
115
116 Packet capturing is performed with the pcap library.  The capture filter
117 syntax follows the rules of the pcap library.  This syntax is different
118 from the read filter syntax.  A read filter can also be specified when
119 capturing, and only packets that pass the read filter will be displayed
120 or saved to the output file; note, however, that capture filters are much
121 more efficient than read filters, and it may be more difficult for
122 B<TShark> to keep up with a busy network if a read filter is
123 specified for a live capture.
124
125 A capture or read filter can either be specified with the B<-f> or B<-R>
126 option, respectively, in which case the entire filter expression must be
127 specified as a single argument (which means that if it contains spaces,
128 it must be quoted), or can be specified with command-line arguments
129 after the option arguments, in which case all the arguments after the
130 filter arguments are treated as a filter expression.  Capture filters
131 are supported only when doing a live capture; read filters are supported
132 when doing a live capture and when reading a capture file, but require
133 TShark to do more work when filtering, so you might be more likely to
134 lose packets under heavy load if you're using a read filter.  If the
135 filter is specified with command-line arguments after the option
136 arguments, it's a capture filter if a capture is being done (i.e., if no
137 B<-r> option was specified) and a read filter if a capture file is being
138 read (i.e., if a B<-r> option was specified).
139
140 The B<-G> option is a special mode that simply causes B<Tshark>
141 to dump one of several types of internal glossaries and then exit.
142
143 =head1 OPTIONS
144
145 =over 4
146
147 =item -2
148
149 Perform a two-pass analysis.
150
151 =item -a  E<lt>capture autostop conditionE<gt>
152
153 Specify a criterion that specifies when B<TShark> is to stop writing
154 to a capture file.  The criterion is of the form I<test>B<:>I<value>,
155 where I<test> is one of:
156
157 B<duration>:I<value> Stop writing to a capture file after I<value> seconds
158 have elapsed.
159
160 B<filesize>:I<value> Stop writing to a capture file after it reaches a size of
161 I<value> kilobytes (where a kilobyte is 1024 bytes).  If this option is used
162 together with the -b option, B<TShark> will stop writing to the current
163 capture file and switch to the next one if filesize is reached.  When reading a
164 capture file, B<TShark> will stop reading the file after the number of bytes
165 read exceeds this number (the complete packet will be read, so more bytes than
166 this number may be read).
167
168 B<files>:I<value> Stop writing to capture files after I<value> number of files
169 were written.
170
171 =item -b  E<lt>capture ring buffer optionE<gt>
172
173 Cause B<TShark> to run in "multiple files" mode.  In "multiple files" mode,
174 B<TShark> will write to several capture files.  When the first capture file
175 fills up, B<TShark> will switch writing to the next file and so on.
176
177 The created filenames are based on the filename given with the B<-w> option,
178 the number of the file and on the creation date and time,
179 e.g. outfile_00001_20050604120117.pcap, outfile_00002_20050604120523.pcap, ...
180
181 With the I<files> option it's also possible to form a "ring buffer".
182 This will fill up new files until the number of files specified,
183 at which point B<TShark> will discard the data in the first file and start
184 writing to that file and so on.  If the I<files> option is not set,
185 new files filled up until one of the capture stop conditions match (or
186 until the disk is full).
187
188 The criterion is of the form I<key>B<:>I<value>,
189 where I<key> is one of:
190
191 B<duration>:I<value> switch to the next file after I<value> seconds have
192 elapsed, even if the current file is not completely filled up.
193
194 B<filesize>:I<value> switch to the next file after it reaches a size of
195 I<value> kilobytes (where a kilobyte is 1024 bytes).
196
197 B<files>:I<value> begin again with the first file after I<value> number of
198 files were written (form a ring buffer).  This value must be less than 100000.
199 Caution should be used when using large numbers of files: some filesystems do
200 not handle many files in a single directory well.  The B<files> criterion
201 requires either B<duration> or B<filesize> to be specified to control when to
202 go to the next file.  It should be noted that each B<-b> parameter takes exactly
203 one criterion; to specify two criterion, each must be preceded by the B<-b>
204 option.
205
206 Example: B<-b filesize:1024 -b files:5> results in a ring buffer of five files
207 of size one megabyte.
208
209 =item -B  E<lt>capture buffer sizeE<gt>
210
211 Set capture buffer size (in MB, default is 1MB).  This is used by the
212 the capture driver to buffer packet data until that data can be written
213 to disk.  If you encounter packet drops while capturing, try to increase
214 this size.  Note that, while B<Tshark> attempts to set the buffer size
215 to 1MB by default, and can be told to set it to a larger value, the
216 system or interface on which you're capturing might silently limit the
217 capture buffer size to a lower value or raise it to a higher value.
218
219 This is available on UNIX systems with libpcap 1.0.0 or later and on
220 Windows.  It is not available on UNIX systems with earlier versions of
221 libpcap.
222
223 This option can occur multiple times.  If used before the first
224 occurrence of the B<-i> option, it sets the default capture buffer size.
225 If used after an B<-i> option, it sets the capture buffer size for
226 the interface specified by the last B<-i> option occurring before
227 this option.  If the capture buffer size is not set specifically,
228 the default capture buffer size is used if provided.
229
230 =item -c  E<lt>capture packet countE<gt>
231
232 Set the maximum number of packets to read when capturing live
233 data.  If reading a capture file, set the maximum number of packets to read.
234
235 =item -C  E<lt>configuration profileE<gt>
236
237 Run with the given configuration profile.
238
239 =item -d  E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt>
240
241 Like Wireshark's B<Decode As...> feature, this lets you specify how a
242 layer type should be dissected.  If the layer type in question (for example,
243 B<tcp.port> or B<udp.port> for a TCP or UDP port number) has the specified
244 selector value, packets should be dissected as the specified protocol.
245
246 Example: B<-d tcp.port==8888,http> will decode any traffic running over
247 TCP port 8888 as HTTP.
248
249 Using an invalid selector or protocol will print out a list of valid selectors
250 and protocol names, respectively.
251
252 Example: B<-d .> is a quick way to get a list of valid selectors.
253
254 Example: B<-d ethertype==0x0800.> is a quick way to get a list of protocols that can be
255 selected with an ethertype.
256
257 =item -D
258
259 Print a list of the interfaces on which B<TShark> can capture, and
260 exit.  For each network interface, a number and an
261 interface name, possibly followed by a text description of the
262 interface, is printed.  The interface name or the number can be supplied
263 to the B<-i> option to specify an interface on which to capture.
264
265 This can be useful on systems that don't have a command to list them
266 (e.g., Windows systems, or UNIX systems lacking B<ifconfig -a>);
267 the number can be useful on Windows 2000 and later systems, where the
268 interface name is a somewhat complex string.
269
270 Note that "can capture" means that B<TShark> was able to open that
271 device to do a live capture.  Depending on your system you may need to
272 run tshark from an account with special privileges (for example, as
273 root) to be able to capture network traffic.  If B<TShark -D> is not run
274 from such an account, it will not list any interfaces.
275
276 =item -e  E<lt>fieldE<gt>
277
278 Add a field to the list of fields to display if B<-T fields> is
279 selected.  This option can be used multiple times on the command line.
280 At least one field must be provided if the B<-T fields> option is
281 selected.
282
283 Example: B<-e frame.number -e ip.addr -e udp>
284
285 Giving a protocol rather than a single field will print multiple items
286 of data about the protocol as a single field.  Fields are separated by
287 tab characters by default.  B<-E> controls the format of the printed
288 fields.
289
290 =item -E  E<lt>field print optionE<gt>
291
292 Set an option controlling the printing of fields when B<-T fields> is
293 selected.
294
295 Options are:
296
297 B<header=y|n> If B<y>, print a list of the field names given using B<-e>
298 as the first line of the output; the field name will be separated using
299 the same character as the field values.  Defaults to B<n>.
300
301 B<separator=/t|/s|>E<lt>characterE<gt> Set the separator character to
302 use for fields.  If B</t> tab will be used (this is the default), if
303 B</s>, a single space will be used.  Otherwise any character that can be
304 accepted by the command line as part of the option may be used.
305
306 B<occurrence=f|l|a> Select which occurrence to use for fields that have
307 multiple occurrences.  If B<f> the first occurrence will be used, if B<l>
308 the last occurrence will be used and if B<a> all occurrences will be used
309 (this is the default).
310
311 B<aggregator=,|/s|>E<lt>characterE<gt> Set the aggregator character to
312 use for fields that have multiple occurrences.  If B<,> a comma will be used
313 (this is the default), if B</s>, a single space will be used.  Otherwise
314 any character that can be accepted by the command line as part of the
315 option may be used.
316
317 B<quote=d|s|n> Set the quote character to use to surround fields.  B<d>
318 uses double-quotes, B<s> single-quotes, B<n> no quotes (the default).
319
320 =item -f  E<lt>capture filterE<gt>
321
322 Set the capture filter expression.
323
324 This option can occur multiple times.  If used before the first
325 occurrence of the B<-i> option, it sets the default capture filter expression.
326 If used after an B<-i> option, it sets the capture filter expression for
327 the interface specified by the last B<-i> option occurring before
328 this option.  If the capture filter expression is not set specifically,
329 the default capture filter expression is used if provided.
330
331 =item -F  E<lt>file formatE<gt>
332
333 Set the file format of the output capture file written using the B<-w>
334 option.  The output written with the B<-w> option is raw packet data, not
335 text, so there is no B<-F> option to request text output.  The option B<-F>
336 without a value will list the available formats.
337
338 =item -G  [fields|fields2|fields3|protocols|values|decodes|defaultprefs|currentprefs]
339
340 The B<-G> option will cause B<Tshark> to dump one of several types of glossaries
341 and then exit.  If no specific glossary type is specified, then the B<fields> report will be generated by default.
342
343 The available report types include:
344
345 B<fields>  Dumps the contents of the registration database to
346 stdout.  An independent program can take this output and format it into nice
347 tables or HTML or whatever.  There is one record per line.  Each record is
348 either a protocol or a header field, differentiated by the first field.
349 The fields are tab-delimited.
350
351  * Protocols
352  * ---------
353  * Field 1 = 'P'
354  * Field 2 = descriptive protocol name
355  * Field 3 = protocol abbreviation
356  *
357  * Header Fields
358  * -------------
359  * Field 1 = 'F'
360  * Field 2 = descriptive field name
361  * Field 3 = field abbreviation
362  * Field 4 = type ( textual representation of the ftenum type )
363  * Field 5 = parent protocol abbreviation
364  * Field 6 = blurb describing field
365
366 B<fields2>  Same as the B<fields> report but includes two additional columns.
367
368  * Field 7 = base for display (for integer types); "parent bitfield width" for FT_BOOLEAN
369  * Field 8 = blurb describing field (yes, apparently we repeated this accidentally)
370
371 B<fields3>  Same as the B<fields> report but includes two additional columns.
372
373  * Field 7 = base for display (for integer types); "parent bitfield width" for FT_BOOLEAN
374  * Field 8 = bitmask: format: hex: 0x....
375
376 B<protocols> Dumps the protocols in the registration database to stdout.
377 An independent program can take this output and format it into nice tables
378 or HTML or whatever.  There is one record per line.  The fields are tab-delimited.
379
380  * Field 1 = protocol name
381  * Field 2 = protocol short name
382  * Field 3 = protocol filter name
383
384 B<values> Dumps the value_strings, range_strings or true/false strings
385 for fields that have them.  There is one record per line.  Fields are
386 tab-delimited.  There are three types of records: Value String, Range
387 String and True/False String.  The first field, 'V', 'R' or 'T', indicates
388 the type of record.
389
390  * Value Strings
391  * -------------
392  * Field 1 = 'V'
393  * Field 2 = field abbreviation to which this value string corresponds
394  * Field 3 = Integer value
395  * Field 4 = String
396  *
397  * Range Strings
398  * -------------
399  * Field 1 = 'R'
400  * Field 2 = field abbreviation to which this range string corresponds
401  * Field 3 = Integer value: lower bound
402  * Field 4 = Integer value: upper bound
403  * Field 5 = String
404  *
405  * True/False Strings
406  * ------------------
407  * Field 1 = 'T'
408  * Field 2 = field abbreviation to which this true/false string corresponds
409  * Field 3 = True String
410  * Field 4 = False String
411
412 B<decodes> Dumps the "layer type"/"decode as" associations to stdout.
413 There is one record per line.  The fields are tab-delimited.
414
415  * Field 1 = layer type, e.g. "tcp.port"
416  * Field 2 = selector in decimal
417  * Field 3 = "decode as" name, e.g. "http"
418
419 B<defaultprefs>  Dumps a default preferences file to stdout.
420
421 B<currentprefs>  Dumps a copy of the current preferences file to stdout.
422
423 =item -h
424
425 Print the version and options and exits.
426
427 =item -H  E<lt>input hosts fileE<gt>
428
429 Read a list of entries from a "hosts" file, which will then be written
430 to a capture file.  Implies B<-W n>.
431
432 The "hosts" file format is documented at
433 L<http://en.wikipedia.org/wiki/Hosts_(file)>.
434
435 =item -i  E<lt>capture interfaceE<gt> | -
436
437 Set the name of the network interface or pipe to use for live packet
438 capture.
439
440 Network interface names should match one of the names listed in
441 "B<tshark -D>" (described above); a number, as reported by
442 "B<tshark -D>", can also be used.  If you're using UNIX, "B<netstat
443 -i>" or "B<ifconfig -a>" might also work to list interface names,
444 although not all versions of UNIX support the B<-a> option to B<ifconfig>.
445
446 If no interface is specified, B<TShark> searches the list of
447 interfaces, choosing the first non-loopback interface if there are any
448 non-loopback interfaces, and choosing the first loopback interface if
449 there are no non-loopback interfaces.  If there are no interfaces at all,
450 B<TShark> reports an error and doesn't start the capture.
451
452 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
453 read data from the standard input.  Data read from pipes must be in
454 standard libpcap format.
455
456 This option can occur multiple times.  When capturing from multiple
457 interfaces, the capture file will be saved in pcap-ng format.
458
459 Note: the Win32 version of B<TShark> doesn't support capturing from
460 pipes!
461
462 =item -I
463
464 Put the interface in "monitor mode"; this is supported only on IEEE
465 802.11 Wi-Fi interfaces, and supported only on some operating systems.
466
467 Note that in monitor mode the adapter might disassociate from the
468 network with which it's associated, so that you will not be able to use
469 any wireless networks with that adapter.  This could prevent accessing
470 files on a network server, or resolving host names or network addresses,
471 if you are capturing in monitor mode and are not connected to another
472 network with another adapter.
473
474 This option can occur multiple times.  If used before the first
475 occurrence of the B<-i> option, it enables the monitor mode for all interfaces.
476 If used after an B<-i> option, it enables the monitor mode for
477 the interface specified by the last B<-i> option occurring before
478 this option.
479
480 =item -K  E<lt>keytabE<gt>
481
482 Load kerberos crypto keys from the specified keytab file.
483 This option can be used multiple times to load keys from several files.
484
485 Example: B<-K krb5.keytab>
486
487 =item -l
488
489 Flush the standard output after the information for each packet is
490 printed.  (This is not, strictly speaking, line-buffered if B<-V>
491 was specified; however, it is the same as line-buffered if B<-V> wasn't
492 specified, as only one line is printed for each packet, and, as B<-l> is
493 normally used when piping a live capture to a program or script, so that
494 output for a packet shows up as soon as the packet is seen and
495 dissected, it should work just as well as true line-buffering.  We do
496 this as a workaround for a deficiency in the Microsoft Visual C++ C
497 library.)
498
499 This may be useful when piping the output of B<TShark> to another
500 program, as it means that the program to which the output is piped will
501 see the dissected data for a packet as soon as B<TShark> sees the
502 packet and generates that output, rather than seeing it only when the
503 standard output buffer containing that data fills up.
504
505 =item -L
506
507 List the data link types supported by the interface and exit.  The reported
508 link types can be used for the B<-y> option.
509
510 =item -n
511
512 Disable network object name resolution (such as hostname, TCP and UDP port
513 names); the B<-N> flag might override this one.
514
515 =item -N  E<lt>name resolving flagsE<gt>
516
517 Turn on name resolving only for particular types of addresses and port
518 numbers, with name resolving for other types of addresses and port
519 numbers turned off.  This flag overrides B<-n> if both B<-N> and B<-n> are
520 present.  If both B<-N> and B<-n> flags are not present, all name resolutions
521 are turned on.
522
523 The argument is a string that may contain the letters:
524
525 B<m> to enable MAC address resolution
526
527 B<n> to enable network address resolution
528
529 B<t> to enable transport-layer port number resolution
530
531 B<C> to enable concurrent (asynchronous) DNS lookups
532
533 =item -o  E<lt>preferenceE<gt>:E<lt>valueE<gt>
534
535 Set a preference value, overriding the default value and any value read
536 from a preference file.  The argument to the option is a string of the
537 form I<prefname>B<:>I<value>, where I<prefname> is the name of the
538 preference (which is the same name that would appear in the preference
539 file), and I<value> is the value to which it should be set.
540
541 =item -O  E<lt>protocolsE<gt>
542
543 Similar to the B<-V> option, but causes B<TShark> to only show a detailed view
544 of the comma-separated list of I<protocols> specified, rather than a detailed
545 view of all protocols.  Use the output of "B<tshark -G protocols>" to find the
546 abbreviations of the protocols you can specify.
547
548 =item -p
549
550 I<Don't> put the interface into promiscuous mode.  Note that the
551 interface might be in promiscuous mode for some other reason; hence,
552 B<-p> cannot be used to ensure that the only traffic that is captured is
553 traffic sent to or from the machine on which B<TShark> is running,
554 broadcast traffic, and multicast traffic to addresses received by that
555 machine.
556
557 This option can occur multiple times.  If used before the first
558 occurrence of the B<-i> option, no interface will be put into the
559 promiscuous mode.
560 If used after an B<-i> option, the interface specified by the last B<-i>
561 option occurring before this option will not be put into the
562 promiscuous mode.
563
564 =item -P
565
566 Decode and display packets even while writing raw packet data using the
567 B<-w> option.
568
569 =item -q
570
571 When capturing packets, don't display the continuous count of packets
572 captured that is normally shown when saving a capture to a file;
573 instead, just display, at the end of the capture, a count of packets
574 captured.  On systems that support the SIGINFO signal, such as various
575 BSDs, you can cause the current count to be displayed by typing your
576 "status" character (typically control-T, although it
577 might be set to "disabled" by default on at least some BSDs, so you'd
578 have to explicitly set it to use it).
579
580 When reading a capture file, or when capturing and not saving to a file,
581 don't print packet information; this is useful if you're using a B<-z>
582 option to calculate statistics and don't want the packet information
583 printed, just the statistics.
584
585 =item -r  E<lt>infileE<gt>
586
587 Read packet data from I<infile>, can be any supported capture file format
588 (including gzipped files).  It's B<not> possible to use named pipes
589 or stdin here!
590
591 =item -R  E<lt>read (display) filterE<gt>
592
593 Cause the specified filter (which uses the syntax of read/display filters,
594 rather than that of capture filters) to be applied before printing a
595 decoded form of packets or writing packets to a file; packets not
596 matching the filter are discarded rather than being printed or written.
597
598 =item -s  E<lt>capture snaplenE<gt>
599
600 Set the default snapshot length to use when capturing live data.
601 No more than I<snaplen> bytes of each network packet will be read into
602 memory, or saved to disk.  A value of 0 specifies a snapshot length of
603 65535, so that the full packet is captured; this is the default.
604
605 This option can occur multiple times.  If used before the first
606 occurrence of the B<-i> option, it sets the default snapshot length.
607 If used after an B<-i> option, it sets the snapshot length for
608 the interface specified by the last B<-i> option occurring before
609 this option.  If the snapshot length is not set specifically,
610 the default snapshot length is used if provided.
611
612 =item -S  E<lt>separatorE<gt>
613
614 Set the line separator to be printed between packets.
615
616 =item -t  ad|a|r|d|dd|e
617
618 Set the format of the packet timestamp printed in summary lines.
619 The format can be one of:
620
621 B<ad> absolute with date: The absolute date and time is the actual time and
622 date the packet was captured
623
624 B<a> absolute: The absolute time is the actual time the packet was captured,
625 with no date displayed
626
627 B<r> relative: The relative time is the time elapsed between the first packet
628 and the current packet
629
630 B<d> delta: The delta time is the time since the previous packet was
631 captured
632
633 B<dd> delta_displayed: The delta_displayed time is the time since the
634 previous displayed packet was captured
635
636 B<e> epoch: The time in seconds since epoch (Jan 1, 1970 00:00:00)
637
638 The default format is relative.
639
640 =item -T  pdml|psml|ps|text|fields
641
642 Set the format of the output when viewing decoded packet data.  The
643 options are one of:
644
645 B<pdml> Packet Details Markup Language, an XML-based format for the details of
646 a decoded packet.  This information is equivalent to the packet details
647 printed with the B<-V> flag.
648
649 B<psml> Packet Summary Markup Language, an XML-based format for the summary
650 information of a decoded packet.  This information is equivalent to the
651 information shown in the one-line summary printed by default.
652
653 B<ps> PostScript for a human-readable one-line summary of each of the packets,
654 or a multi-line view of the details of each of the packets, depending on
655 whether the B<-V> flag was specified.
656
657 B<text> Text of a human-readable one-line summary of each of the packets, or a
658 multi-line view of the details of each of the packets, depending on
659 whether the B<-V> flag was specified.  This is the default.
660
661 B<fields> The values of fields specified with the B<-e> option, in a
662 form specified by the B<-E> option.  For example,
663
664   -T fields -E separator=, -E quote=d
665
666 would generate comma-separated values (CSV) output suitable for importing
667 into your favorite spreadsheet program.
668
669
670 =item -v
671
672 Print the version and exit.
673
674 =item -V
675
676 Cause B<TShark> to print a view of the packet details rather
677 than a one-line summary of the packet.
678
679 =item -w  E<lt>outfileE<gt> | -
680
681 Write raw packet data to I<outfile> or to the standard output if
682 I<outfile> is '-'.
683
684 NOTE: -w provides raw packet data, not text.  If you want text output
685 you need to redirect stdout (e.g. using '>'), don't use the B<-w>
686 option for this.
687
688 =item -W  E<lt>file format optionE<gt>
689
690 Save extra information in the file if the format supports it.  For
691 example,
692
693   -F pcapng -W n
694
695 will save host name resolution records along with captured packets.
696
697 Future versions of Wireshark may automatically change the capture format to
698 B<pcapng> as needed.
699
700 The argument is a string that may contain the following letter:
701
702 B<n> write network address resolution information (pcapng only)
703
704 =item -x
705
706 Cause B<TShark> to print a hex and ASCII dump of the packet data
707 after printing the summary or details.
708
709 =item -X E<lt>eXtension optionsE<gt>
710
711 Specify an option to be passed to a B<TShark> module.  The eXtension option
712 is in the form I<extension_key>B<:>I<value>, where I<extension_key> can be:
713
714 B<lua_script>:I<lua_script_filename> tells B<Wireshark> to load the given script in addition to the
715 default Lua scripts.
716
717 =item -y  E<lt>capture link typeE<gt>
718
719 Set the data link type to use while capturing packets.  The values
720 reported by B<-L> are the values that can be used.
721
722 This option can occur multiple times.  If used before the first
723 occurrence of the B<-i> option, it sets the default capture link type.
724 If used after an B<-i> option, it sets the capture link type for
725 the interface specified by the last B<-i> option occurring before
726 this option.  If the capture link type is not set specifically,
727 the default capture link type is used if provided.
728
729 =item -z  E<lt>statisticsE<gt>
730
731 Get B<TShark> to collect various types of statistics and display the result
732 after finishing reading the capture file.  Use the B<-q> flag if you're
733 reading a capture file and only want the statistics printed, not any
734 per-packet information.
735
736 Note that the B<-z proto> option is different - it doesn't cause
737 statistics to be gathered and printed when the capture is complete, it
738 modifies the regular packet summary output to include the values of
739 fields specified with the option.  Therefore you must not use the B<-q>
740 option, as that option would suppress the printing of the regular packet
741 summary output, and must also not use the B<-V> option, as that would
742 cause packet detail information rather than packet summary information
743 to be printed.
744
745 Currently implemented statistics are:
746
747 =over 4
748
749 =item B<-z> afp,srt[,I<filter>]
750
751 =item B<-z> camel,srt
752
753 =item B<-z> conv,I<type>[,I<filter>]
754
755 Create a table that lists all conversations that could be seen in the
756 capture.  I<type> specifies the conversation endpoint types for which we
757 want to generate the statistics; currently the supported ones are:
758
759   "eth"   Ethernet addresses
760   "fc"    Fibre Channel addresses
761   "fddi"  FDDI addresses
762   "ip"    IPv4 addresses
763   "ipv6"  IPv6 addresses
764   "ipx"   IPX addresses
765   "tcp"   TCP/IP socket pairs  Both IPv4 and IPv6 are supported
766   "tr"    Token Ring addresses
767   "udp"   UDP/IP socket pairs  Both IPv4 and IPv6 are supported
768
769 If the optional I<filter> is specified, only those packets that match the
770 filter will be used in the calculations.
771
772 The table is presented with one line for each conversation and displays
773 the number of packets/bytes in each direction as well as the total
774 number of packets/bytes.  The table is sorted according to the total
775 number of frames.
776
777 =item B<-z> dcerpc,srt,I<uuid>,I<major>.I<minor>[,I<filter>]
778
779 Collect call/reply SRT (Service Response Time) data for DCERPC interface I<uuid>,
780 version I<major>.I<minor>.
781 Data collected is the number of calls for each procedure, MinSRT, MaxSRT
782 and AvgSRT.
783
784 Example: S<B<-z dcerpc,srt,12345778-1234-abcd-ef00-0123456789ac,1.0>> will collect data for the CIFS SAMR Interface.
785
786 This option can be used multiple times on the command line.
787
788 If the optional I<filter> is provided, the stats will only be calculated
789 on those calls that match that filter.
790
791 Example: S<B<-z dcerpc,srt,12345778-1234-abcd-ef00-0123456789ac,1.0,ip.addr==1.2.3.4>> will collect SAMR
792 SRT statistics for a specific host.
793
794 =item B<-z> diameter,avp[,I<cmd.code>,I<field>,I<field>,I<...>]
795
796 This option enables extraction of most important diameter fields from large capture files.
797 Exactly one text line for each diameter message with matched B<diameter.cmd.code> will be printed.
798
799 Empty diameter command code or '*' can be specified to mach any B<diameter.cmd.code>
800
801 Example: B<-z diameter,avp>  extract default field set from diameter messages.
802
803 Example: B<-z diameter,avp,280>  extract default field set from diameter DWR messages.
804
805 Example: B<-z diameter,avp,272>  extract default field set from diameter CC messages.
806
807 Extract most important fields from diameter CC messages:
808
809 B<tshark -r file.cap.gz -q -z diameter,avp,272,CC-Request-Type,CC-Request-Number,Session-Id,Subscription-Id-Data,Rating-Group,Result-Code>
810
811 Following fields will be printed out for each diameter message:
812
813   "frame"        Frame number.
814   "time"         Unix time of the frame arrival.
815   "src"          Source address.
816   "srcport"      Source port.
817   "dst"          Destination address.
818   "dstport"      Destination port.
819   "proto"        Constant string 'diameter', which can be used for post processing of tshark output.  E.g. grep/sed/awk.
820   "msgnr"        seq. number of diameter message within the frame.  E.g. '2' for the third diameter message in the same frame.
821   "is_request"   '0' if message is a request, '1' if message is an answer.
822   "cmd"          diameter.cmd_code, E.g. '272' for credit control messages.
823   "req_frame"    Number of frame where matched request was found or '0'.
824   "ans_frame"    Number of frame where matched answer was found or '0'.
825   "resp_time"    response time in seconds, '0' in case if matched Request/Answer is not found in trace.  E.g. in the begin or end of capture.
826
827 B<-z diameter,avp> option is much faster than B<-V -T text> or B<-T pdml> options.
828
829 B<-z diameter,avp> option is more powerful than B<-T field> and B<-z proto,colinfo> options.
830
831 Multiple diameter messages in one frame are supported.
832
833 Several fields with same name within one diameter message are supported, e.g. I<diameter.Subscription-Id-Data> or I<diameter.Rating-Group>.
834
835 Note: B<tshark -q> option is recommended to suppress default B<tshark> output.
836
837 =item B<-z> expert[I<,error|,warn|,note|,chat>][I<,filter>]
838
839 Collects information about all expert info, and will display them in order,
840 grouped by severity.
841
842 Example: B<-z expert,sip> will show expert items of all severity for frames that
843 match the sip protocol.
844
845 This option can be used multiple times on the command line.
846
847 If the optional I<filter> is provided, the stats will only be calculated
848 on those calls that match that filter.
849
850 Example: B<-z "expert,note,tcp"> will only collect expert items for frames that
851 include the tcp protocol, with a severity of note or higher.
852
853 =item B<-z> follow,I<prot>,I<mode>,I<filter>[I<,range>]
854
855 Displays the contents of a TCP or UDP stream between two nodes.  The data
856 sent by the second node is prefixed with a tab to differentiate it from the
857 data sent by the first node.
858
859 I<prot> specifies the transport protocol.  It can be one of:
860   B<tcp>   TCP
861   B<udp>   UDP
862
863 I<mode> specifies the output mode.  It can be one of:
864   B<ascii> ASCII output with dots for non-printable characters
865   B<hex>   Hexadecimal and ASCII data with offsets
866   B<raw>   Hexadecimal data
867
868 Since the output in B<ascii> mode may contain newlines, the length of each section
869 of output plus a newline precedes each section of output.
870
871 I<filter> specifies the stream to be displayed.  UDP streams are selected with
872 IP address plus port pairs.  TCP streams are selected with either the stream
873 index or IP address plus port pairs.  For example:
874   B<ip-addr0>:B<port0>,B<ip-addr1>:B<port1>
875   B<tcp-stream-index>
876
877 I<range> optionally specifies which "chunks" of the stream should be displayed.
878
879 Example: B<-z "follow,tcp,hex,1"> will display the contents of the first TCP
880 stream in "hex" format.
881
882   ===================================================================
883   Follow: tcp,hex
884   Filter: tcp.stream eq 1
885   Node 0: 200.57.7.197:32891
886   Node 1: 200.57.7.198:2906
887   00000000  00 00 00 22 00 00 00 07  00 0a 85 02 07 e9 00 02  ...".... ........
888   00000010  07 e9 06 0f 00 0d 00 04  00 00 00 01 00 03 00 06  ........ ........
889   00000020  1f 00 06 04 00 00                                 ......
890       00000000  00 01 00 00                                       ....
891       00000026  00 02 00 00
892
893 Example: B<-z "follow,tcp,ascii,200.57.7.197:32891,200.57.7.198:2906"> will
894 display the contents of a TCP stream between 200.57.7.197 port 32891 and
895 200.57.7.98 port 2906.
896
897   ===================================================================
898   Follow: tcp,ascii
899   Filter: (ommitted for readability)
900   Node 0: 200.57.7.197:32891
901   Node 1: 200.57.7.198:2906
902   38
903   ...".....
904   ................
905       4
906       ....
907
908 =item B<-z> h225,counter[I<,filter>]
909
910 Count ITU-T H.225 messages and their reasons.  In the first column you get a
911 list of H.225 messages and H.225 message reasons, which occur in the current
912 capture file.  The number of occurrences of each message or reason is displayed
913 in the second column.
914
915 Example: B<-z h225,counter>.
916
917 If the optional I<filter> is provided, the stats will only be calculated
918 on those calls that match that filter.
919 Example: use B<-z "h225,counter,ip.addr==1.2.3.4"> to only collect stats for
920 H.225 packets exchanged by the host at IP address 1.2.3.4 .
921
922 This option can be used multiple times on the command line.
923
924 =item B<-z> h225,srt[I<,filter>]
925
926 Collect requests/response SRT (Service Response Time) data for ITU-T H.225 RAS.
927 Data collected is number of calls of each ITU-T H.225 RAS Message Type,
928 Minimum SRT, Maximum SRT, Average SRT, Minimum in Packet, and Maximum in Packet.
929 You will also get the number of Open Requests (Unresponded Requests),
930 Discarded Responses (Responses without matching request) and Duplicate Messages.
931
932 Example: B<-z h225,srt>
933
934 This option can be used multiple times on the command line.
935
936 If the optional I<filter> is provided, the stats will only be calculated
937 on those calls that match that filter.
938
939 Example: B<-z "h225,srt,ip.addr==1.2.3.4"> will only collect stats for
940 ITU-T H.225 RAS packets exchanged by the host at IP address 1.2.3.4 .
941
942 =item B<-z> hosts[,ipv4][,ipv6]
943
944 Dump any collected IPv4 and/or IPv6 addresses in "hosts" format.  Both IPv4
945 and IPv6 addresses are dumped by default.
946
947 Addresses are collected from a number of sources, including standard "hosts"
948 files and captured traffic.
949
950 =item B<-z> icmp,srt[,I<filter>]
951
952 Compute total ICMP echo requests, replies, loss, and percent loss, as well as
953 minimum, maximum, mean, median and sample standard deviation SRT statistics
954 typical of what ping provides.
955
956 Example: S<B<-z icmp,srt,ip.src==1.2.3.4>> will collect ICMP SRT statistics
957 for ICMP echo request packets originating from a specific host.
958
959 This option can be used multiple times on the command line.
960
961 =item B<-z> icmpv6,srt[,I<filter>]
962
963 Compute total ICMPv6 echo requests, replies, loss, and percent loss, as well as
964 minimum, maximum, mean, median and sample standard deviation SRT statistics
965 typical of what ping provides.
966
967 Example: S<B<-z icmpv6,srt,ipv6.src==fe80::1>> will collect ICMPv6 SRT statistics
968 for ICMPv6 echo request packets originating from a specific host.
969
970 This option can be used multiple times on the command line.
971
972 =item B<-z> io,phs[,I<filter>]
973
974 Create Protocol Hierarchy Statistics listing both number of packets and bytes.
975 If no I<filter> is specified the statistics will be calculated for all packets.
976 If a I<filter> is specified statistics will be only calculated for those
977 packets that match the filter.
978
979 This option can be used multiple times on the command line.
980
981 =item B<-z> io,stat,I<interval>[,I<filter>][,I<filter>][,I<filter>]...
982
983 Collect packet/bytes statistics for the capture in intervals of
984 I<interval> seconds.  I<Interval> can be specified either as a whole or
985 fractional second and can be specified with microsecond (us) resolution.
986 If I<interval> is 0, the statistics will be calculated over all packets.
987
988 If no I<filter> is specified the statistics will be calculated for all packets.
989 If one or more I<filters> are specified statistics will be calculated for
990 all filters and presented with one column of statistics for each filter.
991
992 This option can be used multiple times on the command line.
993
994 Example: B<-z io,stat,1,ip.addr==1.2.3.4> will generate 1 second
995 statistics for all traffic to/from host 1.2.3.4.
996
997 Example: B<-z "io,stat,0.001,smb&&ip.addr==1.2.3.4"> will generate 1ms
998 statistics for all SMB packets to/from host 1.2.3.4.
999
1000 The examples above all use the standard syntax for generating statistics
1001 which only calculates the number of packets and bytes in each interval.
1002
1003 B<io,stat> can also do much more statistics and calculate COUNT(), SUM(),
1004 MIN(), MAX(), AVG() and LOAD() using a slightly different filter syntax:
1005
1006 =item -z io,stat,I<interval>,E<34>[COUNT|SUM|MIN|MAX|AVG|LOAD](I<field>)I<field> [and I<filter>]E<34>
1007
1008 NOTE: One important thing to note here is that the field that the
1009 calculation is based on MUST also be part of the filter string or
1010 else the calculation will fail.
1011
1012 So: B<-z io,stat,0.010,AVG(smb.time)> does not work.  Use B<-z
1013 io,stat,0.010,AVG(smb.time)smb.time> instead.  Also be aware that a field
1014 can exist multiple times inside the same packet and will then be counted
1015 multiple times in those packets.
1016
1017 NOTE: A second important thing to note is that the system setting for
1018 decimal separator is set to "."! If it is set to "," the statistics
1019 will not be displayed per filter.
1020
1021 B<COUNT(I<field>)I<field> [and I<filter>]> - Calculates the number of times that the
1022 field I<name> (not its value) appears per interval in the filtered packet list.
1023 ''I<field>'' can be any display filter name.
1024
1025 Example: B<-z io,stat,0.010,E<34>COUNT(smb.sid)smb.sidE<34>>
1026
1027 This will count the total number of SIDs seen in each 10ms interval.
1028
1029 B<SUM(I<field>)I<field> [and I<filter>]> - Unlike COUNT, the I<values> of the
1030 specified field are summed per time interval.
1031 ''I<field>'' can only be a named integer, float, double or relative time field.
1032
1033 Example: B<-z io,stat,0.010,E<34>SUM(frame.len)frame.lenE<34>>
1034
1035 Reports the total number of bytes that were transmitted bidirectionally in
1036 all the packets within a 10 millisecond interval.
1037
1038 B<MIN/MAX/AVG(I<field>)I<field> [and I<filter>]> - The minimum, maximum, or average field value
1039 in each interval is calculated.  The specified field must be a named integer,
1040 float, double or relative time field.  For relative time fields, the output is presented in
1041 seconds with six decimal digits of precision rounded to the nearest microsecond.
1042
1043 In the following example, the time of the first Read_AndX call, the last Read_AndX
1044 response values are displayed and the minimum, maximum, and average Read response times
1045 (SRTs) are calculated.  NOTE: If the DOS command shell line continuation character, ''^''
1046 is used, each line cannot end in a comma so it is placed at the beginning of each
1047 continuation line:
1048
1049   tshark -o tcp.desegment_tcp_streams:FALSE -n -q -r smb_reads.cap -z io,stat,0,
1050   "MIN(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==0",
1051   "MAX(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==1",
1052   "MIN(smb.time)smb.time and smb.cmd==0x2e",
1053   "MAX(smb.time)smb.time and smb.cmd==0x2e",
1054   "AVG(smb.time)smb.time and smb.cmd==0x2e"
1055
1056
1057   ======================================================================================================
1058   IO Statistics
1059   Column #0: MIN(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==0
1060   Column #1: MAX(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==1
1061   Column #2: MIN(smb.time)smb.time and smb.cmd==0x2e
1062   Column #3: MAX(smb.time)smb.time and smb.cmd==0x2e
1063   Column #4: AVG(smb.time)smb.time and smb.cmd==0x2e
1064                   |    Column #0   |    Column #1   |    Column #2   |    Column #3   |    Column #4   |
1065   Time            |       MIN      |       MAX      |       MIN      |       MAX      |       AVG      |
1066   000.000-                 0.000000         7.704054         0.000072         0.005539         0.000295
1067   ======================================================================================================
1068
1069 The following command displays the average SMB Read response PDU size, the
1070 total number of read PDU bytes, the average SMB Write request PDU size, and
1071 the total number of bytes transferred in SMB Write PDUs:
1072
1073   tshark -n -q -r smb_reads_writes.cap -z io,stat,0,
1074   "AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to",
1075   "SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to",
1076   "AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to",
1077   "SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to"
1078
1079   =====================================================================================
1080   IO Statistics
1081   Column #0: AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to
1082   Column #1: SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to
1083   Column #2: AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to
1084   Column #3: SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to
1085                   |    Column #0   |    Column #1   |    Column #2   |    Column #3   |
1086   Time            |       AVG      |       SUM      |       AVG      |       SUM      |
1087   000.000-                    30018         28067522               72             3240
1088   =====================================================================================
1089
1090 B<LOAD(I<field>)I<field> [and I<filter>]> - The LOAD/Queue-Depth
1091 in each interval is calculated.  The specified field must be a relative time field that represents a response time.  For example smb.time.
1092 For each interval the Queue-Depth for the specified protocol is calculated.
1093
1094 The following command displays the average SMB LOAD.
1095 A value of 1.0 represents one I/O in flight.
1096
1097   tshark -n -q -r smb_reads_writes.cap
1098   -z "io,stat,0.001,LOAD(smb.time)smb.time"
1099
1100   ============================================================================
1101   IO Statistics
1102   Interval:   0.001000 secs
1103   Column #0: LOAD(smb.time)smb.time
1104                           |    Column #0   |
1105   Time                    |       LOAD     |
1106   0000.000000-0000.001000         1.000000
1107   0000.001000-0000.002000         0.741000
1108   0000.002000-0000.003000         0.000000
1109   0000.003000-0000.004000         1.000000
1110
1111
1112
1113 B<FRAMES | BYTES[()I<filter>]> - Displays the total number of frames or bytes.
1114 The filter field is optional but if included it must be prepended with ''()''.
1115
1116 The following command displays five columns: the total number of frames and bytes
1117 (transferred bidirectionally) using a single comma, the same two stats using the FRAMES and BYTES
1118 subcommands, the total number of frames containing at least one SMB Read response, and
1119 the total number of bytes transmitted to the client (unidirectionally) at IP address 10.1.0.64.
1120
1121   tshark -o tcp.desegment_tcp_streams:FALSE -n -q -r smb_reads.cap -z io,stat,0,,FRAMES,BYTES,
1122   "FRAMES()smb.cmd==0x2e and smb.response_to","BYTES()ip.dst==10.1.0.64"
1123
1124   =======================================================================================================================
1125   IO Statistics
1126   Column #0:
1127   Column #1: FRAMES
1128   Column #2: BYTES
1129   Column #3: FRAMES()smb.cmd==0x2e and smb.response_to
1130   Column #4: BYTES()ip.dst==10.1.0.64
1131                   |            Column #0            |    Column #1   |    Column #2   |    Column #3   |    Column #4   |
1132   Time            |     Frames     |      Bytes     |     FRAMES     |     BYTES      |     FRAMES     |     BYTES      |
1133   000.000-                    33576         29721685            33576         29721685              870         29004801
1134   =======================================================================================================================
1135
1136 =item B<-z> mac-lte,stat[I<,filter>]
1137
1138 This option will activate a counter for LTE MAC messages.  You will get
1139 information about the maximum number of UEs/TTI, common messages and
1140 various counters for each UE that appears in the log.
1141
1142 Example: B<-z mac-lte,stat>.
1143
1144 This option can be used multiple times on the command line.
1145
1146 If the optional I<filter> is provided, the stats will only be calculated
1147 for those frames that match that filter.
1148 Example: B<-z "mac-lte,stat,mac-lte.rnti>3000"> will only collect stats for
1149 UEs with an assigned RNTI whose value is more than 3000.
1150
1151 =item B<-z> megaco,rtd[I<,filter>]
1152
1153 Collect requests/response RTD (Response Time Delay) data for MEGACO.
1154 (This is similar to B<-z smb,srt>).  Data collected is the number of calls
1155 for each known MEGACO Type, MinRTD, MaxRTD and AvgRTD.
1156 Additionally you get the number of duplicate requests/responses,
1157 unresponded requests, responses, which don't match with any request.
1158 Example: B<-z megaco,rtd>.
1159
1160 If the optional I<filter> is provided, the stats will only be calculated
1161 on those calls that match that filter.
1162 Example: B<-z "megaco,rtd,ip.addr==1.2.3.4"> will only collect stats for
1163 MEGACO packets exchanged by the host at IP address 1.2.3.4 .
1164
1165 This option can be used multiple times on the command line.
1166
1167 =item B<-z> mgcp,rtd[I<,filter>]
1168
1169 Collect requests/response RTD (Response Time Delay) data for MGCP.
1170 (This is similar to B<-z smb,srt>).  Data collected is the number of calls
1171 for each known MGCP Type, MinRTD, MaxRTD and AvgRTD.
1172 Additionally you get the number of duplicate requests/responses,
1173 unresponded requests, responses, which don't match with any request.
1174 Example: B<-z mgcp,rtd>.
1175
1176 This option can be used multiple times on the command line.
1177
1178 If the optional I<filter> is provided, the stats will only be calculated
1179 on those calls that match that filter.
1180 Example: B<-z "mgcp,rtd,ip.addr==1.2.3.4"> will only collect stats for
1181 MGCP packets exchanged by the host at IP address 1.2.3.4 .
1182
1183 =item B<-z> proto,colinfo,I<filter>,I<field>
1184
1185 Append all I<field> values for the packet to the Info column of the
1186 one-line summary output.
1187 This feature can be used to append arbitrary fields to the Info column
1188 in addition to the normal content of that column.
1189 I<field> is the display-filter name of a field which value should be placed
1190 in the Info column.
1191 I<filter> is a filter string that controls for which packets the field value
1192 will be presented in the info column.  I<field> will only be presented in the
1193 Info column for the packets which match I<filter>.
1194
1195 NOTE: In order for B<TShark> to be able to extract the I<field> value
1196 from the packet, I<field> MUST be part of the I<filter> string.  If not,
1197 B<TShark> will not be able to extract its value.
1198
1199 For a simple example to add the "nfs.fh.hash" field to the Info column
1200 for all packets containing the "nfs.fh.hash" field, use
1201
1202 B<-z proto,colinfo,nfs.fh.hash,nfs.fh.hash>
1203
1204 To put "nfs.fh.hash" in the Info column but only for packets coming from
1205 host 1.2.3.4 use:
1206
1207 B<-z "proto,colinfo,nfs.fh.hash && ip.src==1.2.3.4,nfs.fh.hash">
1208
1209 This option can be used multiple times on the command line.
1210
1211 =item B<-z> rlc-lte,stat[I<,filter>]
1212
1213 This option will activate a counter for LTE RLC messages.  You will get
1214 information about common messages and various counters for each UE that appears
1215 in the log.
1216
1217 Example: B<-z rlc-lte,stat>.
1218
1219 This option can be used multiple times on the command line.
1220
1221 If the optional I<filter> is provided, the stats will only be calculated
1222 for those frames that match that filter.
1223 Example: B<-z "rlc-lte,stat,rlc-lte.ueid>3000"> will only collect stats for
1224 UEs with a UEId of more than 3000.
1225
1226 =item B<-z> rpc,programs
1227
1228 Collect call/reply SRT data for all known ONC-RPC programs/versions.
1229 Data collected is number of calls for each protocol/version, MinSRT,
1230 MaxSRT and AvgSRT.
1231 This option can only be used once on the command line.
1232
1233 =item B<-z> rpc,srt,I<program>,I<version>[,I<filter>]
1234
1235 Collect call/reply SRT (Service Response Time) data for I<program>/I<version>.  Data collected
1236 is number of calls for each procedure, MinSRT, MaxSRT and AvgSRT.
1237
1238 Example: B<-z rpc,srt,100003,3> will collect data for NFS v3.
1239
1240 This option can be used multiple times on the command line.
1241
1242 If the optional I<filter> is provided, the stats will only be calculated
1243 on those calls that match that filter.
1244
1245 Example: B<-z rpc,srt,100003,3,nfs.fh.hash==0x12345678> will collect NFS v3
1246 SRT statistics for a specific file.
1247
1248 =item B<-z> rtp,streams
1249
1250 Collect statistics for all RTP streams and calculate max. delta, max. and
1251 mean jitter and packet loss percentages.
1252
1253 =item B<-z> scsi,srt,I<cmdset>[,I<filter>]
1254
1255 Collect call/reply SRT (Service Response Time) data for SCSI commandset I<cmdset>.
1256
1257 Commandsets are 0:SBC   1:SSC  5:MMC
1258
1259 Data collected
1260 is the number of calls for each procedure, MinSRT, MaxSRT and AvgSRT.
1261
1262 Example: B<-z scsi,srt,0> will collect data for SCSI BLOCK COMMANDS (SBC).
1263
1264 This option can be used multiple times on the command line.
1265
1266 If the optional I<filter> is provided, the stats will only be calculated
1267 on those calls that match that filter.
1268
1269 Example: B<-z scsi,srt,0,ip.addr==1.2.3.4> will collect SCSI SBC
1270 SRT statistics for a specific iscsi/ifcp/fcip host.
1271
1272 =item B<-z> sip,stat[I<,filter>]
1273
1274 This option will activate a counter for SIP messages.  You will get the number
1275 of occurrences of each SIP Method and of each SIP Status-Code.  Additionally
1276 you also get the number of resent SIP Messages (only for SIP over UDP).
1277
1278 Example: B<-z sip,stat>.
1279
1280 This option can be used multiple times on the command line.
1281
1282 If the optional I<filter> is provided, the stats will only be calculated
1283 on those calls that match that filter.
1284 Example: B<-z "sip,stat,ip.addr==1.2.3.4"> will only collect stats for
1285 SIP packets exchanged by the host at IP address 1.2.3.4 .
1286
1287 =item B<-z> smb,sids
1288
1289 When this feature is used B<TShark> will print a report with all the
1290 discovered SID and account name mappings.  Only those SIDs where the
1291 account name is known will be presented in the table.
1292
1293 For this feature to work you will need to either to enable
1294 "Edit/Preferences/Protocols/SMB/Snoop SID to name mappings" in the
1295 preferences or you can override the preferences by specifying
1296 S<B<-o "smb.sid_name_snooping:TRUE">> on the B<TShark> command line.
1297
1298 The current method used by B<TShark> to find the SID->name mapping
1299 is relatively restricted with a hope of future expansion.
1300
1301 =item B<-z> smb,srt[,I<filter>]
1302
1303 Collect call/reply SRT (Service Response Time) data for SMB.  Data collected
1304 is number of calls for each SMB command, MinSRT, MaxSRT and AvgSRT.
1305
1306 Example: B<-z smb,srt>
1307
1308 The data will be presented as separate tables for all normal SMB commands,
1309 all Transaction2 commands and all NT Transaction commands.
1310 Only those commands that are seen in the capture will have its stats
1311 displayed.
1312 Only the first command in a xAndX command chain will be used in the
1313 calculation.  So for common SessionSetupAndX + TreeConnectAndX chains,
1314 only the SessionSetupAndX call will be used in the statistics.
1315 This is a flaw that might be fixed in the future.
1316
1317 This option can be used multiple times on the command line.
1318
1319 If the optional I<filter> is provided, the stats will only be calculated
1320 on those calls that match that filter.
1321
1322 Example: B<-z "smb,srt,ip.addr==1.2.3.4"> will only collect stats for
1323 SMB packets exchanged by the host at IP address 1.2.3.4 .
1324
1325 =back
1326
1327 =back
1328
1329 =head1 CAPTURE FILTER SYNTAX
1330
1331 See the manual page of pcap-filter(7) or, if that doesn't exist, tcpdump(8),
1332 or, if that doesn't exist, L<http://wiki.wireshark.org/CaptureFilters>.
1333
1334 =head1 READ FILTER SYNTAX
1335
1336 For a complete table of protocol and protocol fields that are filterable
1337 in B<TShark> see the wireshark-filter(4) manual page.
1338
1339 =head1 FILES
1340
1341 These files contains various B<Wireshark> configuration values.
1342
1343 =over 4
1344
1345 =item Preferences
1346
1347 The F<preferences> files contain global (system-wide) and personal
1348 preference settings.  If the system-wide preference file exists, it is
1349 read first, overriding the default settings.  If the personal preferences
1350 file exists, it is read next, overriding any previous values.  Note: If
1351 the command line option B<-o> is used (possibly more than once), it will
1352 in turn override values from the preferences files.
1353
1354 The preferences settings are in the form I<prefname>B<:>I<value>,
1355 one per line,
1356 where I<prefname> is the name of the preference
1357 and I<value> is the value to
1358 which it should be set; white space is allowed between B<:> and
1359 I<value>.  A preference setting can be continued on subsequent lines by
1360 indenting the continuation lines with white space.  A B<#> character
1361 starts a comment that runs to the end of the line:
1362
1363   # Capture in promiscuous mode?
1364   # TRUE or FALSE (case-insensitive).
1365   capture.prom_mode: TRUE
1366
1367 The global preferences file is looked for in the F<wireshark> directory
1368 under the F<share> subdirectory of the main installation directory (for
1369 example, F</usr/local/share/wireshark/preferences>) on UNIX-compatible
1370 systems, and in the main installation directory (for example,
1371 F<C:\Program Files\Wireshark\preferences>) on Windows systems.
1372
1373 The personal preferences file is looked for in
1374 F<$HOME/.wireshark/preferences> on
1375 UNIX-compatible systems and F<%APPDATA%\Wireshark\preferences> (or, if
1376 %APPDATA% isn't defined, F<%USERPROFILE%\Application
1377 Data\Wireshark\preferences>) on Windows systems.
1378
1379 =item Disabled (Enabled) Protocols
1380
1381 The F<disabled_protos> files contain system-wide and personal lists of
1382 protocols that have been disabled, so that their dissectors are never
1383 called.  The files contain protocol names, one per line, where the
1384 protocol name is the same name that would be used in a display filter
1385 for the protocol:
1386
1387   http
1388   tcp     # a comment
1389
1390 The global F<disabled_protos> file uses the same directory as the global
1391 preferences file.
1392
1393 The personal F<disabled_protos> file uses the same directory as the
1394 personal preferences file.
1395
1396 =item Name Resolution (hosts)
1397
1398 If the personal F<hosts> file exists, it is
1399 used to resolve IPv4 and IPv6 addresses before any other
1400 attempts are made to resolve them.  The file has the standard F<hosts>
1401 file syntax; each line contains one IP address and name, separated by
1402 whitespace.  The same directory as for the personal preferences file is
1403 used.
1404
1405 Capture filter name resolution is handled by libpcap on UNIX-compatible
1406 systems and WinPCAP on Windows.  As such the Wireshark personal F<hosts> file
1407 will not be consulted for capture filter name resolution.
1408
1409 =item Name Resolution (ethers)
1410
1411 The F<ethers> files are consulted to correlate 6-byte hardware addresses to
1412 names.  First the personal F<ethers> file is tried and if an address is not
1413 found there the global F<ethers> file is tried next.
1414
1415 Each line contains one hardware address and name, separated by
1416 whitespace.  The digits of the hardware address are separated by colons
1417 (:), dashes (-) or periods (.).  The same separator character must be
1418 used consistently in an address.  The following three lines are valid
1419 lines of an F<ethers> file:
1420
1421   ff:ff:ff:ff:ff:ff          Broadcast
1422   c0-00-ff-ff-ff-ff          TR_broadcast
1423   00.00.00.00.00.00          Zero_broadcast
1424
1425 The global F<ethers> file is looked for in the F</etc> directory on
1426 UNIX-compatible systems, and in the main installation directory (for
1427 example, F<C:\Program Files\Wireshark>) on Windows systems.
1428
1429 The personal F<ethers> file is looked for in the same directory as the personal
1430 preferences file.
1431
1432 Capture filter name resolution is handled by libpcap on UNIX-compatible
1433 systems and WinPCAP on Windows.  As such the Wireshark personal F<ethers> file
1434 will not be consulted for capture filter name resolution.
1435
1436 =item Name Resolution (manuf)
1437
1438 The F<manuf> file is used to match the 3-byte vendor portion of a 6-byte
1439 hardware address with the manufacturer's name; it can also contain well-known
1440 MAC addresses and address ranges specified with a netmask.  The format of the
1441 file is the same as the F<ethers> files, except that entries of the form:
1442
1443   00:00:0C      Cisco
1444
1445 can be provided, with the 3-byte OUI and the name for a vendor, and
1446 entries such as:
1447
1448   00-00-0C-07-AC/40     All-HSRP-routers
1449
1450 can be specified, with a MAC address and a mask indicating how many bits
1451 of the address must match.  The above entry, for example, has 40
1452 significant bits, or 5 bytes, and would match addresses from
1453 00-00-0C-07-AC-00 through 00-00-0C-07-AC-FF.  The mask need not be a
1454 multiple of 8.
1455
1456 The F<manuf> file is looked for in the same directory as the global
1457 preferences file.
1458
1459 =item Name Resolution (ipxnets)
1460
1461 The F<ipxnets> files are used to correlate 4-byte IPX network numbers to
1462 names.  First the global F<ipxnets> file is tried and if that address is not
1463 found there the personal one is tried next.
1464
1465 The format is the same as the F<ethers>
1466 file, except that each address is four bytes instead of six.
1467 Additionally, the address can be represented as a single hexadecimal
1468 number, as is more common in the IPX world, rather than four hex octets.
1469 For example, these four lines are valid lines of an F<ipxnets> file:
1470
1471   C0.A8.2C.00              HR
1472   c0-a8-1c-00              CEO
1473   00:00:BE:EF              IT_Server1
1474   110f                     FileServer3
1475
1476 The global F<ipxnets> file is looked for in the F</etc> directory on
1477 UNIX-compatible systems, and in the main installation directory (for
1478 example, F<C:\Program Files\Wireshark>) on Windows systems.
1479
1480 The personal F<ipxnets> file is looked for in the same directory as the
1481 personal preferences file.
1482
1483 =back
1484
1485 =head1 ENVIRONMENT VARIABLES
1486
1487 =over 4
1488
1489 =item WIRESHARK_DEBUG_EP_NO_CHUNKS
1490
1491 Normally per-packet memory is allocated in large "chunks."  This behavior
1492 doesn't work well with debugging tools such as Valgrind or ElectricFence.
1493 Export this environment variable to force individual allocations.
1494 Note: disabling chunks also disables canaries (see below).
1495
1496 =item WIRESHARK_DEBUG_SE_NO_CHUNKS
1497
1498 Normally per-file memory is allocated in large "chunks."  This behavior
1499 doesn't work well with debugging tools such as Valgrind or ElectricFence.
1500 Export this environment variable to force individual allocations.
1501 Note: disabling chunks also disables canaries (see below).
1502
1503 =item WIRESHARK_DEBUG_EP_NO_CANARY
1504
1505 Normally per-packet memory allocations are separated by "canaries" which
1506 allow detection of memory overruns.  This comes at the expense of some extra
1507 memory usage.  Exporting this environment variable disables these canaries.
1508
1509 =item WIRESHARK_DEBUG_SE_USE_CANARY
1510
1511 Exporting this environment variable causes per-file memory allocations to be
1512 protected with "canaries" which allow for detection of memory overruns.
1513 This comes at the expense of significant extra memory usage.
1514
1515 =item WIRESHARK_DEBUG_SCRUB_MEMORY
1516
1517 If this environment variable is set, the contents of per-packet and
1518 per-file memory is initialized to 0xBADDCAFE when the memory is allocated
1519 and is reset to 0xDEADBEEF when the memory is freed.  This functionality is
1520 useful mainly to developers looking for bugs in the way memory is handled.
1521
1522 =item WIRESHARK_RUN_FROM_BUILD_DIRECTORY
1523
1524 This environment variable causes the plugins and other data files to be loaded
1525 from the build directory (where the program was compiled) rather than from the
1526 standard locations.  It has no effect when the program in question is running
1527 with root (or setuid) permissions on *NIX.
1528
1529 =item WIRESHARK_DATA_DIR
1530
1531 This environment variable causes the various data files to be loaded from
1532 a directory other than the standard locations.  It has no effect when the
1533 program in question is running with root (or setuid) permissions on *NIX.
1534
1535 =item WIRESHARK_PYTHON_DIR
1536
1537 This environment variable points to an alternate location for Python.
1538 It has no effect when the program in question is running with root (or setuid)
1539 permissions on *NIX.
1540
1541 =item ERF_RECORDS_TO_CHECK
1542
1543 This environment variable controls the number of ERF records checked when
1544 deciding if a file really is in the ERF format.  Setting this environment
1545 variable a number higher than the default (20) would make false positives
1546 less likely.
1547
1548 =item IPFIX_RECORDS_TO_CHECK
1549
1550 This environment variable controls the number of IPFIX records checked when
1551 deciding if a file really is in the IPFIX format.  Setting this environment
1552 variable a number higher than the default (20) would make false positives
1553 less likely.
1554
1555 =item WIRESHARK_ABORT_ON_DISSECTOR_BUG
1556
1557 If this environment variable is set, B<TShark> will call abort(3)
1558 when a dissector bug is encountered.  abort(3) will cause the program to
1559 exit abnormally; if you are running B<TShark> in a debugger, it
1560 should halt in the debugger and allow inspection of the process, and, if
1561 you are not running it in a debugger, it will, on some OSes, assuming
1562 your environment is configured correctly, generate a core dump file.
1563 This can be useful to developers attempting to troubleshoot a problem
1564 with a protocol dissector.
1565
1566 =item WIRESHARK_EP_VERIFY_POINTERS
1567
1568 This environment variable, if present, causes certain uses of pointers to be
1569 audited to ensure they do not point to memory that is deallocated after each
1570 packet has been fully dissected.  This can be useful to developers writing or
1571 auditing code.
1572
1573 =item WIRESHARK_SE_VERIFY_POINTERS
1574
1575 This environment variable, if present, causes certain uses of pointers to be
1576 audited to ensure they do not point to memory that is deallocated after when
1577 a capture file is closed.  This can be useful to developers writing or
1578 auditing code.
1579
1580 =item WIRESHARK_ABORT_ON_OUT_OF_MEMORY
1581
1582 This environment variable, if present, causes abort(3) to be called if certain
1583 out-of-memory conditions (which normally result in an exception and an
1584 explanatory error message) are experienced.  This can be useful to developers
1585 debugging out-of-memory conditions.
1586
1587 =back
1588
1589 =head1 SEE ALSO
1590
1591 wireshark-filter(4), wireshark(1), editcap(1), pcap(3), dumpcap(1),
1592 text2pcap(1), mergecap(1), pcap-filter(7) or tcpdump(8) if it doesn't exist.
1593
1594 =head1 NOTES
1595
1596 B<TShark> is part of the B<Wireshark> distribution.  The latest version
1597 of B<Wireshark> can be found at L<http://www.wireshark.org>.
1598
1599 HTML versions of the Wireshark project man pages are available at:
1600 L<http://www.wireshark.org/docs/man-pages>.
1601
1602 =head1 AUTHORS
1603
1604 B<TShark> uses the same packet dissection code that B<Wireshark> does,
1605 as well as using many other modules from B<Wireshark>; see the list of
1606 authors in the B<Wireshark> man page for a list of authors of that code.