Note that -P can override -Q's suppression of packet output.
[metze/wireshark/wip.git] / doc / tshark.pod
1
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<-g> ]>
22 S<[ B<-h> ]>
23 S<[ B<-H> E<lt>input hosts fileE<gt> ]>
24 S<[ B<-i> E<lt>capture interfaceE<gt>|- ]>
25 S<[ B<-j> E<lt>protocol match filterE<gt> ]>
26 S<[ B<-I> ]>
27 S<[ B<-K> E<lt>keytabE<gt> ]>
28 S<[ B<-l> ]>
29 S<[ B<-L> ]>
30 S<[ B<-n> ]>
31 S<[ B<-N> E<lt>name resolving flagsE<gt> ]>
32 S<[ B<-o> E<lt>preference settingE<gt> ] ...>
33 S<[ B<-O> E<lt>protocolsE<gt> ]>
34 S<[ B<-p> ]>
35 S<[ B<-P> ]>
36 S<[ B<-q> ]>
37 S<[ B<-Q> ]>
38 S<[ B<-r> E<lt>infileE<gt> ]>
39 S<[ B<-R> E<lt>Read filterE<gt> ]>
40 S<[ B<-s> E<lt>capture snaplenE<gt> ]>
41 S<[ B<-S> E<lt>separatorE<gt> ]>
42 S<[ B<-t> a|ad|adoy|d|dd|e|r|u|ud|udoy ]>
43 S<[ B<-T> ek|fields|json|pdml|ps|psml|tabs|text ]>
44 S<[ B<-u> E<lt>seconds typeE<gt>]>
45 S<[ B<-U> E<lt>tap_nameE<gt>]>
46 S<[ B<-v> ]>
47 S<[ B<-V> ]>
48 S<[ B<-w> E<lt>outfileE<gt>|- ]>
49 S<[ B<-W> E<lt>file format optionE<gt>]>
50 S<[ B<-x> ]>
51 S<[ B<-X> E<lt>eXtension optionE<gt>]>
52 S<[ B<-y> E<lt>capture link typeE<gt> ]>
53 S<[ B<-Y> E<lt>displaY filterE<gt> ]>
54 S<[ B<-M> E<lt>auto session resetE<gt> ]>
55 S<[ B<-z> E<lt>statisticsE<gt> ]>
56 S<[ B<--capture-comment> E<lt>commentE<gt> ]>
57 S<[ B<--list-time-stamp-types> ]>
58 S<[ B<--time-stamp-type> E<lt>typeE<gt> ]>
59 S<[ B<--color> ]>
60 S<[ B<--no-duplicate-keys> ]>
61 S<[ B<--export-objects> E<lt>protocolE<gt>,E<lt>destdirE<gt> ]>
62 S<[ B<--enable-protocol> E<lt>proto_nameE<gt> ]>
63 S<[ B<--disable-protocol> E<lt>proto_nameE<gt> ]>
64 S<[ B<--enable-heuristic> E<lt>short_nameE<gt> ]>
65 S<[ B<--disable-heuristic> E<lt>short_nameE<gt> ]>
66 S<[ E<lt>capture filterE<gt> ]>
67
68 B<tshark>
69 B<-G> [ E<lt>report typeE<gt> ]
70
71 =head1 DESCRIPTION
72
73 B<TShark> is a network protocol analyzer.  It lets you capture packet
74 data from a live network, or read packets from a previously saved
75 capture file, either printing a decoded form of those packets to the
76 standard output or writing the packets to a file.  B<TShark>'s native
77 capture file format is B<pcap> format, which is also the format used
78 by B<tcpdump> and various other tools.
79
80 Without any options set, B<TShark> will work much like B<tcpdump>.  It will
81 use the pcap library to capture traffic from the first available network
82 interface and displays a summary line on stdout for each received packet.
83
84 B<TShark> is able to detect, read and write the same capture files that
85 are supported by B<Wireshark>.
86 The input file doesn't need a specific filename extension; the file
87 format and an optional gzip compression will be automatically detected.
88 Near the beginning of the DESCRIPTION section of wireshark(1) or
89 L<https://www.wireshark.org/docs/man-pages/wireshark.html>
90 is a detailed description of the way B<Wireshark> handles this, which is
91 the same way B<Tshark> handles this.
92
93 Compressed file support uses (and therefore requires) the zlib library.
94 If the zlib library is not present, B<TShark> will compile, but will
95 be unable to read compressed files.
96
97 If the B<-w> option is not specified, B<TShark> writes to the standard
98 output the text of a decoded form of the packets it captures or reads.
99 If the B<-w> option is specified, B<TShark> writes to the file
100 specified by that option the raw data of the packets, along with the
101 packets' time stamps.
102
103 When writing a decoded form of packets, B<TShark> writes, by
104 default, a summary line containing the fields specified by the
105 preferences file (which are also the fields displayed in the packet list
106 pane in B<Wireshark>), although if it's writing packets as it captures
107 them, rather than writing packets from a saved capture file, it won't
108 show the "frame number" field.  If the B<-V> option is specified, it
109 writes instead a view of the details of the packet, showing all the
110 fields of all protocols in the packet.  If the B<-O> option is specified,
111 it will only show the full protocols specified.  Use the output of
112 "B<tshark -G protocols>" to find the abbreviations of the protocols you can
113 specify.
114
115 If you want to write the decoded form of packets to a file, run
116 B<TShark> without the B<-w> option, and redirect its standard output to
117 the file (do I<not> use the B<-w> option).
118
119 When writing packets to a file, B<TShark>, by default, writes the
120 file in B<pcap> format, and writes all of the packets it sees to the
121 output file.  The B<-F> option can be used to specify the format in which
122 to write the file.  This list of available file formats is displayed by
123 the B<-F> flag without a value.  However, you can't specify a file format
124 for a live capture.
125
126 Read filters in B<TShark>, which allow you to select which packets
127 are to be decoded or written to a file, are very powerful; more fields
128 are filterable in B<TShark> than in other protocol analyzers, and the
129 syntax you can use to create your filters is richer.  As B<TShark>
130 progresses, expect more and more protocol fields to be allowed in read
131 filters.
132
133 Packet capturing is performed with the pcap library.  The capture filter
134 syntax follows the rules of the pcap library.  This syntax is different
135 from the read filter syntax.  A read filter can also be specified when
136 capturing, and only packets that pass the read filter will be displayed
137 or saved to the output file; note, however, that capture filters are much
138 more efficient than read filters, and it may be more difficult for
139 B<TShark> to keep up with a busy network if a read filter is
140 specified for a live capture.
141
142 A capture or read filter can either be specified with the B<-f> or B<-R>
143 option, respectively, in which case the entire filter expression must be
144 specified as a single argument (which means that if it contains spaces,
145 it must be quoted), or can be specified with command-line arguments
146 after the option arguments, in which case all the arguments after the
147 filter arguments are treated as a filter expression.  Capture filters
148 are supported only when doing a live capture; read filters are supported
149 when doing a live capture and when reading a capture file, but require
150 TShark to do more work when filtering, so you might be more likely to
151 lose packets under heavy load if you're using a read filter.  If the
152 filter is specified with command-line arguments after the option
153 arguments, it's a capture filter if a capture is being done (i.e., if no
154 B<-r> option was specified) and a read filter if a capture file is being
155 read (i.e., if a B<-r> option was specified).
156
157 The B<-G> option is a special mode that simply causes B<Tshark>
158 to dump one of several types of internal glossaries and then exit.
159
160 =head1 OPTIONS
161
162 =over 4
163
164 =item -2
165
166 Perform a two-pass analysis. This causes tshark to buffer output until the
167 entire first pass is done, but allows it to fill in fields that require future
168 knowledge, such as 'response in frame #' fields. Also permits reassembly
169 frame dependencies to be calculated correctly.
170
171 =item -a  E<lt>capture autostop conditionE<gt>
172
173 Specify a criterion that specifies when B<TShark> is to stop writing
174 to a capture file.  The criterion is of the form I<test>B<:>I<value>,
175 where I<test> is one of:
176
177 B<duration>:I<value> Stop writing to a capture file after I<value> seconds
178 have elapsed.
179
180 B<filesize>:I<value> Stop writing to a capture file after it reaches a size of
181 I<value> kB.  If this option is used together with the -b option, B<TShark>
182 will stop writing to the current capture file and switch to the next one if
183 filesize is reached.  When reading a capture file, B<TShark> will stop reading
184 the file after the number of bytes read exceeds this number (the complete
185 packet  will be read, so more bytes than this number may be read).  Note that
186 the filesize is limited to a maximum value of 2 GiB.
187
188 B<files>:I<value> Stop writing to capture files after I<value> number of files
189 were written.
190
191 =item -b  E<lt>capture ring buffer optionE<gt>
192
193 Cause B<TShark> to run in "multiple files" mode.  In "multiple files" mode,
194 B<TShark> will write to several capture files.  When the first capture file
195 fills up, B<TShark> will switch writing to the next file and so on.
196
197 The created filenames are based on the filename given with the B<-w> option,
198 the number of the file and on the creation date and time,
199 e.g. outfile_00001_20050604120117.pcap, outfile_00002_20050604120523.pcap, ...
200
201 With the I<files> option it's also possible to form a "ring buffer".
202 This will fill up new files until the number of files specified,
203 at which point B<TShark> will discard the data in the first file and start
204 writing to that file and so on.  If the I<files> option is not set,
205 new files filled up until one of the capture stop conditions match (or
206 until the disk is full).
207
208 The criterion is of the form I<key>B<:>I<value>,
209 where I<key> is one of:
210
211 B<duration>:I<value> switch to the next file after I<value> seconds have
212 elapsed, even if the current file is not completely filled up.
213
214 B<interval>:I<value> switch to the next file when the time is an exact
215 multiple of I<value> seconds
216
217 B<filesize>:I<value> switch to the next file after it reaches a size of
218 I<value> kB.  Note that the filesize is limited to a maximum value of 2 GiB.
219
220 B<files>:I<value> begin again with the first file after I<value> number of
221 files were written (form a ring buffer).  This value must be less than 100000.
222 Caution should be used when using large numbers of files: some filesystems do
223 not handle many files in a single directory well.  The B<files> criterion
224 requires either B<duration>, B<interval> or B<filesize> to be specified to
225 control when to go to the next file.  It should be noted that each B<-b>
226 parameter takes exactly one criterion; to specify two criterion, each must be
227 preceded by the B<-b> option.
228
229 Example: B<-b filesize:1000 -b files:5> results in a ring buffer of five files
230 of size one megabyte each.
231
232 =item -B  E<lt>capture buffer sizeE<gt>
233
234 Set capture buffer size (in MiB, default is 2 MiB).  This is used by
235 the capture driver to buffer packet data until that data can be written
236 to disk.  If you encounter packet drops while capturing, try to increase
237 this size.  Note that, while B<Tshark> attempts to set the buffer size
238 to 2 MiB by default, and can be told to set it to a larger value, the
239 system or interface on which you're capturing might silently limit the
240 capture buffer size to a lower value or raise it to a higher value.
241
242 This is available on UNIX systems with libpcap 1.0.0 or later and on
243 Windows.  It is not available on UNIX systems with earlier versions of
244 libpcap.
245
246 This option can occur multiple times.  If used before the first
247 occurrence of the B<-i> option, it sets the default capture buffer size.
248 If used after an B<-i> option, it sets the capture buffer size for
249 the interface specified by the last B<-i> option occurring before
250 this option.  If the capture buffer size is not set specifically,
251 the default capture buffer size is used instead.
252
253 =item -c  E<lt>capture packet countE<gt>
254
255 Set the maximum number of packets to read when capturing live
256 data.  If reading a capture file, set the maximum number of packets to read.
257
258 =item -C  E<lt>configuration profileE<gt>
259
260 Run with the given configuration profile.
261
262 =item -d  E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt>
263
264 Like Wireshark's B<Decode As...> feature, this lets you specify how a
265 layer type should be dissected.  If the layer type in question (for example,
266 B<tcp.port> or B<udp.port> for a TCP or UDP port number) has the specified
267 selector value, packets should be dissected as the specified protocol.
268
269 Example: B<-d tcp.port==8888,http> will decode any traffic running over
270 TCP port 8888 as HTTP.
271
272 Example: B<-d tcp.port==8888:3,http> will decode any traffic running over
273 TCP ports 8888, 8889 or 8890 as HTTP.
274
275 Example: B<-d tcp.port==8888-8890,http> will decode any traffic running over
276 TCP ports 8888, 8889 or 8890 as HTTP.
277
278 Using an invalid selector or protocol will print out a list of valid selectors
279 and protocol names, respectively.
280
281 Example: B<-d .> is a quick way to get a list of valid selectors.
282
283 Example: B<-d ethertype==0x0800.> is a quick way to get a list of protocols that can be
284 selected with an ethertype.
285
286 =item -D
287
288 Print a list of the interfaces on which B<TShark> can capture, and
289 exit.  For each network interface, a number and an
290 interface name, possibly followed by a text description of the
291 interface, is printed.  The interface name or the number can be supplied
292 to the B<-i> option to specify an interface on which to capture.
293
294 This can be useful on systems that don't have a command to list them
295 (UNIX systems lacking B<ifconfig -a> or Linux systems lacking
296 B<ip link show>). The number can be useful on Windows systems, where
297 the interface name might be a long name or a GUID.
298
299 Note that "can capture" means that B<TShark> was able to open that
300 device to do a live capture.  Depending on your system you may need to
301 run tshark from an account with special privileges (for example, as
302 root) to be able to capture network traffic.  If B<TShark -D> is not run
303 from such an account, it will not list any interfaces.
304
305 =item -e  E<lt>fieldE<gt>
306
307 Add a field to the list of fields to display if B<-T ek|fields|json|pdml>
308 is selected.  This option can be used multiple times on the command line.
309 At least one field must be provided if the B<-T fields> option is
310 selected. Column names may be used prefixed with "_ws.col."
311
312 Example: B<-e frame.number -e ip.addr -e udp -e _ws.col.Info>
313
314 Giving a protocol rather than a single field will print multiple items
315 of data about the protocol as a single field.  Fields are separated by
316 tab characters by default.  B<-E> controls the format of the printed
317 fields.
318
319 =item -E  E<lt>field print optionE<gt>
320
321 Set an option controlling the printing of fields when B<-T fields> is
322 selected.
323
324 Options are:
325
326 B<bom=y|n> If B<y>, prepend output with the UTF-8 byte order mark
327 (hexadecimal ef, bb, bf). Defaults to B<n>.
328
329 B<header=y|n> If B<y>, print a list of the field names given using B<-e>
330 as the first line of the output; the field name will be separated using
331 the same character as the field values.  Defaults to B<n>.
332
333 B<separator=/t|/s|>E<lt>characterE<gt> Set the separator character to
334 use for fields.  If B</t> tab will be used (this is the default), if
335 B</s>, a single space will be used.  Otherwise any character that can be
336 accepted by the command line as part of the option may be used.
337
338 B<occurrence=f|l|a> Select which occurrence to use for fields that have
339 multiple occurrences.  If B<f> the first occurrence will be used, if B<l>
340 the last occurrence will be used and if B<a> all occurrences will be used
341 (this is the default).
342
343 B<aggregator=,|/s|>E<lt>characterE<gt> Set the aggregator character to
344 use for fields that have multiple occurrences.  If B<,> a comma will be used
345 (this is the default), if B</s>, a single space will be used.  Otherwise
346 any character that can be accepted by the command line as part of the
347 option may be used.
348
349 B<quote=d|s|n> Set the quote character to use to surround fields.  B<d>
350 uses double-quotes, B<s> single-quotes, B<n> no quotes (the default).
351
352 =item -f  E<lt>capture filterE<gt>
353
354 Set the capture filter expression.
355
356 This option can occur multiple times.  If used before the first
357 occurrence of the B<-i> option, it sets the default capture filter expression.
358 If used after an B<-i> option, it sets the capture filter expression for
359 the interface specified by the last B<-i> option occurring before
360 this option.  If the capture filter expression is not set specifically,
361 the default capture filter expression is used if provided.
362
363 Pre-defined capture filter names, as shown in the GUI menu item Capture->Capture Filters,
364 can be used by prefixing the argument with "predef:".
365 Example: B<-f "predef:MyPredefinedHostOnlyFilter">
366
367 =item -F  E<lt>file formatE<gt>
368
369 Set the file format of the output capture file written using the B<-w>
370 option.  The output written with the B<-w> option is raw packet data, not
371 text, so there is no B<-F> option to request text output.  The option B<-F>
372 without a value will list the available formats.
373
374 =item -g
375
376 This option causes the output file(s) to be created with group-read permission
377 (meaning that the output file(s) can be read by other members of the calling
378 user's group).
379
380 =item -G  [ E<lt>report typeE<gt> ]
381
382 The B<-G> option will cause B<Tshark> to dump one of several types of glossaries
383 and then exit.  If no specific glossary type is specified, then the B<fields> report will be generated by default.
384 Using the report type of B<help> lists all the current report types.
385
386 The available report types include:
387
388 B<column-formats> Dumps the column formats understood by tshark.
389 There is one record per line.  The fields are tab-delimited.
390
391  * Field 1 = format string (e.g. "%rD")
392  * Field 2 = text description of format string (e.g. "Dest port (resolved)")
393
394 B<currentprefs>  Dumps a copy of the current preferences file to stdout.
395
396 B<decodes> Dumps the "layer type"/"decode as" associations to stdout.
397 There is one record per line.  The fields are tab-delimited.
398
399  * Field 1 = layer type, e.g. "tcp.port"
400  * Field 2 = selector in decimal
401  * Field 3 = "decode as" name, e.g. "http"
402
403 B<defaultprefs>  Dumps a default preferences file to stdout.
404
405 B<dissector-tables>  Dumps a list of dissector tables to stdout.  There
406 is one record per line.  The fields are tab-delimited.
407
408  * Field 1 = dissector table name, e.g. "tcp.port"
409  * Field 2 = name used for the dissector table in the GUI
410  * Field 3 = type (textual representation of the ftenum type)
411  * Field 4 = base for display (for integer types)
412  * Field 5 = protocol name
413  * Field 6 = "decode as" support
414
415 B<fieldcount>  Dumps the number of header fields to stdout.
416
417 B<fields>  Dumps the contents of the registration database to
418 stdout.  An independent program can take this output and format it into nice
419 tables or HTML or whatever.  There is one record per line.  Each record is
420 either a protocol or a header field, differentiated by the first field.
421 The fields are tab-delimited.
422
423  * Protocols
424  * ---------
425  * Field 1 = 'P'
426  * Field 2 = descriptive protocol name
427  * Field 3 = protocol abbreviation
428  *
429  * Header Fields
430  * -------------
431  * Field 1 = 'F'
432  * Field 2 = descriptive field name
433  * Field 3 = field abbreviation
434  * Field 4 = type (textual representation of the ftenum type)
435  * Field 5 = parent protocol abbreviation
436  * Field 6 = base for display (for integer types); "parent bitfield width" for FT_BOOLEAN
437  * Field 7 = bitmask: format: hex: 0x....
438  * Field 8 = blurb describing field
439
440 B<folders> Dumps various folders used by tshark.  This is essentially the
441 same data reported in Wireshark's About | Folders tab.
442 There is one record per line.  The fields are tab-delimited.
443
444  * Field 1 = Folder type (e.g "Personal configuration:")
445  * Field 2 = Folder location (e.g. "/home/vagrant/.config/wireshark/")
446
447 B<ftypes> Dumps the "ftypes" (fundamental types) understood by tshark.
448 There is one record per line.  The fields are tab-delimited.
449
450  * Field 1 = FTYPE (e.g "FT_IPv6")
451  * Field 2 = text description of type (e.g. "IPv6 address")
452
453 B<heuristic-decodes> Dumps the heuristic decodes currently installed.
454 There is one record per line.  The fields are tab-delimited.
455
456  * Field 1 = underlying dissector (e.g. "tcp")
457  * Field 2 = name of heuristic decoder (e.g. ucp")
458  * Field 3 = heuristic enabled (e.g. "T" or "F")
459
460 B<help> Displays the available report types.
461
462 B<plugins> Dumps the plugins currently installed.
463 There is one record per line.  The fields are tab-delimited.
464
465  * Field 1 = plugin library (e.g. "gryphon.so")
466  * Field 2 = plugin version (e.g. 0.0.4)
467  * Field 3 = plugin type (e.g. "dissector" or "tap")
468  * Field 4 = full path to plugin file
469
470 B<protocols> Dumps the protocols in the registration database to stdout.
471 An independent program can take this output and format it into nice tables
472 or HTML or whatever.  There is one record per line.  The fields are tab-delimited.
473
474  * Field 1 = protocol name
475  * Field 2 = protocol short name
476  * Field 3 = protocol filter name
477
478 B<values> Dumps the value_strings, range_strings or true/false strings
479 for fields that have them.  There is one record per line.  Fields are
480 tab-delimited.  There are three types of records: Value String, Range
481 String and True/False String.  The first field, 'V', 'R' or 'T', indicates
482 the type of record.
483
484  * Value Strings
485  * -------------
486  * Field 1 = 'V'
487  * Field 2 = field abbreviation to which this value string corresponds
488  * Field 3 = Integer value
489  * Field 4 = String
490  *
491  * Range Strings
492  * -------------
493  * Field 1 = 'R'
494  * Field 2 = field abbreviation to which this range string corresponds
495  * Field 3 = Integer value: lower bound
496  * Field 4 = Integer value: upper bound
497  * Field 5 = String
498  *
499  * True/False Strings
500  * ------------------
501  * Field 1 = 'T'
502  * Field 2 = field abbreviation to which this true/false string corresponds
503  * Field 3 = True String
504  * Field 4 = False String
505
506 =item -h
507
508 =item --help
509
510 Print the version and options and exit.
511
512 =item -H  E<lt>input hosts fileE<gt>
513
514 Read a list of entries from a "hosts" file, which will then be written
515 to a capture file.  Implies B<-W n>. Can be called multiple times.
516
517 The "hosts" file format is documented at
518 L<http://en.wikipedia.org/wiki/Hosts_(file)>.
519
520 =item -i  E<lt>capture interfaceE<gt> | -
521
522 Set the name of the network interface or pipe to use for live packet
523 capture.
524
525 Network interface names should match one of the names listed in
526 "B<tshark -D>" (described above); a number, as reported by
527 "B<tshark -D>", can also be used.  If you're using UNIX, "B<netstat
528 -i>" or "B<ifconfig -a>" might also work to list interface names,
529 although not all versions of UNIX support the B<-a> option to B<ifconfig>.
530
531 If no interface is specified, B<TShark> searches the list of
532 interfaces, choosing the first non-loopback interface if there are any
533 non-loopback interfaces, and choosing the first loopback interface if
534 there are no non-loopback interfaces.  If there are no interfaces at all,
535 B<TShark> reports an error and doesn't start the capture.
536
537 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
538 read data from the standard input.  Data read from pipes must be in
539 standard pcap format.
540
541 This option can occur multiple times.  When capturing from multiple
542 interfaces, the capture file will be saved in pcapng format.
543
544 Note: the Win32 version of B<TShark> doesn't support capturing from
545 pipes!
546
547 =item -I
548
549 Put the interface in "monitor mode"; this is supported only on IEEE
550 802.11 Wi-Fi interfaces, and supported only on some operating systems.
551
552 Note that in monitor mode the adapter might disassociate from the
553 network with which it's associated, so that you will not be able to use
554 any wireless networks with that adapter.  This could prevent accessing
555 files on a network server, or resolving host names or network addresses,
556 if you are capturing in monitor mode and are not connected to another
557 network with another adapter.
558
559 This option can occur multiple times.  If used before the first
560 occurrence of the B<-i> option, it enables the monitor mode for all interfaces.
561 If used after an B<-i> option, it enables the monitor mode for
562 the interface specified by the last B<-i> option occurring before
563 this option.
564
565 =item -j  E<lt>protocol match filterE<gt>
566
567 Protocol match filter used for ek|json|jsonraw|pdml output file types.
568 Parent node containing multiple child nodes is only included,
569 if the name is found in the filter.
570
571 Example: B<-j "ip ip.flags text">
572
573 =item -J  E<lt>protocol match filterE<gt>
574
575 Protocol top level filter used for ek|json|jsonraw|pdml output file types.
576 Parent node containing multiple child nodes is included with all children.
577
578 Example: B<-J "http tcp">
579
580 =item -K  E<lt>keytabE<gt>
581
582 Load kerberos crypto keys from the specified keytab file.
583 This option can be used multiple times to load keys from several files.
584
585 Example: B<-K krb5.keytab>
586
587 =item -l
588
589 Flush the standard output after the information for each packet is
590 printed.  (This is not, strictly speaking, line-buffered if B<-V>
591 was specified; however, it is the same as line-buffered if B<-V> wasn't
592 specified, as only one line is printed for each packet, and, as B<-l> is
593 normally used when piping a live capture to a program or script, so that
594 output for a packet shows up as soon as the packet is seen and
595 dissected, it should work just as well as true line-buffering.  We do
596 this as a workaround for a deficiency in the Microsoft Visual C++ C
597 library.)
598
599 This may be useful when piping the output of B<TShark> to another
600 program, as it means that the program to which the output is piped will
601 see the dissected data for a packet as soon as B<TShark> sees the
602 packet and generates that output, rather than seeing it only when the
603 standard output buffer containing that data fills up.
604
605 =item -L
606
607 List the data link types supported by the interface and exit.  The reported
608 link types can be used for the B<-y> option.
609
610 =item -n
611
612 Disable network object name resolution (such as hostname, TCP and UDP port
613 names); the B<-N> flag might override this one.
614
615 =item -N  E<lt>name resolving flagsE<gt>
616
617 Turn on name resolving only for particular types of addresses and port
618 numbers, with name resolving for other types of addresses and port
619 numbers turned off.  This flag overrides B<-n> if both B<-N> and B<-n> are
620 present.  If both B<-N> and B<-n> flags are not present, all name resolutions
621 are turned on.
622
623 The argument is a string that may contain the letters:
624
625 B<d> to enable resolution from captured DNS packets
626
627 B<m> to enable MAC address resolution
628
629 B<n> to enable network address resolution
630
631 B<N> to enable using external resolvers (e.g., DNS) for network address
632 resolution
633
634 B<t> to enable transport-layer port number resolution
635
636 =item -o  E<lt>preferenceE<gt>:E<lt>valueE<gt>
637
638 Set a preference value, overriding the default value and any value read
639 from a preference file.  The argument to the option is a string of the
640 form I<prefname>B<:>I<value>, where I<prefname> is the name of the
641 preference (which is the same name that would appear in the preference
642 file), and I<value> is the value to which it should be set.
643
644 =item -O  E<lt>protocolsE<gt>
645
646 Similar to the B<-V> option, but causes B<TShark> to only show a detailed view
647 of the comma-separated list of I<protocols> specified, rather than a detailed
648 view of all protocols.  Use the output of "B<tshark -G protocols>" to find the
649 abbreviations of the protocols you can specify.
650
651 =item -p
652
653 I<Don't> put the interface into promiscuous mode.  Note that the
654 interface might be in promiscuous mode for some other reason; hence,
655 B<-p> cannot be used to ensure that the only traffic that is captured is
656 traffic sent to or from the machine on which B<TShark> is running,
657 broadcast traffic, and multicast traffic to addresses received by that
658 machine.
659
660 This option can occur multiple times.  If used before the first
661 occurrence of the B<-i> option, no interface will be put into the
662 promiscuous mode.
663 If used after an B<-i> option, the interface specified by the last B<-i>
664 option occurring before this option will not be put into the
665 promiscuous mode.
666
667 =item -P
668
669 =item --print
670
671 Decode and display the packet summary or details, even if writing raw
672 packet data using the B<-w> option, and even if packet output is
673 otherwise suppressed with B<-Q>.
674
675 =item -q
676
677 When capturing packets, don't display the continuous count of packets
678 captured that is normally shown when saving a capture to a file;
679 instead, just display, at the end of the capture, a count of packets
680 captured.  On systems that support the SIGINFO signal, such as various
681 BSDs, you can cause the current count to be displayed by typing your
682 "status" character (typically control-T, although it
683 might be set to "disabled" by default on at least some BSDs, so you'd
684 have to explicitly set it to use it).
685
686 When reading a capture file, or when capturing and not saving to a file,
687 don't print packet information; this is useful if you're using a B<-z>
688 option to calculate statistics and don't want the packet information
689 printed, just the statistics.
690
691 =item -Q
692
693 When capturing packets, only display true errors.  This outputs less
694 than the B<-q> option, so the interface name and total packet
695 count and the end of a capture are not sent to stderr.
696
697 =item -r  E<lt>infileE<gt>
698
699 Read packet data from I<infile>, can be any supported capture file format
700 (including gzipped files).  It is possible to use named pipes or stdin (-)
701 here but only with certain (not compressed) capture file formats (in
702 particular: those that can be read without seeking backwards).
703
704 =item -R  E<lt>Read filterE<gt>
705
706 Cause the specified filter (which uses the syntax of read/display filters,
707 rather than that of capture filters) to be applied during the first pass of
708 analysis. Packets not matching the filter are not considered for future
709 passes. Only makes sense with multiple passes, see -2. For regular filtering
710 on single-pass dissect see -Y instead.
711
712 Note that forward-looking fields such as 'response in frame #' cannot be used
713 with this filter, since they will not have been calculate when this filter is
714 applied.
715
716 =item -s  E<lt>capture snaplenE<gt>
717
718 Set the default snapshot length to use when capturing live data.
719 No more than I<snaplen> bytes of each network packet will be read into
720 memory, or saved to disk.  A value of 0 specifies a snapshot length of
721 262144, so that the full packet is captured; this is the default.
722
723 This option can occur multiple times.  If used before the first
724 occurrence of the B<-i> option, it sets the default snapshot length.
725 If used after an B<-i> option, it sets the snapshot length for
726 the interface specified by the last B<-i> option occurring before
727 this option.  If the snapshot length is not set specifically,
728 the default snapshot length is used if provided.
729
730 =item -S  E<lt>separatorE<gt>
731
732 Set the line separator to be printed between packets.
733
734 =item -t  a|ad|adoy|d|dd|e|r|u|ud|udoy
735
736 Set the format of the packet timestamp printed in summary lines.
737 The format can be one of:
738
739 B<a> absolute: The absolute time, as local time in your time zone,
740 is the actual time the packet was captured, with no date displayed
741
742 B<ad> absolute with date: The absolute date, displayed as YYYY-MM-DD,
743 and time, as local time in your time zone, is the actual time and date
744 the packet was captured
745
746 B<adoy> absolute with date using day of year: The absolute date,
747 displayed as YYYY/DOY, and time, as local time in your time zone,
748 is the actual time and date the packet was captured
749
750 B<d> delta: The delta time is the time since the previous packet was
751 captured
752
753 B<dd> delta_displayed: The delta_displayed time is the time since the
754 previous displayed packet was captured
755
756 B<e> epoch: The time in seconds since epoch (Jan 1, 1970 00:00:00)
757
758 B<r> relative: The relative time is the time elapsed between the first packet
759 and the current packet
760
761 B<u> UTC: The absolute time, as UTC, is the actual time the packet was
762 captured, with no date displayed
763
764 B<ud> UTC with date: The absolute date, displayed as YYYY-MM-DD,
765 and time, as UTC, is the actual time and date the packet was captured
766
767 B<udoy> UTC with date using day of year: The absolute date, displayed
768 as YYYY/DOY, and time, as UTC, is the actual time and date the packet
769 was captured
770
771 The default format is relative.
772
773 =item -T  ek|fields|json|jsonraw|pdml|ps|psml|tabs|text
774
775 Set the format of the output when viewing decoded packet data.  The
776 options are one of:
777
778 B<ek> Newline delimited JSON format for bulk import into Elasticsearch.
779 It can be used with B<-j> or B<-J> including the JSON filter or with
780 B<-x> to include raw hex-encoded packet data.
781 If B<-P> is specified it will print the packet summary only, with both
782 B<-P> and B<-V> it will print the packet summary and packet details.
783 If neither B<-P> or B<-V> are used it will print the packet details only.
784 Example of usage to import data into Elasticsearch:
785
786   tshark -T ek -j "http tcp ip" -P -V -x -r file.pcap > file.json
787   curl -H "Content-Type: application/x-ndjson" -XPOST http://elasticsearch:9200/_bulk --data-binary "@file.json"
788
789 B<fields> The values of fields specified with the B<-e> option, in a
790 form specified by the B<-E> option.  For example,
791
792   -T fields -E separator=, -E quote=d
793
794 would generate comma-separated values (CSV) output suitable for importing
795 into your favorite spreadsheet program.
796
797 B<json> JSON file format. It can be used with B<-j> or B<-J> including
798 the JSON filter or with B<-x> flag to include raw hex-encoded packet data.
799 Example of usage:
800
801   tshark -T json -r file.pcap
802   tshark -T json -j "http tcp ip" -x -r file.pcap
803
804 B<jsonraw> JSON file format including only raw hex-encoded packet data.
805 It can be used with B<-j> including or B<-J >the JSON filter flag.
806 Example of usage:
807
808   tshark -T jsonraw -r file.pcap
809   tshark -T jsonraw -j "http tcp ip" -x -r file.pcap
810
811 B<pdml> Packet Details Markup Language, an XML-based format for the details of
812 a decoded packet.  This information is equivalent to the packet details
813 printed with the B<-V> flag.
814 Using the --color option will add color attributes to B<pdml> output. These
815 attributes are nonstandard.
816
817 B<ps> PostScript for a human-readable one-line summary of each of the packets,
818 or a multi-line view of the details of each of the packets, depending on
819 whether the B<-V> flag was specified.
820
821 B<psml> Packet Summary Markup Language, an XML-based format for the summary
822 information of a decoded packet.  This information is equivalent to the
823 information shown in the one-line summary printed by default.
824 Using the --color option will add color attributes to B<pdml> output. These
825 attributes are nonstandard.
826
827 B<tabs> Similar to the default B<text> report except the human-readable one-line
828 summary of each packet will include an ASCII horizontal tab (0x09) character
829 as a delimiter between each column.
830
831 B<text> Text of a human-readable one-line summary of each of the packets, or a
832 multi-line view of the details of each of the packets, depending on
833 whether the B<-V> flag was specified.  This is the default.
834
835 =item -u E<lt>seconds typeE<gt>
836
837 Specifies the seconds type.  Valid choices are:
838
839 B<s> for seconds
840
841 B<hms> for hours, minutes and seconds
842
843 =item -U E<lt>tap nameE<gt>
844
845 PDUs export, exports PDUs from infile to outfile according to the tap name given. Use -Y to filter.
846
847 Enter an empty tap name "" to get a list of available names.
848
849 =item -v
850
851 =item --version
852
853 Print the version and exit.
854
855 =item -V
856
857 Cause B<TShark> to print a view of the packet details.
858
859 =item -w  E<lt>outfileE<gt> | -
860
861 Write raw packet data to I<outfile> or to the standard output if
862 I<outfile> is '-'.
863
864 NOTE: -w provides raw packet data, not text.  If you want text output
865 you need to redirect stdout (e.g. using '>'), don't use the B<-w>
866 option for this.
867
868 =item -W  E<lt>file format optionE<gt>
869
870 Save extra information in the file if the format supports it.  For
871 example,
872
873   -F pcapng -W n
874
875 will save host name resolution records along with captured packets.
876
877 Future versions of Wireshark may automatically change the capture format to
878 B<pcapng> as needed.
879
880 The argument is a string that may contain the following letter:
881
882 B<n> write network address resolution information (pcapng only)
883
884 =item -x
885
886 Cause B<TShark> to print a hex and ASCII dump of the packet data
887 after printing the summary and/or details, if either are also being displayed.
888
889 =item -X E<lt>eXtension optionsE<gt>
890
891 Specify an option to be passed to a B<TShark> module.  The eXtension option
892 is in the form I<extension_key>B<:>I<value>, where I<extension_key> can be:
893
894 B<lua_script>:I<lua_script_filename> tells B<TShark> to load the given script in addition to the
895 default Lua scripts.
896
897 B<lua_script>I<num>:I<argument> tells B<TShark> to pass the given argument
898 to the lua script identified by 'num', which is the number indexed order of the 'lua_script' command.
899 For example, if only one script was loaded with '-X lua_script:my.lua', then '-X lua_script1:foo'
900 will pass the string 'foo' to the 'my.lua' script.  If two scripts were loaded, such as '-X lua_script:my.lua'
901 and '-X lua_script:other.lua' in that order, then a '-X lua_script2:bar' would pass the string 'bar' to the second lua
902 script, namely 'other.lua'.
903
904 B<read_format>:I<file_format> tells B<TShark> to use the given file format to read in the
905 file (the file given in the B<-r> command option). Providing no I<file_format> argument, or
906 an invalid one, will produce a file of available file formats to use.
907
908 =item -y  E<lt>capture link typeE<gt>
909
910 Set the data link type to use while capturing packets.  The values
911 reported by B<-L> are the values that can be used.
912
913 This option can occur multiple times.  If used before the first
914 occurrence of the B<-i> option, it sets the default capture link type.
915 If used after an B<-i> option, it sets the capture link type for
916 the interface specified by the last B<-i> option occurring before
917 this option.  If the capture link type is not set specifically,
918 the default capture link type is used if provided.
919
920 =item -Y  E<lt>displaY filterE<gt>
921
922 Cause the specified filter (which uses the syntax of read/display filters,
923 rather than that of capture filters) to be applied before printing a
924 decoded form of packets or writing packets to a file.  Packets matching the
925 filter are printed or written to file; packets that the matching packets
926 depend upon (e.g., fragments), are not printed but are written to file;
927 packets not matching the filter nor depended upon are discarded rather
928 than being printed or written.
929
930 Use this instead of -R for filtering using single-pass analysis. If doing
931 two-pass analysis (see -2) then only packets matching the read filter (if there
932 is one) will be checked against this filter.
933
934 =item -M  E<lt>auto session resetE<gt>
935
936 Automatically reset internal session when reached to specified number of packets.
937 for example,
938
939     -M 100000
940
941 will reset session every 100000 packets.
942
943 This feature does not support -2 two-pass analysis
944
945 =item -z  E<lt>statisticsE<gt>
946
947 Get B<TShark> to collect various types of statistics and display the result
948 after finishing reading the capture file.  Use the B<-q> flag if you're
949 reading a capture file and only want the statistics printed, not any
950 per-packet information.
951
952 Note that the B<-z proto> option is different - it doesn't cause
953 statistics to be gathered and printed when the capture is complete, it
954 modifies the regular packet summary output to include the values of
955 fields specified with the option.  Therefore you must not use the B<-q>
956 option, as that option would suppress the printing of the regular packet
957 summary output, and must also not use the B<-V> option, as that would
958 cause packet detail information rather than packet summary information
959 to be printed.
960
961 Currently implemented statistics are:
962
963 =over 4
964
965 =item B<-z help>
966
967 Display all possible values for B<-z>.
968
969 =item B<-z> afp,srt[,I<filter>]
970
971 Show Apple Filing Protocol service response time statistics.
972
973 =item B<-z> camel,srt
974
975 =item B<-z> compare,I<start>,I<stop>,I<ttl[0|1]>,I<order[0|1]>,I<variance>[,I<filter>]
976
977 If the optional I<filter> is specified, only those packets that match the
978 filter will be used in the calculations.
979
980 =item B<-z> conv,I<type>[,I<filter>]
981
982 Create a table that lists all conversations that could be seen in the
983 capture.  I<type> specifies the conversation endpoint types for which we
984 want to generate the statistics; currently the supported ones are:
985
986   "bluetooth"  Bluetooth addresses
987   "eth"   Ethernet addresses
988   "fc"    Fibre Channel addresses
989   "fddi"  FDDI addresses
990   "ip"    IPv4 addresses
991   "ipv6"  IPv6 addresses
992   "ipx"   IPX addresses
993   "jxta"  JXTA message addresses
994   "ncp"   NCP connections
995   "rsvp"  RSVP connections
996   "sctp"  SCTP addresses
997   "tcp"   TCP/IP socket pairs  Both IPv4 and IPv6 are supported
998   "tr"    Token Ring addresses
999   "usb"   USB addresses
1000   "udp"   UDP/IP socket pairs  Both IPv4 and IPv6 are supported
1001   "wlan"  IEEE 802.11 addresses
1002
1003 If the optional I<filter> is specified, only those packets that match the
1004 filter will be used in the calculations.
1005
1006 The table is presented with one line for each conversation and displays
1007 the number of packets/bytes in each direction as well as the total
1008 number of packets/bytes.  The table is sorted according to the total
1009 number of frames.
1010
1011 =item B<-z> dcerpc,srt,I<uuid>,I<major>.I<minor>[,I<filter>]
1012
1013 Collect call/reply SRT (Service Response Time) data for DCERPC interface I<uuid>,
1014 version I<major>.I<minor>.
1015 Data collected is the number of calls for each procedure, MinSRT, MaxSRT
1016 and AvgSRT.
1017
1018 Example: S<B<-z dcerpc,srt,12345778-1234-abcd-ef00-0123456789ac,1.0>> will collect data for the CIFS SAMR Interface.
1019
1020 This option can be used multiple times on the command line.
1021
1022 If the optional I<filter> is provided, the stats will only be calculated
1023 on those calls that match that filter.
1024
1025 Example: S<B<-z dcerpc,srt,12345778-1234-abcd-ef00-0123456789ac,1.0,ip.addr==1.2.3.4>> will collect SAMR
1026 SRT statistics for a specific host.
1027
1028 =item B<-z> bootp,stat[,I<filter>]
1029
1030 Show DHCP (BOOTP) statistics.
1031
1032 =item B<-z> diameter,avp[,I<cmd.code>,I<field>,I<field>,I<...>]
1033
1034 This option enables extraction of most important diameter fields from large capture files.
1035 Exactly one text line for each diameter message with matched B<diameter.cmd.code> will be printed.
1036
1037 Empty diameter command code or '*' can be specified to mach any B<diameter.cmd.code>
1038
1039 Example: B<-z diameter,avp>  extract default field set from diameter messages.
1040
1041 Example: B<-z diameter,avp,280>  extract default field set from diameter DWR messages.
1042
1043 Example: B<-z diameter,avp,272>  extract default field set from diameter CC messages.
1044
1045 Extract most important fields from diameter CC messages:
1046
1047 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>
1048
1049 Following fields will be printed out for each diameter message:
1050
1051   "frame"        Frame number.
1052   "time"         Unix time of the frame arrival.
1053   "src"          Source address.
1054   "srcport"      Source port.
1055   "dst"          Destination address.
1056   "dstport"      Destination port.
1057   "proto"        Constant string 'diameter', which can be used for post processing of tshark output.  E.g. grep/sed/awk.
1058   "msgnr"        seq. number of diameter message within the frame.  E.g. '2' for the third diameter message in the same frame.
1059   "is_request"   '0' if message is a request, '1' if message is an answer.
1060   "cmd"          diameter.cmd_code, E.g. '272' for credit control messages.
1061   "req_frame"    Number of frame where matched request was found or '0'.
1062   "ans_frame"    Number of frame where matched answer was found or '0'.
1063   "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.
1064
1065 B<-z diameter,avp> option is much faster than B<-V -T text> or B<-T pdml> options.
1066
1067 B<-z diameter,avp> option is more powerful than B<-T field> and B<-z proto,colinfo> options.
1068
1069 Multiple diameter messages in one frame are supported.
1070
1071 Several fields with same name within one diameter message are supported, e.g. I<diameter.Subscription-Id-Data> or I<diameter.Rating-Group>.
1072
1073 Note: B<tshark -q> option is recommended to suppress default B<tshark> output.
1074
1075 =item B<-z> dns,tree[,I<filter>]
1076
1077 Create a summary of the captured DNS packets. General information are collected such as qtype and qclass distribution.
1078 For some data (as qname length or DNS payload) max, min and average values are also displayed.
1079
1080 =item B<-z> endpoints,I<type>[,I<filter>]
1081
1082 Create a table that lists all endpoints that could be seen in the
1083 capture.  I<type> specifies the endpoint types for which we
1084 want to generate the statistics; currently the supported ones are:
1085
1086   "bluetooth"  Bluetooth addresses
1087   "eth"   Ethernet addresses
1088   "fc"    Fibre Channel addresses
1089   "fddi"  FDDI addresses
1090   "ip"    IPv4 addresses
1091   "ipv6"  IPv6 addresses
1092   "ipx"   IPX addresses
1093   "jxta"  JXTA message addresses
1094   "ncp"   NCP connections
1095   "rsvp"  RSVP connections
1096   "sctp"  SCTP addresses
1097   "tcp"   TCP/IP socket pairs  Both IPv4 and IPv6 are supported
1098   "tr"    Token Ring addresses
1099   "usb"   USB addresses
1100   "udp"   UDP/IP socket pairs  Both IPv4 and IPv6 are supported
1101   "wlan"  IEEE 802.11 addresses
1102
1103 If the optional I<filter> is specified, only those packets that match the
1104 filter will be used in the calculations.
1105
1106 The table is presented with one line for each conversation and displays
1107 the number of packets/bytes in each direction as well as the total
1108 number of packets/bytes.  The table is sorted according to the total
1109 number of frames.
1110
1111 =item B<-z> expert[I<,error|,warn|,note|,chat>][I<,filter>]
1112
1113 Collects information about all expert info, and will display them in order,
1114 grouped by severity.
1115
1116 Example: B<-z expert,sip> will show expert items of all severity for frames that
1117 match the sip protocol.
1118
1119 This option can be used multiple times on the command line.
1120
1121 If the optional I<filter> is provided, the stats will only be calculated
1122 on those calls that match that filter.
1123
1124 Example: B<-z "expert,note,tcp"> will only collect expert items for frames that
1125 include the tcp protocol, with a severity of note or higher.
1126
1127 =item B<-z> flow,I<name>,I<mode>,[I<filter>]
1128
1129 Displays the flow of data between two nodes. Output is the same as ASCII format
1130 saved from GUI.
1131
1132 I<name> specifies the flow name.  It can be one of:
1133
1134   any      All frames
1135   icmp     ICMP
1136   icmpv6   ICMPv6
1137   lbm_uim  UIM
1138   tcp      TCP
1139
1140 I<mode> specifies the address type.  It can be one of:
1141
1142   standard   Any address
1143   network    Network address
1144
1145 Example: B<-z flow,tcp,network> will show data flow for all TCP frames
1146
1147 =item B<-z> follow,I<prot>,I<mode>,I<filter>[I<,range>]
1148
1149 Displays the contents of a TCP or UDP stream between two nodes.  The data
1150 sent by the second node is prefixed with a tab to differentiate it from the
1151 data sent by the first node.
1152
1153 I<prot> specifies the transport protocol.  It can be one of:
1154
1155   tcp   TCP
1156   udp   UDP
1157   ssl   SSL
1158
1159 I<mode> specifies the output mode.  It can be one of:
1160
1161   ascii  ASCII output with dots for non-printable characters
1162   ebcdic EBCDIC output with dots for non-printable characters
1163   hex    Hexadecimal and ASCII data with offsets
1164   raw    Hexadecimal data
1165
1166 Since the output in B<ascii> or B<ebcdic> mode may contain newlines, the length
1167 of each section of output plus a newline precedes each section of output.
1168
1169 I<filter> specifies the stream to be displayed. UDP/TCP streams are selected
1170 with either the stream index or IP address plus port pairs. SSL streams are
1171 selected with the stream index. For example:
1172
1173   ip-addr0:port0,ip-addr1:port1
1174   stream-index
1175
1176 I<range> optionally specifies which "chunks" of the stream should be displayed.
1177
1178 Example: B<-z "follow,tcp,hex,1"> will display the contents of the second TCP
1179 stream (the first is stream 0) in "hex" format.
1180
1181   ===================================================================
1182   Follow: tcp,hex
1183   Filter: tcp.stream eq 1
1184   Node 0: 200.57.7.197:32891
1185   Node 1: 200.57.7.198:2906
1186   00000000  00 00 00 22 00 00 00 07  00 0a 85 02 07 e9 00 02  ...".... ........
1187   00000010  07 e9 06 0f 00 0d 00 04  00 00 00 01 00 03 00 06  ........ ........
1188   00000020  1f 00 06 04 00 00                                 ......
1189   00000000  00 01 00 00                                       ....
1190   00000026  00 02 00 00
1191
1192 Example: B<-z "follow,tcp,ascii,200.57.7.197:32891,200.57.7.198:2906"> will
1193 display the contents of a TCP stream between 200.57.7.197 port 32891 and
1194 200.57.7.98 port 2906.
1195
1196   ===================================================================
1197   Follow: tcp,ascii
1198   Filter: (omitted for readability)
1199   Node 0: 200.57.7.197:32891
1200   Node 1: 200.57.7.198:2906
1201   38
1202   ...".....
1203   ................
1204   4
1205   ....
1206
1207 =item B<-z> h225,counter[I<,filter>]
1208
1209 Count ITU-T H.225 messages and their reasons.  In the first column you get a
1210 list of H.225 messages and H.225 message reasons, which occur in the current
1211 capture file.  The number of occurrences of each message or reason is displayed
1212 in the second column.
1213
1214 Example: B<-z h225,counter>.
1215
1216 If the optional I<filter> is provided, the stats will only be calculated
1217 on those calls that match that filter.
1218 Example: use B<-z "h225,counter,ip.addr==1.2.3.4"> to only collect stats for
1219 H.225 packets exchanged by the host at IP address 1.2.3.4 .
1220
1221 This option can be used multiple times on the command line.
1222
1223 =item B<-z> h225,srt[I<,filter>]
1224
1225 Collect requests/response SRT (Service Response Time) data for ITU-T H.225 RAS.
1226 Data collected is number of calls of each ITU-T H.225 RAS Message Type,
1227 Minimum SRT, Maximum SRT, Average SRT, Minimum in Packet, and Maximum in Packet.
1228 You will also get the number of Open Requests (Unresponded Requests),
1229 Discarded Responses (Responses without matching request) and Duplicate Messages.
1230
1231 Example: B<-z h225,srt>
1232
1233 This option can be used multiple times on the command line.
1234
1235 If the optional I<filter> is provided, the stats will only be calculated
1236 on those calls that match that filter.
1237
1238 Example: B<-z "h225,srt,ip.addr==1.2.3.4"> will only collect stats for
1239 ITU-T H.225 RAS packets exchanged by the host at IP address 1.2.3.4 .
1240
1241 =item B<-z> hosts[,ipv4][,ipv6]
1242
1243 Dump any collected IPv4 and/or IPv6 addresses in "hosts" format.  Both IPv4
1244 and IPv6 addresses are dumped by default.
1245
1246 Addresses are collected from a number of sources, including standard "hosts"
1247 files and captured traffic.
1248
1249 =item B<-z> hpfeeds,tree[,I<filter>]
1250
1251 Calculate statistics for HPFEEDS traffic such as publish per channel, and opcode
1252 distribution.
1253
1254 =item B<-z> http,stat,
1255
1256 Calculate the HTTP statistics distribution. Displayed values are
1257 the HTTP status codes and the HTTP request methods.
1258
1259 =item B<-z> http,tree
1260
1261 Calculate the HTTP packet distribution. Displayed values are the
1262 HTTP request modes and the HTTP status codes.
1263
1264 =item B<-z> http_ref,tree
1265
1266 Calculate the HTTP requests by referer. Displayed values are the
1267 referring URI.
1268
1269 =item B<-z> http_req,tree
1270
1271 Calculate the HTTP requests by server. Displayed values are the
1272 server name and the URI path.
1273
1274 =item B<-z> http_srv,tree
1275
1276 Calculate the HTTP requests and responses by server. For the HTTP
1277 requests, displayed values are the server IP address and server
1278 hostname. For the HTTP responses, displayed values are the server
1279 IP address and status.
1280
1281 =item B<-z> icmp,srt[,I<filter>]
1282
1283 Compute total ICMP echo requests, replies, loss, and percent loss, as well as
1284 minimum, maximum, mean, median and sample standard deviation SRT statistics
1285 typical of what ping provides.
1286
1287 Example: S<B<-z icmp,srt,ip.src==1.2.3.4>> will collect ICMP SRT statistics
1288 for ICMP echo request packets originating from a specific host.
1289
1290 This option can be used multiple times on the command line.
1291
1292 =item B<-z> icmpv6,srt[,I<filter>]
1293
1294 Compute total ICMPv6 echo requests, replies, loss, and percent loss, as well as
1295 minimum, maximum, mean, median and sample standard deviation SRT statistics
1296 typical of what ping provides.
1297
1298 Example: S<B<-z icmpv6,srt,ipv6.src==fe80::1>> will collect ICMPv6 SRT statistics
1299 for ICMPv6 echo request packets originating from a specific host.
1300
1301 This option can be used multiple times on the command line.
1302
1303 =item B<-z> io,phs[,I<filter>]
1304
1305 Create Protocol Hierarchy Statistics listing both number of packets and bytes.
1306 If no I<filter> is specified the statistics will be calculated for all packets.
1307 If a I<filter> is specified statistics will only be calculated for those
1308 packets that match the filter.
1309
1310 This option can be used multiple times on the command line.
1311
1312 =item B<-z> io,stat,I<interval>[,I<filter>][,I<filter>][,I<filter>]...
1313
1314 Collect packet/bytes statistics for the capture in intervals of
1315 I<interval> seconds.  I<Interval> can be specified either as a whole or
1316 fractional second and can be specified with microsecond (us) resolution.
1317 If I<interval> is 0, the statistics will be calculated over all packets.
1318
1319 If no I<filter> is specified the statistics will be calculated for all packets.
1320 If one or more I<filters> are specified statistics will be calculated for
1321 all filters and presented with one column of statistics for each filter.
1322
1323 This option can be used multiple times on the command line.
1324
1325 Example: B<-z io,stat,1,ip.addr==1.2.3.4> will generate 1 second
1326 statistics for all traffic to/from host 1.2.3.4.
1327
1328 Example: B<-z "io,stat,0.001,smb&&ip.addr==1.2.3.4"> will generate 1ms
1329 statistics for all SMB packets to/from host 1.2.3.4.
1330
1331 The examples above all use the standard syntax for generating statistics
1332 which only calculates the number of packets and bytes in each interval.
1333
1334 B<io,stat> can also do much more statistics and calculate COUNT(), SUM(),
1335 MIN(), MAX(), AVG() and LOAD() using a slightly different filter syntax:
1336
1337 =item -z io,stat,I<interval>,E<34>[COUNT|SUM|MIN|MAX|AVG|LOAD](I<field>)I<filter>E<34>
1338
1339 NOTE: One important thing to note here is that the filter is not optional
1340 and that the field that the calculation is based on MUST be part of the filter
1341 string or the calculation will fail.
1342
1343 So: B<-z io,stat,0.010,AVG(smb.time)> does not work.  Use B<-z
1344 io,stat,0.010,AVG(smb.time)smb.time> instead.  Also be aware that a field
1345 can exist multiple times inside the same packet and will then be counted
1346 multiple times in those packets.
1347
1348 NOTE: A second important thing to note is that the system setting for
1349 decimal separator must be set to "."! If it is set to "," the statistics
1350 will not be displayed per filter.
1351
1352 B<COUNT(I<field>)I<filter>> - Calculates the number of times that the
1353 field I<name> (not its value) appears per interval in the filtered packet list.
1354 ''I<field>'' can be any display filter name.
1355
1356 Example: B<-z io,stat,0.010,E<34>COUNT(smb.sid)smb.sidE<34>>
1357
1358 This will count the total number of SIDs seen in each 10ms interval.
1359
1360 B<SUM(I<field>)I<filter>> - Unlike COUNT, the I<values> of the
1361 specified field are summed per time interval.
1362 ''I<field>'' can only be a named integer, float, double or relative time field.
1363
1364 Example: B<-z io,stat,0.010,E<34>SUM(frame.len)frame.lenE<34>>
1365
1366 Reports the total number of bytes that were transmitted bidirectionally in
1367 all the packets within a 10 millisecond interval.
1368
1369 B<MIN/MAX/AVG(I<field>)I<filter>> - The minimum, maximum, or average field value
1370 in each interval is calculated.  The specified field must be a named integer,
1371 float, double or relative time field.  For relative time fields, the output is presented in
1372 seconds with six decimal digits of precision rounded to the nearest microsecond.
1373
1374 In the following example, the time of the first Read_AndX call, the last Read_AndX
1375 response values are displayed and the minimum, maximum, and average Read response times
1376 (SRTs) are calculated.  NOTE: If the DOS command shell line continuation character, ''^''
1377 is used, each line cannot end in a comma so it is placed at the beginning of each
1378 continuation line:
1379
1380   tshark -o tcp.desegment_tcp_streams:FALSE -n -q -r smb_reads.cap -z io,stat,0,
1381   "MIN(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==0",
1382   "MAX(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==1",
1383   "MIN(smb.time)smb.time and smb.cmd==0x2e",
1384   "MAX(smb.time)smb.time and smb.cmd==0x2e",
1385   "AVG(smb.time)smb.time and smb.cmd==0x2e"
1386
1387
1388   ======================================================================================================
1389   IO Statistics
1390   Column #0: MIN(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==0
1391   Column #1: MAX(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==1
1392   Column #2: MIN(smb.time)smb.time and smb.cmd==0x2e
1393   Column #3: MAX(smb.time)smb.time and smb.cmd==0x2e
1394   Column #4: AVG(smb.time)smb.time and smb.cmd==0x2e
1395                   |    Column #0   |    Column #1   |    Column #2   |    Column #3   |    Column #4   |
1396   Time            |       MIN      |       MAX      |       MIN      |       MAX      |       AVG      |
1397   000.000-                 0.000000         7.704054         0.000072         0.005539         0.000295
1398   ======================================================================================================
1399
1400 The following command displays the average SMB Read response PDU size, the
1401 total number of read PDU bytes, the average SMB Write request PDU size, and
1402 the total number of bytes transferred in SMB Write PDUs:
1403
1404   tshark -n -q -r smb_reads_writes.cap -z io,stat,0,
1405   "AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to",
1406   "SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to",
1407   "AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to",
1408   "SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to"
1409
1410   =====================================================================================
1411   IO Statistics
1412   Column #0: AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to
1413   Column #1: SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to
1414   Column #2: AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to
1415   Column #3: SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to
1416                   |    Column #0   |    Column #1   |    Column #2   |    Column #3   |
1417   Time            |       AVG      |       SUM      |       AVG      |       SUM      |
1418   000.000-                    30018         28067522               72             3240
1419   =====================================================================================
1420
1421 B<LOAD(I<field>)I<filter>> - The LOAD/Queue-Depth
1422 in each interval is calculated.  The specified field must be a relative time field that represents a response time.  For example smb.time.
1423 For each interval the Queue-Depth for the specified protocol is calculated.
1424
1425 The following command displays the average SMB LOAD.
1426 A value of 1.0 represents one I/O in flight.
1427
1428   tshark -n -q -r smb_reads_writes.cap
1429   -z "io,stat,0.001,LOAD(smb.time)smb.time"
1430
1431   ============================================================================
1432   IO Statistics
1433   Interval:   0.001000 secs
1434   Column #0: LOAD(smb.time)smb.time
1435                           |    Column #0   |
1436   Time                    |       LOAD     |
1437   0000.000000-0000.001000         1.000000
1438   0000.001000-0000.002000         0.741000
1439   0000.002000-0000.003000         0.000000
1440   0000.003000-0000.004000         1.000000
1441
1442
1443
1444 B<FRAMES | BYTES[()I<filter>]> - Displays the total number of frames or bytes.
1445 The filter field is optional but if included it must be prepended with ''()''.
1446
1447 The following command displays five columns: the total number of frames and bytes
1448 (transferred bidirectionally) using a single comma, the same two stats using the FRAMES and BYTES
1449 subcommands, the total number of frames containing at least one SMB Read response, and
1450 the total number of bytes transmitted to the client (unidirectionally) at IP address 10.1.0.64.
1451
1452   tshark -o tcp.desegment_tcp_streams:FALSE -n -q -r smb_reads.cap -z io,stat,0,,FRAMES,BYTES,
1453   "FRAMES()smb.cmd==0x2e and smb.response_to","BYTES()ip.dst==10.1.0.64"
1454
1455   =======================================================================================================================
1456   IO Statistics
1457   Column #0:
1458   Column #1: FRAMES
1459   Column #2: BYTES
1460   Column #3: FRAMES()smb.cmd==0x2e and smb.response_to
1461   Column #4: BYTES()ip.dst==10.1.0.64
1462                   |            Column #0            |    Column #1   |    Column #2   |    Column #3   |    Column #4   |
1463   Time            |     Frames     |      Bytes     |     FRAMES     |     BYTES      |     FRAMES     |     BYTES      |
1464   000.000-                    33576         29721685            33576         29721685              870         29004801
1465   =======================================================================================================================
1466
1467 =item B<-z> mac-lte,stat[I<,filter>]
1468
1469 This option will activate a counter for LTE MAC messages.  You will get
1470 information about the maximum number of UEs/TTI, common messages and
1471 various counters for each UE that appears in the log.
1472
1473 Example: B<-z mac-lte,stat>.
1474
1475 This option can be used multiple times on the command line.
1476
1477 If the optional I<filter> is provided, the stats will only be calculated
1478 for those frames that match that filter.
1479 Example: B<-z "mac-lte,stat,mac-lte.rnti>3000"> will only collect stats for
1480 UEs with an assigned RNTI whose value is more than 3000.
1481
1482 =item B<-z> megaco,rtd[I<,filter>]
1483
1484 Collect requests/response RTD (Response Time Delay) data for MEGACO.
1485 (This is similar to B<-z smb,srt>).  Data collected is the number of calls
1486 for each known MEGACO Type, MinRTD, MaxRTD and AvgRTD.
1487 Additionally you get the number of duplicate requests/responses,
1488 unresponded requests, responses, which don't match with any request.
1489 Example: B<-z megaco,rtd>.
1490
1491 If the optional I<filter> is provided, the stats will only be calculated
1492 on those calls that match that filter.
1493 Example: B<-z "megaco,rtd,ip.addr==1.2.3.4"> will only collect stats for
1494 MEGACO packets exchanged by the host at IP address 1.2.3.4 .
1495
1496 This option can be used multiple times on the command line.
1497
1498 =item B<-z> mgcp,rtd[I<,filter>]
1499
1500 Collect requests/response RTD (Response Time Delay) data for MGCP.
1501 (This is similar to B<-z smb,srt>).  Data collected is the number of calls
1502 for each known MGCP Type, MinRTD, MaxRTD and AvgRTD.
1503 Additionally you get the number of duplicate requests/responses,
1504 unresponded requests, responses, which don't match with any request.
1505 Example: B<-z mgcp,rtd>.
1506
1507 This option can be used multiple times on the command line.
1508
1509 If the optional I<filter> is provided, the stats will only be calculated
1510 on those calls that match that filter.
1511 Example: B<-z "mgcp,rtd,ip.addr==1.2.3.4"> will only collect stats for
1512 MGCP packets exchanged by the host at IP address 1.2.3.4 .
1513
1514 =item B<-z> proto,colinfo,I<filter>,I<field>
1515
1516 Append all I<field> values for the packet to the Info column of the
1517 one-line summary output.
1518 This feature can be used to append arbitrary fields to the Info column
1519 in addition to the normal content of that column.
1520 I<field> is the display-filter name of a field which value should be placed
1521 in the Info column.
1522 I<filter> is a filter string that controls for which packets the field value
1523 will be presented in the info column.  I<field> will only be presented in the
1524 Info column for the packets which match I<filter>.
1525
1526 NOTE: In order for B<TShark> to be able to extract the I<field> value
1527 from the packet, I<field> MUST be part of the I<filter> string.  If not,
1528 B<TShark> will not be able to extract its value.
1529
1530 For a simple example to add the "nfs.fh.hash" field to the Info column
1531 for all packets containing the "nfs.fh.hash" field, use
1532
1533 B<-z proto,colinfo,nfs.fh.hash,nfs.fh.hash>
1534
1535 To put "nfs.fh.hash" in the Info column but only for packets coming from
1536 host 1.2.3.4 use:
1537
1538 B<-z "proto,colinfo,nfs.fh.hash && ip.src==1.2.3.4,nfs.fh.hash">
1539
1540 This option can be used multiple times on the command line.
1541
1542 =item B<-z> rlc-lte,stat[I<,filter>]
1543
1544 This option will activate a counter for LTE RLC messages.  You will get
1545 information about common messages and various counters for each UE that appears
1546 in the log.
1547
1548 Example: B<-z rlc-lte,stat>.
1549
1550 This option can be used multiple times on the command line.
1551
1552 If the optional I<filter> is provided, the stats will only be calculated
1553 for those frames that match that filter.
1554 Example: B<-z "rlc-lte,stat,rlc-lte.ueid>3000"> will only collect stats for
1555 UEs with a UEId of more than 3000.
1556
1557 =item B<-z> rpc,programs
1558
1559 Collect call/reply SRT data for all known ONC-RPC programs/versions.
1560 Data collected is number of calls for each protocol/version, MinSRT,
1561 MaxSRT and AvgSRT.
1562 This option can only be used once on the command line.
1563
1564 =item B<-z> rpc,srt,I<program>,I<version>[,I<filter>]
1565
1566 Collect call/reply SRT (Service Response Time) data for I<program>/I<version>.
1567 Data collected is the number of calls for each procedure, MinSRT, MaxSRT,
1568 AvgSRT, and the total time taken for each procedure.
1569
1570
1571 Example: B<-z rpc,srt,100003,3> will collect data for NFS v3.
1572
1573 This option can be used multiple times on the command line.
1574
1575 If the optional I<filter> is provided, the stats will only be calculated
1576 on those calls that match that filter.
1577
1578 Example: B<-z rpc,srt,100003,3,nfs.fh.hash==0x12345678> will collect NFS v3
1579 SRT statistics for a specific file.
1580
1581 =item B<-z> rtp,streams
1582
1583 Collect statistics for all RTP streams and calculate max. delta, max. and
1584 mean jitter and packet loss percentages.
1585
1586 =item B<-z> scsi,srt,I<cmdset>[,I<filter>]
1587
1588 Collect call/reply SRT (Service Response Time) data for SCSI commandset I<cmdset>.
1589
1590 Commandsets are 0:SBC   1:SSC  5:MMC
1591
1592 Data collected
1593 is the number of calls for each procedure, MinSRT, MaxSRT and AvgSRT.
1594
1595 Example: B<-z scsi,srt,0> will collect data for SCSI BLOCK COMMANDS (SBC).
1596
1597 This option can be used multiple times on the command line.
1598
1599 If the optional I<filter> is provided, the stats will only be calculated
1600 on those calls that match that filter.
1601
1602 Example: B<-z scsi,srt,0,ip.addr==1.2.3.4> will collect SCSI SBC
1603 SRT statistics for a specific iscsi/ifcp/fcip host.
1604
1605 =item B<-z> sip,stat[I<,filter>]
1606
1607 This option will activate a counter for SIP messages.  You will get the number
1608 of occurrences of each SIP Method and of each SIP Status-Code.  Additionally
1609 you also get the number of resent SIP Messages (only for SIP over UDP).
1610
1611 Example: B<-z sip,stat>.
1612
1613 This option can be used multiple times on the command line.
1614
1615 If the optional I<filter> is provided, the stats will only be calculated
1616 on those calls that match that filter.
1617 Example: B<-z "sip,stat,ip.addr==1.2.3.4"> will only collect stats for
1618 SIP packets exchanged by the host at IP address 1.2.3.4 .
1619
1620 =item B<-z> smb,sids
1621
1622 When this feature is used B<TShark> will print a report with all the
1623 discovered SID and account name mappings.  Only those SIDs where the
1624 account name is known will be presented in the table.
1625
1626 For this feature to work you will need to either to enable
1627 "Edit/Preferences/Protocols/SMB/Snoop SID to name mappings" in the
1628 preferences or you can override the preferences by specifying
1629 S<B<-o "smb.sid_name_snooping:TRUE">> on the B<TShark> command line.
1630
1631 The current method used by B<TShark> to find the SID->name mapping
1632 is relatively restricted with a hope of future expansion.
1633
1634 =item B<-z> smb,srt[,I<filter>]
1635
1636 Collect call/reply SRT (Service Response Time) data for SMB.  Data collected
1637 is number of calls for each SMB command, MinSRT, MaxSRT and AvgSRT.
1638
1639 Example: B<-z smb,srt>
1640
1641 The data will be presented as separate tables for all normal SMB commands,
1642 all Transaction2 commands and all NT Transaction commands.
1643 Only those commands that are seen in the capture will have its stats
1644 displayed.
1645 Only the first command in a xAndX command chain will be used in the
1646 calculation.  So for common SessionSetupAndX + TreeConnectAndX chains,
1647 only the SessionSetupAndX call will be used in the statistics.
1648 This is a flaw that might be fixed in the future.
1649
1650 This option can be used multiple times on the command line.
1651
1652 If the optional I<filter> is provided, the stats will only be calculated
1653 on those calls that match that filter.
1654
1655 Example: B<-z "smb,srt,ip.addr==1.2.3.4"> will only collect stats for
1656 SMB packets exchanged by the host at IP address 1.2.3.4 .
1657
1658 =back
1659
1660 =item --capture-comment E<lt>commentE<gt>
1661
1662 Add a capture comment to the output file.
1663
1664 This option is only available if a new output file in pcapng format is
1665 created. Only one capture comment may be set per output file.
1666
1667 =item --list-time-stamp-types
1668
1669 List time stamp types supported for the interface. If no time stamp type can be
1670 set, no time stamp types are listed.
1671
1672 =item --time-stamp-type E<lt>typeE<gt>
1673
1674 Change the interface's timestamp method.
1675
1676 =item --color
1677
1678 Enable coloring of packets according to standard Wireshark color
1679 filters. On Windows colors are limited to the standard console
1680 character attribute colors. Other platforms require a terminal that
1681 handles 24-bit "true color" terminal escape sequences. See
1682 L<https://wiki.wireshark.org/ColoringRules> for more information on
1683 configuring color filters.
1684
1685 =item --no-duplicate-keys
1686
1687 If a key appears multiple times in an object, only write it a single time with
1688 as value a json array containing all the separate values. (Only works with
1689 -T json)
1690
1691 =item --export-objects E<lt>protocolE<gt>,E<lt>destdirE<gt>
1692
1693 Export all objects within a protocol into directory B<destdir>. The available
1694 values for B<protocol> can be listed with B<--export-objects help>.
1695
1696 The objects are directly saved in the given directory. Filenames are dependent
1697 on the dissector, but typically it is named after the basename of a file.
1698 Duplicate files are not overwritten, instead an increasing number is appended
1699 before the file extension.
1700
1701 This interface is subject to change, adding the possibility to filter on files.
1702
1703 =item --enable-protocol E<lt>proto_nameE<gt>
1704
1705 Enable dissection of proto_name.
1706
1707 =item --disable-protocol E<lt>proto_nameE<gt>
1708
1709 Disable dissection of proto_name.
1710
1711 =item --enable-heuristic E<lt>short_nameE<gt>
1712
1713 Enable dissection of heuristic protocol.
1714
1715 =item --disable-heuristic E<lt>short_nameE<gt>
1716
1717 Disable dissection of heuristic protocol.
1718
1719 =back
1720
1721 =head1 CAPTURE FILTER SYNTAX
1722
1723 See the manual page of pcap-filter(7) or, if that doesn't exist, tcpdump(8),
1724 or, if that doesn't exist, L<https://wiki.wireshark.org/CaptureFilters>.
1725
1726 =head1 READ FILTER SYNTAX
1727
1728 For a complete table of protocol and protocol fields that are filterable
1729 in B<TShark> see the wireshark-filter(4) manual page.
1730
1731 =head1 FILES
1732
1733 These files contains various B<Wireshark> configuration values.
1734
1735 =over 4
1736
1737 =item Preferences
1738
1739 The F<preferences> files contain global (system-wide) and personal
1740 preference settings.  If the system-wide preference file exists, it is
1741 read first, overriding the default settings.  If the personal preferences
1742 file exists, it is read next, overriding any previous values.  Note: If
1743 the command line option B<-o> is used (possibly more than once), it will
1744 in turn override values from the preferences files.
1745
1746 The preferences settings are in the form I<prefname>B<:>I<value>,
1747 one per line,
1748 where I<prefname> is the name of the preference
1749 and I<value> is the value to
1750 which it should be set; white space is allowed between B<:> and
1751 I<value>.  A preference setting can be continued on subsequent lines by
1752 indenting the continuation lines with white space.  A B<#> character
1753 starts a comment that runs to the end of the line:
1754
1755   # Capture in promiscuous mode?
1756   # TRUE or FALSE (case-insensitive).
1757   capture.prom_mode: TRUE
1758
1759 The global preferences file is looked for in the F<wireshark> directory
1760 under the F<share> subdirectory of the main installation directory (for
1761 example, F</usr/local/share/wireshark/preferences>) on UNIX-compatible
1762 systems, and in the main installation directory (for example,
1763 F<C:\Program Files\Wireshark\preferences>) on Windows systems.
1764
1765 The personal preferences file is looked for in
1766 F<$XDG_CONFIG_HOME/wireshark/preferences>
1767 (or, if F<$XDG_CONFIG_HOME/wireshark> does not exist while F<$HOME/.wireshark>
1768 is present, F<$HOME/.wireshark/preferences>) on
1769 UNIX-compatible systems and F<%APPDATA%\Wireshark\preferences> (or, if
1770 %APPDATA% isn't defined, F<%USERPROFILE%\Application
1771 Data\Wireshark\preferences>) on Windows systems.
1772
1773 =item Disabled (Enabled) Protocols
1774
1775 The F<disabled_protos> files contain system-wide and personal lists of
1776 protocols that have been disabled, so that their dissectors are never
1777 called.  The files contain protocol names, one per line, where the
1778 protocol name is the same name that would be used in a display filter
1779 for the protocol:
1780
1781   http
1782   tcp     # a comment
1783
1784 The global F<disabled_protos> file uses the same directory as the global
1785 preferences file.
1786
1787 The personal F<disabled_protos> file uses the same directory as the
1788 personal preferences file.
1789
1790 =item Name Resolution (hosts)
1791
1792 If the personal F<hosts> file exists, it is
1793 used to resolve IPv4 and IPv6 addresses before any other
1794 attempts are made to resolve them.  The file has the standard F<hosts>
1795 file syntax; each line contains one IP address and name, separated by
1796 whitespace.  The same directory as for the personal preferences file is
1797 used.
1798
1799 Capture filter name resolution is handled by libpcap on UNIX-compatible
1800 systems and WinPcap on Windows.  As such the Wireshark personal F<hosts> file
1801 will not be consulted for capture filter name resolution.
1802
1803 =item Name Resolution (subnets)
1804
1805 If an IPv4 address cannot be translated via name resolution (no exact
1806 match is found) then a partial match is attempted via the F<subnets> file.
1807
1808 Each line of this file consists of an IPv4 address, a subnet mask length
1809 separated only by a / and a name separated by whitespace. While the address
1810 must be a full IPv4 address, any values beyond the mask length are subsequently
1811 ignored.
1812
1813 An example is:
1814
1815 # Comments must be prepended by the # sign!
1816 192.168.0.0/24 ws_test_network
1817
1818 A partially matched name will be printed as "subnet-name.remaining-address".
1819 For example, "192.168.0.1" under the subnet above would be printed as
1820 "ws_test_network.1"; if the mask length above had been 16 rather than 24, the
1821 printed address would be ``ws_test_network.0.1".
1822
1823 =item Name Resolution (ethers)
1824
1825 The F<ethers> files are consulted to correlate 6-byte hardware addresses to
1826 names.  First the personal F<ethers> file is tried and if an address is not
1827 found there the global F<ethers> file is tried next.
1828
1829 Each line contains one hardware address and name, separated by
1830 whitespace.  The digits of the hardware address are separated by colons
1831 (:), dashes (-) or periods (.).  The same separator character must be
1832 used consistently in an address.  The following three lines are valid
1833 lines of an F<ethers> file:
1834
1835   ff:ff:ff:ff:ff:ff          Broadcast
1836   c0-00-ff-ff-ff-ff          TR_broadcast
1837   00.00.00.00.00.00          Zero_broadcast
1838
1839 The global F<ethers> file is looked for in the F</etc> directory on
1840 UNIX-compatible systems, and in the main installation directory (for
1841 example, F<C:\Program Files\Wireshark>) on Windows systems.
1842
1843 The personal F<ethers> file is looked for in the same directory as the personal
1844 preferences file.
1845
1846 Capture filter name resolution is handled by libpcap on UNIX-compatible
1847 systems and WinPcap on Windows.  As such the Wireshark personal F<ethers> file
1848 will not be consulted for capture filter name resolution.
1849
1850 =item Name Resolution (manuf)
1851
1852 The F<manuf> file is used to match the 3-byte vendor portion of a 6-byte
1853 hardware address with the manufacturer's name; it can also contain well-known
1854 MAC addresses and address ranges specified with a netmask.  The format of the
1855 file is the same as the F<ethers> files, except that entries of the form:
1856
1857   00:00:0C      Cisco
1858
1859 can be provided, with the 3-byte OUI and the name for a vendor, and
1860 entries such as:
1861
1862   00-00-0C-07-AC/40     All-HSRP-routers
1863
1864 can be specified, with a MAC address and a mask indicating how many bits
1865 of the address must match.  The above entry, for example, has 40
1866 significant bits, or 5 bytes, and would match addresses from
1867 00-00-0C-07-AC-00 through 00-00-0C-07-AC-FF.  The mask need not be a
1868 multiple of 8.
1869
1870 The F<manuf> file is looked for in the same directory as the global
1871 preferences file.
1872
1873 =item Name Resolution (services)
1874
1875 The F<services> file is used to translate port numbers into names.
1876
1877 The file has the standard F<services> file syntax; each line contains one
1878 (service) name and one transport identifier separated by white space.  The
1879 transport identifier includes one port number and one transport protocol name
1880 (typically tcp, udp, or sctp) separated by a /.
1881
1882 An example is:
1883
1884 mydns       5045/udp     # My own Domain Name Server
1885 mydns       5045/tcp     # My own Domain Name Server
1886
1887 =item Name Resolution (ipxnets)
1888
1889 The F<ipxnets> files are used to correlate 4-byte IPX network numbers to
1890 names.  First the global F<ipxnets> file is tried and if that address is not
1891 found there the personal one is tried next.
1892
1893 The format is the same as the F<ethers>
1894 file, except that each address is four bytes instead of six.
1895 Additionally, the address can be represented as a single hexadecimal
1896 number, as is more common in the IPX world, rather than four hex octets.
1897 For example, these four lines are valid lines of an F<ipxnets> file:
1898
1899   C0.A8.2C.00              HR
1900   c0-a8-1c-00              CEO
1901   00:00:BE:EF              IT_Server1
1902   110f                     FileServer3
1903
1904 The global F<ipxnets> file is looked for in the F</etc> directory on
1905 UNIX-compatible systems, and in the main installation directory (for
1906 example, F<C:\Program Files\Wireshark>) on Windows systems.
1907
1908 The personal F<ipxnets> file is looked for in the same directory as the
1909 personal preferences file.
1910
1911 =back
1912
1913 =head1 OUTPUT
1914
1915 B<TShark> uses UTF-8 to represent strings internally. In some cases the
1916 output might not be valid. For example, a dissector might generate
1917 invalid UTF-8 character sequences. Programs reading B<TShark> output
1918 should expect UTF-8 and be prepared for invalid output.
1919
1920 If B<TShark> detects that it is writing to a TTY on UNIX or Linux and
1921 the locale does not support UTF-8, output will be re-encoded to match the
1922 current locale.
1923
1924 If B<TShark> detects that it is writing to a TTY on Windows, output will be
1925 encoded as UTF-16LE.
1926
1927 =head1 ENVIRONMENT VARIABLES
1928
1929 =over 4
1930
1931 =item WIRESHARK_APPDATA
1932
1933 On Windows, Wireshark normally stores all application data in %APPDATA% or
1934 %USERPROFILE%.  You can override the default location by exporting this
1935 environment variable to specify an alternate location.
1936
1937 =item WIRESHARK_DEBUG_WMEM_OVERRIDE
1938
1939 Setting this environment variable forces the wmem framework to use the
1940 specified allocator backend for *all* allocations, regardless of which
1941 backend is normally specified by the code. This is mainly useful to developers
1942 when testing or debugging. See I<README.wmem> in the source distribution for
1943 details.
1944
1945 =item WIRESHARK_RUN_FROM_BUILD_DIRECTORY
1946
1947 This environment variable causes the plugins and other data files to be loaded
1948 from the build directory (where the program was compiled) rather than from the
1949 standard locations.  It has no effect when the program in question is running
1950 with root (or setuid) permissions on *NIX.
1951
1952 =item WIRESHARK_DATA_DIR
1953
1954 This environment variable causes the various data files to be loaded from
1955 a directory other than the standard locations.  It has no effect when the
1956 program in question is running with root (or setuid) permissions on *NIX.
1957
1958 =item ERF_RECORDS_TO_CHECK
1959
1960 This environment variable controls the number of ERF records checked when
1961 deciding if a file really is in the ERF format.  Setting this environment
1962 variable a number higher than the default (20) would make false positives
1963 less likely.
1964
1965 =item IPFIX_RECORDS_TO_CHECK
1966
1967 This environment variable controls the number of IPFIX records checked when
1968 deciding if a file really is in the IPFIX format.  Setting this environment
1969 variable a number higher than the default (20) would make false positives
1970 less likely.
1971
1972 =item WIRESHARK_ABORT_ON_DISSECTOR_BUG
1973
1974 If this environment variable is set, B<TShark> will call abort(3)
1975 when a dissector bug is encountered.  abort(3) will cause the program to
1976 exit abnormally; if you are running B<TShark> in a debugger, it
1977 should halt in the debugger and allow inspection of the process, and, if
1978 you are not running it in a debugger, it will, on some OSes, assuming
1979 your environment is configured correctly, generate a core dump file.
1980 This can be useful to developers attempting to troubleshoot a problem
1981 with a protocol dissector.
1982
1983 =item WIRESHARK_ABORT_ON_TOO_MANY_ITEMS
1984
1985 If this environment variable is set, B<TShark> will call abort(3)
1986 if a dissector tries to add too many items to a tree (generally this
1987 is an indication of the dissector not breaking out of a loop soon enough).
1988 abort(3) will cause the program to exit abnormally; if you are running
1989 B<TShark> in a debugger, it should halt in the debugger and allow
1990 inspection of the process, and, if you are not running it in a debugger,
1991 it will, on some OSes, assuming your environment is configured correctly,
1992 generate a core dump file.  This can be useful to developers attempting to
1993 troubleshoot a problem with a protocol dissector.
1994
1995 =back
1996
1997 =head1 SEE ALSO
1998
1999 wireshark-filter(4), wireshark(1), editcap(1), pcap(3), dumpcap(1),
2000 text2pcap(1), mergecap(1), pcap-filter(7) or tcpdump(8)
2001
2002 =head1 NOTES
2003
2004 B<TShark> is part of the B<Wireshark> distribution.  The latest version
2005 of B<Wireshark> can be found at L<https://www.wireshark.org>.
2006
2007 HTML versions of the Wireshark project man pages are available at:
2008 L<https://www.wireshark.org/docs/man-pages>.
2009
2010 =head1 AUTHORS
2011
2012 B<TShark> uses the same packet dissection code that B<Wireshark> does,
2013 as well as using many other modules from B<Wireshark>; see the list of
2014 authors in the B<Wireshark> man page for a list of authors of that code.