Commit Graph

104 Commits

Author SHA1 Message Date
Bill Meier e4d6610bd5 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31729
2010-01-29 16:09:25 +00:00
Stephen Fisher 7c125a357b Make edticap behave like the rest of the Wireshark programs where it will
send normal -h output to stdout so it can be paginated and the usage output
to stderr when there was an error in the command arguments.


svn path=/trunk/; revision=31388
2009-12-29 21:04:40 +00:00
Gerald Combs 5ba1582dda From Jim Young via bug 4162:
This patch limits the number of fractional digits used to calculate the
fractional component of editcap's -t and -w options.

Specifically this patch truncates the fractional component (if any) of the -t
and -w options to 6 and 9 respectively.

svn path=/trunk/; revision=30698
2009-10-25 20:18:24 +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
Guy Harris 7595bc232a Clean up the "available XXX type" messages a bit.
svn path=/trunk/; revision=28793
2009-06-21 18:55:32 +00:00
Stig Bjørlykke 9a8e93d88b If no valid packages was found in the input file we write an empty
header in the output file.  This way we at least create a file.

svn path=/trunk/; revision=28617
2009-06-02 23:14:19 +00:00
Stig Bjørlykke fa71489b83 Only call wtap_dump_close() if we have an open file.
We can have a situation where a file only contains a valid file header
without any packages, so this will avoid a crash.

svn path=/trunk/; revision=28602
2009-06-02 17:22:40 +00:00
Guy Harris 5e8e10cfa3 Have fileset_extract_prefix_suffix() print an error message if it fails,
so we don't just exit silently.  Don't bother checking the validity of
arguments - it shouldn't be passed NULL fprefix or fsuffix arguments in
the first place, and isn't passed them.

Exit with an exit status of 1 for command-line syntax errors and 2 for
file open/close/IO errors.

svn path=/trunk/; revision=28458
2009-05-23 20:29:12 +00:00
Guy Harris dc3b1136cc Fix indentation.
svn path=/trunk/; revision=28457
2009-05-23 20:22:42 +00:00
Sake Blok 67bd294b03 Initialize pdh...
svn path=/trunk/; revision=28455
2009-05-23 08:57:20 +00:00
Sake Blok a8eb860103 From Kovarththanan Rajaratnam <krj@rajaratnam.dk> in bug 2683
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2683):

Editcap should split file according to fileset pattern


svn path=/trunk/; revision=28454
2009-05-23 07:59:23 +00:00
Bill Meier fa920e48ed Minor cleanup of "-h" output text.
svn path=/trunk/; revision=28334
2009-05-12 16:06:14 +00:00
Gerald Combs c8f44535fe Fix Win64 compilation.
svn path=/trunk/; revision=28076
2009-04-17 16:21:33 +00:00
Balint Reczey 14fa469df3 From Jim Young <jyoung@gsu.edu>:
- New duplicate packet removal options for editcap
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3168

I changed the patch a bit:
- Adapted to 80 chars wide screen
- Merged -w and -W parameters

svn path=/trunk/; revision=28074
2009-04-17 15:21:46 +00:00
Gerald Combs e648060f0f Fix the last(?) of the Win64 compilation problems.
svn path=/trunk/; revision=28065
2009-04-16 04:05:39 +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
Bill Meier 8afa208ffb Windows build: #include winsock2.h only when needed.
#include winsock2.h pulls in about 90 distinct .h files
and about 140 total .h files. 
Currently winsock2.h is (mostly unnecessarily) included
for each dissector via packet.h/wtap.h.
This patch removes #include winsock2.h from wtap.h and 
then includes winsock2.h (or windows.h) in the 
few specific places required. 
With this patch, my Windows Wireshark build takes 
about 30% less time.


svn path=/trunk/; revision=26535
2008-10-24 00:42:09 +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
Sake Blok 70ec244f8f From Ken Smith (bug 2574): Allow editcap to parse files into even time intervals
A few changes from me:
- make use of nstime_set_unset and nstime_is_unset i.s.o. extra variable first_pass
- change 'if' to 'while' to allow intervals with no packets
- remove 'unused' variable current_pkt_ts



svn path=/trunk/; revision=25499
2008-06-21 09:45:21 +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
Luis Ontanon bf9a9b83a5 Long time ago, I added these to troubleshoot a problem a user was seeing but I could not reproduce, as I had no feedback I forgot about removing these prints.
This must be copied over to the release branch.


svn path=/trunk/; revision=24727
2008-03-25 21:07:52 +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
Martin Mathieson d7f43bd1b1 When doing random error mutation, protect DCT2000
meta information that is found at the beginning of
the data - this lets me fuzztest my .out files
properly.

Also make some whitespace more consistent.

