4 capinfos - Prints information about capture files
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.
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.
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.
56 Options are processed from left to right order with later options
57 superseding or adding to earlier options.
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.
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.
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.
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.
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.
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.
111 Displays the number of packets in the capture file.
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.
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.
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.
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.
144 Displays the per-file encapsulation of the capture file.
148 Prints the help listing and exits.
152 Displays the SHA1, RIPEMD160, and MD5 hashes for the file.
156 Displays the average data rate, in bits/sec
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.
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.
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
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 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.
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
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.
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.
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.
230 Displays the size of the file, in bytes. This reports
231 the size of the capture file itself.
235 Display the start and end times as seconds since January
236 1, 1970. Handy for synchronizing dumps using B<editcap -t>.
240 Displays the capture type of the capture file.
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
252 Displays the capture duration, in seconds. This is the
253 difference in time between the earliest packet seen and
258 Displays the average packet rate, in packets/sec
262 Displays the average data rate, in bytes/sec
266 Displays the average packet size, in bytes
272 To see a description of the capinfos options use:
276 To generate a long form report for the capture file
279 capinfos mycapture.pcap
281 To generate a TAB delimited table form report for the capture
282 file mycapture.pcap use:
284 capinfos -T mycapture.pcap
286 To generate a CSV style table form report for the capture
287 file mycapture.pcap use:
289 capinfos -T -m -Q mycapture.pcap
293 capinfos -TmQ mycapture.pcap
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:
300 capinfos -T -t -E -c *.pcap
304 capinfos -TtEs *.pcap
306 Note: The ability to use of filename globbing characters are
307 a feature of *nix style command shells.
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:
313 capinfos -TmQ *.pcap >mycaptures.csv
315 The resulting mycaptures.csv file can be easily imported
316 into spreadsheet applications.
320 tcpdump(8), pcap(3), wireshark(1), mergecap(1), editcap(1), tshark(1),
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>.
328 HTML versions of the Wireshark project man pages are available at:
329 L<http://www.wireshark.org/docs/man-pages>.
335 Ian Schorr <ian[AT]ianschorr.com>
340 Gerald Combs <gerald[AT]wireshark.org>
341 Jim Young <jyoung[AT]gsu.edu>