Commit Graph

165 Commits

Author SHA1 Message Date
Guy Harris 0885d29451 Make sure err_info is always set, and print it iff it's non-null.
Change-Id: Ib5c600c491a3d8adcfa91c00fa9445283610545b
Reviewed-on: https://code.wireshark.org/review/5830
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 04:04:19 +00:00
Guy Harris 6011a047d3 WTAP_ERR_UNWRITABLE_ errors aren't returned by reads or open-for-reading.
Check for them *only* on opening for writing and writes.

Change-Id: I4b537d511ec04bcfc81f69166a2b9a2ee9310067
Reviewed-on: https://code.wireshark.org/review/5827
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 00:41:43 +00:00
Guy Harris 51522b3372 Handle "I can't map this for that file format" better.
For cases where record (meta)data is something that can't be written out
in a particular file format, return WTAP_ERR_UNWRITABLE_REC_DATA along
with an err_info string.

Report (and free) that err_info string in cases where
WTAP_ERR_UNWRITABLE_REC_DATA is returned.

Clean up some other error reporting cases, and flag with an XXX some
cases where we aren't reporting errors at all, while we're at it.

Change-Id: I91d02093af0d42c24ec4634c2c773b30f3d39ab3
Reviewed-on: https://code.wireshark.org/review/5823
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-18 00:03:26 +00:00
Guy Harris dbdcae80ba Rename WTAP_ERR_UNSUPPORTED_ENCAP to WTAP_ERR_UNWRITABLE_ENCAP.
That makes it clearer what the problem is, and that it should only be
returned by the dump code path, not by the read code path.

Change-Id: Icc5c9cff43be6c073f0467607555fa7138c5d074
Reviewed-on: https://code.wireshark.org/review/5797
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-17 06:41:45 +00:00
Guy Harris b56d4d0187 Clean up the "unknown per-packet encapsulation" message.
Report the file name, report the frame number as unsigned (which it is),
and make it look more like other error messages.

Change-Id: Ia5281da1c94d55c745da8a8b20dafdb74dd13f92
Reviewed-on: https://code.wireshark.org/review/5793
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-17 06:08:31 +00:00
Guy Harris be7f053984 Report (and free) err_info for WTAP_ERR_DECOMPRESS.
Change-Id: I61ecc58be4b0688c43df0b0f006fb899bdc1721c
Reviewed-on: https://code.wireshark.org/review/4216
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-20 20:19:36 +00:00
Guy Harris cda5c16667 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 <guy@alum.mit.edu>
2014-08-24 08:57:13 +00:00
Graham Bloice 97546165fa 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 <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-24 08:04:08 +00:00
Bill Meier f3dd7fe1eb Fix whitespace/indentation to match editor modelines.
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 20:42:21 +00:00
Guy Harris b4ce352539 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
program does, a reference to http://www.wireshark.org for more
information, a Usage: line, and a list of command-line options.

This means programs doing that don't need to include version.h; that's
left up to get_ws_vcs_version_info() to do.

Change-Id: Idac641bc10e4dfd04c9914d379b3a3e0cc5ca8cb
Reviewed-on: https://code.wireshark.org/review/2794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 08:46:01 +00:00
Guy Harris 8afe331369 More getopt_long, to add --help and --version support.
Change-Id: I946067b972a70154f02ab561bc0fd029a7a5abc4
Reviewed-on: https://code.wireshark.org/review/2791
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 04:51:20 +00:00
Bill Meier 60ffafdb7c Fix compile error when building w/o GNUTLS
Specifically: <wsutil/file_util.h> is aleays needed (for create_app_running_mutex())

Change-Id: I78e5a767f62bc2af67b6407539742dc245259f56
Reviewed-on: https://code.wireshark.org/review/2699
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-29 17:50:55 +00:00
Jeff Morriss 3773a7561c 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

Bug: 5804
Change-Id: I35db35a4eace2797afd895f9be7322ef39928480
Reviewed-on: https://code.wireshark.org/review/2489
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 01:05:02 +00:00
Guy Harris 6db77b000f 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
data.

Modify code that reads packets to be able to handle non-packet records,
even if that just means ignoring them.

Rename some routines to indicate that they handle more than just
packets.

We don't yet have any libwiretap code that supplies records other than
REC_TYPE_PACKET or that supporting writing records other than
REC_TYPE_PACKET, or any code to support plugins for handling
REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug
8590.

Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813
Reviewed-on: https://code.wireshark.org/review/1773
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24 18:31:25 +00:00
Guy Harris a344c9736e Revert "Allow wtap_read() and wtap_seek_read() to return non-packet records."
This reverts commit c0c480d08c.

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.

