The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / capinfos.c @ master

History | View | Annotate | Download (44 KB)

# Date Author Comment
cda5c166 08/24/2014 04:57 AM Guy Harris

Clean up capinfos output.

Make sure there's always a space between a number and "[TGMK]bytes",
"[TGMK]bits", and "[TGMK]packets".

Change-Id: I710385303e451e9aea6fc9bbea562f59ca0d22c9
Reviewed-on: https://code.wireshark.org/review/3810
Reviewed-by: Guy Harris <>

97546165 08/24/2014 04:04 AM Graham Bloice

Modify includes of config.h so that out-of-tree builds, i.e. CMake
don't pick up the in-tree copy.

Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71
Reviewed-on: https://code.wireshark.org/review/3798
Petri-Dish: Graham Bloice <>...

f3dd7fe1 08/05/2014 04:42 PM Bill Meier

Fix whitespace/indentation to match editor modelines.

Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <>

b4ce3525 07/03/2014 04:46 AM Guy Harris

Make --help and --version information a bit more uniform.

Have --version print the version number, the copyright information, the
"compiled with" information, the "running on/with" information, and the
compiler information.

Have --help print the version number, a one-line summary of what the...

8afe3313 07/03/2014 12:51 AM Guy Harris

More getopt_long, to add --help and --version support.

Change-Id: I946067b972a70154f02ab561bc0fd029a7a5abc4
Reviewed-on: https://code.wireshark.org/review/2791
Reviewed-by: Guy Harris <>

60ffafdb 06/29/2014 01:50 PM Bill Meier

Fix compile error when building w/o GNUTLS

Specifically: &lt;wsutil/file_util.h&gt; is aleays needed (for create_app_running_mutex())

Change-Id: I78e5a767f62bc2af67b6407539742dc245259f56
Reviewed-on: https://code.wireshark.org/review/2699
Reviewed-by: Bill Meier <>

3773a756 06/20/2014 09:05 PM Jeff Morriss

Add command-line argument to request the version to a number of the utilities.

In some cases "-v" was already used so "-V" is the option.
Note that the version information in these utilities is much shorter than what
is presented by the big programs.

As requested by https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5804...

6db77b00 05/24/2014 02:31 PM Guy Harris

Allow wtap_read() and wtap_seek_read() to return records other than packets.

Add a "record type" field to "struct wtap_pkthdr"; currently, it can be
REC_TYPE_PACKET, for a record containing a packet, or
REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific...

a344c973 05/23/2014 06:50 AM Guy Harris

Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."

This reverts commit c0c480d08c175eed4524ea9e73ec86298f468cf4.

A better way to do this is to have the record type be part of struct wtap_pkthdr; that keeps the metadata for the record together and requires fewer API changes. That is in-progress....

c0c480d0 05/22/2014 11:02 PM Guy Harris

Allow wtap_read() and wtap_seek_read() to return non-packet records.

This is the first step towards implementing the mechanisms requestd in
bug 8590; currently, we don't return any records other than packet
records from libwiretap, and just ignore non-packet records in the rest...

a1b1c8be 05/09/2014 01:21 AM Guy Harris

Revert "Refactor Wiretap"

This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a.

This isn't building, and looks as if it requires significant work to fix.

Change-Id: I622b1bb243e353e874883a302ab419532b7601f2
Reviewed-on: https://code.wireshark.org/review/1568...

1abeb277 05/08/2014 11:04 PM Michael Mann

Refactor Wiretap

Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality....

29659139 03/04/2014 09:27 AM Alexis La Goutte

Remove all $Id$ from top of file

