765c8c97128efeba14081ee7da7cae614c039aef
[obnox/wireshark/wip.git] / doc / dumpcap.pod
1
2 =head1 NAME
3
4 dumpcap - Dump network traffic
5
6 =head1 SYNOPSYS
7
8 B<dumpcap>
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<-D> ]>
14 S<[ B<-f> E<lt>capture filterE<gt> ]>
15 S<[ B<-h> ]>
16 S<[ B<-i> E<lt>capture interfaceE<gt>|- ]> 
17 S<[ B<-L> ]>
18 S<[ B<-p> ]>
19 S<[ B<-s> E<lt>capture snaplenE<gt> ]>
20 S<[ B<-v> ]>
21 S<[ B<-w> E<lt>outfileE<gt> ]>
22 S<[ B<-y> E<lt>capture link typeE<gt> ]>
23
24 =head1 DESCRIPTION
25
26 B<Dumpcap> is a network traffic dump tool.  It lets you capture packet
27 data from a live network and write the packets to a file.  B<Dumpcap>'s 
28 native capture file format is B<libpcap> format, which is also the format 
29 used by B<Wireshark>, B<tcpdump> and various other tools.  
30
31 Without any options set it will 
32 use the pcap library to capture traffic from the first available network 
33 interface and writes the received raw packet data, along with the packets'
34 time stamps into a libpcap file.
35
36 If the B<-w> option is not specified, B<Dumpcap> writes to a newly 
37 created libpcap file with a randomly chosen name. 
38 If the B<-w> option is specified, B<Dumpcap> writes to the file
39 specified by that option.
40
41 Packet capturing is performed with the pcap library.  The capture filter
42 syntax follows the rules of the pcap library.
43
44 =head1 OPTIONS
45
46 =over 4
47
48 =item -a  E<lt>capture autostop conditionE<gt>
49
50 Specify a criterion that specifies when B<Dumpcap> is to stop writing
51 to a capture file.  The criterion is of the form I<test>B<:>I<value>,
52 where I<test> is one of:
53
54 B<duration>:I<value> Stop writing to a capture file after I<value> seconds have elapsed.
55
56 B<filesize>:I<value> Stop writing to a capture file after it reaches a size of I<value>
57 kilobytes (where a kilobyte is 1024 bytes). If this option 
58 is used together with the -b option, dumpcap will stop writing to the 
59 current capture file and switch to the next one if filesize is reached.
60
61 B<files>:I<value> Stop writing to capture files after I<value> number of files were written.
62
63 =item -b  E<lt>capture ring buffer optionE<gt>
64
65 Cause B<Dumpcap> to run in "multiple files" mode.  In "multiple files" mode, 
66 B<Dumpcap> will write to several capture files. When the first capture file 
67 fills up, B<Dumpcap> will switch writing to the next file and so on.
68
69 The created filenames are based on the filename given with the B<-w> option, the number of 
70 the file and on the creation date and time, 
71 e.g. outfile_00001_20050604120117.pcap, outfile_00001_20050604120523.pcap, ...
72
73 With the I<files> option it's also possible to form a "ring buffer". 
74 This will fill up new files until the number of files specified, 
75 at which point B<Dumpcap> will discard the data in the first file and start 
76 writing to that file and so on. If the I<files> option is not set,
77 new files filled up until one of the capture stop conditions match (or 
78 until the disk if full).
79
80 The criterion is of the form I<key>B<:>I<value>,
81 where I<key> is one of:
82
83 B<duration>:I<value> switch to the next file after I<value> seconds have 
84 elapsed, even if the current file is not completely filled up.
85
86 B<filesize>:I<value> switch to the next file after it reaches a size of 
87 I<value> kilobytes (where a kilobyte is 1024 bytes). 
88
89 B<files>:I<value> begin again with the first file after I<value> number of 
90 files were written (form a ring buffer).
91
92 =item -B  E<lt>capture buffer size (Win32 only)E<gt>
93
94 Win32 only: set capture buffer size (in MB, default is 1MB). This is used by the
95 the capture driver to buffer packet data until that data can be written to 
96 disk. If you encounter packet drops while capturing, try to increase this size.
97
98 =item -c  E<lt>capture packet countE<gt>
99
100 Set the maximum number of packets to read when capturing live
101 data.
102
103 =item -D
104
105 Print a list of the interfaces on which B<Dumpcap> can capture, and
106 exit.  For each network interface, a number and an
107 interface name, possibly followed by a text description of the
108 interface, is printed.  The interface name or the number can be supplied
109 to the B<-i> option to specify an interface on which to capture.
110
111 This can be useful on systems that don't have a command to list them  
112 (e.g., Windows systems, or UNIX systems lacking B<ifconfig -a>);
113 the number can be useful on Windows 2000 and later systems, where the
114 interface name is a somewhat complex string.
115
116 Note that "can capture" means that B<Dumpcap> was able to open
117 that device to do a live capture. Depending on your system you may need to 
118 run dumpcap from an account with special privileges (for example, as root) 
119 to be able to capture network traffic.
120 If "B<dumpcap -D>" is not run from such an account, it will not list 
121 any interfaces.
122
123 =item -f  E<lt>capture filterE<gt>
124
125 Set the capture filter expression.
126
127 The entire filter expression must be specified as a single argument (which means 
128 that if it contains spaces, it must be quoted).  
129
130 =item -h
131
132 Print the version and options and exits.
133
134 =item -i  E<lt>capture interfaceE<gt>|-
135
136 Set the name of the network interface or pipe to use for live packet
137 capture. 
138
139 Network interface names should match one of the names listed in
140 "B<dumpcap -D>" (described above); a number, as reported by
141 "B<dumpcap -D>", can also be used.  If you're using UNIX, "B<netstat
142 -i>" or "B<ifconfig -a>" might also work to list interface names,
143 although not all versions of UNIX support the B<-a> option to B<ifconfig>.
144
145 If no interface is specified, B<Dumpcap> searches the list of
146 interfaces, choosing the first non-loopback interface if there are any
147 non-loopback interfaces, and choosing the first loopback interface if
148 there are no non-loopback interfaces. If there are no interfaces at all,
149 B<Dumpcap> reports an error and doesn't start the capture.
150
151 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
152 read data from the standard input.  Data read from pipes must be in
153 standard libpcap format.
154
155 Note: the Win32 version of B<Dumpcap> doesn't support capturing from
156 pipes or stdin!
157
158 =item -L
159
160 List the data link types supported by the interface and exit. The reported
161 link types can be used for the B<-y> option.
162
163 =item -p
164
165 I<Don't> put the interface into promiscuous mode.  Note that the
166 interface might be in promiscuous mode for some other reason; hence,
167 B<-p> cannot be used to ensure that the only traffic that is captured is
168 traffic sent to or from the machine on which B<Dumpcap> is running,
169 broadcast traffic, and multicast traffic to addresses received by that
170 machine.
171
172 =item -s  E<lt>capture snaplenE<gt>
173
174 Set the default snapshot length to use when capturing live data. 
175 No more than I<snaplen> bytes of each network packet will be read into
176 memory, or saved to disk.
177
178 =item -v
179
180 Print the version and exit.
181
182 =item -w  E<lt>outfileE<gt>
183
184 Write raw packet data to I<outfile>.  
185
186 NOTE: The usage of "-" for stdout is not allowed here!
187
188 =item -y  E<lt>capture link typeE<gt>
189
190 Set the data link type to use while capturing packets.  The values
191 reported by B<-L> are the values that can be used.
192
193 =back
194
195 =head1 CAPTURE FILTER SYNTAX
196
197 See the manual page of tcpdump(8).
198
199 =head1 SEE ALSO
200
201 wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), tcpdump(8),
202 pcap(3)
203
204 =head1 NOTES
205
206 B<Dumpcap> is part of the B<Wireshark> distribution.  The latest version
207 of B<Wireshark> can be found at L<http://www.wireshark.org>.
208
209 HTML versions of the Wireshark project man pages are available at:
210 L<http://www.wireshark.org/docs/man-pages>.
211
212 =head1 AUTHORS
213
214 B<Dumpcap> is derived from the B<Wireshark> capturing engine code; 
215 see the list of
216 authors in the B<Wireshark> man page for a list of authors of that code.