Change-Id: Ic558f163a48e2c6d0df7f55e81a35a5e24b53bc6
Reviewed-on: https://code.wireshark.org/review/1741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 10:50:10 +00:00
Guy Harris c0c480d08c 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
of Wireshark, but this at least gets the ball rolling.

Change-Id: I34a45b54dd361f69fdad1a758d8ca4f42d67d574
Reviewed-on: https://code.wireshark.org/review/1736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 03:02:32 +00:00
Guy Harris a1b1c8bed5 Revert "Refactor Wiretap"
This reverts commit 1abeb277f5.

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
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09 05:21:01 +00:00
Michael Mann 1abeb277f5 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.

The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes.

bug:9607
Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae
Reviewed-on: https://code.wireshark.org/review/1485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-09 03:04:39 +00:00
Alexis La Goutte 296591399f 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 <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Michal Labedzki 579e7e19ce 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
as file format to be dissected.

Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a
Reviewed-on: https://code.wireshark.org/review/16
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:43:13 +00:00
Gerald Combs f966980937 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`
for package names by default.

Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96
Reviewed-on: https://code.wireshark.org/review/139
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-07 23:03:03 +00:00
Alexis La Goutte c6022b3b85 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
2014-01-26 12:56:32 +00:00
Bill Meier 8ef3e2fad3 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;


svn path=/trunk/; revision=54555
2014-01-02 15:41:45 +00:00
Guy Harris 0cc1545d05 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.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Guy Harris db25270df8 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
2013-11-17 02:55:14 +00:00
Jakub Zawadzki ef30aee86a nstime_to_sec() and capinfos secs_nsecs() seems to be same.
svn path=/trunk/; revision=53185
2013-11-09 11:03:02 +00:00
Jakub Zawadzki 38edae1c71 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
2013-11-09 10:38:02 +00:00
Guy Harris 853da2eb9b 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.

svn path=/trunk/; revision=53166
2013-11-08 09:53:01 +00:00
Michael Mann ab78bb54c4 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
with status code 1.

From Peter Wu

svn path=/trunk/; revision=52762
2013-10-22 14:52:28 +00:00
Chris Maynard a4595812f9 Trivial: Fix typo.
svn path=/trunk/; revision=51011
2013-07-29 15:43:37 +00:00
Jeff Morriss 54bb2e7a5c 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
2013-07-15 02:48:26 +00:00
Martin Kaiser 07a024dc90 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
2013-04-13 18:15:46 +00:00
Martin Kaiser 1daadad423 TABs -> spaces
add editor modelines
reformat some parts

svn path=/trunk/; revision=48840
2013-04-13 18:08:11 +00:00
Martin Kaiser 412fcff0cb add a cast to make capinfos compile when USE_GOPTION is defined
svn path=/trunk/; revision=48839
2013-04-13 17:55:54 +00:00
Martin Kaiser 9e4ad1f01e capinfos -k displays the capture comment (from the shb)
svn path=/trunk/; revision=48837
2013-04-13 17:48:51 +00:00
Gerald Combs 29ceca1b26 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
guard and do so in capinfos.c and editcap.c. We include ws_symbol_export.h
in over 200 files so it didn't seem to make sense to remove its include
guard entirely.

svn path=/trunk/; revision=48170
2013-03-07 17:20:12 +00:00
Anders Broman b204e38aef Use explicit casts.
svn path=/trunk/; revision=48108
2013-03-05 22:15:20 +00:00
Gerald Combs 2f47e63a88 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
2013-02-28 04:44:38 +00:00
Gerald Combs ccc78e6b63 Try to fix compilation on Windows.
svn path=/trunk/; revision=47901
2013-02-26 07:14:44 +00:00
Gerald Combs 0645396514 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
2013-02-26 06:40:25 +00:00
Martin Kaiser 38a73a32f3 include the wsutil/wsgcrypt.h instead of including gcrypt.h directly
svn path=/trunk/; revision=47802
2013-02-21 18:23:29 +00:00
Gerald Combs bd4cffae58 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.

svn path=/trunk/; revision=47758
2013-02-20 01:19:42 +00:00
Pascal Quantin deb4f08cb2 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
2013-01-04 14:56:27 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Anders Broman 713dbd01c9 Remove #define USE_GOPTION = 1, the code is incomplete
svn path=/trunk/; revision=43945
2012-07-23 19:18:00 +00:00
Anders Broman c19583b72c From Michael Mann:
Generic preferences implementation - Printing and Name Resolution.

svn path=/trunk/; revision=43579
2012-07-06 04:48:36 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris cf6d9841e3 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.

svn path=/trunk/; revision=42818
2012-05-24 05:05:29 +00:00
Guy Harris 08d7ff268b 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
(XXX - we should do that if we have only one packet that has a time stamp).

svn path=/trunk/; revision=41186
2012-02-26 05:51:54 +00:00
Guy Harris d94bd07f99 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
used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only
be used for files that we have no reason to believe are invalid but that
have a version number we don't know about or some other
non-link-layer-encapsulation-type value we don't know about.

svn path=/trunk/; revision=40175
2011-12-13 09:53:50 +00:00
Guy Harris 741432d483 Handle ctime() and localtime() returning NULL and localtime() on Windows
blowing up when handed a bad value.

svn path=/trunk/; revision=39878
2011-11-16 03:13:02 +00:00
Jeff Morriss bf95c7b5e4 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,
  Solaris 9 does not).
- (All the places which need getopt already include unistd.h (if we have it).)

If this breaks things on some OS, we might need (a real) HAVE_GETOPT_H check.

svn path=/trunk/; revision=38437
2011-08-09 21:02:10 +00:00
Stig Bjørlykke 0623a49e2d 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
2011-06-28 15:18:21 +00:00
Stig Bjørlykke 8443bbbf75 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
2011-06-28 09:00:11 +00:00
Gerald Combs a24687ce8e Move the Windows argument list conversion code to a common routine.
svn path=/trunk/; revision=37372
2011-05-24 00:07:56 +00:00
Gerald Combs 32749c0fad Use a comparison instead of an assignment. Fixes Coverity CID 1194.
svn path=/trunk/; revision=37066
2011-05-11 20:39:11 +00:00
Bill Meier 61bc175a82 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


ToDo: For the tabular form report display the list of per-packet encapsulations seen.


svn path=/trunk/; revision=36962
2011-05-02 02:06:52 +00:00
Guy Harris 6cbf6ce16c 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
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.

Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.

svn path=/trunk/; revision=36748
2011-04-21 09:41:52 +00:00
Chris Maynard f9fa7e8def Use g_snprintf instead of sprintf: Coverity 622.
Use g_strlcpy instead of strcpy: Coverity 632.

svn path=/trunk/; revision=36595
2011-04-12 17:52:52 +00:00
Bill Meier 9121c18590 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.

With this fix, I expect fuzz-test.sh (and list_protos_in_cap.sh
and presumably other scripts) will work a bit more as as expected.


svn path=/trunk/; revision=36487
2011-04-06 01:41:03 +00:00
Anders Broman 8735a8d631 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
2011-04-05 05:50:45 +00:00
Bill Meier 6d01681d93 Fix Windows comiler warning: remove unused 'wsadata' variable.
svn path=/trunk/; revision=35560
2011-01-16 22:10:03 +00:00
Gerald Combs 3bc1fc3802 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
2011-01-06 23:28:58 +00:00
Gerald Combs a87bdf9660 Turn on ASLR via /DYNAMICBASE and DEP via SetProcessDEPPolicy().
svn path=/trunk/; revision=34137
2010-09-16 19:20:06 +00:00
Gerald Combs f194916d62 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
2010-06-02 00:24:03 +00:00
Jeff Morriss 47e2d75820 Move some code (including the optional objects) into libwsutil
svn path=/trunk/; revision=33012
2010-05-28 20:19:55 +00:00
Jeff Morriss 6e802e4e2e Remove extra % in printf format string.
svn path=/trunk/; revision=32651
2010-05-03 19:42:09 +00:00
Bill Meier 7cec985521 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
2010-05-03 19:08:11 +00:00
Stephen Fisher 7364f9d94f Add snaplen to capinfos output. Idea from Chris Maynard on -dev.
svn path=/trunk/; revision=32594
2010-04-29 06:29:51 +00:00
Guy Harris 9e2dc2cdfc Squelch some compiler warnings.
svn path=/trunk/; revision=32077
2010-03-02 00:11:42 +00:00
Bill Meier e81b0d3f7c Fix a gcc -Wshadow warning
svn path=/trunk/; revision=31934
2010-02-20 17:44:52 +00:00
Gerald Combs 23a90258fb 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
2010-02-17 20:15:50 +00:00
Jaap Keuter 81771c67b7 Avoid crash on invalid file name.
svn path=/trunk/; revision=31632
2010-01-23 12:29:57 +00:00
Bill Meier c14b985146 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)

svn path=/trunk/; revision=31382
2009-12-29 16:11:43 +00:00
Gerald Combs 8fc1491a60 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
2009-12-21 21:06:01 +00:00
Stig Bjørlykke 184ca96aba Initialize hd pointer to avoid a compiler warning.
svn path=/trunk/; revision=31290
2009-12-17 12:09:40 +00:00
Stephen Fisher 6db27eb8a2 From Jim Young via bug #4304: Patch to capinfos -H feature to generate
expected column header names


svn path=/trunk/; revision=31194
2009-12-08 07:04:12 +00:00
Guy Harris a6bae6e39b winposixtype.h appears to be Windows-only.
svn path=/trunk/; revision=31193
2009-12-08 01:49:01 +00:00
Gerald Combs e5be652056 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
2009-12-08 00:13:57 +00:00
Gerald Combs 7c276becfd Add SHA1, RMD160, and MD5 hashes to capinfos.
svn path=/trunk/; revision=31191
2009-12-07 23:18:12 +00:00
Jaap Keuter 25470e5663 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.
This gets rid of a special post getopt() argument count test.

Add new table output format (with related options). This feature allows 
outputting the various infos into a tab delimited text file, or to a comma 
separated variables file (*.csv) instead of the original "long" format.

svn path=/trunk/; revision=30956
2009-11-13 21:43:57 +00:00
Stig Bjørlykke 2ac6a245e2 Removed redundant redeclaration of optind.
svn path=/trunk/; revision=30619
2009-10-19 14:44:37 +00:00
Stig Bjørlykke 98024a007f Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_H
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision.

svn path=/trunk/; revision=30370
2009-10-06 16:01:18 +00:00
Gerald Combs 1e93d53b56 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
2009-07-22 23:59:15 +00:00
Bill Meier fa920e48ed Minor cleanup of "-h" output text.
svn path=/trunk/; revision=28334
2009-05-12 16:06:14 +00:00
Bill Meier 4853b28fba capinfos: Print "n/a" for rates and duration if only one packet in capture.\;
line up capinfos output. 

svn path=/trunk/; revision=28328
2009-05-11 14:00:05 +00:00
Guy Harris c73ab7dff7 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
2009-03-22 06:53:17 +00:00
Guy Harris 6f059e8cb7 In Solaris, the second argument to dladdr() is just a void *, not a
const void *.

svn path=/trunk/; revision=27813
2009-03-22 06:38:02 +00:00
Guy Harris 7c6e2155cc Attempt to use dladdr() to get the pathname of the executable image if
it's available and works.

svn path=/trunk/; revision=27812
2009-03-22 00:42:33 +00:00
Guy Harris ace4af44fc 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
:-)).  Have it use the report_err.c routines, so it works in
console-mode programs.

Clean up some comments while we're at it.

svn path=/trunk/; revision=27456
2009-02-15 21:47:57 +00:00
Jeff Morriss a7b7e98cb1 Only declare failure_message() if we HAVE_PLUGINS (since it's only used when that's the case).
svn path=/trunk/; revision=27051
2008-12-18 19:24:34 +00:00
Guy Harris 4caea25cc1 Get rid of an unused variable.
svn path=/trunk/; revision=26769
2008-11-13 17:37:47 +00:00
Jeff Morriss 83f9ecf96f 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
someone is compiling --without-plugins.

svn path=/trunk/; revision=25640
2008-06-30 17:16:29 +00:00
Guy Harris be161ba460 Free up the err_info string returned by wtap_read() and
wtap_seek_read().

Clean up indentation.

svn path=/trunk/; revision=25400
2008-05-30 02:44:02 +00:00
Stig Bjørlykke 16717f3be2 From Andrew Feren (bug 2462):
Patch to print packet rate.

From me:
Document -x option in man page.

svn path=/trunk/; revision=25024
2008-04-14 20:02:45 +00:00
Jeff Morriss b59322ecc1 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
ensuing discussion on -dev).

capinfos and editcap: don't complain if plugins fail to load: dissector
plugins should fail to load because they need libwireshark.  I am assuming
here that wiretap plugins don't need libwireshark (I've never seen such a
plugin but LEGO's code and comments suggest this is the case).

(The goal of this checkin is to stop linking capinfos and editcap against
libwireshark while still allowing wiretap plugins.  Since we don't have any
such plugins in the tree I do somewhat doubt the need for all this but I don't
want to be the one to remove the functionality.)

svn path=/trunk/; revision=24650
2008-03-16 00:58:15 +00:00
Jeff Morriss ddca4dd583 Include epan/priveleges.h for get_credential_info()
svn path=/trunk/; revision=24649
2008-03-16 00:41:10 +00:00
Jeff Morriss d951728e6b 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.

svn path=/trunk/; revision=24648
2008-03-16 00:32:12 +00:00
Guy Harris e1d5eaff72 Use G_GINT64_MODIFIER rather than PRI[duox]64 to print gint64's and
guint64's.

svn path=/trunk/; revision=23782
2007-12-06 08:33:46 +00:00
Guy Harris 5f9d1e28e6 Fix typo.
svn path=/trunk/; revision=23027
2007-09-29 02:05:31 +00:00