(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <>

579e7e19 02/25/2014 12:43 PM Michal Labedzki

Wireshark: Add option to choose format type of capture file

The best heuristic can fail, so add possibility to manually choose
capture file format type, so not correctly recognize file format can be
loaded in Wireshark.

On the other side now it is possible to open capture file...

f9669809 02/07/2014 06:03 PM Gerald Combs

Replace "svn" with "git" all over the place.

Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate.
Rename "svnversion.h" to "version.h" as Evan suggested. Update some
URLs. In make-version.pl, make sure we don't set an improper upstream
branch name. Use the number of commits + short hash from `git describe`...

c6022b3b 01/26/2014 07:56 AM Alexis La Goutte

Drop support of Visual Studio 2005

  • Remove _MSC_VER < 1500 check
  • Cleanup config.nmake

See http://www.wireshark.org/lists/wireshark-dev/201305/msg00159.html

svn path=/trunk/; revision=54965

8ef3e2fa 01/02/2014 10:41 AM Bill Meier

For getopt() arg processing:
- Use exit(0) for -h option as per convention;

For g_option...() arg processing (when USE_GOPTION is set):
- Fix bug: 'capinfos x' doesn't print any info about x;
(bug introduced in SVN #48481);
- Use stderr for error messages related to cmd-line arg parsing;...

0cc1545d 12/02/2013 03:30 AM Guy Harris

Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins. Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types....

db25270d 11/16/2013 09:55 PM Guy Harris

Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377

ef30aee8 11/09/2013 06:03 AM Jakub Zawadzki

nstime_to_sec() and capinfos secs_nsecs() seems to be same.

svn path=/trunk/; revision=53185

38edae1c 11/09/2013 05:38 AM Jakub Zawadzki

Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.

After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy.

svn path=/trunk/; revision=53184

853da2eb 11/08/2013 04:53 AM Guy Harris

The "file types" we have are actually combinations of types and
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2
are separate "file types", even though they both come from Network
Monitor.

Rename various functions, #defines, and variables appropriately....

ab78bb54 10/22/2013 10:52 AM Michael Mann

Print informations even on short reads. Bug 9310 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9310)

Before this patch, an error message would be printed when the file
appears to be truncated. After this patch, a warning will be printed,
but the information is still displayed. In both cases, capinfos exits...

a4595812 07/29/2013 11:43 AM Chris Maynard

Trivial: Fix typo.

svn path=/trunk/; revision=51011

54bb2e7a 07/14/2013 10:48 PM Jeff Morriss

Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark).

svn path=/trunk/; revision=50598

07a024dc 04/13/2013 02:15 PM Martin Kaiser

disable printing of all infos when USE_GOPTION is set and
a command line option for a specific info was set

(in other words: make the behaviour of goption and getopt the same)

svn path=/trunk/; revision=48841

1daadad4 04/13/2013 02:08 PM Martin Kaiser

TABs -> spaces
add editor modelines
reformat some parts

svn path=/trunk/; revision=48840

412fcff0 04/13/2013 01:55 PM Martin Kaiser

add a cast to make capinfos compile when USE_GOPTION is defined

svn path=/trunk/; revision=48839

9e4ad1f0 04/13/2013 01:48 PM Martin Kaiser

capinfos -k displays the capture comment (from the shb)

svn path=/trunk/; revision=48837

29ceca1b 03/07/2013 12:20 PM Gerald Combs

From Balint:

[PATCH 1/2] Revert "Try to fix the "LNK4217: locally defined symbol"
warnings.

This reverts commit r48158.

[PATCH 2/2] Employ small hack in editcap to link with a few objects from
libwireshark properly

From me:

Add the ability to reset symbol exports via ws_symbol_export.h's include...

b204e38a 03/05/2013 05:15 PM Anders Broman

Use explicit casts.

svn path=/trunk/; revision=48108

2f47e63a 02/27/2013 11:44 PM Gerald Combs