svn path=/trunk/; revision=24401
2008-02-20 14:13:15 +00:00
Stig Bjørlykke e88b6111a1 Initialize filenamelen to avoid a warning.
svn path=/trunk/; revision=24275
2008-02-06 12:01:48 +00:00
Stig Bjørlykke d856658e6e snprintf -> g_snprintf
svn path=/trunk/; revision=24260
2008-02-03 16:03:33 +00:00
Stig Bjørlykke 47d744b59d More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
2008-02-03 15:38:20 +00:00
Stig Bjørlykke 2df21cb1b7 Fixed some strcpy -> strncpy/g_snprintf cleanups.
Removed a debug printout in t38.

svn path=/trunk/; revision=24188
2008-01-24 23:01:37 +00:00
Stig Bjørlykke 11a9f57c1a Fixed some malloc -> g_malloc, free -> g_free, strdup -> g_strdup.
svn path=/trunk/; revision=24179
2008-01-24 19:09:30 +00:00
Martin Mathieson f16a563466 Replace a handful of tabs with spaces.
svn path=/trunk/; revision=24176
2008-01-24 17:14:01 +00:00
Bill Meier 83888f9c01 From RD Thrush: Fix for 'editcap relies on gnu extension to strptime(3)'
svn path=/trunk/; revision=24124
2008-01-17 21:04:48 +00:00
Sake Blok da42105f77 Clean up the usage information of editcap and change the text
of the -t option to fit its current behaviour

('fixes' bug 2101)


svn path=/trunk/; revision=24072
2008-01-12 18:31:07 +00:00
Gerald Combs 1c9158a00e Add a newline.
svn path=/trunk/; revision=23416
2007-11-09 20:05:44 +00:00
Guy Harris 58585ac5c5 Clean up indentation.
"time_t" is not guaranteed to be an "unsigned long"; when printing it
with %lu, cast it to "unsigned long".

The "secs" field of a wtap_nstime, however, *is* defined to be a time_t;
there's no need to cast it to time_t.

svn path=/trunk/; revision=23036
2007-09-30 22:13:38 +00:00
Sake Blok 27efb95042 This patch fixes the following two errors that appear when
configure is run with "--without-plugins"

cc1: warnings being treated as errors
about_dlg.c: In function ‘about_wireshark_cb’:
about_dlg.c:426: warning: unused variable ‘plugins_page’
make[2]: *** [about_dlg.o] Error 1

editcap.c: In function ‘main’:
editcap.c:663: error: ‘check_ts’ undeclared (first use in this function)
editcap.c:663: error: (Each undeclared identifier is reported only once
editcap.c:663: error: for each function it appears in.)
make[2]: *** [editcap.o] Error 1


svn path=/trunk/; revision=22761
2007-08-31 14:14:17 +00:00
Luis Ontanon d8e818e9da 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
2007-08-07 20:07:43 +00:00
Luis Ontanon c1c9e0bb90 nononono.... print one on 250 not every line
svn path=/trunk/; revision=22426
2007-07-30 21:17:03 +00:00
Luis Ontanon f43578e8f4 for bug 1158 have editcap print the value of the timestamps while running so I can get feedback from the user.
svn path=/trunk/; revision=22425
2007-07-30 21:10:12 +00:00
Jeff Morriss 301432dc5c Increase the maximum number of packet selections to 512 (from 100). More importantly, give the user feedback if we run out of room for packet selections. As mentioned on the list, this could be made completely dynamic if someone actually goes over the (new) limit. OK for 0.99.6 but not necessary.
svn path=/trunk/; revision=22145
2007-06-20 20:02:52 +00:00
Luis Ontanon 162382dcb1 Have editcap and capinfos compile --without-plugins
Should go in 0.99.6


svn path=/trunk/; revision=22116
2007-06-17 04:58:16 +00:00
Luis Ontanon 11f06217ce 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

epan/plugins.h and epan/proto.c
   do not have init_plugins() calling the proto_reg functions instead do it in init_proto()

gtk/main.c and tshark.c
   init_plugin_dir() has become suprefluous

capinfos.c and editcap.c
   load the wiretap plugins

Makefiles
   do what's needed to build withe the above changes.




svn path=/trunk/; revision=21935
2007-05-25 17:22:32 +00:00
Jörg Mayer b16106f89f Only #deinfe __USE_XOPEN if not already defined. On my Suse 10.2 it was
already #defined to 1, so this would create a warning/error.


svn path=/trunk/; revision=21508
2007-04-22 20:04:34 +00:00
Ulf Lamping 45c8c7a843 fix MSVC warnings of / and set CFLAGS to block new warnings
svn path=/trunk/; revision=21098
2007-03-21 23:14:23 +00:00
Jaap Keuter 849fafe7f7 From Sebastien Tandeil:
a patch to avoid the warning "implicit declaration of function
'strptime'" in editcap.c
glib.h is included just after the define __USE_XOPEN and include <time.h>

svn path=/trunk/; revision=20455
2007-01-16 19:13:09 +00:00