Commit Graph

203 Commits

Author SHA1 Message Date
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
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
Hadriel Kaplan 2c09745406 Fix capture_sync: Assigned value is garbage or undefined (clang analyzer)
I'm not 100% positive this fix is the right way to handle this condition,
but it seems the safest way without changing a lot of other code.

Change-Id: Icaa8d6f38bc03177162f046d1e7ca55d87bad6a6
Reviewed-on: https://code.wireshark.org/review/373
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Tested-by: Balint Reczey <balint@balintreczey.hu>
2014-02-26 11:32:52 +00:00
Martin Kaiser f544e0812a coverity 281214
check the return value of strtok() before passing it to strtoul()

(can't be triggered in practice as dumpcap never sends a NULL string)

svn path=/trunk/; revision=54847
2014-01-19 16:06:45 +00:00
Jakub Zawadzki 65db82872c When including <epan/prefs.h> don't force inclusion of <epan/uat.h>
svn path=/trunk/; revision=53769
2013-12-03 22:16:49 +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
Jeff Morriss 15b539fcbc Replace a question in a comment with a better explanation (that answers the question).
svn path=/trunk/; revision=52550
2013-10-11 20:29:11 +00:00
Chris Maynard bc654875f0 Handle the 2GiB boundary case of the max filesize autostop condition properly so that we avoid overflow conditions and so that we ensure we don't capture more than 2GiB. Also, document the max filesize autostop value of 2GIB as well as indicating that it's truly GiB and not GB.
This fixes the problem reported on ask: http://ask.wireshark.org/questions/23891/wireshark-wont-run-with-multiple-capture-files

#BACKPORT(1.10) ... not sure about 1.8?

svn path=/trunk/; revision=51576
2013-08-29 18:15:13 +00:00
Gerald Combs c06e10baa4 Add a routine to create a dummy signal pipe and pass it to dumpcap when
gathering interface statistics. This should help dumpcap exit properly
if its parent process crashes or is killed.

svn path=/trunk/; revision=51502
2013-08-24 00:12:27 +00:00
Martin Kaiser 24c88b8007 pass --capture-comment from tshark to dumpcap
handle error cases in tshark

svn path=/trunk/; revision=51094
2013-08-01 21:09:19 +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
Luis Ontanon 99013aefa8 MS: list interfaces!
svn path=/trunk/; revision=50195
2013-06-27 19:00:01 +00:00
Luis Ontanon 0bdc0efc46 get main_window_update out of the way... pass an update_cb to the capture_sync stuff
... as per the XXX comment removed from tshark.c this was a mess to keep the linker
happy... I couldn't!

I did this without even understanding whether calling main_window_update was realy
necessary in most cases. I guess nothing or more specific update cbs would be best.


svn path=/trunk/; revision=50188
2013-06-27 17:10:50 +00:00
Anders Broman 78e334b845 From Mike Garratt:
Friendly Names support causing unnecessary delay when Wireshark starts.

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

svn path=/trunk/; revision=49752
2013-06-04 04:36:19 +00:00
Guy Harris ff20a73022 No need for those arguments to be pointers to arrays of const pointers,
especially given that we end up freeing what all of those pointers point
to.

svn path=/trunk/; revision=49542
2013-05-23 01:25:06 +00:00
Guy Harris e964f27f39 Fix the Windows side to look for the signal pipe stuff in cap_session.
svn path=/trunk/; revision=49497
2013-05-22 08:24:30 +00:00
Guy Harris 8596d17d7f Pull the capture-session state information out of capture_opts and put
it into a separate capture_session structure.  capture_opts should
contain only user-specified option information (and stuff directly
derived from it, such as the "capturing from a pipe" flag).

svn path=/trunk/; revision=49493
2013-05-22 07:44:28 +00:00
Guy Harris a1133d2fdd From Michal Labedzki: linktype_val_to_name() returns a string, not a
number, and that string is what's appropriate for the -y command-line
argument, so just directly pass it to sync_pipe_add_arg(), and get rid
of the now-unnecessary sdlt variable.

svn path=/trunk/; revision=48546
2013-03-25 11:53:56 +00:00
Martin Kaiser 5a81820401 it seems that g_free() needs a gpointer
using a gconstpointer creates a warning
capture_sync.c: In function ‘sync_pipe_open_command’:
capture_sync.c:823:13: error: passing argument 1 of ‘g_free’ discards ‘const’ qualifier from pointer target type [-Werror]

svn path=/trunk/; revision=48096
2013-03-05 20:25:32 +00:00
Anders Broman 177b69dc23 Use explicit casts.
svn path=/trunk/; revision=48088
2013-03-05 17:39:20 +00:00
Jeff Morriss d0992bf8cd Add a #define for the default capture buffer size and use it.
svn path=/trunk/; revision=47942
2013-02-28 15:27:56 +00:00
Anders Broman 6cbcb0d94d Increase the default buffer size to 2MB.
svn path=/trunk/; revision=47920
2013-02-27 20:38:43 +00:00
Chris Maynard de91f3638b Declare count as ssize_t instead of size_t, since read(), and thus ws_read(), can return a negative number. If that were to happen, then assigning the return value to an unsigned variable and then comparing that variable against 0 will yield incorrect/unintended results. Fixes Coverity CID 761910: Negative array index write.
svn path=/trunk/; revision=47069
2013-01-14 16:34:19 +00:00
Bill Meier 7dfa337910 Add a few consts to fix some compiler (GCC) errors.
svn path=/trunk/; revision=46849
2012-12-29 20:56:11 +00:00
Guy Harris 074297d7dd Make sure we don't sign-extend the (binary) bytes of the message length.
svn path=/trunk/; revision=46792
2012-12-26 20:42:23 +00:00
Evan Huus d520e82bd2 Use casts rather than changing the prototype of pipe_convert_header.
It has to be unsigned or else certain headers get misread due to signedness.

svn path=/trunk/; revision=46790
2012-12-26 17:14:31 +00:00
Evan Huus c2945ff831 Squash some sign-conversion warnings that g++ picks up but gcc does
not. QtShark now builds warning-free (for me at least).

svn path=/trunk/; revision=46786
2012-12-26 13:41:30 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jeff Morriss 20211340e5 Make the "-g" argument to tshark actually work (by passing it to dumpcap).
svn path=/trunk/; revision=46515
2012-12-12 03:25:35 +00:00
Bill Meier 7cd0417af5 Fix numerous instances of a variable/parameter name "shadowing" a library function name;
(At least some (gcc ?) compilers give a "shadow" warning for these).

svn path=/trunk/; revision=46402
2012-12-05 15:56:36 +00:00
Anders Broman e57bf90ebe From Bill Parker:
code fails to check/test return value from select() 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7861

svn path=/trunk/; revision=45917
2012-11-05 09:18:43 +00:00
Gerald Combs 552a9c6b1e Make sure sync_interface_stats_close calls sync_pipe_kill on all
platforms.  This ham-fistedly fixes a delay when moving from the
"Capture" item to the "Open" and "Learn" items on the welcome screen in
the Qt version.

svn path=/trunk/; revision=45475
2012-10-11 16:55:28 +00:00
Gerald Combs 34b3dc498b Add a cast.
svn path=/trunk/; revision=45407
2012-10-08 20:22:21 +00:00
Gerald Combs 4f1eb84444 Log the time we spend waiting for the capture child to exit.
Add breadcrumbs so that we can switch from g_get_current_time to
g_get_real_time when our minimum GLib version is >= 2.28.

svn path=/trunk/; revision=45399
2012-10-08 18:11:30 +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
Gerald Combs 5f2783de05 Revert r44644 and 44645. g_source_*, g_timeout_, and g_io_* all depend
on the GLib main loop which isn't portable (unless you want to want to
manage the main loop yourself).

