248ad436e8dc8b5705b1366ce2cdfa1a9bcd0789
[obnox/wireshark/wip.git] / doc / tethereal.pod.template
1
2 =head1 NAME
3
4 tethereal - Dump and analyze network traffic
5
6 =head1 SYNOPSYS
7
8 B<tethereal>
9 S<[ B<-a> capture autostop condition ] ...>
10 S<[ B<-b> number of ring buffer files [:duration] ]>
11 S<[ B<-c> count ]>
12 S<[ B<-d> <layer type>==<selector>,<decode-as protocol> ]>
13 S<[ B<-D> ]>
14 S<[ B<-f> capture filter expression ]>
15 S<[ B<-F> file format ]>
16 S<[ B<-h> ]>
17 S<[ B<-i> interface ]> 
18 S<[ B<-l> ]>
19 S<[ B<-n> ]>
20 S<[ B<-N> resolving flags ]>
21 S<[ B<-o> preference setting ] ...>
22 S<[ B<-p> ]>
23 S<[ B<-q> ]>
24 S<[ B<-r> infile ]>
25 S<[ B<-R> display filter expression ]>
26 S<[ B<-s> snaplen ]>
27 S<[ B<-S> ]>
28 S<[ B<-t> time stamp format ]>
29 S<[ B<-v> ]>
30 S<[ B<-V> ]>
31 S<[ B<-w> savefile ]>
32 S<[ B<-x> ]>
33 S<[ B<-z> statistics-string ]>
34 S<[ filter expression ]>
35
36 =head1 DESCRIPTION
37
38 B<Tethereal> is a network protocol analyzer.  It lets you capture packet
39 data from a live network, or read packets from a previously saved
40 capture file, either printing a decoded form of those packets to the
41 standard output or writing the packets to a file.  B<Tethereal>'s native
42 capture file format is B<libpcap> format, which is also the format used
43 by B<tcpdump> and various other tools.  In addition, B<Tethereal> can
44 read capture files from B<snoop> and B<atmsnoop>, Shomiti/Finisar
45 B<Surveyor>, Novell B<LANalyzer>, Network General/Network Associates
46 DOS-based B<Sniffer> (compressed or uncompressed), Microsoft B<Network
47 Monitor>, AIX's B<iptrace>, Cinco Networks B<NetXRay>, Network
48 Associates Windows-based B<Sniffer>, AG Group/WildPackets
49 B<EtherPeek>/B<TokenPeek>/B<AiroPeek>, B<RADCOM>'s WAN/LAN analyzer,
50 B<Lucent/Ascend> router debug output, HP-UX's B<nettl>, the dump output
51 from B<Toshiba's> ISDN routers, the output from B<i4btrace> from the
52 ISDN4BSD project, the output in B<IPLog> format from the Cisco Secure
53 Intrusion Detection System, B<pppd logs> (pppdump format), the output
54 from VMS's B<TCPIPtrace>/B<TCPtrace>/B<UCX$TRACE> utilities, the text
55 output from the B<DBS Etherwatch> VMS utility, traffic capture files
56 from Visual Networks' Visual UpTime, the output from B<CoSine> L2 debug,
57 and the output from Accellent's 5Views LAN agents.  There is no need to
58 tell B<Tethereal> what type of file you are reading; it will determine
59 the file type by itself.  B<Tethereal> is also capable of reading any of
60 these file formats if they are compressed using gzip.  B<Tethereal>
61 recognizes this directly from the file; the '.gz' extension is not
62 required for this purpose.
63
64 If the B<-w> flag is not specified, B<Tethereal> prints a decoded form
65 of the packets it captures or reads; otherwise, it writes those packets
66 to the file specified by that flag.
67
68 When printing a decoded form of packets, B<Tethereal> prints, by
69 default, a summary line containing the fields specified by the
70 preferences file (which are also the fields displayed in the packet list
71 pane in B<Ethereal>), although if it's printing packets as it captures
72 them, rather than printing packets from a saved capture file, it won't
73 print the "frame number" field.  If the B<-V> flag is specified, it
74 prints intead a protocol tree, showing all the fields of all protocols
75 in the packet.
76
77 When writing packets to a file, B<Tethereal>, by default, writes the
78 file in B<libpcap> format, and writes all of the packets it sees to the
79 output file.  The B<-F> flag can be used to specify the format in which
80 to write the file.  The following formats are supported:
81
82 =over 8
83
84 =item B<libpcap> - libpcap (tcpdump, Ethereal, etc.)
85
86 =item B<rh6_1libpcap> - Red Hat Linux 6.1 libpcap (tcpdump)
87
88 =item B<suse6_3libpcap> - SuSE Linux 6.3 libpcap (tcpdump)
89
90 =item B<modlibpcap> - modified libpcap (tcpdump)
91
92 =item B<nokialibpcap> - Nokia libpcap (tcpdump)
93
94 =item B<lanalyzer> - Novell LANalyzer
95
96 =item B<ngsniffer> - Network Associates Sniffer (DOS-based)
97
98 =item B<snoop> - Sun snoop
99
100 =item B<netmon1> - Microsoft Network Monitor 1.x
101
102 =item B<netmon2> - Microsoft Network Monitor 2.x
103
104 =item B<ngwsniffer_1_1> - Network Associates Sniffer (Windows-based) 1.1
105
106 =item B<ngwsniffer_2_0> - Network Associates Sniffer (Windows-based) 2.00x
107
108 =item B<visual> - Visual Networks traffic capture
109
110 =back
111
112 This list is also displayed by the B<-h> flag.
113
114 Read filters in B<Tethereal>, which allow you to select which packets
115 are to be decoded or written to a file, are very powerful; more fields
116 are filterable in B<Tethereal> than in other protocol analyzers, and the
117 syntax you can use to create your filters is richer.  As B<Tethereal>
118 progresses, expect more and more protocol fields to be allowed in read
119 filters.
120
121 Packet capturing is performed with the pcap library.  The capture filter
122 syntax follows the rules of the pcap library.  This syntax is different
123 from the read filter syntax.  A read filter can also be specified when
124 capturing, and only packets that pass the read filter will be displayed
125 or saved to the output file; note, however, that capture filters are much
126 more efficient than read filters, and it may be more difficult for
127 B<Tethereal> to keep up with a busy network if a read filter is
128 specified for a live capture.
129
130 Compressed file support uses (and therefore requires) the zlib library. 
131 If the zlib library is not present, B<Tethereal> will compile, but will
132 be unable to read compressed files.
133
134 A capture or read filter can either be specified with the B<-f> or B<-R>
135 option, respectively, in which case the entire filter expression must be
136 specified as a single argument (which means that if it contains spaces,
137 it must be quoted), or can be specified with command-line arguments
138 after the option arguments, in which case all the arguments after the
139 filter arguments are treated as a filter expression.  If the filter is
140 specified with command-line arguments after the option arguments, it's a
141 capture filter if a capture is being done (i.e., if no B<-r> flag was
142 specified) and a read filter if a capture file is being read (i.e., if a
143 B<-r> flag was specified).
144
145 =head1 OPTIONS
146
147 =over 4
148
149 =item -a
150
151 Specify a criterion that specifies when B<Tethereal> is to stop writing
152 to a capture file.  The criterion is of the form I<test>B<:>I<value>,
153 where I<test> is one of:
154
155 =for man .RS
156
157 =for html <P><DL>
158
159 =item duration
160
161 Stop writing to a capture file after I<value> seconds have elapsed.
162
163 =item filesize
164
165 Stop writing to a capture file after it reaches a size of I<value>
166 kilobytes (where a kilobyte is 1000 bytes, not 1024 bytes).
167
168 =for man .RE
169
170 =for html </DL>
171
172 =item -b
173
174 If a maximum capture file size was specified, cause B<Tethereal> to run
175 in "ring buffer" mode, with the specified number of files.  In "ring
176 buffer" mode, B<Tethereal> will write to several capture files. 
177 Their name is based on the number of the file and on the creation date 
178 and time.
179
180 When the first capture file fills up, B<Tethereal> will switch to writing
181 to the next file, until it fills up the last file, at which point it'll
182 discard the data in the first file (unless 0 is specified, in which case,
183 the number of files is unlimited) and start writing to that file and so on.
184
185 If the optional duration is specified, B<Tethereal> will switch also 
186 to the next file when the specified number of seconds has elapsed even
187 if the current file is not completely fills up.
188
189 You can only save files in B<libpcap> format when using a ring buffer.
190
191 =item -c
192
193 Set the default number of packets to read when capturing live
194 data.
195
196 =item -d
197
198 Specify that if the layer type in question (for example, B<tcp.port> or
199 B<udp.port> for a TCP or UDP port number) has the specified selector
200 value, packets should be dissected as the specified protocol.
201
202 =item -D
203
204 Print a list of the interfaces on which B<Tethereal> can capture, and
205 exit.  Note that "can capture" means that B<Tethereal> was able to open
206 that device to do a live capture; if, on your system, a program doing a
207 network capture must be run from an account with special privileges (for
208 example, as root), then, if B<Tethereal> is run with the B<-D> flag and
209 is not run from such an account, it will not list any interfaces.
210
211 =item -f
212
213 Set the capture filter expression.
214
215 =item -F
216
217 Set the file format of the output capture file.
218
219 =item -h
220
221 Print the version and options and exits.
222
223 =item -i
224
225 Set the name of the network interface or pipe to use for live packet
226 capture. 
227
228 Network interface names should match one of the names listed in
229 "B<tethereal -D>" (described above).  If you're using Unix, "B<netstat
230 -i>" or "B<ifconfig -a>" might also work to list interface names,
231 although not all versions of Unix support the B<-a> flag to B<ifconfig>.
232 If no interface is specified, B<Tethereal> searches the list of
233 interfaces, choosing the first non-loopback interface if there are any
234 non-loopback interfaces, and choosing the first loopback interface if
235 there are no non-loopback interfaces; if there are no interfaces,
236 B<Tethereal> reports an error and doesn't start the capture.
237
238 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
239 read data from the standard input.  Data read from pipes must be in
240 standard libpcap format.
241
242 =item -l
243
244 Flush the standard output after the information for each packet is
245 printed.  (This is not, strictly speaking, line-buffered if B<-V>
246 was specified; however, it is the same as line-buffered if B<-V> wasn't
247 specified, as only one line is printed for each packet, and, as B<-l> is
248 normally used when piping a live capture to a program or script, so that
249 output for a packet shows up as soon as the packet is seen and
250 dissected, it should work just as well as true line-buffering.  We do
251 this as a workaround for a deficiency in the Microsoft Visual C++ C
252 library.)
253
254 This may be useful when piping the output of B<Tethereal> to another
255 program, as it means that the program to which the output is piped will
256 see the dissected data for a packet as soon as B<Tethereal> sees the
257 packet and generates that output, rather than seeing it only when the
258 standard output buffer containing that data fills up.
259
260 =item -n
261
262 Disable network object name resolution (such as hostname, TCP and UDP port
263 names).
264
265 =item -N
266
267 Turn on name resolving for particular types of addresses and port
268 numbers, with name resolving for other types of addresses and port
269 numbers turned off; the argument is a string that may contain the
270 letters B<m> to enable MAC address resolution, B<n> to enable network
271 address resolution, and B<t> to enable transport-layer port number
272 resolution.  This overrides B<-n> if both B<-N> and B<-n> are present.
273 The letter B<C> enables concurrent (asynchronous) DNS lookups.
274
275 =item -o
276
277 Set a preference value, overriding the default value and any value read
278 from a preference file.  The argument to the flag is a string of the
279 form I<prefname>B<:>I<value>, where I<prefname> is the name of the
280 preference (which is the same name that would appear in the preference
281 file), and I<value> is the value to which it should be set.
282
283 =item -p
284
285 I<Don't> put the interface into promiscuous mode.  Note that the
286 interface might be in promiscuous mode for some other reason; hence,
287 B<-p> cannot be used to ensure that the only traffic that is captured is
288 traffic sent to or from the machine on which B<Tethereal> is running,
289 broadcast traffic, and multicast traffic to addresses received by that
290 machine.
291
292 =item -q
293
294 Don't display the continuous count of packets captured that is normally
295 shown when saving a capture to a file; instead, just display, at the end
296 of the capture, a count of packets captured.  On systems that support
297 the SIGINFO signal, such as various BSDs, typing your "status" character
298 (typically control-T) will cause the current count to be displayed.
299
300 =item -r
301
302 Read packet data from I<infile>.
303
304 =item -R
305
306 Cause the specified filter (which uses the syntax of read filters,
307 rather than that of capture filters) to be applied before printing a
308 decoded form of packets or writing packets to a file; packets not
309 matching the filter are discarded rather than being printed or written.
310
311 =item -s
312
313 Set the default snapshot length to use when capturing live data. 
314 No more than I<snaplen> bytes of each network packet will be read into
315 memory, or saved to disk.
316
317 =item -S
318
319 Decode and display packets even while writing to file.
320
321 =item -t
322
323 Set the format of the packet timestamp printed in summary lines.  The
324 format can be one of 'r' (relative), 'a' (absolute), 'ad' (absolute with
325 date), or 'd' (delta).  The relative time is the time elapsed between
326 the first packet and the current packet.  The absolute time is the
327 actual time the packet was captured, with no date displayed; the
328 absolute date and time is the actual time and date the packet was
329 captured.  The delta time is the time since the previous packet was
330 captured.  The default is relative.
331
332 =item -v
333
334 Print the version and exit.
335
336 =item -V
337
338 Cause B<Tethereal> to print a protocol tree for each packet rather than
339 a one-line summary of the packet.
340
341 =item -w
342
343 Write packet data to I<savefile> or to the standard output if
344 I<savefile> is "-".
345
346 =item -x
347
348 Cause B<Tethereal> to print a hex and ASCII dump of the packet data
349 after printing the summary or protocol tree.
350
351 =item -z
352
353 Get B<Tethereal> to collect various types of statistics and display the result
354 after finishing reading the capture file.
355 Currently implemented statistics are:
356
357 B<-z> dcerpc,rtt,I<uuid>,I<major>.I<minor>[,I<filter>]
358
359 Collect call/reply RTT data for DCERPC interface I<uuid>, 
360 version I<major>.I<minor>.
361 Data collected is number of calls for each procedure, MinRTT, MaxRTT 
362 and AvgRTT. 
363 Example: use B<-z dcerpc,rtt,12345778-1234-abcd-ef00-0123456789ac,1.0> to collect data for CIFS SAMR Interface.  
364 This option can be used multiple times on the command line. 
365
366 If the optional filterstring is provided, the stats will only be calculated
367 on those calls that match that filter.
368 Example: use B<-z dcerpc,rtt,12345778-1234-abcd-ef00-0123456789ac,1.0,ip.addr==1.2.3.4> to collect SAMR
369 RTT statistics for a specific host.
370
371
372 B<-z> io,phs[,I<filter>]
373
374 Create Protocol Hierarchy Statistics listing both number of frames and bytes.
375 If no I<filter> is specified the statistics will be calculated for all frames.
376 If a I<filters> is specified statistics will be only calculated for those
377 packets that match the filter.
378
379 This option can be used multiple times on the command line. 
380
381
382 B<-z> io,stat,I<interval>[,I<filter>][,I<filter>][,I<filter>]...
383
384 Collect frame/bytes statistics for the capture in intervals of I<interval> 
385 seconds. I<Intervals> can be specified either as whole or fractional seconds.
386 Interval can be specified in ms resolution.
387
388 If no I<filter> is specified the statistics will be calculated for all frames.
389 If one or more I<filters> are specified statistics will be calculated for
390 all filters and presented with one column of statistics for each filter.
391
392 This option can be used multiple times on the command line. 
393
394
395 Example: B<-z io,stat,1,ip.addr==1.2.3.4> to generate 1 second
396 statistics for all traffic to/from host 1.2.3.4.
397
398 Example: B<-z "io,stat,0.001,smb&&ip.addr==1.2.3.4"> to generate 1ms
399 statistics for all SMB frames to/from host 1.2.3.4.
400
401 The examples above all use the standard syntax for generating statistics
402 which only calculates the number of frames and bytes in each interval.
403
404
405 io,stat can also do much more statistics and calculate COUNT() SUM() MIN() 
406 MAX() and AVG() using a slightly filter syntax:
407   [COUNT|SUM|MIN|MAX|AVG](<field>)<filter>
408 One important thing to note here is that the field that the calculation is 
409 based on MUST also be part of the filter string or else the calculation will
410 fail.
411
412 So: B<-z io,stat,0.010,AVG(smb.time)> does not work.  Use B<-z
413 io,stat,0.010,AVG(smb.time)smb.time> instead.  Also be aware that a field
414 can exist multiple times inside the same packet and will then be counted
415 multiple times in those packets. 
416
417
418 COUNT(<field>) can be used on any type which has a display filter name. 
419 It will count how many times this particular field is encountered in the
420 filtered packet list.
421
422 Example: B<-z io,stat,0.010,COUNT(smb.sid)smb.sid>
423 This will count the total number of SIDs seen in each 10ms interval.
424
425 SUM(<field>) can only be used on named fields of integer type.
426 This will sum together every occurence of this fields value for each interval.
427
428 Example: B<-z io,stat,0.010,SUM(frame.pkt_len)frame.pkt_len>
429 This will report the total number of bytes seen in all the frames within
430 an interval.
431
432 MIN/MAX/AVG(<field>) can only be used on named fields that are either
433 integers or relative time fields.  This will calculate maximum/minimum
434 or average seen in each interval.  If the field is a relative time field
435 the output will be presented in seconds and three digits after the
436 decimal point.  The resolution for time calculations is 1ms and anything
437 smaller will be truncated.
438
439 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">
440
441 This will calculate statistics for all smb response times we see to/from
442 host 1.1.1.1 in 10ms intervals.  The output will be displayed in 4
443 columns; number of frames/bytes, minimum response time, maximum response
444 time and average response time.
445
446
447
448 B<-z> talkers,I<type>[,I<filter>]
449
450 Create a table that lists all conversations that could be seen in the capture.
451 I<type> specifies which type of conversation we want to generate the 
452 statistics for, currently the supported ones are
453   "eth"   Ethernet
454   "fc"    Fibre Channel
455   "ip"    IP addresses
456   "ipx"   IPX addresses
457   "tcp"   TCP/IP socketpairs   Both IPv4 and IPv6 are supported
458   "tr"    TokenRing
459   "udp"   UDP/IP socketpairs   Both IPv4 and IPv6 are supported
460
461 If the optional filter string is specified, only those packets that match the
462 filter will be used in the calculations.
463
464 The table is presented with one line for each conversation and displays
465 number of frames/bytes in each direction as well as total number of 
466 frames/bytes.
467 The table is sorted according to total number of bytes.
468
469
470 B<-z> proto,colinfo,I<filter>,I<field>
471
472 Append all I<field> values for the packet to the COL_INFO information line.
473 This feature can be used to append arbitrary fields to the COL_INFO line
474 in addition to the normal content of the COL_INFO line.
475 I<field> is the display-filter name of a field which value should be placed
476 on the COL_INFO line.
477 I<filter> is a filter string that controls for which packets the field value
478 will be presented on COL_INFO line. I<field> will only be presented on the
479 COL_INFO line for the packets which match I<filter>.
480
481 NOTE: In order for B<Tethereal> to be able to extract the I<field> value
482 from the packet, I<field> MUST be part of the I<filter> string.  If not,
483 B<Tethereal> will not be able to extract its value.
484
485 For a simple example to add the "nfs.fh.hash" field to COL_INFO for all
486 packets containing the "nfs.fh.hash" field, use
487
488 B<-z proto,colinfo,nfs.fh.hash,nfs.fh.hash>
489
490
491 To put "nfs.fh.hash" on COL_INFO but only for packets coming from host 1.2.3.4
492 use :
493
494 B<-z "proto,colinfo,nfs.fh.hash && ip.src==1.2.3.4,nfs.fh.hash">
495
496 This option can be used multiple times on the command line. 
497
498
499 B<-z> rpc,rtt,I<program>,I<version>[,I<filter>]
500
501 Collect call/reply RTT data for I<program>/I<version>.  Data collected
502 is number of calls for each procedure, MinRTT, MaxRTT and AvgRTT. 
503 Example: use B<-z rpc,rtt,100003,3> to collect data for NFS v3.  This
504 option can be used multiple times on the command line. 
505
506 If the optional filterstring is provided, the stats will only be calculated
507 on those calls that match that filter.
508 Example: use B<-z rpc,rtt,100003,3,nfs.fh.hash==0x12345678> to collect NFS v3
509 RTT statistics for a specific file.
510
511
512 B<-z> rpc,programs
513
514 Collect call/reply RTT data for all known ONC-RPC programs/versions.  
515 Data collected is number of calls for each protocol/version, MinRTT, 
516 MaxRTT and AvgRTT. 
517 This option can only be used once on the command line.
518
519 B<-z> smb,rtt[,I<filter>]
520
521 Collect call/reply RTT data for SMB.  Data collected
522 is number of calls for each SMB command, MinRTT, MaxRTT and AvgRTT. 
523 Example: use B<-z smb,rtt>.
524 The data will be presented as separate tables for all normal SMB commands,
525 all Transaction2 commands and all NT Transaction commands.
526 Only those commands that are seen in the capture will have its stats
527 displayed.
528 Only the first command in a xAndX command chain will be used in the
529 calculation.  So for common SessionSetupAndX + TreeConnectAndX chains,
530 only the SessionSetupAndX call will be used in the statistics.
531 This is a flaw that might be fixed in the future.
532
533 This option can be used multiple times on the command line. 
534
535 If the optional filterstring is provided, the stats will only be calculated
536 on those calls that match that filter.
537 Example: use B<-z "smb,rtt,ip.addr==1.2.3.4"> to only collect stats for
538 SMB packets echanged by the host at IP address 1.2.3.4 .
539
540 B<-z> smb,sids
541
542 When this feature is used B<Tethereal> will print a report with all the
543 discovered SID and account name mappings.  Only those SIDs where the
544 account name is known will be presented in the table.
545
546 For this feature to work you will need to either to enable
547 "Edit/Preferences/Protocols/SMB/Snoop SID to name mappings" in the
548 preferences or you can override the preferences by specifying
549 B<-o "smb.sid_name_snooping:TRUE"> on the B<Tethereal> command line.
550
551 The current methods used by B<Tethereal> to find the SID->name mapping
552 is relatively restricted but is hoped to be expanded in the future.
553
554 B<-z> mgcp,rtd[I<,filter>]
555
556 Collect requests/response RTD (Response Time Delay) data for MGCP. 
557 This is similar to B<-z smb,rtt>). Data collected is number of calls
558 for each known MGCP Type, MinRTD, MaxRTD and AvgRTD.
559 Additionally you get the number of duplicate requests/responses, 
560 unresponded requests, responses ,which don't match with
561 any request. 
562 Example: use B<-z mgcp,rtd>.
563
564 This option can be used multiple times on the command line. 
565
566 If the optional filterstring is provided, the stats will only be calculated
567 on those calls that match that filter.
568 Example: use B<-z "mgcp,rtd,ip.addr==1.2.3.4"> to only collect stats for
569 MGCP packets exchanged by the host at IP address 1.2.3.4 .
570
571 =back
572
573 =head1 CAPTURE FILTER SYNTAX
574
575 See manual page of tcpdump(8).
576
577 =head1 READ FILTER SYNTAX
578
579 Read filters help you remove the noise from a packet trace and let you
580 see only the packets that interest you.  If a packet meets the
581 requirements expressed in your read filter, then it is printed.  Read
582 filters let you compare the fields within a protocol against a specific
583 value, compare fields against fields, and to check the existence of
584 specified fields or protocols.
585
586 The simplest read filter allows you to check for the existence of a
587 protocol or field.  If you want to see all packets which contain the IPX
588 protocol, the filter would be "ipx".  (Without the quotation marks) To
589 see all packets that contain a Token-Ring RIF field, use "tr.rif".
590
591 Fields can also be compared against values.  The comparison operators
592 can be expressed either through C-like symbols, or through English-like
593 abbreviations:
594
595     eq, ==    Equal
596     ne, !=    Not equal
597     gt, >     Greater than
598     lt, <     Less Than
599     ge, >=    Greater than or Equal to
600     le, <=    Less than or Equal to
601
602 Furthermore, each protocol field is typed. The types are:
603
604     Unsigned integer (either 8-bit, 16-bit, 24-bit, or 32-bit)
605     Signed integer (either 8-bit, 16-bit, 24-bit, or 32-bit)
606     Boolean
607     Ethernet address (6 bytes)
608     Byte string (n-number of bytes)
609     IPv4 address
610     IPv6 address
611     IPX network number
612     String (text)
613     Double-precision floating point number
614
615 An integer may be expressed in decimal, octal, or hexadecimal notation. 
616 The following three read filters are equivalent:
617
618     frame.pkt_len > 10
619     frame.pkt_len > 012
620     frame.pkt_len > 0xa
621
622 Boolean values are either true or false.  In a read filter expression
623 testing the value of a Boolean field, "true" is expressed as 1 or any
624 other non-zero value, and "false" is expressed as zero.  For example, a
625 token-ring packet's source route field is boolean.  To find any
626 source-routed packets, a read filter would be:
627
628     tr.sr == 1
629
630 Non source-routed packets can be found with:
631
632     tr.sr == 0
633
634 Ethernet addresses, as well as a string of bytes, are represented in hex
635 digits.  The hex digits may be separated by colons, periods, or hyphens:
636
637     fddi.dst eq ff:ff:ff:ff:ff:ff
638     ipx.srcnode == 0.0.0.0.0.1
639     eth.src == aa-aa-aa-aa-aa-aa
640
641 If a string of bytes contains only one byte, then it is represented as
642 an unsigned integer.  That is, if you are testing for hex value 'ff' in
643 a one-byte byte-string, you must compare it agains '0xff' and not 'ff'. 
644
645 IPv4 addresses can be represented in either dotted decimal notation, or
646 by using the hostname:
647
648     ip.dst eq www.mit.edu
649     ip.src == 192.168.1.1
650
651 IPv4 addresses can be compared with the same logical relations as numbers:
652 eq, ne, gt, ge, lt, and le.  The IPv4 address is stored in host order,
653 so you do not have to worry about how the endianness of an IPv4 address
654 when using it in a read filter.
655
656 Classless InterDomain Routing (CIDR) notation can be used to test if an
657 IPv4 address is in a certain subnet.  For example, this display filter
658 will find all packets in the 129.111 Class-B network:
659
660     ip.addr == 129.111.0.0/16
661
662 Remember, the number after the slash represents the number of bits used
663 to represent the network.  CIDR notation can also be used with
664 hostnames, in this example of finding IP addresses on the same Class C
665 network as 'sneezy':
666
667     ip.addr eq sneezy/24
668
669 The CIDR notation can only be used on IP addresses or hostnames, not in
670 variable names.  So, a display filter like "ip.src/24 == ip.dst/24" is
671 not valid.  (yet)
672
673 IPX networks are represented by unsigned 32-bit integers.  Most likely
674 you will be using hexadecimal when testing for IPX network values:
675
676     ipx.srcnet == 0xc0a82c00
677
678 Strings are enclosed in double-quotes:
679
680     http.request.method == "POST"
681
682 Inside double quotes, you may use the backslash to embed a double-quote,
683 or an arbitrary byte represented in either octal or hexadecimal.
684
685     browser.comment = "An embedded \" double-quote"
686
687 Use of hexadecimal to look for "HEAD":
688
689     http.request.method == "\x48EAD"
690
691 Use of octal to look for "HEAD":
692
693     http.request.method == "\x110EAD"
694
695 This means that you must escape backslashes with backslashes inside
696 double quotes:
697
698     smb.path == "\\\\SERVER\\SHARE"
699
700 to look for \\SERVER\SHARE in "smb.path".
701
702 A slice operator also exists.  You can check the substring
703 (byte-string) of any protocol or field.  For example, you can filter on
704 the vendor portion of an ethernet address (the first three bytes) like
705 this:
706
707     eth.src[0:3] == 00:00:83
708
709 If the length of your byte-slice is only one byte, then it is still
710 represented in hex, but without the preceding "0x": 
711
712     llc[3] == aa
713
714 You can use the slice operator on a protocol name, too.  And
715 remember, the "frame" protocol encompasses the entire packet, allowing
716 you to look at the nth byte of a packet regardless of its frame type
717 (Ethernet, token-ring, etc.).
718
719     token[0:5] ne 0.0.0.1.1
720     ipx[0:2] == ff:ff
721     llc[3:1] eq 0xaa
722
723 The following syntax governs slices:
724
725         [i:j]   i = start_offset, j = length
726         [i-j]   i = start_offset, j = end_offset, inclusive.
727         [i]     i = start_offset, length = 1
728         [:j]    start_offset = 0, length = j
729         [i:]    start_offset = i, end_offset = end_of_field
730
731 Offsets and lengths can be negative, in which case they indicate the
732 offset from the B<end> of the field.  Here's how to check the last 4
733 bytes of a frame:
734
735     frame[-4:4] == 0.1.2.3
736
737 or
738
739     frame[-4:] == 0.1.2.3
740
741 You can create complex concatenations of slices using the comma operator:
742
743         field[1,3-5,9:] == 01:03:04:05:09:0a:0b
744
745 All the above tests can be combined together with logical expressions. 
746 These too are expressable in C-like syntax or with English-like
747 abbreviations:
748
749     and, &&   Logical AND
750     or, ||    Logical OR
751     not, !    Logical NOT
752
753 Expressions can be grouped by parentheses as well.  The following are
754 all valid read filter expression:
755
756     tcp.port == 80 and ip.src == 192.168.2.1
757     not llc
758     (ipx.srcnet == 0xbad && ipx.srnode == 0.0.0.0.0.1) || ip
759     tr.dst[0:3] == 0.6.29 xor tr.src[0:3] == 0.6.29
760
761 A special caveat must be given regarding fields that occur more than
762 once per packet.  "ip.addr" occurs twice per IP packet, once for the
763 source address, and once for the destination address.  Likewise,
764 tr.rif.ring fields can occur more than once per packet.  The following
765 two expressions are not equivalent:
766
767         ip.addr ne 192.168.4.1
768     not ip.addr eq 192.168.4.1
769
770 The first filter says "show me IP packets where an ip.addr exists that
771 does not equal 192.168.4.1".  That is, as long as one ip.addr in the
772 packet does not equal 192.168.44.1, the packet passes the read
773 filter.  The second filter "don't show me any packets that have at least
774 one ip.addr field equal to 192.168.4.1".  If one ip.addr is 192.168.4.1,
775 the packet does not pass.  If B<neither> ip.addr fields is 192.168.4.1,
776 then the packet passes.
777
778 It is easy to think of the 'ne' and 'eq' operators as having an implict
779 "exists" modifier when dealing with multiply-recurring fields.  "ip.addr
780 ne 192.168.4.1" can be thought of as "there exists an ip.addr that does
781 not equal 192.168.4.1".
782
783 Be careful with multiply-recurring fields; they can be confusing.
784
785 Care must also be taken when using the read filter to remove noise
786 from the packet trace. If you want to e.g. filter out all IP multicast
787 packets to address 224.1.2.3, then using:
788
789     ip.dst ne 224.1.2.3
790
791 may be too restrictive. Filtering with "ip.dst" selects only those
792 B<IP> packets that satisfy the rule. Any other packets, including all
793 non-IP packets, will not be printed. For printing also the non-IP
794 packets, you can use one of the following two expressions:
795
796     not ip or ip.dst ne 224.1.2.3
797     not ip.addr eq 224.1.2.3
798
799 The first filter uses "not ip" to include all non-IP packets and then
800 lets "ip.dst ne 224.1.2.3" to filter out the unwanted IP packets. The
801 second filter has already been explained above where filtering with
802 multiply occuring fields was discussed.
803
804 The following is a table of protocol and protocol fields that are
805 filterable in B<Tethereal>.  The abbreviation of the protocol or field is
806 given.  This abbreviation is what you use in the read filter.  The
807 type of the field is also given.
808
809 =insert_dfilter_table
810
811 =head1 FILES
812
813 The F<ethereal.conf> file, which is installed in the F<etc> directory
814 under the main installation directory (for example, F</usr/local/etc>)
815 on UNIX-compatible systems, and in the main installation directory (for
816 example, F<C:\Program Files\Ethereal>) on Windows systems, and the
817 personal preferences file, which is F<$HOME/.ethereal/preferences> on
818 UNIX-compatible systems and F<%APPDATA%\Ethereal\preferences> (or, if
819 %APPDATA% isn't defined,
820 F<%USERPROFILE%\Application Data\Ethereal\preferences>) on
821 Windows systems, contain system-wide and personal preference settings,
822 respectively.  The file contains preference settings of the form
823 I<prefname>B<:>I<value>, one per line, where I<prefname> is the name of
824 the preference (which is the same name that would appear in the
825 preference file), and I<value> is the value to which it should be set;
826 white space is allowed between B<:> and I<value>.  A preference setting
827 can be continued on subsequent lines by indenting the continuation lines
828 with white space.  A B<#> character starts a comment that runs to the
829 end of the line.
830
831 The system-wide preference file is read first, if it exists, overriding
832 B<Tethereal>'s default values; the personal preferences file is then
833 read, if it exists, overriding default values and values read from the
834 system-wide preference file.
835
836 The disabled protocols file, which is F<$HOME/.ethereal/disabled_protos>
837 on UNIX-compatible systems and F<%APPDATA%\Ethereal\disabled_protos>
838 (or, if %APPDATA% isn't defined, F<%USERPROFILE%\Application
839 Data\Ethereal\disabled_protos>) on Windows systems, contain a list of
840 protocols that have been disabled, so that their dissectors are never
841 called.  The file contains protocol names, one per line, where the
842 protocol name is the same name that would be used in a display filter
843 for the protocol.  A B<#> character starts a comment that runs to the
844 end of the line.
845
846 The F<ethers> file, which is found in the F</etc> directory on
847 UNIX-compatible systems, and in the main installation directory (for
848 example, F<C:\Program Files\Ethereal>) on Windows systems, is consulted
849 to correlate 6-byte hardware addresses to names.  If an address is not
850 found in the F<ethers> file, the F<$HOME/.ethereal/ethers> file on
851 UNIX-compatible systems, and the F<%APPDATA%\Ethereal\ethers> file (or, if
852 %APPDATA% isn't defined, the
853 F<%USERPROFILE%\Application Data\Ethereal\ethers> file) on Windows
854 systems is consulted next.  Each line contains one hardware
855 address and name, separated by whitespace.  The digits of the hardware
856 address are separated by either a colon (:), a dash (-), or a period
857 (.).  The following three lines are valid lines of an ethers file:
858
859   ff:ff:ff:ff:ff:ff          Broadcast
860   c0-00-ff-ff-ff-ff          TR_broadcast
861   00.00.00.00.00.00          Zero_broadcast
862
863 The F<manuf> file, which is installed in the F<etc> directory under the
864 main installation directory (for example, F</usr/local/etc>) on
865 UNIX-compatible systems, and in the main installation directory (for
866 example, F<C:\Program Files\Ethereal>) on Windows systems, matches the
867 3-byte vendor portion of a 6-byte hardware address with the
868 manufacturer's name; it can also contain well-known MAC addresses and
869 address ranges specified with a netmask.  The format of the file is the
870 same as the F<ethers> file, except that entries of the form
871
872   00:00:0C      Cisco
873
874 can be provided, with the 3-byte OUI and the name for a vendor, and
875 entries of the form
876
877   00-00-0C-07-AC/40     All-HSRP-routers
878
879 can be specified, with a MAC address and a mask indicating how many bits
880 of the address must match.  Trailing zero bytes can be omitted from
881 address ranges.  That entry, for example, will match addresses from
882 00-00-0C-07-AC-00 through 00-00-0C-07-AC-FF.  The mask need not be a
883 multiple of 8.
884
885 The F<ipxnets> file, which is found in the F</etc> directory on
886 UNIX-compatible systems, and in the main installation directory (for
887 example, F<C:\Program Files\Ethereal>) on Windows systems, correlates
888 4-byte IPX network numbers to names.  If a network number is not found
889 in the F<ipxnets> file, the F<$HOME/.ethereal/ipxnets> file on
890 UNIX-compatible systems, and the F<%APPDATA%\Ethereal\ipxnets> file (or,
891 if %APPDATA% isn't defined, the
892 F<%USERPROFILE%\Application Data\Ethereal\ipxnets> file)
893 on Windows systems, is consulted next.  The format is the same as the
894 F<ethers> file, except that each address if four bytes instead of six. 
895 Additionally, the address can be represented a single hexadecimal
896 number, as is more common in the IPX world, rather than four hex octets. 
897 For example, these four lines are valid lines of an ipxnets file.
898
899   C0.A8.2C.00              HR
900   c0-a8-1c-00              CEO
901   00:00:BE:EF              IT_Server1
902   110f                     FileServer3
903
904 =head1 SEE ALSO
905
906 I<ethereal(1)>, I<editcap(1)>, I<tcpdump(8)>, I<pcap(3)>
907
908 =head1 NOTES
909
910 B<Tethereal> is part of the B<Ethereal> distribution.  The latest version
911 of B<Ethereal> can be found at B<http://www.ethereal.com>.
912
913 =head1 AUTHORS
914
915 B<Tethereal> uses the same packet dissection code that B<Ethereal> does,
916 as well as using many other modules from B<Ethereal>; see the list of
917 authors in the B<Ethereal> man page for a list of authors of that code.