.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "TSHARK 1" .TH TSHARK 1 "2009-01-15" "1.1.2" "The Wireshark Network Analyzer" .SH "NAME" tshark \- Dump and analyze network traffic .SH "SYNOPSYS" .IX Header "SYNOPSYS" \&\fBtshark\fR [\ \fB\-a\fR\ \ ]\ ... [\ \fB\-b\fR\ ]\ ... [\ \fB\-B\fR\ \ ]\ [\ \fB\-c\fR\ \ ] [\ \fB\-C\fR\ \ ] [\ \fB\-d\fR\ ==,\ ] [\ \fB\-D\fR\ ] [\ \fB\-e\fR\ \ ] [\ \fB\-E\fR\ \ ] [\ \fB\-f\fR\ \ ] [\ \fB\-F\fR\ \ ] [\ \fB\-h\fR\ ] [\ \fB\-i\fR\ |\-\ ] [\ \fB\-K\fR\ \ ] [\ \fB\-l\fR\ ] [\ \fB\-L\fR\ ] [\ \fB\-n\fR\ ] [\ \fB\-N\fR\ \ ] [\ \fB\-o\fR\ \ ]\ ... [\ \fB\-p\fR\ ] [\ \fB\-q\fR\ ] [\ \fB\-r\fR\ \ ] [\ \fB\-R\fR\ \ ] [\ \fB\-s\fR\ \ ] [\ \fB\-S\fR\ ] [\ \fB\-t\fR\ ad|a|r|d|e\ ] [\ \fB\-T\fR\ pdml|psml|ps|text|fields\ ] [\ \fB\-v\fR\ ] [\ \fB\-V\fR\ ] [\ \fB\-w\fR\ |\-\ ] [\ \fB\-x\fR\ ] [\ \fB\-X\fR\ ] [\ \fB\-y\fR\ \ ] [\ \fB\-z\fR\ \ ] [\ \ ] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBTShark\fR is a network protocol analyzer. It lets you capture packet data from a live network, or read packets from a previously saved capture file, either printing a decoded form of those packets to the standard output or writing the packets to a file. \fBTShark\fR's native capture file format is \fBlibpcap\fR format, which is also the format used by \fBtcpdump\fR and various other tools. .PP Without any options set, \fBTShark\fR will work much like \fBtcpdump\fR. It will use the pcap library to capture traffic from the first available network interface and displays a summary line on stdout for each received packet. .PP \&\fBTShark\fR is able to detect, read and write the same capture files that are supported by \fBWireshark\fR. The input file doesn't need a specific filename extension; the file format and an optional gzip compression will be automatically detected. Near the beginning of the \s-1DESCRIPTION\s0 section of \fIwireshark\fR\|(1) or is a detailed description of the way \fBWireshark\fR handles this, which is the same way \fBTshark\fR handles this. .PP Compressed file support uses (and therefore requires) the zlib library. If the zlib library is not present, \fBTShark\fR will compile, but will be unable to read compressed files. .PP If the \fB\-w\fR option is not specified, \fBTShark\fR writes to the standard output the text of a decoded form of the packets it captures or reads. If the \fB\-w\fR option is specified, \fBTShark\fR writes to the file specified by that option the raw data of the packets, along with the packets' time stamps. .PP When writing a decoded form of packets, \fBTShark\fR writes, by default, a summary line containing the fields specified by the preferences file (which are also the fields displayed in the packet list pane in \fBWireshark\fR), although if it's writing packets as it captures them, rather than writting packets from a saved capture file, it won't show the \*(L"frame number\*(R" field. If the \fB\-V\fR option is specified, it writes instead a view of the details of the packet, showing all the fields of all protocols in the packet. .PP If you want to write the decoded form of packets to a file, run \&\fBTShark\fR without the \fB\-w\fR option, and redirect its standard output to the file (do \fInot\fR use the \fB\-w\fR option). .PP When writing packets to a file, \fBTShark\fR, by default, writes the file in \fBlibpcap\fR format, and writes all of the packets it sees to the output file. The \fB\-F\fR option can be used to specify the format in which to write the file. This list of available file formats is displayed by the \fB\-F\fR flag without a value. However, you can't specify a file format for a live capture. .PP Read filters in \fBTShark\fR, which allow you to select which packets are to be decoded or written to a file, are very powerful; more fields are filterable in \fBTShark\fR than in other protocol analyzers, and the syntax you can use to create your filters is richer. As \fBTShark\fR progresses, expect more and more protocol fields to be allowed in read filters. .PP Packet capturing is performed with the pcap library. The capture filter syntax follows the rules of the pcap library. This syntax is different from the read filter syntax. A read filter can also be specified when capturing, and only packets that pass the read filter will be displayed or saved to the output file; note, however, that capture filters are much more efficient than read filters, and it may be more difficult for \&\fBTShark\fR to keep up with a busy network if a read filter is specified for a live capture. .PP A capture or read filter can either be specified with the \fB\-f\fR or \fB\-R\fR option, respectively, in which case the entire filter expression must be specified as a single argument (which means that if it contains spaces, it must be quoted), or can be specified with command-line arguments after the option arguments, in which case all the arguments after the filter arguments are treated as a filter expression. Capture filters are supported only when doing a live capture; read filters are supported when doing a live capture and when reading a capture file, but require TShark to do more work when filtering, so you might be more likely to lose packets under heavy load if you're using a read filter. If the filter is specified with command-line arguments after the option arguments, it's a capture filter if a capture is being done (i.e., if no \&\fB\-r\fR option was specified) and a read filter if a capture file is being read (i.e., if a \fB\-r\fR option was specified). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\-a " 4 .IX Item "-a " Specify a criterion that specifies when \fBTShark\fR is to stop writing to a capture file. The criterion is of the form \fItest\fR\fB:\fR\fIvalue\fR, where \fItest\fR is one of: .Sp \&\fBduration\fR:\fIvalue\fR Stop writing to a capture file after \fIvalue\fR seconds have elapsed. .Sp \&\fBfilesize\fR:\fIvalue\fR Stop writing to a capture file after it reaches a size of \fIvalue\fR kilobytes (where a kilobyte is 1024 bytes). If this option is used together with the \-b option, \fBTShark\fR will stop writing to the current capture file and switch to the next one if filesize is reached. When reading a capture file, \&\fBTShark\fR will stop reading the file after the number of bytes read exceeds this number (the complete packet will be read, so more bytes than this number may be read). .Sp \&\fBfiles\fR:\fIvalue\fR Stop writing to capture files after \fIvalue\fR number of files were written. .IP "\-b " 4 .IX Item "-b " Cause \fBTShark\fR to run in \*(L"multiple files\*(R" mode. In \*(L"multiple files\*(R" mode, \&\fBTShark\fR will write to several capture files. When the first capture file fills up, \fBTShark\fR will switch writing to the next file and so on. .Sp The created filenames are based on the filename given with the \fB\-w\fR option, the number of the file and on the creation date and time, e.g. outfile_00001_20050604120117.pcap, outfile_00001_20050604120523.pcap, ... .Sp With the \fIfiles\fR option it's also possible to form a \*(L"ring buffer\*(R". This will fill up new files until the number of files specified, at which point \fBTShark\fR will discard the data in the first file and start writing to that file and so on. If the \fIfiles\fR option is not set, new files filled up until one of the capture stop conditions match (or until the disk if full). .Sp The criterion is of the form \fIkey\fR\fB:\fR\fIvalue\fR, where \fIkey\fR is one of: .Sp \&\fBduration\fR:\fIvalue\fR switch to the next file after \fIvalue\fR seconds have elapsed, even if the current file is not completely filled up. .Sp \&\fBfilesize\fR:\fIvalue\fR switch to the next file after it reaches a size of \&\fIvalue\fR kilobytes (where a kilobyte is 1024 bytes). .Sp \&\fBfiles\fR:\fIvalue\fR begin again with the first file after \fIvalue\fR number of files were written (form a ring buffer). .IP "\-B " 4 .IX Item "-B " Win32 only: set capture buffer size (in \s-1MB\s0, default is 1MB). This is used by the the capture driver to buffer packet data until that data can be written to disk. If you encounter packet drops while capturing, try to increase this size. .IP "\-c " 4 .IX Item "-c " Set the maximum number of packets to read when capturing live data. If reading a capture file, set the maximum number of packets to read. .IP "\-C " 4 .IX Item "-C " Run with the given configuration profile. .IP "\-d ==," 4 .IX Item "-d ==," Like Wireshark's \fBDecode As...\fR feature, this lets you specify how a layer type should be dissected. If the layer type in question (for example, \&\fBtcp.port\fR or \fBudp.port\fR for a \s-1TCP\s0 or \s-1UDP\s0 port number) has the specified selector value, packets should be dissected as the specified protocol. .Sp Example: \fB\-d tcp.port==8888,http\fR will decode any traffic running over \&\s-1TCP\s0 port 8888 as \s-1HTTP\s0. .Sp Using an invalid selector or protocol will print out a list of valid selectors and protocol names, respectively. .Sp Example: \fB\-d .\fR is a quick way to get a list of valid selectors. .Sp Example: \fB\-d ethertype==0x0800.\fR is a quick way to get a list of protocols that can be selected with an ethertype. .IP "\-D" 4 .IX Item "-D" Print a list of the interfaces on which \fBTShark\fR can capture, and exit. For each network interface, a number and an interface name, possibly followed by a text description of the interface, is printed. The interface name or the number can be supplied to the \fB\-i\fR option to specify an interface on which to capture. .Sp This can be useful on systems that don't have a command to list them (e.g., Windows systems, or \s-1UNIX\s0 systems lacking \fBifconfig \-a\fR); the number can be useful on Windows 2000 and later systems, where the interface name is a somewhat complex string. .Sp Note that \*(L"can capture\*(R" means that \fBTShark\fR was able to open that device to do a live capture. Depending on your system you may need to run tshark from an account with special privileges (for example, as root) to be able to capture network traffic. If \fBTShark \-D\fR is not run from such an account, it will not list any interfaces. .IP "\-e " 4 .IX Item "-e " Add a field to the list of fields to display if \fB\-T fields\fR is selected. This option can be used multiple times on the command line. At least one field must be provided if the \fB\-T fields\fR option is selected. .Sp Example: \fB\-e frame.number \-e ip.addr \-e udp\fR .Sp Giving a protocol rather than a single field will print multiple items of data about the protocol as a single field. Fields are separated by tab characters by default. \fB\-E\fR controls the format of the printed fields. .IP "\-E " 4 .IX Item "-E " Set an option controlling the printing of fields when \fB\-T fields\fR is selected. .Sp Options are: .Sp \&\fBheader=y|n\fR If \fBy\fR, print a list of the field names given using \fB\-e\fR as the first line of the output; the field name will be separated using the same character as the field values. Defaults to \fBn\fR. .Sp \&\fBseparator=/t|/s|\fR Set the separator character to use for fields. If \fB/t\fR tab will be used (this is the default), if \&\fB/s\fR, s single space will be used. Otherwise any character that can be accepted by the command line as part of the option may be used. .Sp \&\fBquote=d|s|n\fR Set the quote character to use to surround fields. \fBd\fR uses double\-quotes, \fBs\fR single\-quotes, \fBn\fR no quotes (the default). .IP "\-f " 4 .IX Item "-f " Set the capture filter expression. .IP "\-F " 4 .IX Item "-F " Set the file format of the output capture file written using the \fB\-w\fR option. The output written with the \fB\-w\fR option is raw packet data, not text, so there is no \fB\-F\fR option to request text output. The option \fB\-F\fR without a value will list the available formats. .IP "\-h" 4 .IX Item "-h" Print the version and options and exits. .IP "\-i |\-" 4 .IX Item "-i |-" Set the name of the network interface or pipe to use for live packet capture. .Sp Network interface names should match one of the names listed in "\fBtshark \-D\fR\*(L" (described above); a number, as reported by \&\*(R"\fBtshark \-D\fR\*(L", can also be used. If you're using \s-1UNIX\s0, \*(R"\fBnetstat \&\-i\fR\*(L" or \*(R"\fBifconfig \-a\fR" might also work to list interface names, although not all versions of \s-1UNIX\s0 support the \fB\-a\fR option to \fBifconfig\fR. .Sp If no interface is specified, \fBTShark\fR searches the list of interfaces, choosing the first non-loopback interface if there are any non-loopback interfaces, and choosing the first loopback interface if there are no non-loopback interfaces. If there are no interfaces at all, \&\fBTShark\fR reports an error and doesn't start the capture. .Sp Pipe names should be either the name of a \s-1FIFO\s0 (named pipe) or ``\-'' to read data from the standard input. Data read from pipes must be in standard libpcap format. .Sp Note: the Win32 version of \fBTShark\fR doesn't support capturing from pipes! .IP "\-K " 4 .IX Item "-K " Load kerberos crypto keys from the specified keytab file. This option can be used multiple times to load keys from several files. .Sp Example: \fB\-K krb5.keytab\fR .IP "\-l" 4 .IX Item "-l" Flush the standard output after the information for each packet is printed. (This is not, strictly speaking, line-buffered if \fB\-V\fR was specified; however, it is the same as line-buffered if \fB\-V\fR wasn't specified, as only one line is printed for each packet, and, as \fB\-l\fR is normally used when piping a live capture to a program or script, so that output for a packet shows up as soon as the packet is seen and dissected, it should work just as well as true line\-buffering. We do this as a workaround for a deficiency in the Microsoft Visual \*(C+ C library.) .Sp This may be useful when piping the output of \fBTShark\fR to another program, as it means that the program to which the output is piped will see the dissected data for a packet as soon as \fBTShark\fR sees the packet and generates that output, rather than seeing it only when the standard output buffer containing that data fills up. .IP "\-L" 4 .IX Item "-L" List the data link types supported by the interface and exit. The reported link types can be used for the \fB\-y\fR option. .IP "\-n" 4 .IX Item "-n" Disable network object name resolution (such as hostname, \s-1TCP\s0 and \s-1UDP\s0 port names), the \fB\-N\fR flag might override this one. .IP "\-N " 4 .IX Item "-N " Turn on name resolving only for particular types of addresses and port numbers, with name resolving for other types of addresses and port numbers turned off. This flag overrides \fB\-n\fR if both \fB\-N\fR and \fB\-n\fR are present. If both \fB\-N\fR and \fB\-n\fR flags are not present, all name resolutions are turned on. .Sp The argument is a string that may contain the letters: .Sp \&\fBm\fR to enable \s-1MAC\s0 address resolution .Sp \&\fBn\fR to enable network address resolution .Sp \&\fBt\fR to enable transport-layer port number resolution .Sp \&\fBC\fR to enable concurrent (asynchronous) \s-1DNS\s0 lookups .IP "\-o :" 4 .IX Item "-o :" Set a preference value, overriding the default value and any value read from a preference file. The argument to the option is a string of the form \fIprefname\fR\fB:\fR\fIvalue\fR, where \fIprefname\fR is the name of the preference (which is the same name that would appear in the preference file), and \fIvalue\fR is the value to which it should be set. .IP "\-p" 4 .IX Item "-p" \&\fIDon't\fR put the interface into promiscuous mode. Note that the interface might be in promiscuous mode for some other reason; hence, \&\fB\-p\fR cannot be used to ensure that the only traffic that is captured is traffic sent to or from the machine on which \fBTShark\fR is running, broadcast traffic, and multicast traffic to addresses received by that machine. .IP "\-q" 4 .IX Item "-q" When capturing packets, don't display the continuous count of packets captured that is normally shown when saving a capture to a file; instead, just display, at the end of the capture, a count of packets captured. On systems that support the \s-1SIGINFO\s0 signal, such as various BSDs, you can cause the current count to be displayed by typing your \&\*(L"status\*(R" character (typically control\-T, although it might be set to \*(L"disabled\*(R" by default on at least some BSDs, so you'd have to explicitly set it to use it). .Sp When reading a capture file, or when capturing and not saving to a file, don't print packet information; this is useful if you're using a \fB\-z\fR option to calculate statistics and don't want the packet information printed, just the statistics. .IP "\-r " 4 .IX Item "-r " Read packet data from \fIinfile\fR, can be any supported capture file format (including gzipped files). It's \fBnot\fR possible to use named pipes or stdin here! .IP "\-R " 4 .IX Item "-R " Cause the specified filter (which uses the syntax of read/display filters, rather than that of capture filters) to be applied before printing a decoded form of packets or writing packets to a file; packets not matching the filter are discarded rather than being printed or written. .IP "\-s " 4 .IX Item "-s " Set the default snapshot length to use when capturing live data. No more than \fIsnaplen\fR bytes of each network packet will be read into memory, or saved to disk. .IP "\-S" 4 .IX Item "-S" Decode and display packets even while writing raw packet data using the \&\fB\-w\fR option. .IP "\-t ad|a|r|d|e" 4 .IX Item "-t ad|a|r|d|e" Set the format of the packet timestamp printed in summary lines, the default is relative. The format can be one of: .Sp \&\fBad\fR absolute with date: The absolute date and time is the actual time and date the packet was captured .Sp \&\fBa\fR absolute: The absolute time is the actual time the packet was captured, with no date displayed .Sp \&\fBr\fR relative: The relative time is the time elapsed between the first packet and the current packet .Sp \&\fBd\fR delta: The delta time is the time since the previous packet was captured .Sp \&\fBe\fR epoch: The time in seconds since epoch (Jan 1, 1970 00:00:00) .IP "\-T pdml|psml|ps|text|fields" 4 .IX Item "-T pdml|psml|ps|text|fields" Set the format of the output when viewing decoded packet data. The options are one of: .Sp \&\fBpdml\fR Packet Details Markup Language, an XML-based format for the details of a decoded packet. This information is equivalent to the packet details printed with the \fB\-V\fR flag. .Sp \&\fBpsml\fR Packet Summary Markup Language, an XML-based format for the summary information of a decoded packet. This information is equivalent to the information shown in the one-line summary printed by default. .Sp \&\fBps\fR PostScript for a human-readable one-line summary of each of the packets, or a multi-line view of the details of each of the packets, depending on whether the \fB\-V\fR flag was specified. .Sp \&\fBtext\fR Text of a human-readable one-line summary of each of the packets, or a multi-line view of the details of each of the packets, depending on whether the \fB\-V\fR flag was specified. This is the default. .Sp \&\fBfields\fR The values of fields specified with the \fB\-e\fR option, in a form specified by the \fB\-E\fR option. .IP "\-v" 4 .IX Item "-v" Print the version and exit. .IP "\-V" 4 .IX Item "-V" Cause \fBTShark\fR to print a view of the packet details rather than a one-line summary of the packet. .IP "\-w |\-" 4 .IX Item "-w |-" Write raw packet data to \fIoutfile\fR or to the standard output if \&\fIoutfile\fR is '\-'. .Sp \&\s-1NOTE:\s0 \-w provides raw packet data, not text. If you want text output you need to redirect stdout (e.g. using '>'), don't use the \fB\-w\fR option for this. .IP "\-x" 4 .IX Item "-x" Cause \fBTShark\fR to print a hex and \s-1ASCII\s0 dump of the packet data after printing the summary or details. .IP "\-X " 4 .IX Item "-X " Specify an option to be passed to a \fBTShark\fR module. The eXtension option is in the form \fIextension_key\fR\fB:\fR\fIvalue\fR, where \fIextension_key\fR can be: .Sp \&\fBlua_script\fR:\fIlua_script_filename\fR tells \fBWireshark\fR to load the given script in addition to the default Lua scripts. .IP "\-y " 4 .IX Item "-y " Set the data link type to use while capturing packets. The values reported by \fB\-L\fR are the values that can be used. .IP "\-z " 4 .IX Item "-z " Get \fBTShark\fR to collect various types of statistics and display the result after finishing reading the capture file. Use the \fB\-q\fR flag if you're reading a capture file and only want the statistics printed, not any per-packet information. .Sp Note that the \fB\-z proto\fR option is different \- it doesn't cause statistics to be gathered and printed when the capture is complete, it modifies the regular packet summary output to include the values of fields specified with the option. Therefore you must not use the \fB\-q\fR option, as that option would suppress the printing of the regular packet summary output, and must also not use the \fB\-V\fR option, as that would cause packet detail information rather than packet summary information to be printed. .Sp Currently implemented statistics are: .Sp \&\fB\-z\fR dcerpc,rtt,\fIuuid\fR,\fImajor\fR.\fIminor\fR[,\fIfilter\fR] .Sp Collect call/reply \s-1RTT\s0 data for \s-1DCERPC\s0 interface \fIuuid\fR, version \fImajor\fR.\fIminor\fR. Data collected is number of calls for each procedure, MinRTT, MaxRTT and AvgRTT. Example: use \fB\-z dcerpc,rtt,12345778\-1234\-abcd\-ef00\-0123456789ac,1.0\fR to collect data for \s-1CIFS\s0 \s-1SAMR\s0 Interface. This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z dcerpc,rtt,12345778\-1234\-abcd\-ef00\-0123456789ac,1.0,ip.addr==1.2.3.4\fR to collect \s-1SAMR\s0 \&\s-1RTT\s0 statistics for a specific host. .Sp \&\fB\-z\fR io,phs[,\fIfilter\fR] .Sp Create Protocol Hierarchy Statistics listing both number of packets and bytes. If no \fIfilter\fR is specified the statistics will be calculated for all packets. If a \fIfilters\fR is specified statistics will be only calculated for those packets that match the filter. .Sp This option can be used multiple times on the command line. .Sp \&\fB\-z\fR io,stat,\fIinterval\fR[,\fIfilter\fR][,\fIfilter\fR][,\fIfilter\fR]... .Sp Collect packet/bytes statistics for the capture in intervals of \&\fIinterval\fR seconds. \fIIntervals\fR can be specified either as whole or fractional seconds. Interval can be specified in ms resolution. .Sp If no \fIfilter\fR is specified the statistics will be calculated for all packets. If one or more \fIfilters\fR are specified statistics will be calculated for all filters and presented with one column of statistics for each filter. .Sp This option can be used multiple times on the command line. .Sp Example: \fB\-z io,stat,1,ip.addr==1.2.3.4\fR to generate 1 second statistics for all traffic to/from host 1.2.3.4. .Sp Example: \fB\-z \*(L"io,stat,0.001,smb&&ip.addr==1.2.3.4\*(R"\fR to generate 1ms statistics for all \s-1SMB\s0 packets to/from host 1.2.3.4. .Sp The examples above all use the standard syntax for generating statistics which only calculates the number of packets and bytes in each interval. .Sp \&\fBio,stat\fR can also do much more statistics and calculate \s-1\fICOUNT\s0()\fR, \s-1\fISUM\s0()\fR, \&\s-1\fIMIN\s0()\fR, \s-1\fIMAX\s0()\fR, and \s-1\fIAVG\s0()\fR using a slightly different filter syntax: .Sp .Vb 1 \& [COUNT|SUM|MIN|MAX|AVG]() .Ve .Sp One important thing to note here is that the field that the calculation is based on \s-1MUST\s0 also be part of the filter string or else the calculation will fail. .Sp So: \fB\-z io,stat,0.010,AVG(smb.time)\fR does not work. Use \fB\-z io,stat,0.010,AVG(smb.time)smb.time\fR instead. Also be aware that a field can exist multiple times inside the same packet and will then be counted multiple times in those packets. .Sp \&\s-1COUNT\s0() can be used on any type which has a display filter name. It will count how many times this particular field is encountered in the filtered packet list. .Sp Example: \fB\-z io,stat,0.010,COUNT(smb.sid)smb.sid\fR This will count the total number of SIDs seen in each 10ms interval. .Sp \&\s-1SUM\s0() can only be used on named fields of integer type. This will sum together every occurence of this fields value for each interval. .Sp Example: \fB\-z io,stat,0.010,SUM(frame.pkt_len)frame.pkt_len\fR This will report the total number of bytes seen in all the packets within an interval. .Sp \&\s-1MIN/MAX/AVG\s0() can only be used on named fields that are either integers or relative time fields. This will calculate maximum/minimum or average seen in each interval. If the field is a relative time field the output will be presented in seconds and three digits after the decimal point. The resolution for time calculations is 1ms and anything smaller will be truncated. .Sp Example: \fB\-z \*(L"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\*(R"\fR .Sp This will calculate statistics for all smb response times we see to/from host 1.1.1.1 in 10ms intervals. The output will be displayed in 4 columns; number of packets/bytes, minimum response time, maximum response time and average response time. .Sp \&\fB\-z\fR conv,\fItype\fR[,\fIfilter\fR] .Sp Create a table that lists all conversations that could be seen in the capture. \&\fItype\fR specifies which type of conversation we want to generate the statistics for; currently the supported ones are .Sp .Vb 8 \& "eth" Ethernet \& "fc" Fibre Channel \& "fddi" FDDI \& "ip" IP addresses \& "ipx" IPX addresses \& "tcp" TCP/IP socket pairs Both IPv4 and IPv6 are supported \& "tr" Token Ring \& "udp" UDP/IP socket pairs Both IPv4 and IPv6 are supported .Ve .Sp If the optional filter string is specified, only those packets that match the filter will be used in the calculations. .Sp The table is presented with one line for each conversation and displays number of packets/bytes in each direction as well as total number of packets/bytes. The table is sorted according to total number of bytes. .Sp \&\fB\-z\fR proto,colinfo,\fIfilter\fR,\fIfield\fR .Sp Append all \fIfield\fR values for the packet to the Info column of the one-line summary output. This feature can be used to append arbitrary fields to the Info column in addition to the normal content of that column. \&\fIfield\fR is the display-filter name of a field which value should be placed in the Info column. \&\fIfilter\fR is a filter string that controls for which packets the field value will be presented in the info column. \fIfield\fR will only be presented in the Info column for the packets which match \fIfilter\fR. .Sp \&\s-1NOTE:\s0 In order for \fBTShark\fR to be able to extract the \fIfield\fR value from the packet, \fIfield\fR \s-1MUST\s0 be part of the \fIfilter\fR string. If not, \&\fBTShark\fR will not be able to extract its value. .Sp For a simple example to add the \*(L"nfs.fh.hash\*(R" field to the Info column for all packets containing the \*(L"nfs.fh.hash\*(R" field, use .Sp \&\fB\-z proto,colinfo,nfs.fh.hash,nfs.fh.hash\fR .Sp To put \*(L"nfs.fh.hash\*(R" in the Info column but only for packets coming from host 1.2.3.4 use: .Sp \&\fB\-z \*(L"proto,colinfo,nfs.fh.hash && ip.src==1.2.3.4,nfs.fh.hash\*(R"\fR .Sp This option can be used multiple times on the command line. .Sp \&\fB\-z\fR rpc,rtt,\fIprogram\fR,\fIversion\fR[,\fIfilter\fR] .Sp Collect call/reply \s-1RTT\s0 data for \fIprogram\fR/\fIversion\fR. Data collected is number of calls for each procedure, MinRTT, MaxRTT and AvgRTT. Example: use \fB\-z rpc,rtt,100003,3\fR to collect data for \s-1NFS\s0 v3. This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z rpc,rtt,100003,3,nfs.fh.hash==0x12345678\fR to collect \s-1NFS\s0 v3 \&\s-1RTT\s0 statistics for a specific file. .Sp \&\fB\-z\fR rpc,programs .Sp Collect call/reply \s-1RTT\s0 data for all known ONC-RPC programs/versions. Data collected is number of calls for each protocol/version, MinRTT, MaxRTT and AvgRTT. This option can only be used once on the command line. .Sp \&\fB\-z\fR rtp,streams .Sp Collect statistics for all \s-1RTP\s0 streams and calculate max. delta, max. and mean jitter and packet loss percentages. .Sp \&\fB\-z\fR smb,rtt[,\fIfilter\fR] .Sp Collect call/reply \s-1RTT\s0 data for \s-1SMB\s0. Data collected is number of calls for each \s-1SMB\s0 command, MinRTT, MaxRTT and AvgRTT. Example: use \fB\-z smb,rtt\fR. The data will be presented as separate tables for all normal \s-1SMB\s0 commands, all Transaction2 commands and all \s-1NT\s0 Transaction commands. Only those commands that are seen in the capture will have its stats displayed. Only the first command in a xAndX command chain will be used in the calculation. So for common SessionSetupAndX + TreeConnectAndX chains, only the SessionSetupAndX call will be used in the statistics. This is a flaw that might be fixed in the future. .Sp This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z \*(L"smb,rtt,ip.addr==1.2.3.4\*(R"\fR to only collect stats for \&\s-1SMB\s0 packets echanged by the host at \s-1IP\s0 address 1.2.3.4 . .Sp \&\fB\-z\fR smb,sids .Sp When this feature is used \fBTShark\fR will print a report with all the discovered \s-1SID\s0 and account name mappings. Only those SIDs where the account name is known will be presented in the table. .Sp For this feature to work you will need to either to enable \&\*(L"Edit/Preferences/Protocols/SMB/Snoop \s-1SID\s0 to name mappings\*(R" in the preferences or you can override the preferences by specifying \&\fB\-o \*(L"smb.sid_name_snooping:TRUE\*(R"\fR on the \fBTShark\fR command line. .Sp The current methods used by \fBTShark\fR to find the \s-1SID\-\s0>name mapping is relatively restricted but is hoped to be expanded in the future. .Sp \&\fB\-z\fR mgcp,rtd[\fI,filter\fR] .Sp Collect requests/response \s-1RTD\s0 (Response Time Delay) data for \s-1MGCP\s0. This is similar to \fB\-z smb,rtt\fR). Data collected is number of calls for each known \s-1MGCP\s0 Type, MinRTD, MaxRTD and AvgRTD. Additionally you get the number of duplicate requests/responses, unresponded requests, responses ,which don't match with any request. Example: use \fB\-z mgcp,rtd\fR. .Sp This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z \*(L"mgcp,rtd,ip.addr==1.2.3.4\*(R"\fR to only collect stats for \&\s-1MGCP\s0 packets exchanged by the host at \s-1IP\s0 address 1.2.3.4 . .Sp \&\fB\-z\fR megaco,rtd[\fI,filter\fR] .Sp Collect requests/response \s-1RTD\s0 (Response Time Delay) data for \s-1MEGACO\s0. This is similar to \fB\-z smb,rtt\fR). Data collected is number of calls for each known \s-1MEGACO\s0 Type, MinRTD, MaxRTD and AvgRTD. Additionally you get the number of duplicate requests/responses, unresponded requests, responses ,which don't match with any request. Example: use \fB\-z megaco,rtd\fR. .Sp This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z \*(L"megaco,rtd,ip.addr==1.2.3.4\*(R"\fR to only collect stats for \&\s-1MEGACO\s0 packets exchanged by the host at \s-1IP\s0 address 1.2.3.4 . .Sp \&\fB\-z\fR h225,counter[\fI,filter\fR] .Sp Count ITU-T H.225 messages and their reasons. In the first column you get a list of H.225 messages and H.225 message reasons, which occur in the current capture file. The number of occurences of each message or reason is displayed in the second column. .Sp Example: use \fB\-z h225,counter\fR. .Sp This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z \*(L"h225,counter,ip.addr==1.2.3.4\*(R"\fR to only collect stats for H.225 packets exchanged by the host at \s-1IP\s0 address 1.2.3.4 . .Sp \&\fB\-z\fR h225,srt[\fI,filter\fR] .Sp Collect requests/response \s-1SRT\s0 (Service Response Time) data for ITU-T H.225 \s-1RAS\s0. Data collected is number of calls of each ITU-T H.225 \s-1RAS\s0 Message Type, Minimum \s-1SRT\s0, Maximum \s-1SRT\s0, Average \s-1SRT\s0, Minimum in Frame, and Maximum in Frame. You will also get the number of Open Requests (Unresponded Requests), Discarded Responses (Responses without matching request) and Duplicate Messages. Example: use \fB\-z h225,srt\fR. .Sp This option can be used multiple times on the command line. .Sp If the optional filterstring is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z \*(L"h225,srt,ip.addr==1.2.3.4\*(R"\fR to only collect stats for ITU-T H.225 \s-1RAS\s0 packets exchanged by the host at \s-1IP\s0 address 1.2.3.4 . .Sp \&\fB\-z\fR sip,stat[\fI,filter\fR] .Sp This option will activate a counter for \s-1SIP\s0 messages. You will get the number of occurences of each \s-1SIP\s0 Method and of each \s-1SIP\s0 Status\-Code. Additionally you also get the number of resent \s-1SIP\s0 Messages (only for \s-1SIP\s0 over \s-1UDP\s0). .Sp Example: use \fB\-z sip,stat\fR. .Sp This option can be used multiple times on the command line. .Sp If the optional filter string is provided, the stats will only be calculated on those calls that match that filter. Example: use \fB\-z \*(L"sip,stat,ip.addr==1.2.3.4\*(R"\fR to only collect stats for \&\s-1SIP\s0 packets exchanged by the host at \s-1IP\s0 address 1.2.3.4 . .SH "CAPTURE FILTER SYNTAX" .IX Header "CAPTURE FILTER SYNTAX" See the manual page of \fIpcap\-filter\fR\|(4) or, if that doesn't exist, \fItcpdump\fR\|(8). .SH "READ FILTER SYNTAX" .IX Header "READ FILTER SYNTAX" For a complete table of protocol and protocol fields that are filterable in \fBTShark\fR see the \fIwireshark\-filter\fR\|(4) manual page. .SH "FILES" .IX Header "FILES" These files contains various \fBWireshark\fR configuration values. .IP "Preferences" 4 .IX Item "Preferences" The \fIpreferences\fR files contain global (system\-wide) and personal preference settings. If the system-wide preference file exists, it is read first, overriding the default settings. If the personal preferences file exists, it is read next, overriding any previous values. Note: If the command line option \fB\-o\fR is used (possibly more than once), it will in turn override values from the preferences files. .Sp The preferences settings are in the form \fIprefname\fR\fB:\fR\fIvalue\fR, one per line, where \fIprefname\fR is the name of the preference and \fIvalue\fR is the value to which it should be set; white space is allowed between \fB:\fR and \&\fIvalue\fR. A preference setting can be continued on subsequent lines by indenting the continuation lines with white space. A \fB#\fR character starts a comment that runs to the end of the line: .Sp .Vb 3 \& # Capture in promiscuous mode? \& # TRUE or FALSE (case-insensitive). \& capture.prom_mode: TRUE .Ve .Sp The global preferences file is looked for in the \fIwireshark\fR directory under the \fIshare\fR subdirectory of the main installation directory (for example, \fI/usr/local/share/wireshark/preferences\fR) on UNIX-compatible systems, and in the main installation directory (for example, \&\fIC:\eProgram Files\eWireshark\epreferences\fR) on Windows systems. .Sp The personal preferences file is looked for in \&\fI$HOME/.wireshark/preferences\fR on UNIX-compatible systems and \fI%APPDATA%\eWireshark\epreferences\fR (or, if \&\f(CW%APPDATA\fR% isn't defined, \fI%USERPROFILE%\eApplication Data\eWireshark\epreferences\fR) on Windows systems. .IP "Disabled (Enabled) Protocols" 4 .IX Item "Disabled (Enabled) Protocols" The \fIdisabled_protos\fR files contain system-wide and personal lists of protocols that have been disabled, so that their dissectors are never called. The files contain protocol names, one per line, where the protocol name is the same name that would be used in a display filter for the protocol: .Sp .Vb 2 \& http \& tcp # a comment .Ve .Sp The global \fIdisabled_protos\fR file uses the same directory as the global preferences file. .Sp The personal \fIdisabled_protos\fR file uses the same directory as the personal preferences file. .IP "Name Resolution (hosts)" 4 .IX Item "Name Resolution (hosts)" If the personal \fIhosts\fR file exists, it is used to resolve IPv4 and IPv6 addresses before any other attempts are made to resolve them. The file has the standard \fIhosts\fR file syntax; each line contains one \s-1IP\s0 address and name, separated by whitespace. The same directory as for the personal preferences file is used. .IP "Name Resolution (ethers)" 4 .IX Item "Name Resolution (ethers)" The \fIethers\fR files are consulted to correlate 6\-byte hardware addresses to names. First the personal \fIethers\fR file is tried and if an address is not found there the global \fIethers\fR file is tried next. .Sp Each line contains one hardware address and name, separated by whitespace. The digits of the hardware address are separated by colons (:), dashes (\-) or periods (.). The same separator character must be used consistently in an address. The following three lines are valid lines of an \fIethers\fR file: .Sp .Vb 3 \& ff:ff:ff:ff:ff:ff Broadcast \& c0-00-ff-ff-ff-ff TR_broadcast \& 00.00.00.00.00.00 Zero_broadcast .Ve .Sp The global \fIethers\fR file is looked for in the \fI/etc\fR directory on UNIX-compatible systems, and in the main installation directory (for example, \fIC:\eProgram Files\eWireshark\fR) on Windows systems. .Sp The personal \fIethers\fR file is looked for in the same directory as the personal preferences file. .IP "Name Resolution (manuf)" 4 .IX Item "Name Resolution (manuf)" The \fImanuf\fR file is used to match the 3\-byte vendor portion of a 6\-byte hardware address with the manufacturer's name; it can also contain well-known \&\s-1MAC\s0 addresses and address ranges specified with a netmask. The format of the file is the same as the \fIethers\fR files, except that entries of the form: .Sp .Vb 1 \& 00:00:0C Cisco .Ve .Sp can be provided, with the 3\-byte \s-1OUI\s0 and the name for a vendor, and entries such as: .Sp .Vb 1 \& 00-00-0C-07-AC/40 All-HSRP-routers .Ve .Sp can be specified, with a \s-1MAC\s0 address and a mask indicating how many bits of the address must match. The above entry, for example, has 40 significant bits, or 5 bytes, and would match addresses from 00\-00\-0C\-07\-AC\-00 through 00\-00\-0C\-07\-AC\-FF. The mask need not be a multiple of 8. .Sp The \fImanuf\fR file is looked for in the same directory as the global preferences file. .IP "Name Resolution (ipxnets)" 4 .IX Item "Name Resolution (ipxnets)" The \fIipxnets\fR files are used to correlate 4\-byte \s-1IPX\s0 network numbers to names. First the global \fIipxnets\fR file is tried and if that address is not found there the personal one is tried next. .Sp The format is the same as the \fIethers\fR file, except that each address is four bytes instead of six. Additionally, the address can be represented as a single hexadecimal number, as is more common in the \s-1IPX\s0 world, rather than four hex octets. For example, these four lines are valid lines of an \fIipxnets\fR file: .Sp .Vb 4 \& C0.A8.2C.00 HR \& c0-a8-1c-00 CEO \& 00:00:BE:EF IT_Server1 \& 110f FileServer3 .Ve .Sp The global \fIipxnets\fR file is looked for in the \fI/etc\fR directory on UNIX-compatible systems, and in the main installation directory (for example, \fIC:\eProgram Files\eWireshark\fR) on Windows systems. .Sp The personal \fIipxnets\fR file is looked for in the same directory as the personal preferences file. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIwireshark\-filter\fR\|(4), \fIwireshark\fR\|(1), \fIeditcap\fR\|(1), \fIpcap\-filter\fR\|(4), \fItcpdump\fR\|(8), \&\fIpcap\fR\|(3), \fIdumpcap\fR\|(1), \fItext2pcap\fR\|(1) .SH "NOTES" .IX Header "NOTES" \&\fBTShark\fR is part of the \fBWireshark\fR distribution. The latest version of \fBWireshark\fR can be found at . .PP \&\s-1HTML\s0 versions of the Wireshark project man pages are available at: . .SH "AUTHORS" .IX Header "AUTHORS" \&\fBTShark\fR uses the same packet dissection code that \fBWireshark\fR does, as well as using many other modules from \fBWireshark\fR; see the list of authors in the \fBWireshark\fR man page for a list of authors of that code.