svn path=/trunk/; revision=44655
2012-08-24 15:25:42 +00:00
Gerald Combs 5adc43f597 Move the pipe input routines to the common UI directory.
svn path=/trunk/; revision=44644
2012-08-23 18:42:48 +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
Jörg Mayer d2b4825558 Comment back in the body of tb80211_do_set_channel to avoid warnings about
unused parameters. Add the missing functions by applying the skipped patches
to capture_sync.[hc]

svn path=/trunk/; revision=43414
2012-06-20 18:42:45 +00:00
Chris Maynard 30c0f5de32 Undo an accidental portion of the last commit.
svn path=/trunk/; revision=43173
2012-06-09 03:54:29 +00:00
Chris Maynard e40c7ab1dc Be sure to specify FORMAT_MESSAGE_IGNORE_INSERTS in the dwFlags arg to all FormatMessage() calls where FORMAT_MESSAGE_FROM_SYSTEM is also specified. (Ref: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/28/6564257.aspx)
svn path=/trunk/; revision=43172
2012-06-09 03:41:23 +00:00
Guy Harris b4392dad37 From Evan Huus: fix memory leak. Fixes bug 7081.
svn path=/trunk/; revision=42057
2012-04-13 22:42:19 +00:00
Guy Harris 7f6caeb730 If the length is bogus in a message received from the sync pipe, dump
out all 4 bytes we read, to provide more information about the message
that was sent so it's easier to see if something was spewing extra
output to the standard output or error in the child.

svn path=/trunk/; revision=41489
2012-03-11 20:00:39 +00:00
Michael Tüxen 14b1a44c0f Third try. This time pipes and stdin are supported and the
test scripts are passed.

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.

svn path=/trunk/; revision=40715
2012-01-25 13:04:32 +00:00
Michael Tüxen 4fece25e7f We need a 3rd try. (After learning how to run the testuite on Windows locally).
svn path=/trunk/; revision=40695
2012-01-24 17:12:56 +00:00
Michael Tüxen 08d6785412 Second try. This time pipes and stdin are supported.
Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just
provides the base for future extensions like removing
remote interface, mulitple airpcap devices and multiple
pipes.

This patch was provided by Irene Ruengeler.


svn path=/trunk/; revision=40693
2012-01-24 16:05:26 +00:00
Guy Harris d7b2aad043 Move some headers for UI stuff, and the alert_box.c UI-specific file, to
the ui directory.  (Perhaps some other files that would be used by all
flavors of Wireshark, for any GUI toolkit or for someting such as
ncurses, and not for any command-line tool such as TShark, should be
moved there as well.)

Shuffle some #includes to put the "ui/XXX.h" includes together.

svn path=/trunk/; revision=40529
2012-01-16 01:07:52 +00:00
Guy Harris 002ad074c4 Expand, and fix, a comment. Change a function argument name to match
the name in the definition of the function it calls.

svn path=/trunk/; revision=40367
2012-01-04 03:31:21 +00:00
Guy Harris c73c44cf4b Get rid of unnecessary assignment (the code below it always assigns a
value to the variable).  Praise be to Clang Cat.

svn path=/trunk/; revision=39877
2011-11-16 02:43:58 +00:00
Michael Tüxen c219f2eea5 Back out infrastructure change. We missed supporting
stdin and pipes.




svn path=/trunk/; revision=39498
2011-10-20 19:44:40 +00:00