'\" t .\" Title: capinfos .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-02-04 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "CAPINFOS" "1" "2024-02-04" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" capinfos \- Prints information about capture files .SH "SYNOPSIS" .sp \fBcapinfos\fP [\~\fB\-a\fP\~] [\~\fB\-A\fP\~] [\~\fB\-b\fP\~] [\~\fB\-B\fP\~] [\~\fB\-c\fP\~] [\~\fB\-C\fP\~] [\~\fB\-d\fP\~] [\~\fB\-D\fP\~] [\~\fB\-e\fP\~] [\~\fB\-E\fP\~] [\~\fB\-F\fP\~] [\~\fB\-h\fP\~] [\~\fB\-H\fP\~] [\~\fB\-i\fP\~] [\~\fB\-I\fP\~] [\~\fB\-k\fP\~] [\~\fB\-K\fP\~] [\~\fB\-l\fP\~] [\~\fB\-L\fP\~] [\~\fB\-m\fP\~] [\~\fB\-M\fP\~] [\~\fB\-n\fP\~] [\~\fB\-N\fP\~] [\~\fB\-o\fP\~] [\~\fB\-p\fP\~] [\~\fB\-P\fP\~] [\~\fB\-q\fP\~] [\~\fB\-Q\fP\~] [\~\fB\-r\fP\~] [\~\fB\-R\fP\~] [\~\fB\-s\fP\~] [\~\fB\-S\fP\~] [\~\fB\-t\fP\~] [\~\fB\-T\fP\~] [\~\fB\-u\fP\~] [\~\fB\-v\fP\~] [\~\fB\-x\fP\~] [\~\fB\-y\fP\~] [\~\fB\-z\fP\~] <\fIinfile\fP> \fI...\fP .sp \fBcapinfos\fP \fB\-h|\-\-help\fP .sp \fBcapinfos\fP \fB\-v|\-\-version\fP .SH "DESCRIPTION" .sp \fBCapinfos\fP is a program that reads one or more capture files and returns some or all available statistics (infos) of each <\fIinfile\fP> in one of two types of output formats: long or table. .sp The long output is suitable for a human to read. The table output is useful for generating a report that can be easily imported into a spreadsheet or database. .sp The user specifies what type of output (long or table) and which statistics to display by specifying flags (options) that corresponding to the report type and desired infos. If no options are specified, \fBCapinfos\fP will report all statistics available in "long" format. .sp Options are processed from left to right order with later options superseding or adding to earlier options. .sp \fBCapinfos\fP is able to detect and read the same capture files that are supported by \fBWireshark\fP. The input files don\(cqt need a specific filename extension; the file format and an optional gzip, zstd or lz4 compression will be automatically detected. Near the beginning of the DESCRIPTION section of wireshark(1) or \c .URL "https://www.wireshark.org/docs/man\-pages/wireshark.html" "" is a detailed description of the way \fBWireshark\fP handles this, which is the same way \fBCapinfos\fP handles this. .SH "OPTIONS" .sp \-a .RS 4 Displays the start time of the capture. \fBCapinfos\fP considers the earliest timestamp seen to be the start time, so the first packet in the capture is not necessarily the earliest \- if packets exist "out\-of\-order", time\-wise, in the capture, \fBCapinfos\fP detects this. .RE .sp \-A .RS 4 Generate all infos. By default \fBCapinfos\fP will display all infos values for each input file, but enabling any of the individual display infos options will disable the generate all option. .RE .sp \-b .RS 4 .sp Separate infos with ASCII SPACE (0x20) characters. This option is only useful when generating a table style report (\-T). The various info values will be separated (delimited) from one another with a single ASCII SPACE character. .if n .sp .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 .B Note .ps -1 .br .sp Since some of the header labels as well as some of the value fields contain SPACE characters. This option is of limited value unless one of the quoting options (\-q or \-Q) is also specified. .sp .5v .RE .RE .sp \-B .RS 4 Separate the infos with ASCII TAB characters. This option is only useful when generating a table style report (\-T). The various info values will be separated (delimited) from one another with a single ASCII TAB character. The TAB character is the default delimiter when \-T style report is enabled. .RE .sp \-c .RS 4 Displays the number of packets in the capture file. .RE .sp \-C .RS 4 .sp Cancel processing any additional files if and when \fBCapinfos\fP fails to open an input file or gets an error reading an input file. By default \fBCapinfos\fP will continue processing files even if it gets an error opening or reading a file. .sp Note: An error message will be written to stderr whenever \fBCapinfos\fP fails to open a file or gets an error reading from a file regardless whether the \-C option is specified or not. Upon exit, \fBCapinfos\fP will return an error status if any errors occurred during processing. .RE .sp \-d .RS 4 Displays the total length of all packets in the file, in bytes. This counts the size of the packets as they appeared in their original form, not as they appear in this file. For example, if a packet was originally 1514 bytes and only 256 of those bytes were saved to the capture file (if packets were captured with a snaplen or other slicing option), \fBCapinfos\fP will consider the packet to have been 1514 bytes. .RE .sp \-D .RS 4 Displays a count of the number of decryption secrets in the file. This information is not available in table format. .RE .sp \-e .RS 4 Displays the end time of the capture. \fBCapinfos\fP considers the latest timestamp seen to be the end time, so the last packet in the capture is not necessarily the latest \- if packets exist "out\-of\-order", time\-wise, in the capture, \fBCapinfos\fP detects this. .RE .sp \-E .RS 4 Displays the per\-file encapsulation of the capture file. .RE .sp \-F .RS 4 Displays additional capture file information. .RE .sp \-h|\-\-help .RS 4 Print the version number and options and exit. .RE .sp \-H .RS 4 Displays the SHA256 and SHA1 hashes for the file. SHA1 output may be removed in the future. .RE .sp \-i .RS 4 Displays the average data rate, in bits/sec .RE .sp \-I .RS 4 Displays detailed capture file interface information. This information is not available in table format. .RE .sp \-k .RS 4 Displays the capture comment. For pcapng files, this is the comment from the section header block. .RE .sp \-K .RS 4 Use this option to suppress printing capture comments. By default capture comments are enabled. Capture comments are relatively freeform and might contain embedded new\-line characters and/or other delimiting characters making it harder for a human or machine to easily parse the \fBCapinfos\fP output. Excluding capture comments can aid in post\-processing of output. .RE .sp \-l .RS 4 Display the snaplen (if any) for a file. snaplen (if available) is determined from the capture file header and by looking for truncated records in the capture file. .RE .sp \-L .RS 4 Generate long report. \fBCapinfos\fP can generate two different styles of reports. The "long" report is the default style of output and is suitable for a human to use. .RE .sp \-m .RS 4 Separate the infos with comma (,) characters. This option is only useful when generating a table style report (\-T). The various info values will be separated (delimited) from one another with a single comma "," character. .RE .sp \-M .RS 4 Print raw (machine readable) values in long reports. By default \fBCapinfos\fP prints numeric values with human\-readable SI suffixes, and shows human\-readable file type and encapsulation. Table reports (\-T) always print raw values. .RE .sp \-n .RS 4 Displays a count of the number of resolved IPv4 addresses and a count of the number of resolved IPv6 addresses in the file. This information is not available in table format. .RE .sp \-N .RS 4 Do not quote the infos. This option is only useful when generating a table style report (\-T). Excluding any quoting characters around the various values and using a TAB delimiter produces a very "clean" table report that is easily parsed with CLI tools. By default infos are \fBNOT\fP quoted. .RE .sp \-o .RS 4 Displays "True" if packets exist in strict chronological order or "False" if one or more packets in the capture exists "out\-of\-order" time\-wise. .RE .sp \-p .RS 4 Display individual packet comments. It is recommended to print raw values (\-M) when using this option as packet comments may include newlines and other special characters. .RE .sp \-P .RS 4 Disable displaying individual packet comments. .RE .sp \-q .RS 4 Quote infos with single quotes (\*(Aq). This option is only useful when generating a table style report (\-T). When this option is enabled, each value will be encapsulated within a pair of single quote (\*(Aq) characters. This option (when used with the \-m option) is useful for generating one type of CSV style file report. .RE .sp \-Q .RS 4 Quote infos with double quotes ("). This option is only useful when generating a table style report (\-T). When this option is enabled, each value will be encapsulated within a pair of double quote (") characters. This option (when used with the \-m option) is useful for generating the most common type of CSV style file report. .RE .sp \-r .RS 4 Do not generate header record. This option is only useful when generating a table style report (\-T). If this option is specified then \fBno\fP header record will be generated within the table report. .RE .sp \-R .RS 4 Generate header record. This option is only useful when generating a table style report (\-T). A header is generated by default. A header record (if generated) is the first line of data reported and includes labels for all the columns included within the table report. .RE .sp \-s .RS 4 Displays the size of the file, in bytes. This reports the size of the capture file itself. .RE .sp \-S .RS 4 Display the start and end times as seconds since January 1, 1970. Handy for synchronizing dumps using \fBeditcap \-t\fP. .RE .sp \-t .RS 4 Displays the capture type of the capture file. .RE .sp \-T .RS 4 Generate a table report. A table report is a text file that is suitable for importing into a spreadsheet or database. \fBCapinfos\fP can build a tab delimited text file (the default) or several variations on Comma\-separated values (CSV) files. .RE .sp \-u .RS 4 Displays the capture duration, in seconds. This is the difference in time between the earliest packet seen and latest packet seen. .RE .sp \-v|\-\-version .RS 4 Print the full version information and exit. .RE .sp \-x .RS 4 Displays the average packet rate, in packets/sec .RE .sp \-y .RS 4 Displays the average data rate, in bytes/sec .RE .sp \-z .RS 4 Displays the average packet size, in bytes .RE .SH "DIAGNOSTIC OPTIONS" .sp \-\-log\-level .RS 4 Set the active log level. Supported levels in lowest to highest order are "noisy", "debug", "info", "message", "warning", "critical", and "error". Messages at each level and higher will be printed, for example "warning" prints "warning", "critical", and "error" messages and "noisy" prints all messages. Levels are case insensitive. .RE .sp \-\-log\-fatal .RS 4 Abort the program if any messages are logged at the specified level or higher. For example, "warning" aborts on any "warning", "critical", or "error" messages. .RE .sp \-\-log\-domains .RS 4 Only print messages for the specified log domains, e.g. "GUI,Epan,sshdump". List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-debug .RS 4 Force the specified domains to log at the "debug" level. List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-noisy .RS 4 Force the specified domains to log at the "noisy" level. List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-fatal\-domains .RS 4 Abort the program if any messages are logged for the specified log domains. List of domains must be comma\-separated. .RE .sp \-\-log\-file .RS 4 Write log messages and stderr output to the specified file. .RE .SH "EXAMPLES" .sp To see a description of the options use: .sp .if n .RS 4 .nf .fam C capinfos \-h .fam .fi .if n .RE .sp To generate a long form report for the capture file mycapture.pcap use: .sp .if n .RS 4 .nf .fam C capinfos mycapture.pcap .fam .fi .if n .RE .sp To generate a TAB delimited table form report for the capture file mycapture.pcap use: .sp .if n .RS 4 .nf .fam C capinfos \-T mycapture.pcap .fam .fi .if n .RE .sp To generate a CSV style table form report for the capture file mycapture.pcap use: .sp .if n .RS 4 .nf .fam C capinfos \-T \-m \-Q mycapture.pcap .fam .fi .if n .RE .sp or .sp .if n .RS 4 .nf .fam C capinfos \-TmQ mycapture.pcap .fam .fi .if n .RE .sp To generate a TAB delimited table style report with just the filenames, capture type, capture encapsulation type and packet count for all the pcap files in the current directory use: .sp .if n .RS 4 .nf .fam C capinfos \-T \-t \-E \-c *.pcap .fam .fi .if n .RE .sp or .sp .if n .RS 4 .nf .fam C capinfos \-TtEc *.pcap .fam .fi .if n .RE .sp Note: The ability to use of filename globbing characters are a feature of *nix style command shells. .sp To generate a CSV delimited table style report of all infos for all pcap files in the current directory and write it to a text file called mycaptures.csv use: .sp .if n .RS 4 .nf .fam C capinfos \-TmQ *.pcap >mycaptures.csv .fam .fi .if n .RE .sp The resulting mycaptures.csv file can be easily imported into spreadsheet applications. .SH "SEE ALSO" .sp pcap(3), wireshark(1), mergecap(1), editcap(1), tshark(1), dumpcap(1), captype(1), pcap\-filter(7) or tcpdump(8) .SH "NOTES" .sp This is the manual page for \fBCapinfos\fP 4.2.2. \fBCapinfos\fP is part of the \fBWireshark\fP distribution. The latest version of \fBWireshark\fP can be found at \c .URL "https://www.wireshark.org" "" "." .sp HTML versions of the Wireshark project man pages are available at .URL "https://www.wireshark.org/docs/man\-pages" "" "." .SH "AUTHORS" .sp .B Original Author .br Ian Schorr .sp .B Contributors .br Gerald Combs .br Jim Young