NEARLY → OVER.
[obnox/wireshark/wip.git] / doc / capinfos.pod
1
2 =head1 NAME
3
4 capinfos - Prints information about capture files
5
6 =head1 SYNOPSIS
7
8 B<capinfos>
9 S<[ B<-a> ]>
10 S<[ B<-A> ]>
11 S<[ B<-b> ]>
12 S<[ B<-B> ]>
13 S<[ B<-c> ]>
14 S<[ B<-C> ]>
15 S<[ B<-d> ]>
16 S<[ B<-e> ]>
17 S<[ B<-E> ]>
18 S<[ B<-h> ]>
19 S<[ B<-H> ]>
20 S<[ B<-i> ]>
21 S<[ B<-l> ]>
22 S<[ B<-L> ]>
23 S<[ B<-m> ]>
24 S<[ B<-N> ]>
25 S<[ B<-o> ]>
26 S<[ B<-q> ]>
27 S<[ B<-Q> ]>
28 S<[ B<-r> ]>
29 S<[ B<-R> ]>
30 S<[ B<-s> ]>
31 S<[ B<-S> ]>
32 S<[ B<-t> ]>
33 S<[ B<-T> ]>
34 S<[ B<-u> ]>
35 S<[ B<-x> ]>
36 S<[ B<-y> ]>
37 S<[ B<-z> ]>
38 E<lt>I<infile>E<gt>
39 I<...>
40
41 =head1 DESCRIPTION
42
43 B<Capinfos> is a program that reads one or more capture files and
44 returns some or all available statistics (infos) of each E<lt>I<infile>E<gt>
45 in one of two types of output formats: long or table.
46
47 The long output is suitable for a human to read.  The table output
48 is useful for generating a report that can be easily imported into
49 a spreadsheet or database.
50
51 The user specifies what type of output (long or table) and which 
52 statistics to display by specifying flags (options) that corresponding 
53 to the report type and desired infos.  If no options are specified, 
54 B<Capinfos> will report all statistics available in "long" format.
55
56 Options are processed from left to right order with later options 
57 superceeding or adding to earlier options.
58
59 B<Capinfos> is able to detect and read the same capture files that are
60 supported by B<Wireshark>.
61 The input files don't need a specific filename extension; the file
62 format and an optional gzip compression will be automatically detected.
63 Near the beginning of the DESCRIPTION section of wireshark(1) or
64 L<http://www.wireshark.org/docs/man-pages/wireshark.html>
65 is a detailed description of the way B<Wireshark> handles this, which is
66 the same way B<Capinfos> handles this.
67
68 =head1 OPTIONS
69
70 =over 4
71
72 =item -a
73
74 Displays the start time of the capture.  B<Capinfos> considers
75 the earliest timestamp seen to be the start time, so the
76 first packet in the capture is not necessarily the earliest -
77 if packets exist "out-of-order", time-wise, in the capture,
78 B<Capinfos> detects this.
79
80 =item -A 
81
82 Generate all infos. By default capinfos will display 
83 all infos values for each input file, but enabling 
84 any of the individual display infos options will 
85 disable the generate all option.  
86
87 =item -b 
88
89 Separate infos with ASCII SPACE (0x20) characters.
90 This option is only useful when generating a table 
91 style report (-T).  The various info values will be 
92 separated (delimited) from one another with a single 
93 ASCII SPACE character.  
94
95 NOTE: Since some of the header labels as well as some 
96 of the value fields contain SPACE characters.  This 
97 option is of limited value unless one of the quoting 
98 options (-q or -Q) is also specified.
99
100 =item -B 
101
102 Separate the infos with ASCII TAB characters.  
103 This option is only useful when generating a table 
104 style report (-T).  The various info values will be 
105 separated (delimited) from one another with a single 
106 ASCII TAB character.  The TAB character is the default 
107 delimiter when -T style report is enabled.
108
109 =item -c
110
111 Displays the number of packets in the capture file.
112
113 =item -C 
114
115 Cancel processing any additional files if and
116 when capinfos should fail to open an input file.  
117 By default capinfos will attempt to open each and 
118 every file name argument.  
119
120 Note: An error message will be written to stderr 
121 whenever capinfos fails to open a file regardless
122 of whether the -C option is specified or not.
123
124 =item -d
125
126 Displays the total length of all packets in the file, in
127 bytes.  This counts the size of the packets as they appeared
128 in their original form, not as they appear in this file.
129 For example, if a packet was originally 1514 bytes and only
130 256 of those bytes were saved to the capture file (if packets
131 were captured with a snaplen or other slicing option),
132 B<Capinfos> will consider the packet to have been 1514 bytes.
133
134 =item -e
135
136 Displays the end time of the capture.  B<Capinfos> considers
137 the latest timestamp seen to be the end time, so the
138 last packet in the capture is not necessarily the latest -
139 if packets exist "out-of-order", time-wise, in the capture,
140 B<Capinfos> detects this.
141
142 =item -E
143
144 Displays the per-file encapsulation of the capture file.
145
146 =item -h
147
148 Prints the help listing and exits.
149
150 =item -H
151
152 Displays the SHA1, RIPEMD160, and MD5 hashes for the file.
153
154 =item -i
155
156 Displays the average data rate, in bits/sec
157
158 =item -l 
159
160 Display the snaplen (if any) for a file.
161 snaplen (if available) is determined from the capture file header
162 and by looking for truncated records in the capture file.
163
164 =item -o
165
166 Displays "True" if packets exist in strict chronological order 
167 or "False" if one or more packets in the capture exists 
168 "out-of-order" time-wise.
169
170 =item -L 
171
172 Generate long report.  Capinfos can generate two 
173 different styles of reports.  The "long" report is 
174 the default style of output and is suitable for a 
175 human to use.
176
177 =item -m 
178
179 Separate the infos with comma (,) characters.  This option 
180 is only useful when generating a table style report (-T).
181 The various info values will be separated (delimited)
182 from one another with a single comma "," character.
183
184 =item -N 
185
186 Do not quote the infos.  This option is only useful 
187 when generating a table style report (-T).  Excluding 
188 any quoting characters around the various values and 
189 using a TAB delimiter produces a very "clean" table 
190 report that is easily parsed with CLI tools.  By 
191 default infos are B<NOT> quoted.
192
193 =item -q 
194
195 Quote infos with single quotes ('). This option is 
196 only useful when generating a table style report (-T).
197 When this option is enabled, each value will be
198 encapsulated within a pair of single quote (') 
199 characters.  This option (when used  with the -m 
200 option) is useful for generating one type of CSV 
201 style file report.
202
203 =item -Q 
204
205 Quote infos with double quotes (").  This option is 
206 only useful when generating a table style report (-T).
207 When this option is enabled, each value will be
208 encapsulated within a pair of double quote (") 
209 characters.  This option (when used with the -m 
210 option) is useful for generating the most common
211 type of CSV style file report.
212
213 =item -r 
214
215 Do not generate header record.  This option is only 
216 useful when generating a table style report (-T).
217 If this option is specified then B<no> header record will be 
218 generated within the table report.
219
220 =item -R 
221
222 Generate header record.  This option is only useful 
223 when generating a table style report (-T).  A header
224 is generated by default.  A header record (if generated) 
225 is the first line of data reported and includes labels 
226 for all the columns included within the table report.  
227
228 =item -s
229
230 Displays the size of the file, in bytes.  This reports
231 the size of the capture file itself.
232
233 =item -S
234
235 Display the start and end times as seconds since January
236 1, 1970. Handy for synchronizing dumps using B<editcap -t>.
237
238 =item -t
239
240 Displays the capture type of the capture file.
241
242 =item -T 
243
244 Generate a table report. A table report is a text file
245 that is suitable for importing into a spreadsheet or 
246 database.  Capinfos can build a tab delimited text file 
247 (the default) or several variations on Comma-separated 
248 values (CSV) files.
249
250 =item -u
251
252 Displays the capture duration, in seconds.  This is the
253 difference in time between the earliest packet seen and
254 latest packet seen.
255
256 =item -x
257
258 Displays the average packet rate, in packets/sec
259
260 =item -y
261
262 Displays the average data rate, in bytes/sec
263
264 =item -z
265
266 Displays the average packet size, in bytes
267
268 =back
269
270 =head1 EXAMPLES
271
272 To see a description of the capinfos options use:
273
274     capinfos -h
275
276 To generate a long form report for the capture file 
277 mycapture.pcap use:
278
279     capinfos mycapture.pcap 
280
281 To generate a TAB delimited table form report for the capture 
282 file mycapture.pcap use:
283
284     capinfos -T mycapture.pcap 
285
286 To generate a CSV style table form report for the capture 
287 file mycapture.pcap use:
288
289     capinfos -T -m -Q mycapture.pcap 
290
291 or
292
293     capinfos -TmQ mycapture.pcap 
294
295
296 To generate a TAB delimited table style report with just the 
297 filenames, capture type, capture encapsulation type and packet 
298 count for all the pcap files in the current directory use:
299
300     capinfos -T -t -E -c *.pcap
301
302 or 
303   
304     capinfos -TtEs *.pcap
305
306 Note: The ability to use of filename globbing characters are 
307 a feature of *nix style command shells.  
308
309 To generate a CSV delimited table style report of all infos 
310 for all pcap files in the current directory and write it to 
311 a text file called mycaptures.csv use:
312
313     capinfos -TmQ *.pcap >mycaptures.csv
314
315 The resulting mycaptures.csv file can be easily imported 
316 into spreadsheet applications.
317
318 =head1 SEE ALSO
319
320 tcpdump(8), pcap(3), wireshark(1), mergecap(1), editcap(1), tshark(1),
321 dumpcap(1)
322
323 =head1 NOTES
324
325 B<Capinfos> is part of the B<Wireshark> distribution.  The latest version
326 of B<Wireshark> can be found at L<http://www.wireshark.org>.
327
328 HTML versions of the Wireshark project man pages are available at:
329 L<http://www.wireshark.org/docs/man-pages>.
330
331 =head1 AUTHORS
332
333   Original Author
334   -------- ------
335   Ian Schorr           <ian[AT]ianschorr.com>
336
337
338   Contributors
339   ------------
340   Gerald Combs         <gerald[AT]wireshark.org>
341   Jim Young            <jyoung[AT]gsu.edu>