Commit graph

185 commits

Author SHA1 Message Date
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
Michael Tüxen
95ae2fe13a 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=39495
2011-10-20 18:17:54 +00:00
Guy Harris
40a863f8bf Fix prematurely-terminated comment.
svn path=/trunk/; revision=38696
2011-08-24 02:37:36 +00:00
Guy Harris
898334c7a5 Fix a comment; this includes describing an additional way in which we
could fail to open the capture file.

svn path=/trunk/; revision=38695
2011-08-24 02:25:08 +00:00
Michael Tüxen
2ab112d5dd Hopefully fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6256.

svn path=/trunk/; revision=38694
2011-08-23 23:10:50 +00:00
Michael Tüxen
4e255f1398 Fix Windows build.
svn path=/trunk/; revision=38352
2011-08-05 08:26:07 +00:00
Michael Tüxen
f924ea67ca Simplification suggested by Guy.
svn path=/trunk/; revision=38351
2011-08-05 08:11:27 +00:00
Michael Tüxen
7f895c681b Generate the capure sync pipe correctly.
Fix obtained from Irene Ruengeler.

svn path=/trunk/; revision=38349
2011-08-05 07:10:20 +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
Michael Tüxen
df70b4c15c Fix the bug reported by Guy. Now
tshark -i en0 icmpp
returns a correct error message.


svn path=/trunk/; revision=37806
2011-06-27 19:07:36 +00:00
Michael Tüxen
4bc67de4ea Report the correct interface when there is a problem with a capture filter.
This patch is from Irene Ruengeler.

svn path=/trunk/; revision=37804
2011-06-27 12:13:15 +00:00
Michael Tüxen
421dafd2de Get rid of old non-interface specific settings which are now interface
specifc. This finalizes the change of the infrastructure.
This patch is based on work by Irene Ruengeler.

svn path=/trunk/; revision=37794
2011-06-27 00:09:03 +00:00
Gerald Combs
8d88f3a790 Make pcap-ng the default. Add a compile-time option to prefer pcap-ng or
pcap.  Add a "-P" capture option which tries to use pcap instead of
pcap-ng ("-P" seemed to be the best option but we may want to use a
different letter).

Update the documentation and release notes.

svn path=/trunk/; revision=37696
2011-06-17 17:52:31 +00:00
Bill Meier
aaa723e538 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;
Also: whitespace cleanup.

svn path=/trunk/; revision=37603
2011-06-07 23:03:12 +00:00
Michael Tüxen
c6c2577bbc Fix the capturing from the GUI. Honor the iface variable.
The next step is to retire the iface variable and use
the ifaces array only. This should simplify things and
fix the cases, where you start wireshark with command
line arguments and also use the GUI.

svn path=/trunk/; revision=37342
2011-05-21 13:22:38 +00:00
Michael Tüxen
8b701e108a In case we have no interface information in the array, use the global value.
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5935.

svn path=/trunk/; revision=37307
2011-05-19 20:20:35 +00:00
Michael Tüxen
3a2a342fc4 Move the debug output for the generated command line arguments to the correct place.
svn path=/trunk/; revision=37276
2011-05-19 04:30:05 +00:00
Martin Mathieson
2baa82a136 Only declare a variable if its going to be used.
svn path=/trunk/; revision=37273
2011-05-19 01:09:05 +00:00
Guy Harris
d391f403da We don't have the ability to set the capture buffer size on all platforms.
svn path=/trunk/; revision=37255
2011-05-18 19:29:47 +00:00