Take a stab at adding a section on environment variables that affect *shark's behavio...
[obnox/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<-a> E<lt>capture autostop conditionE<gt> ] ...>
10 S<[ B<-b> E<lt>capture ring buffer optionE<gt>] ...>
11 S<[ B<-B> E<lt>capture buffer size (Win32 only)E<gt> ] >
12 S<[ B<-c> E<lt>capture packet countE<gt> ]>
13 S<[ B<-C> E<lt>configuration profileE<gt> ]>
14 S<[ B<-d> E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt> ]>
15 S<[ B<-D> ]>
16 S<[ B<-e> E<lt>fieldE<gt> ]>
17 S<[ B<-E> E<lt>field print optionE<gt> ]>
18 S<[ B<-f> E<lt>capture filterE<gt> ]>
19 S<[ B<-F> E<lt>file formatE<gt> ]>
20 S<[ B<-h> ]>
21 S<[ B<-i> E<lt>capture interfaceE<gt>|- ]>
22 S<[ B<-K> E<lt>keytabE<gt> ]>
23 S<[ B<-l> ]>
24 S<[ B<-L> ]>
25 S<[ B<-n> ]>
26 S<[ B<-N> E<lt>name resolving flagsE<gt> ]>
27 S<[ B<-o> E<lt>preference settingE<gt> ] ...>
28 S<[ B<-p> ]>
29 S<[ B<-q> ]>
30 S<[ B<-r> E<lt>infileE<gt> ]>
31 S<[ B<-R> E<lt>read (display) filterE<gt> ]>
32 S<[ B<-s> E<lt>capture snaplenE<gt> ]>
33 S<[ B<-S> ]>
34 S<[ B<-t> ad|a|r|d|dd|e ]>
35 S<[ B<-T> pdml|psml|ps|text|fields ]>
36 S<[ B<-v> ]>
37 S<[ B<-V> ]>
38 S<[ B<-w> E<lt>outfileE<gt>|- ]>
39 S<[ B<-x> ]>
40 S<[ B<-X> E<lt>eXtension optionE<gt>]>
41 S<[ B<-y> E<lt>capture link typeE<gt> ]>
42 S<[ B<-z> E<lt>statisticsE<gt> ]>
43 S<[ E<lt>capture filterE<gt> ]>
44
45 =head1 DESCRIPTION
46
47 B<TShark> is a network protocol analyzer.  It lets you capture packet
48 data from a live network, or read packets from a previously saved
49 capture file, either printing a decoded form of those packets to the
50 standard output or writing the packets to a file.  B<TShark>'s native
51 capture file format is B<libpcap> format, which is also the format used
52 by B<tcpdump> and various other tools.
53
54 Without any options set, B<TShark> will work much like B<tcpdump>. It will
55 use the pcap library to capture traffic from the first available network
56 interface and displays a summary line on stdout for each received packet.
57
58 B<TShark> is able to detect, read and write the same capture files that
59 are supported by B<Wireshark>.
60 The input file doesn't need a specific filename extension; the file
61 format and an optional gzip compression will be automatically detected.
62 Near the beginning of the DESCRIPTION section of wireshark(1) or
63 L<http://www.wireshark.org/docs/man-pages/wireshark.html>
64 is a detailed description of the way B<Wireshark> handles this, which is
65 the same way B<Tshark> handles this.
66
67 Compressed file support uses (and therefore requires) the zlib library.
68 If the zlib library is not present, B<TShark> will compile, but will
69 be unable to read compressed files.
70
71 If the B<-w> option is not specified, B<TShark> writes to the standard
72 output the text of a decoded form of the packets it captures or reads.
73 If the B<-w> option is specified, B<TShark> writes to the file
74 specified by that option the raw data of the packets, along with the
75 packets' time stamps.
76
77 When writing a decoded form of packets, B<TShark> writes, by
78 default, a summary line containing the fields specified by the
79 preferences file (which are also the fields displayed in the packet list
80 pane in B<Wireshark>), although if it's writing packets as it captures
81 them, rather than writing packets from a saved capture file, it won't
82 show the "frame number" field.  If the B<-V> option is specified, it
83 writes instead a view of the details of the packet, showing all the
84 fields of all protocols in the packet.
85
86 If you want to write the decoded form of packets to a file, run
87 B<TShark> without the B<-w> option, and redirect its standard output to
88 the file (do I<not> use the B<-w> option).
89
90 When writing packets to a file, B<TShark>, by default, writes the
91 file in B<libpcap> format, and writes all of the packets it sees to the
92 output file.  The B<-F> option can be used to specify the format in which
93 to write the file. This list of available file formats is displayed by
94 the B<-F> flag without a value. However, you can't specify a file format
95 for a live capture.
96
97 Read filters in B<TShark>, which allow you to select which packets
98 are to be decoded or written to a file, are very powerful; more fields
99 are filterable in B<TShark> than in other protocol analyzers, and the
100 syntax you can use to create your filters is richer.  As B<TShark>
101 progresses, expect more and more protocol fields to be allowed in read
102 filters.
103
104 Packet capturing is performed with the pcap library.  The capture filter
105 syntax follows the rules of the pcap library.  This syntax is different
106 from the read filter syntax.  A read filter can also be specified when
107 capturing, and only packets that pass the read filter will be displayed
108 or saved to the output file; note, however, that capture filters are much
109 more efficient than read filters, and it may be more difficult for
110 B<TShark> to keep up with a busy network if a read filter is
111 specified for a live capture.
112
113 A capture or read filter can either be specified with the B<-f> or B<-R>
114 option, respectively, in which case the entire filter expression must be
115 specified as a single argument (which means that if it contains spaces,
116 it must be quoted), or can be specified with command-line arguments
117 after the option arguments, in which case all the arguments after the
118 filter arguments are treated as a filter expression.  Capture filters
119 are supported only when doing a live capture; read filters are supported
120 when doing a live capture and when reading a capture file, but require
121 TShark to do more work when filtering, so you might be more likely to
122 lose packets under heavy load if you're using a read filter.  If the
123 filter is specified with command-line arguments after the option
124 arguments, it's a capture filter if a capture is being done (i.e., if no
125 B<-r> option was specified) and a read filter if a capture file is being
126 read (i.e., if a B<-r> option was specified).
127
128 =head1 OPTIONS
129
130 =over 4
131
132 =item -a  E<lt>capture autostop conditionE<gt>
133
134 Specify a criterion that specifies when B<TShark> is to stop writing
135 to a capture file.  The criterion is of the form I<test>B<:>I<value>,
136 where I<test> is one of:
137
138 B<duration>:I<value> Stop writing to a capture file after I<value> seconds have elapsed.
139
140 B<filesize>:I<value> Stop writing to a capture file after it reaches a size of I<value>
141 kilobytes (where a kilobyte is 1024 bytes). If this option
142 is used together with the -b option, B<TShark> will stop writing to the
143 current capture file and switch to the next one if filesize is reached. When reading a capture file,
144 B<TShark> will stop reading the file after the number of bytes read exceeds this number
145 (the complete packet will be read, so more bytes than this number may be read).
146
147 B<files>:I<value> Stop writing to capture files after I<value> number of files were written.
148
149 =item -b  E<lt>capture ring buffer optionE<gt>
150
151 Cause B<TShark> to run in "multiple files" mode.  In "multiple files" mode,
152 B<TShark> will write to several capture files. When the first capture file
153 fills up, B<TShark> will switch writing to the next file and so on.
154
155 The created filenames are based on the filename given with the B<-w> option, the number of
156 the file and on the creation date and time,
157 e.g. outfile_00001_20050604120117.pcap, outfile_00001_20050604120523.pcap, ...
158
159 With the I<files> option it's also possible to form a "ring buffer".
160 This will fill up new files until the number of files specified,
161 at which point B<TShark> will discard the data in the first file and start
162 writing to that file and so on. If the I<files> option is not set,
163 new files filled up until one of the capture stop conditions match (or
164 until the disk if full).
165
166 The criterion is of the form I<key>B<:>I<value>,
167 where I<key> is one of:
168
169 B<duration>:I<value> switch to the next file after I<value> seconds have
170 elapsed, even if the current file is not completely filled up.
171
172 B<filesize>:I<value> switch to the next file after it reaches a size of
173 I<value> kilobytes (where a kilobyte is 1024 bytes).
174
175 B<files>:I<value> begin again with the first file after I<value> number of
176 files were written (form a ring buffer).
177
178 =item -B  E<lt>capture buffer sizeE<gt> (Win32 only)
179
180 Win32 only: set capture buffer size (in MB, default is 1MB). This is used by the
181 the capture driver to buffer packet data until that data can be written to
182 disk. If you encounter packet drops while capturing, try to increase this size.
183
184 =item -c  E<lt>capture packet countE<gt>
185
186 Set the maximum number of packets to read when capturing live
187 data. If reading a capture file, set the maximum number of packets to read.
188
189 =item -C  E<lt>configuration profileE<gt>
190
191 Run with the given configuration profile.
192
193 =item -d  E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt>
194
195 Like Wireshark's B<Decode As...> feature, this lets you specify how a
196 layer type should be dissected. If the layer type in question (for example,
197 B<tcp.port> or B<udp.port> for a TCP or UDP port number) has the specified
198 selector value, packets should be dissected as the specified protocol.
199
200 Example: B<-d tcp.port==8888,http> will decode any traffic running over
201 TCP port 8888 as HTTP.
202
203 Using an invalid selector or protocol will print out a list of valid selectors
204 and protocol names, respectively.
205
206 Example: B<-d .> is a quick way to get a list of valid selectors.
207
208 Example: B<-d ethertype==0x0800.> is a quick way to get a list of protocols that can be
209 selected with an ethertype.
210
211 =item -D
212
213 Print a list of the interfaces on which B<TShark> can capture, and
214 exit.  For each network interface, a number and an
215 interface name, possibly followed by a text description of the
216 interface, is printed.  The interface name or the number can be supplied
217 to the B<-i> option to specify an interface on which to capture.
218
219 This can be useful on systems that don't have a command to list them
220 (e.g., Windows systems, or UNIX systems lacking B<ifconfig -a>);
221 the number can be useful on Windows 2000 and later systems, where the
222 interface name is a somewhat complex string.
223
224 Note that "can capture" means that B<TShark> was able to open that
225 device to do a live capture.  Depending on your system you may need to
226 run tshark from an account with special privileges (for example, as
227 root) to be able to capture network traffic.  If B<TShark -D> is not run
228 from such an account, it will not list any interfaces.
229
230 =item -e  E<lt>fieldE<gt>
231
232 Add a field to the list of fields to display if B<-T fields> is
233 selected.  This option can be used multiple times on the command line.
234 At least one field must be provided if the B<-T fields> option is
235 selected.
236
237 Example: B<-e frame.number -e ip.addr -e udp>
238
239 Giving a protocol rather than a single field will print multiple items
240 of data about the protocol as a single field.  Fields are separated by
241 tab characters by default.  B<-E> controls the format of the printed
242 fields.
243
244 =item -E  E<lt>field print optionE<gt>
245
246 Set an option controlling the printing of fields when B<-T fields> is
247 selected.
248
249 Options are:
250
251 B<header=y|n> If B<y>, print a list of the field names given using B<-e>
252 as the first line of the output; the field name will be separated using
253 the same character as the field values.  Defaults to B<n>.
254
255 B<separator=/t|/s|>E<lt>characterE<gt> Set the separator character to
256 use for fields.  If B</t> tab will be used (this is the default), if
257 B</s>, s single space will be used.  Otherwise any character that can be
258 accepted by the command line as part of the option may be used.
259
260 B<quote=d|s|n> Set the quote character to use to surround fields.  B<d>
261 uses double-quotes, B<s> single-quotes, B<n> no quotes (the default).
262
263 =item -f  E<lt>capture filterE<gt>
264
265 Set the capture filter expression.
266
267 =item -F  E<lt>file formatE<gt>
268
269 Set the file format of the output capture file written using the B<-w>
270 option.  The output written with the B<-w> option is raw packet data, not
271 text, so there is no B<-F> option to request text output.  The option B<-F>
272 without a value will list the available formats.
273
274 =item -h
275
276 Print the version and options and exits.
277
278 =item -i  E<lt>capture interfaceE<gt> | -
279
280 Set the name of the network interface or pipe to use for live packet
281 capture.
282
283 Network interface names should match one of the names listed in
284 "B<tshark -D>" (described above); a number, as reported by
285 "B<tshark -D>", can also be used.  If you're using UNIX, "B<netstat
286 -i>" or "B<ifconfig -a>" might also work to list interface names,
287 although not all versions of UNIX support the B<-a> option to B<ifconfig>.
288
289 If no interface is specified, B<TShark> searches the list of
290 interfaces, choosing the first non-loopback interface if there are any
291 non-loopback interfaces, and choosing the first loopback interface if
292 there are no non-loopback interfaces. If there are no interfaces at all,
293 B<TShark> reports an error and doesn't start the capture.
294
295 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
296 read data from the standard input.  Data read from pipes must be in
297 standard libpcap format.
298
299 Note: the Win32 version of B<TShark> doesn't support capturing from
300 pipes!
301
302 =item -K  E<lt>keytabE<gt>
303
304 Load kerberos crypto keys from the specified keytab file.
305 This option can be used multiple times to load keys from several files.
306
307 Example: B<-K krb5.keytab>
308
309 =item -l
310
311 Flush the standard output after the information for each packet is
312 printed.  (This is not, strictly speaking, line-buffered if B<-V>
313 was specified; however, it is the same as line-buffered if B<-V> wasn't
314 specified, as only one line is printed for each packet, and, as B<-l> is
315 normally used when piping a live capture to a program or script, so that
316 output for a packet shows up as soon as the packet is seen and
317 dissected, it should work just as well as true line-buffering.  We do
318 this as a workaround for a deficiency in the Microsoft Visual C++ C
319 library.)
320
321 This may be useful when piping the output of B<TShark> to another
322 program, as it means that the program to which the output is piped will
323 see the dissected data for a packet as soon as B<TShark> sees the
324 packet and generates that output, rather than seeing it only when the
325 standard output buffer containing that data fills up.
326
327 =item -L
328
329 List the data link types supported by the interface and exit. The reported
330 link types can be used for the B<-y> option.
331
332 =item -n
333
334 Disable network object name resolution (such as hostname, TCP and UDP port
335 names); the B<-N> flag might override this one.
336
337 =item -N  E<lt>name resolving flagsE<gt>
338
339 Turn on name resolving only for particular types of addresses and port
340 numbers, with name resolving for other types of addresses and port
341 numbers turned off. This flag overrides B<-n> if both B<-N> and B<-n> are
342 present. If both B<-N> and B<-n> flags are not present, all name resolutions are
343 turned on.
344
345 The argument is a string that may contain the letters:
346
347 B<m> to enable MAC address resolution
348
349 B<n> to enable network address resolution
350
351 B<t> to enable transport-layer port number resolution
352
353 B<C> to enable concurrent (asynchronous) DNS lookups
354
355 =item -o  E<lt>preferenceE<gt>:E<lt>valueE<gt>
356
357 Set a preference value, overriding the default value and any value read
358 from a preference file.  The argument to the option is a string of the
359 form I<prefname>B<:>I<value>, where I<prefname> is the name of the
360 preference (which is the same name that would appear in the preference
361 file), and I<value> is the value to which it should be set.
362
363 =item -p
364
365 I<Don't> put the interface into promiscuous mode.  Note that the
366 interface might be in promiscuous mode for some other reason; hence,
367 B<-p> cannot be used to ensure that the only traffic that is captured is
368 traffic sent to or from the machine on which B<TShark> is running,
369 broadcast traffic, and multicast traffic to addresses received by that
370 machine.
371
372 =item -q
373
374 When capturing packets, don't display the continuous count of packets
375 captured that is normally shown when saving a capture to a file;
376 instead, just display, at the end of the capture, a count of packets
377 captured.  On systems that support the SIGINFO signal, such as various
378 BSDs, you can cause the current count to be displayed by typing your
379 "status" character (typically control-T, although it
380 might be set to "disabled" by default on at least some BSDs, so you'd
381 have to explicitly set it to use it).
382
383 When reading a capture file, or when capturing and not saving to a file,
384 don't print packet information; this is useful if you're using a B<-z>
385 option to calculate statistics and don't want the packet information
386 printed, just the statistics.
387
388 =item -r  E<lt>infileE<gt>
389
390 Read packet data from I<infile>, can be any supported capture file format
391 (including gzipped files). It's B<not> possible to use named pipes
392 or stdin here!
393
394 =item -R  E<lt>read (display) filterE<gt>
395
396 Cause the specified filter (which uses the syntax of read/display filters,
397 rather than that of capture filters) to be applied before printing a
398 decoded form of packets or writing packets to a file; packets not
399 matching the filter are discarded rather than being printed or written.
400
401 =item -s  E<lt>capture snaplenE<gt>
402
403 Set the default snapshot length to use when capturing live data.
404 No more than I<snaplen> bytes of each network packet will be read into
405 memory, or saved to disk.  A value of 0 specifies a snapshot length of
406 65535, so that the full packet is captured; this is the default.
407
408 =item -S
409
410 Decode and display packets even while writing raw packet data using the
411 B<-w> option.
412
413 =item -t  ad|a|r|d|dd|e
414
415 Set the format of the packet timestamp printed in summary lines.
416 The format can be one of:
417
418 B<ad> absolute with date: The absolute date and time is the actual time and
419 date the packet was captured
420
421 B<a> absolute: The absolute time is the actual time the packet was captured,
422 with no date displayed
423
424 B<r> relative: The relative time is the time elapsed between the first packet
425 and the current packet
426
427 B<d> delta: The delta time is the time since the previous packet was
428 captured
429
430 B<dd> delta_displayed: The delta_displayed time is the time since the
431 previous displayed packet was captured
432
433 B<e> epoch: The time in seconds since epoch (Jan 1, 1970 00:00:00)
434
435 The default format is relative.
436
437 =item -T  pdml|psml|ps|text|fields
438
439 Set the format of the output when viewing decoded packet data.  The
440 options are one of:
441
442 B<pdml> Packet Details Markup Language, an XML-based format for the details of
443 a decoded packet.  This information is equivalent to the packet details
444 printed with the B<-V> flag.
445
446 B<psml> Packet Summary Markup Language, an XML-based format for the summary
447 information of a decoded packet.  This information is equivalent to the
448 information shown in the one-line summary printed by default.
449
450 B<ps> PostScript for a human-readable one-line summary of each of the packets,
451 or a multi-line view of the details of each of the packets, depending on
452 whether the B<-V> flag was specified.
453
454 B<text> Text of a human-readable one-line summary of each of the packets, or a
455 multi-line view of the details of each of the packets, depending on
456 whether the B<-V> flag was specified.  This is the default.
457
458 B<fields> The values of fields specified with the B<-e> option, in a
459 form specified by the B<-E> option. For example,
460
461   -T fields -E separator=, -E quote=d
462
463 would generate comma-separated values (CSV) output suitable for importing
464 into your favorite spreadsheet program.
465
466
467 =item -v
468
469 Print the version and exit.
470
471 =item -V
472
473 Cause B<TShark> to print a view of the packet details rather
474 than a one-line summary of the packet.
475
476 =item -w  E<lt>outfileE<gt> | -
477
478 Write raw packet data to I<outfile> or to the standard output if
479 I<outfile> is '-'.
480
481 NOTE: -w provides raw packet data, not text. If you want text output
482 you need to redirect stdout (e.g. using '>'), don't use the B<-w>
483 option for this.
484
485 =item -x
486
487 Cause B<TShark> to print a hex and ASCII dump of the packet data
488 after printing the summary or details.
489
490 =item -X E<lt>eXtension optionsE<gt>
491
492 Specify an option to be passed to a B<TShark> module. The eXtension option
493 is in the form I<extension_key>B<:>I<value>, where I<extension_key> can be:
494
495 B<lua_script>:I<lua_script_filename> tells B<Wireshark> to load the given script in addition to the
496 default Lua scripts.
497
498 =item -y  E<lt>capture link typeE<gt>
499
500 Set the data link type to use while capturing packets.  The values
501 reported by B<-L> are the values that can be used.
502
503 =item -z  E<lt>statisticsE<gt>
504
505 Get B<TShark> to collect various types of statistics and display the result
506 after finishing reading the capture file.  Use the B<-q> flag if you're
507 reading a capture file and only want the statistics printed, not any
508 per-packet information.
509
510 Note that the B<-z proto> option is different - it doesn't cause
511 statistics to be gathered and printed when the capture is complete, it
512 modifies the regular packet summary output to include the values of
513 fields specified with the option.  Therefore you must not use the B<-q>
514 option, as that option would suppress the printing of the regular packet
515 summary output, and must also not use the B<-V> option, as that would
516 cause packet detail information rather than packet summary information
517 to be printed.
518
519 Currently implemented statistics are:
520
521 =over 4
522
523 =item B<-z> dcerpc,rtt,I<uuid>,I<major>.I<minor>[,I<filter>]
524
525 Collect call/reply RTT data for DCERPC interface I<uuid>,
526 version I<major>.I<minor>.
527 Data collected is the number of calls for each procedure, MinRTT, MaxRTT
528 and AvgRTT.
529
530 Example: S<B<-z dcerpc,rtt,12345778-1234-abcd-ef00-0123456789ac,1.0>> will collect data for the CIFS SAMR Interface.
531
532 If the optional I<filter> is provided, the stats will only be calculated
533 on those calls that match that filter.
534
535 Example: S<B<-z dcerpc,rtt,12345778-1234-abcd-ef00-0123456789ac,1.0,ip.addr==1.2.3.4>> willcollect SAMR
536 RTT statistics for a specific host.
537
538 This option can be used multiple times on the command line.
539
540 =item B<-z> io,phs[,I<filter>]
541
542 Create Protocol Hierarchy Statistics listing both number of packets and bytes.
543 If no I<filter> is specified the statistics will be calculated for all packets.
544 If a I<filter> is specified statistics will be only calculated for those
545 packets that match the filter.
546
547 This option can be used multiple times on the command line.
548
549 =item B<-z> io,stat,I<interval>[,I<filter>][,I<filter>][,I<filter>]...
550
551 Collect packet/bytes statistics for the capture in intervals of
552 I<interval> seconds.  I<Interval> can be specified either as a whole or
553 fractional second and can be specified with ms resolution.
554 If I<interval> is 0, the statistics will be calculated over all packets.
555
556 If no I<filter> is specified the statistics will be calculated for all packets.
557 If one or more I<filters> are specified statistics will be calculated for
558 all filters and presented with one column of statistics for each filter.
559
560 This option can be used multiple times on the command line.
561
562 Example: B<-z io,stat,1,ip.addr==1.2.3.4> will generate 1 second
563 statistics for all traffic to/from host 1.2.3.4.
564
565 Example: B<-z "io,stat,0.001,smb&&ip.addr==1.2.3.4"> will generate 1ms
566 statistics for all SMB packets to/from host 1.2.3.4.
567
568 The examples above all use the standard syntax for generating statistics
569 which only calculates the number of packets and bytes in each interval.
570
571 B<io,stat> can also do much more statistics and calculate COUNT(), SUM(),
572 MIN(), MAX(), and AVG() using a slightly different filter syntax:
573
574   [COUNT|SUM|MIN|MAX|AVG](<field>)<filter>
575
576 NOTE: One important thing to note here is that the field that the
577 calculation is based on MUST also be part of the filter string or
578 else the calculation will fail.
579
580 So: B<-z io,stat,0.010,AVG(smb.time)> does not work.  Use B<-z
581 io,stat,0.010,AVG(smb.time)smb.time> instead.  Also be aware that a field
582 can exist multiple times inside the same packet and will then be counted
583 multiple times in those packets.
584
585 NOTE: A second important thing to note is that the system setting for
586 decimal separator is set to "."! If it is set to "," the statistics
587 will not be displayed per filter.
588
589 COUNT(<field>) can be used on any type which has a display filter name.
590 It will count how many times this particular field is encountered in the
591 filtered packet list.
592
593 Example: B<-z io,stat,0.010,COUNT(smb.sid)smb.sid>
594
595 This will count the total number of SIDs seen in each 10ms interval.
596
597 SUM(<field>) can only be used on named fields of integer type.
598 This will sum together every occurence of this fields value for each interval.
599
600 Example: B<-z io,stat,0.010,SUM(frame.pkt_len)frame.pkt_len>
601
602 This will report the total number of bytes seen in all the packets within
603 an interval.
604
605 MIN/MAX/AVG(<field>) can only be used on named fields that are either
606 integers or relative time fields.  This will calculate maximum/minimum
607 or average seen in each interval.  If the field is a relative time field
608 the output will be presented in seconds and three digits after the
609 decimal point.  The resolution for time calculations is 1ms and anything
610 smaller will be truncated.
611
612 Example:  B<-z "io,stat,0.010,smb.time&&ip.addr==1.1.1.1,MIN(smb.time)smb.time&&ip.addr==1.1.1.1,MAX(smb.time)smb.time&&ip.addr==1.1.1.1,MAX(smb.time)smb.time&&ip.addr==1.1.1.1">
613
614 This will calculate statistics for all smb response times we see to/from
615 host 1.1.1.1 in 10ms intervals.  The output will be displayed in 4
616 columns; number of packets/bytes, minimum response time, maximum response
617 time and average response time.
618
619 =item B<-z> conv,I<type>[,I<filter>]
620
621 Create a table that lists all conversations that could be seen in the capture.
622 I<type> specifies which type of conversation we want to generate the
623 statistics for; currently the supported ones are
624
625   "eth"   Ethernet
626   "fc"    Fibre Channel
627   "fddi"  FDDI
628   "ip"    IP addresses
629   "ipx"   IPX addresses
630   "tcp"   TCP/IP socket pairs  Both IPv4 and IPv6 are supported
631   "tr"    Token Ring
632   "udp"   UDP/IP socket pairs  Both IPv4 and IPv6 are supported
633
634 If the optional I<filter> is specified, only those packets that match the
635 filter will be used in the calculations.
636
637 The table is presented with one line for each conversation and displays
638 number of packets/bytes in each direction as well as total number of
639 packets/bytes.
640 The table is sorted according to total number of bytes.
641
642 =item B<-z> proto,colinfo,I<filter>,I<field>
643
644 Append all I<field> values for the packet to the Info column of the
645 one-line summary output.
646 This feature can be used to append arbitrary fields to the Info column
647 in addition to the normal content of that column.
648 I<field> is the display-filter name of a field which value should be placed
649 in the Info column.
650 I<filter> is a filterstring that controls for which packets the field value
651 will be presented in the info column. I<field> will only be presented in the
652 Info column for the packets which match I<filter>.
653
654 NOTE: In order for B<TShark> to be able to extract the I<field> value
655 from the packet, I<field> MUST be part of the I<filter> string.  If not,
656 B<TShark> will not be able to extract its value.
657
658 For a simple example to add the "nfs.fh.hash" field to the Info column
659 for all packets containing the "nfs.fh.hash" field, use
660
661 B<-z proto,colinfo,nfs.fh.hash,nfs.fh.hash>
662
663 To put "nfs.fh.hash" in the Info column but only for packets coming from
664 host 1.2.3.4 use:
665
666 B<-z "proto,colinfo,nfs.fh.hash && ip.src==1.2.3.4,nfs.fh.hash">
667
668 This option can be used multiple times on the command line.
669
670 =item B<-z> rpc,rtt,I<program>,I<version>[,I<filter>]
671
672 Collect call/reply RTT data for I<program>/I<version>.  Data collected
673 is number of calls for each procedure, MinRTT, MaxRTT and AvgRTT.
674 Example: B<-z rpc,rtt,100003,3> will collect data for NFS v3.
675
676 If the optional I<filter> is provided, the stats will only be calculated
677 on those calls that match that filter.
678
679 Example: B<-z rpc,rtt,100003,3,nfs.fh.hash==0x12345678> will collect NFS v3
680 RTT statistics for a specific file.
681
682 This option can be used multiple times on the command line.
683
684 =item B<-z> rpc,programs
685
686 Collect call/reply RTT data for all known ONC-RPC programs/versions.
687 Data collected is number of calls for each protocol/version, MinRTT,
688 MaxRTT and AvgRTT.
689 This option can only be used once on the command line.
690
691 =item B<-z> rtp,streams
692
693 Collect statistics for all RTP streams and calculate max. delta, max. and
694 mean jitter and packet loss percentages.
695
696 =item B<-z> smb,rtt[,I<filter>]
697
698 Collect call/reply RTT data for SMB.  Data collected
699 is number of calls for each SMB command, MinRTT, MaxRTT and AvgRTT.
700 Example: B<-z smb,rtt>.
701 The data will be presented as separate tables for all normal SMB commands,
702 all Transaction2 commands and all NT Transaction commands.
703 Only those commands that are seen in the capture will have its stats
704 displayed.
705 Only the first command in a xAndX command chain will be used in the
706 calculation.  So for common SessionSetupAndX + TreeConnectAndX chains,
707 only the SessionSetupAndX call will be used in the statistics.
708 This is a flaw that might be fixed in the future.
709
710 This option can be used multiple times on the command line.
711
712 If the optional I<filter> is provided, the stats will only be calculated
713 on those calls that match that filter.
714
715 Example: B<-z "smb,rtt,ip.addr==1.2.3.4"> will only collect stats for
716 SMB packets echanged by the host at IP address 1.2.3.4 .
717
718 =item B<-z> smb,sids
719
720 When this feature is used B<TShark> will print a report with all the
721 discovered SID and account name mappings.  Only those SIDs where the
722 account name is known will be presented in the table.
723
724 For this feature to work you will need to either to enable
725 "Edit/Preferences/Protocols/SMB/Snoop SID to name mappings" in the
726 preferences or you can override the preferences by specifying
727 S<B<-o "smb.sid_name_snooping:TRUE">> on the B<TShark> command line.
728
729 The current method used by B<TShark> to find the SID->name mapping
730 is relatively restricted with a hope of future expansion.
731
732 =item B<-z> mgcp,rtd[I<,filter>]
733
734 Collect requests/response RTD (Response Time Delay) data for MGCP.
735 (This is similar to B<-z smb,rtt>). Data collected is the number of calls
736 for each known MGCP Type, MinRTD, MaxRTD and AvgRTD.
737 Additionally you get the number of duplicate requests/responses,
738 unresponded requests, responses ,which don't match with
739 any request.
740 Example: B<-z mgcp,rtd>.
741
742 This option can be used multiple times on the command line.
743
744 If the optional I<filter> is provided, the stats will only be calculated
745 on those calls that match that filter.
746 Example: B<-z "mgcp,rtd,ip.addr==1.2.3.4"> will only collect stats for
747 MGCP packets exchanged by the host at IP address 1.2.3.4 .
748
749 =item B<-z> megaco,rtd[I<,filter>]
750
751 Collect requests/response RTD (Response Time Delay) data for MEGACO.
752 (This is similar to B<-z smb,rtt>). Data collected is the number of calls
753 for each known MEGACO Type, MinRTD, MaxRTD and AvgRTD.
754 Additionally you get the number of duplicate requests/responses,
755 unresponded requests, responses ,which don't match with
756 any request.
757 Example: B<-z megaco,rtd>.
758
759 If the optional I<filter> is provided, the stats will only be calculated
760 on those calls that match that filter.
761 Example: B<-z "megaco,rtd,ip.addr==1.2.3.4"> will only collect stats for
762 MEGACO packets exchanged by the host at IP address 1.2.3.4 .
763
764 This option can be used multiple times on the command line.
765
766 =item B<-z> h225,counter[I<,filter>]
767
768 Count ITU-T H.225 messages and their reasons. In the first column you get a
769 list of H.225 messages and H.225 message reasons, which occur in the current
770 capture file. The number of occurences of each message or reason is displayed
771 in the second column.
772
773 Example: B<-z h225,counter>.
774
775 If the optional I<filter> is provided, the stats will only be calculated
776 on those calls that match that filter.
777 Example: use B<-z "h225,counter,ip.addr==1.2.3.4"> to only collect stats for
778 H.225 packets exchanged by the host at IP address 1.2.3.4 .
779
780 This option can be used multiple times on the command line.
781
782 =item B<-z> h225,srt[I<,filter>]
783
784 Collect requests/response SRT (Service Response Time) data for ITU-T H.225 RAS.
785 Data collected is number of calls of each ITU-T H.225 RAS Message Type,
786 Minimum SRT, Maximum SRT, Average SRT, Minimum in Frame, and Maximum in Frame.
787 You will also get the number of Open Requests (Unresponded Requests),
788 Discarded Responses (Responses without matching request) and Duplicate Messages.
789 Example: B<-z h225,srt>.
790
791 If the optional I<filter> is provided, the stats will only be calculated
792 on those calls that match that filter.
793 Example: B<-z "h225,srt,ip.addr==1.2.3.4"> will only collect stats for
794 ITU-T H.225 RAS packets exchanged by the host at IP address 1.2.3.4 .
795
796 This option can be used multiple times on the command line.
797
798 =item B<-z> sip,stat[I<,filter>]
799
800 This option will activate a counter for SIP messages. You will get the number
801 of occurences of each SIP Method and of each SIP Status-Code. Additionally you
802 also get the number of resent SIP Messages (only for SIP over UDP).
803
804 Example: B<-z sip,stat>.
805
806 This option can be used multiple times on the command line.
807
808 If the optional I<filter> is provided, the stats will only be calculated
809 on those calls that match that filter.
810 Example: B<-z "sip,stat,ip.addr==1.2.3.4"> will only collect stats for
811 SIP packets exchanged by the host at IP address 1.2.3.4 .
812
813 =back
814
815 =back
816
817 =head1 CAPTURE FILTER SYNTAX
818
819 See the manual page of pcap-filter(4) or, if that doesn't exist, tcpdump(8).
820
821 =head1 READ FILTER SYNTAX
822
823 For a complete table of protocol and protocol fields that are filterable
824 in B<TShark> see the wireshark-filter(4) manual page.
825
826 =head1 FILES
827
828 These files contains various B<Wireshark> configuration values.
829
830 =over 4
831
832 =item Preferences
833
834 The F<preferences> files contain global (system-wide) and personal
835 preference settings. If the system-wide preference file exists, it is
836 read first, overriding the default settings. If the personal preferences
837 file exists, it is read next, overriding any previous values. Note: If
838 the command line option B<-o> is used (possibly more than once), it will
839 in turn override values from the preferences files.
840
841 The preferences settings are in the form I<prefname>B<:>I<value>,
842 one per line,
843 where I<prefname> is the name of the preference
844 and I<value> is the value to
845 which it should be set; white space is allowed between B<:> and
846 I<value>.  A preference setting can be continued on subsequent lines by
847 indenting the continuation lines with white space.  A B<#> character
848 starts a comment that runs to the end of the line:
849
850   # Capture in promiscuous mode?
851   # TRUE or FALSE (case-insensitive).
852   capture.prom_mode: TRUE
853
854 The global preferences file is looked for in the F<wireshark> directory
855 under the F<share> subdirectory of the main installation directory (for
856 example, F</usr/local/share/wireshark/preferences>) on UNIX-compatible
857 systems, and in the main installation directory (for example,
858 F<C:\Program Files\Wireshark\preferences>) on Windows systems.
859
860 The personal preferences file is looked for in
861 F<$HOME/.wireshark/preferences> on
862 UNIX-compatible systems and F<%APPDATA%\Wireshark\preferences> (or, if
863 %APPDATA% isn't defined, F<%USERPROFILE%\Application
864 Data\Wireshark\preferences>) on Windows systems.
865
866 =item Disabled (Enabled) Protocols
867
868 The F<disabled_protos> files contain system-wide and personal lists of
869 protocols that have been disabled, so that their dissectors are never
870 called.  The files contain protocol names, one per line, where the
871 protocol name is the same name that would be used in a display filter
872 for the protocol:
873
874   http
875   tcp     # a comment
876
877 The global F<disabled_protos> file uses the same directory as the global
878 preferences file.
879
880 The personal F<disabled_protos> file uses the same directory as the
881 personal preferences file.
882
883 =item Name Resolution (hosts)
884
885 If the personal F<hosts> file exists, it is
886 used to resolve IPv4 and IPv6 addresses before any other
887 attempts are made to resolve them.  The file has the standard F<hosts>
888 file syntax; each line contains one IP address and name, separated by
889 whitespace. The same directory as for the personal preferences file is
890 used.
891
892 =item Name Resolution (ethers)
893
894 The F<ethers> files are consulted to correlate 6-byte hardware addresses to
895 names. First the personal F<ethers> file is tried and if an address is not
896 found there the global F<ethers> file is tried next.
897
898 Each line contains one hardware address and name, separated by
899 whitespace.  The digits of the hardware address are separated by colons
900 (:), dashes (-) or periods (.).  The same separator character must be
901 used consistently in an address. The following three lines are valid
902 lines of an F<ethers> file:
903
904   ff:ff:ff:ff:ff:ff          Broadcast
905   c0-00-ff-ff-ff-ff          TR_broadcast
906   00.00.00.00.00.00          Zero_broadcast
907
908 The global F<ethers> file is looked for in the F</etc> directory on
909 UNIX-compatible systems, and in the main installation directory (for
910 example, F<C:\Program Files\Wireshark>) on Windows systems.
911
912 The personal F<ethers> file is looked for in the same directory as the personal
913 preferences file.
914
915 =item Name Resolution (manuf)
916
917 The F<manuf> file is used to match the 3-byte vendor portion of a 6-byte
918 hardware address with the manufacturer's name; it can also contain well-known
919 MAC addresses and address ranges specified with a netmask.  The format of the
920 file is the same as the F<ethers> files, except that entries of the form:
921
922   00:00:0C      Cisco
923
924 can be provided, with the 3-byte OUI and the name for a vendor, and
925 entries such as:
926
927   00-00-0C-07-AC/40     All-HSRP-routers
928
929 can be specified, with a MAC address and a mask indicating how many bits
930 of the address must match. The above entry, for example, has 40
931 significant bits, or 5 bytes, and would match addresses from
932 00-00-0C-07-AC-00 through 00-00-0C-07-AC-FF. The mask need not be a
933 multiple of 8.
934
935 The F<manuf> file is looked for in the same directory as the global
936 preferences file.
937
938 =item Name Resolution (ipxnets)
939
940 The F<ipxnets> files are used to correlate 4-byte IPX network numbers to
941 names. First the global F<ipxnets> file is tried and if that address is not
942 found there the personal one is tried next.
943
944 The format is the same as the F<ethers>
945 file, except that each address is four bytes instead of six.
946 Additionally, the address can be represented as a single hexadecimal
947 number, as is more common in the IPX world, rather than four hex octets.
948 For example, these four lines are valid lines of an F<ipxnets> file:
949
950   C0.A8.2C.00              HR
951   c0-a8-1c-00              CEO
952   00:00:BE:EF              IT_Server1
953   110f                     FileServer3
954
955 The global F<ipxnets> file is looked for in the F</etc> directory on
956 UNIX-compatible systems, and in the main installation directory (for
957 example, F<C:\Program Files\Wireshark>) on Windows systems.
958
959 The personal F<ipxnets> file is looked for in the same directory as the
960 personal preferences file.
961
962 =back
963
964 =head1 ENVIRONMENT VARIABLES
965
966 =over 4
967
968 =item WIRESHARK_DEBUG_EP_NO_CHUNKS
969
970 Normally per-packet memory is allocated in large "chunks."  This behavior
971 doesn't work well with debugging tools such as Valgrind or ElectricFence.
972 Export this environment variable to force individual allocations.
973 Note: disabling chunks also disables canaries (see below).
974
975 =item WIRESHARK_DEBUG_SE_NO_CHUNKS
976
977 Normally per-file memory is allocated in large "chunks."  This behavior
978 doesn't work well with debugging tools such as Valgrind or ElectricFence.
979 Export this environment variable to force individual allocations.
980 Note: disabling chunks also disables canaries (see below).
981
982 =item WIRESHARK_DEBUG_EP_NO_CANARY
983
984 Normally per-packet memory allocations are separated by "canaries" which
985 allow detection of memory overruns.  This comes at the expense of some extra
986 memory usage.  Exporting this environment variable disables these canaries.
987
988 =item WIRESHARK_DEBUG_SE_USE_CANARY
989
990 Exporting this environment variable causes per-file memory allocations to be
991 protected with "canaries" which allow for detection of memory overruns.
992 This comes at the expense of significant extra memory usage.
993
994 =item WIRESHARK_DEBUG_SCRUB_MEMORY
995
996 If this environment variable is exported, the contents of per-packet and
997 per-file memory is initialized to 0xBADDCAFE when the memory is allocated
998 and is reset to 0xDEADBEEF when the memory is freed.  This functionality is
999 useful mainly to developers looking for bugs in the way memory is handled.
1000
1001 =back
1002
1003 =head1 SEE ALSO
1004
1005 wireshark-filter(4), wireshark(1), editcap(1), pcap-filter(4), tcpdump(8),
1006 pcap(3), dumpcap(1), text2pcap(1), mergecap(1)
1007
1008 =head1 NOTES
1009
1010 B<TShark> is part of the B<Wireshark> distribution.  The latest version
1011 of B<Wireshark> can be found at L<http://www.wireshark.org>.
1012
1013 HTML versions of the Wireshark project man pages are available at:
1014 L<http://www.wireshark.org/docs/man-pages>.
1015
1016 =head1 AUTHORS
1017
1018 B<TShark> uses the same packet dissection code that B<Wireshark> does,
1019 as well as using many other modules from B<Wireshark>; see the list of
1020 authors in the B<Wireshark> man page for a list of authors of that code.