4 capinfos - Prints information about capture files
40 B<Capinfos> is a program that reads one or more capture files and
41 returns some or all available statistics (infos) of each E<lt>I<infile>E<gt>
42 in one of two types of output formats: long or table.
44 The long output is suitable for a human to read. The table output
45 is useful for generating a report that can be easily imported into
46 a spreadsheet or database.
48 The user specifies what type of output (long or table) and which
49 statistics to display by specifying flags (options) that corresponding
50 to the report type and desired infos. If no options are specified,
51 B<Capinfos> will report all statistics available in "long" format.
53 Options are processed from left to right order with later options
54 superceeding or adding to earlier options.
56 B<Capinfos> is able to detect and read the same capture files that are
57 supported by B<Wireshark>.
58 The input files don't need a specific filename extension; the file
59 format and an optional gzip compression will be automatically detected.
60 Near the beginning of the DESCRIPTION section of wireshark(1) or
61 L<http://www.wireshark.org/docs/man-pages/wireshark.html>
62 is a detailed description of the way B<Wireshark> handles this, which is
63 the same way B<Capinfos> handles this.
71 Displays the capture type of the capture file.
75 Displays the per-file encapsulation of the capture file.
79 Displays the number of packets in the capture file.
83 Displays the size of the file, in bytes. This reports
84 the size of the capture file itself.
88 Displays the total length of all packets in the file, in
89 bytes. This counts the size of the packets as they appeared
90 in their original form, not as they appear in this file.
91 For example, if a packet was originally 1514 bytes and only
92 256 of those bytes were saved to the capture file (if packets
93 were captured with a snaplen or other slicing option),
94 B<Capinfos> will consider the packet to have been 1514 bytes.
98 Displays the capture duration, in seconds. This is the
99 difference in time between the earliest packet seen and
104 Displays the start time of the capture. B<Capinfos> considers
105 the earliest timestamp seen to be the start time, so the
106 first packet in the capture is not necessarily the earliest -
107 if packets exist "out-of-order", time-wise, in the capture,
108 B<Capinfos> detects this.
112 Displays the end time of the capture. B<Capinfos> considers
113 the latest timestamp seen to be the end time, so the
114 last packet in the capture is not necessarily the latest -
115 if packets exist "out-of-order", time-wise, in the capture,
116 B<Capinfos> detects this.
120 Displays the average data rate, in bytes/sec
124 Displays the average data rate, in bits/sec
128 Displays the average packet size, in bytes
132 Displays the average packet rate, in packets/sec
136 Displays the SHA1, RIPEMD160, and MD5 hashes for the file.
140 Generate long report. Capinfos can generate two
141 different styles of reports. The "long" report is
142 the default style of output and is suitable for a
147 Generate a table report. A table report is a text file
148 that is suitable for importing into a spreadsheet or
149 database. Capinfos can build a tab delimited text file
150 (the default) or several variations on Comma-separated
155 Generate header record. This option is only useful
156 when generating a table style report (-T). A header
157 is generated by default. A header record (if generated)
158 is the first line of data reported and includes labels
159 for all the columns included within the table report.
163 Do not generate header record. This option is only
164 useful when generating a table style report (-T).
165 If this option is specified then B<no> header record will be
166 generated within the table report.
170 Separate the infos with ASCII TAB characters.
171 This option is only useful when generating a table
172 style report (-T). The various info values will be
173 separated (delimited) from one another with a single
174 ASCII TAB character. The TAB character is the default
175 delimiter when -T style report is enabled.
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.
186 Separate infos with ASCII SPACE (0x20) characters.
187 This option is only useful when generating a table
188 style report (-T). The various info values will be
189 separated (delimited) from one another with a single
190 ASCII SPACE character.
192 NOTE: Since some of the header labels as well as some
193 of the value fields contain SPACE characters. This
194 option is of limited value unless one of the quoting
195 options (-q or -Q) is also specified.
199 Do not quote the infos. This option is only useful
200 when generating a table style report (-T). Excluding
201 any quoting characters around the various values and
202 using a TAB delimiter produces a very "clean" table
203 report that is easily parsed with CLI tools. By
204 default infos are B<NOT> quoted.
208 Quote infos with single quotes ('). This option is
209 only useful when generating a table style report (-T).
210 When this option is enabled, each value will be
211 encapsulated within a pair of single quote (')
212 characters. This option (when used with the -m
213 option) is useful for generating one type of CSV
218 Quote infos with double quotes ("). This option is
219 only useful when generating a table style report (-T).
220 When this option is enabled, each value will be
221 encapsulated within a pair of double quote (")
222 characters. This option (when used with the -m
223 option) is useful for generating the most common
224 type of CSV style file report.
228 Prints the help listing and exits.
232 Cancel processing any additional files if and
233 when capinfos should fail to open an input file.
234 By default capinfos will attempt to open each and
235 every file name argument.
237 Note: An error message will be written to stderr
238 whenever capinfos fails to open a file regardless
239 of whether the -C option is specified or not.
243 Generate all infos. By default capinfos will display
244 all infos values for each input file, but enabling
245 any of the individual display infos options will
246 disable the generate all option.
252 To see a description of the capinfos options use:
256 To generate a long form report for the capture file
259 capinfos mycapture.pcap
261 To generate a TAB delimited table form report for the capture
262 file mycapture.pcap use:
264 capinfos -T mycapture.pcap
266 To generate a CSV style table form report for the capture
267 file mycapture.pcap use:
269 capinfos -T -m -Q mycapture.pcap
273 capinfos -TmQ mycapture.pcap
276 To generate a TAB delimited table style report with just the
277 filenames, capture type, capture encapsulation type and packet
278 count for all the pcap files in the current directory use:
280 capinfos -T -t -E -c *.pcap
284 capinfos -TtEs *.pcap
286 Note: The ability to use of filename globbing characters are
287 a feature of *nix style command shells.
289 To generate a CSV delimited table style report of all infos
290 for all pcap files in the current directory and write it to
291 a text file called mycaptures.csv use:
293 capinfos -TmQ *.pcap >mycaptures.csv
295 The resulting mycaptures.csv file can be easily imported
296 into spreadsheet applications.
300 tcpdump(8), pcap(3), wireshark(1), mergecap(1), editcap(1), tshark(1),
305 B<Capinfos> is part of the B<Wireshark> distribution. The latest version
306 of B<Wireshark> can be found at L<http://www.wireshark.org>.
308 HTML versions of the Wireshark project man pages are available at:
309 L<http://www.wireshark.org/docs/man-pages>.
315 Ian Schorr <ian[AT]ianschorr.com>
320 Gerald Combs <gerald[AT]wireshark.org>
321 Jim Young <jyoung[AT]gsu.edu>