Commit Graph

174 Commits

Author SHA1 Message Date
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
Michael Tüxen b031b9643a Use the interface specific parameter array.
This enables the capturing from mulitple interfaces using 
tshark and wireshark (at the command line).
(tshark -i lo0 -i en0) or (wireshark -k -i lo0 -i en0)
works. You can capture from multiple remote and local
interfaces.

Based on work from Irene Ruengeler.

svn path=/trunk/; revision=37248
2011-05-18 18:02:30 +00:00
Guy Harris fb3f152076 Back out Jeff Morris's change to make the autostop file size 64-bit - it
didn't change the GUI code for setting the autostop file size, and that
broke the build.

svn path=/trunk/; revision=36552
2011-04-11 01:30:36 +00:00
Guy Harris 4ad4d3e678 Jeff Morris's change to make the autostop file size 64-bit. Fixes bug
5691.

svn path=/trunk/; revision=36551
2011-04-11 00:01:08 +00:00
Guy Harris 1b9e4d5c00 STATUS_UNWIND_CONSOLIDATE "should not happen", so don't include it -
we'd have to include some other headers to get it defined.

Get rid of the include of Winbase.h - it doesn't define
STATUS_UNWIND_CONSOLIDATE, and it's not necessary.

svn path=/trunk/; revision=33413
2010-07-02 08:52:35 +00:00
Guy Harris 949b2a2dc8 Include <Winbase.h> to get error statuses.
svn path=/trunk/; revision=33412
2010-07-02 08:41:19 +00:00
Guy Harris 01b72bb5d1 Attempt to detect when dumpcap dies due to an exception and report that
appropriately.

svn path=/trunk/; revision=33411
2010-07-02 08:39:08 +00:00
Guy Harris f2e12f5fb3 Have sync_pipe_wait_for_child() return the child's exit status on
Windows, just as we do on UN*X.

svn path=/trunk/; revision=33410
2010-07-02 04:11:04 +00:00
Guy Harris b0b7697dea From Petr Lautrbach: when capturing, return the exit status of dumpcap,
so we give a non-zero exit status for invalid interfaces or capture
filters.

From me: don't exit immediately if dumpcap failed, print out information
from taps and the like.

svn path=/trunk/; revision=33393
2010-07-01 00:12:16 +00:00
Guy Harris 391b5127d6 Clean up the error reporting. An EOF from the sync pipe when capturing
is just an indication that the capture child exited; don't treat it as
an error, unless the child process exits with an abnormal status.
 
As tshark sends a "stop capture" indication to the child when it's
^C'ed, the child will exit and we'll get an EOF from the capture pipe;
don't make SIGINT etc. interrupt system calls, so they don't cause reads
from the capture pipe to get EINTR errors.

svn path=/trunk/; revision=32986
2010-05-27 00:48:08 +00:00
Stig Bjørlykke b9bf692c3e Untabify.
svn path=/trunk/; revision=32970
2010-05-26 07:19:42 +00:00
Guy Harris 5c27494bd6 Don't report EINTR - it might be from a ^C.
Do report the error string for other read errors, though.

svn path=/trunk/; revision=32969
2010-05-26 05:33:57 +00:00