str_util.c: Although the glib documentation doesn't explicitly say so,
it looks like the thousands grouping (') modifier is supported so use it
in format_size.

capinfos.c: Set our locale.

svn path=/trunk/; revision=47934

ccc78e6b 02/26/2013 02:14 AM Gerald Combs

Try to fix compilation on Windows.

svn path=/trunk/; revision=47901

06453965 02/26/2013 01:40 AM Gerald Combs

Print human-readable statistics by default. Raw values can be printed
using "-M". Based on a suggestion by Hansang Bae.

svn path=/trunk/; revision=47900

38a73a32 02/21/2013 01:23 PM Martin Kaiser

include the wsutil/wsgcrypt.h instead of including gcrypt.h directly

svn path=/trunk/; revision=47802

bd4cffae 02/19/2013 08:19 PM Gerald Combs

When any of our executables start on Windows create or open a "Wireshark
is running" mutex. Have the NSIS installer check for this mutex and ask
the user to close Wireshark if it's found. While not perfect this makes
the WinSparkle update process much less annoying....

deb4f08c 01/04/2013 09:56 AM Pascal Quantin

Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :
Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later

svn path=/trunk/; revision=46930

3551a86c 09/19/2012 09:29 PM Jeff Morriss

We always HAVE_CONFIG_H so don't bother checking whether we have it or not.

svn path=/trunk/; revision=45015

713dbd01 07/23/2012 03:18 PM Anders Broman

Remove #define USE_GOPTION = 1, the code is incomplete

svn path=/trunk/; revision=43945

c19583b7 07/06/2012 12:48 AM Anders Broman

From Michael Mann:
Generic preferences implementation - Printing and Name Resolution.

svn path=/trunk/; revision=43579

bf81b42e 06/28/2012 06:56 PM Jakub Zawadzki

Update Free Software Foundation address.

(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536

cf6d9841 05/24/2012 01:05 AM Guy Harris

Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that.

When doing "Save" on a compressed file, write it out compressed.

In the Statistics -> Summary dialog and in capinfos, report whether the
file is gzip-compressed....

08d7ff26 02/26/2012 12:51 AM Guy Harris

Don't show time stamp-based information if we don't have it (now that we
know whether packets - or "packets" - have time stamps).

Show the time stamp order as "Unknown" if we don't have enough
information to determine whether it's certainly in order or out of order...

d94bd07f 12/13/2011 04:53 AM Guy Harris

Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports any
form of corruption/bogosity in a file, including in a file header as
well as in records in the file. Change the error message
wtap_strerror() returns for it to reflect that.

Use it for some file header problems for which it wasn't already being...

741432d4 11/15/2011 10:13 PM Guy Harris

Handle ctime() and localtime() returning NULL and localtime() on Windows
blowing up when handed a bad value.

svn path=/trunk/; revision=39878

bf95c7b5 08/09/2011 05:02 PM Jeff Morriss

Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :

getopt() can/should normally be found in unistd.h, so:

- When testing for getopt(), define that we HAVE_GETOPT instead of
HAVE_GETOPT_H (to avoid confusion).
- Don't attempt to include getopt.h: not all OS's have it (for example,...

0623a49e 06/28/2011 11:18 AM Stig Bjørlykke

From Jose Pedro Oliveira via bug 5803:
#ifdef HAVE_LIBGCRYPT block includes a line too many.
"Fixes 2nd instance of the problem"

svn path=/trunk/; revision=37816

8443bbbf 06/28/2011 05:00 AM Stig Bjørlykke

Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.

This fixes bug 5715.

svn path=/trunk/; revision=37812

a24687ce 05/23/2011 08:07 PM Gerald Combs

Move the Windows argument list conversion code to a common routine.

svn path=/trunk/; revision=37372

32749c0f 05/11/2011 04:39 PM Gerald Combs

Use a comparison instead of an assignment. Fixes Coverity CID 1194.

svn path=/trunk/; revision=37066

61bc175a 05/01/2011 10:06 PM Bill Meier

For "per packet" file encapsulation, display a list of the encapsulations seen ("long form" report).

Example:
File type: Microsoft NetMon 2.x
File encapsulation: Per packet
IEEE 802.11 plus Network Monitor radio header...

6cbf6ce1 04/21/2011 05:41 AM Guy Harris

Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code. Have it also supply a err_info string, and
report it. Have file_error() supply an err_info string.

Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to...

f9fa7e8d 04/12/2011 01:52 PM Chris Maynard

Use g_snprintf instead of sprintf: Coverity 622.
Use g_strlcpy instead of strcpy: Coverity 632.

svn path=/trunk/; revision=36595

9121c185 04/05/2011 09:41 PM Bill Meier

IMHO capinfos, when finished processing, should exit with an error status
if an error occurred while processing.
E.G.,: For the default (no -C option):
'capinfos invalid.xxx' or 'capinfos a.pcap invalid.xxx c.pcap'
should exit with an error status
(after processing all the input args) if there is an error for invalid.xxx....

8735a8d6 04/05/2011 01:50 AM Anders Broman

From Jose Pedro Oliveira:
#ifdef HAVE_LIBGCRYPT block includes a line too many.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5803

svn path=/trunk/; revision=36470

6d01681d 01/16/2011 05:10 PM Bill Meier

Fix Windows comiler warning: remove unused 'wsadata' variable.

svn path=/trunk/; revision=35560

3bc1fc38 01/06/2011 06:28 PM Gerald Combs

On Windows, convert all of our command-line arguments from UTF-16 to
UTF-8 where we don't already do so. In Wireshark use g_utf16_to_utf8
instead of utf_16to8. This should fix bug 5520.

svn path=/trunk/; revision=35411

a87bdf96 09/16/2010 03:20 PM Gerald Combs

Turn on ASLR via /DYNAMICBASE and DEP via SetProcessDEPPolicy().

svn path=/trunk/; revision=34137

f194916d 06/01/2010 08:24 PM Gerald Combs

From Jim Young via bug 4049:

This patch adds a new '-o' option to capinfos (enabled by default) to report if
the packets within a particular capture file are in strict chronological time
order or not.

svn path=/trunk/; revision=33041

47e2d758 05/28/2010 04:19 PM Jeff Morriss

Move some code (including the optional objects) into libwsutil

svn path=/trunk/; revision=33012

6e802e4e 05/03/2010 03:42 PM Jeff Morriss

Remove extra % in printf format string.

svn path=/trunk/; revision=32651

7cec9855 05/03/2010 03:08 PM Bill Meier

Add "inferred" snapshot length (if any) to the output.
A snapshot length is inferred if there are records
in a capture file with "capture length" less than
"packet length".

svn path=/trunk/; revision=32649

7364f9d9 04/29/2010 02:29 AM Stephen Fisher

Add snaplen to capinfos output. Idea from Chris Maynard on -dev.

svn path=/trunk/; revision=32594

9e2dc2cd 03/01/2010 07:11 PM Guy Harris

Squelch some compiler warnings.

svn path=/trunk/; revision=32077

e81b0d3f 02/20/2010 12:44 PM Bill Meier

Fix a gcc -Wshadow warning

svn path=/trunk/; revision=31934

23a90258 02/17/2010 03:15 PM Gerald Combs

Add an option to capinfos to print start and end times as seconds, which
makes time-shifting using editcap easier. Sort the flags in the capinfos
man page alphabetically to match the other man pages. Add a
time-shifting example to the mergecap man page.

svn path=/trunk/; revision=31905

81771c67 01/23/2010 07:29 AM Jaap Keuter

Avoid crash on invalid file name.

svn path=/trunk/; revision=31632

c14b9851 12/29/2009 11:11 AM Bill Meier

From Jim Young: Include svnversion.h in capinfos and text2pcap

This patch adds a #include "svnversion.h" statement to the capinfos.c and
text2pcap.c files so that their usage() functions will display the SVNVERSION
and SVNPATH infos (if defined).

See Bug #4360 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4360)...

8fc1491a 12/21/2009 04:06 PM Gerald Combs

Switch to using a bundled version of the openSUSE Build Service packages
for GNUTLS since they provide 32-bit and 64-bit Windows packages. We no
longer have winposixtype.h, so remove its #includes and add a ssize_t
typedef to config.h.win32.

svn path=/trunk/; revision=31341

184ca96a 12/17/2009 07:09 AM Stig Bjørlykke

Initialize hd pointer to avoid a compiler warning.

svn path=/trunk/; revision=31290

6db27eb8 12/08/2009 02:04 AM Stephen Fisher

From Jim Young via bug #4304: Patch to capinfos -H feature to generate
expected column header names

svn path=/trunk/; revision=31194

a6bae6e3 12/07/2009 08:49 PM Guy Harris

winposixtype.h appears to be Windows-only.

svn path=/trunk/; revision=31193

e5be6520 12/07/2009 07:13 PM Gerald Combs

Fix compilation under Windows. Allocate our hash buffer dynamically so
that _chkstk doesn't throw a hissy fit. When hashing, open the file in
binary mode.

svn path=/trunk/; revision=31192

7c276bec 12/07/2009 06:18 PM Gerald Combs

Add SHA1, RMD160, and MD5 hashes to capinfos.

svn path=/trunk/; revision=31191

25470e56 11/13/2009 04:43 PM Jaap Keuter

From Jim Young:
The ability to continue processing additional files if and when
wtap_open_offline() should fail. A new -C option reverts to capinfos'
original behavior which is to cancel any further file processing at
first file open failure.

Change the behavior of how the default display of all infos is initiated....

2ac6a245 10/19/2009 10:44 AM Stig Bjørlykke

Removed redundant redeclaration of optind.

svn path=/trunk/; revision=30619

98024a00 10/06/2009 12:01 PM Stig Bjørlykke

Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_H
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision.

svn path=/trunk/; revision=30370

1e93d53b 07/22/2009 07:59 PM Gerald Combs

Use "svn info" to fetch the version by default. Fetch the repository path as
well. Add the repository path to the version strings.

svn path=/trunk/; revision=29171

fa920e48 05/12/2009 12:06 PM Bill Meier

Minor cleanup of "-h" output text.

svn path=/trunk/; revision=28334

4853b28f 05/11/2009 10:00 AM Bill Meier

capinfos: Print "n/a" for rates and duration if only one packet in capture.\;
line up capinfos output.

svn path=/trunk/; revision=28328

c73ab7df 03/22/2009 02:53 AM Guy Harris

Change the signature of init_progfile_dir() so the casting of the
function pointer (to main) to an argument to dladdr() is done in
init_progfile_dir() rather than its callers.

svn path=/trunk/; revision=27814

6f059e8c 03/22/2009 02:38 AM Guy Harris

In Solaris, the second argument to dladdr() is just a void *, not a
const void *.

svn path=/trunk/; revision=27813

7c6e2155 03/21/2009 08:42 PM Guy Harris

Attempt to use dladdr() to get the pathname of the executable image if
it's available and works.

svn path=/trunk/; revision=27812

ace4af44 02/15/2009 04:47 PM Guy Harris

Add a routine to report write errors to the list of failure-reporting
routines handled by epan/report_err.c.

Move copy_binary_file() in file.c to epan/filesystem.c, and rename it to
copy_file_binary_mode() (to clarify that it can copy text files;
arguably, all files are "binary" unless you're on, say, an IBM 1401...

a7b7e98c 12/18/2008 02:24 PM Jeff Morriss

Only declare failure_message() if we HAVE_PLUGINS (since it's only used when that's the case).

svn path=/trunk/; revision=27051

4caea25c 11/13/2008 12:37 PM Guy Harris

Get rid of an unused variable.

svn path=/trunk/; revision=26769

83f9ecf9 06/30/2008 01:16 PM Jeff Morriss

Move privileges.c and unicode-utils.c from epan to wsutil (so things like
capinfos and dumpcap don't need to depend on libwireshark nor directly pull
in those modules). Because capinfos and editcap were only being linked with
privileges.c if we had plugins, this allows those programs to be linked when...

be161ba4 05/29/2008 10:44 PM Guy Harris

Free up the err_info string returned by wtap_read() and
wtap_seek_read().

Clean up indentation.

svn path=/trunk/; revision=25400

16717f3b 04/14/2008 04:02 PM Stig Bjørlykke

From Andrew Feren (bug 2462):
Patch to print packet rate.

From me:
Document -x option in man page.

svn path=/trunk/; revision=25024

b59322ec 03/15/2008 08:58 PM Jeff Morriss

Don't link plugins against libwireshark: any program that loads the dissector
plugins should already be linked against libwireshark.

Don't link capinfos and editcap against libwireshark: they only needed to be
because the plugins were linked against libwireshark (see rev 24123 and the...

ddca4dd5 03/15/2008 08:41 PM Jeff Morriss

Include epan/priveleges.h for get_credential_info()

svn path=/trunk/; revision=24649

d951728e 03/15/2008 08:32 PM Jeff Morriss

Have started_with_special_privs() assert out if get_credential_info() was not
previously called. This prevents the function from always returning TRUE in
programs that hadn't called get_credential_info().

Call get_credential_info() in the programs that should have been....

e1d5eaff 12/06/2007 03:33 AM Guy Harris

Use G_GINT64_MODIFIER rather than PRI[duox]64 to print gint64's and
guint64's.

svn path=/trunk/; revision=23782

5f9d1e28 09/28/2007 10:05 PM Guy Harris

Fix typo.

svn path=/trunk/; revision=23027

e07ae47a 09/25/2007 03:52 PM Gerald Combs

Add the file encapsulation.

svn path=/trunk/; revision=22962

d8e818e9 08/07/2007 04:07 PM Luis Ontanon

Make sure that wiretap plugins are loaded before dissectors are (if a new encap type is registered the plugin probably needs it before reg_handoff)

svn path=/trunk/; revision=22461

162382dc 06/17/2007 12:58 AM Luis Ontanon

Have editcap and capinfos compile --without-plugins

Should go in 0.99.6

svn path=/trunk/; revision=22116

11f06217 05/25/2007 01:22 PM Luis Ontanon

Have editcap and capinfos loading the wiretap plugins.

epan/filesystem.c
have get_plugin_dir() calling init_plugin_dir() if necessary

epan/epan.c and epan/report_err.c
move the report_failure family into the new report_err.c file, have epan_init() calling the initializer...

30dd4b8d 01/28/2007 12:33 PM Bill Meier

If no packets in input file then don't calc packets/sec, etc

svn path=/trunk/; revision=20587

59d6c8ea 11/05/2006 05:46 PM Ulf Lamping

change all file offsets from long to gint64 so we can - theoretically - handle files > 2GB correct.

Please distclean Win32 builds!

svn path=/trunk/; revision=19814