Commit Graph

195 Commits

Author SHA1 Message Date
Guy Harris 91200c27a3 Dear GLib Developers:
Thank you very much for using "gulong" rather than "gsize" as the
"buffer length" argument to g_snprintf(), the fact that the
corresponding argument to snprintf() is a size_t nonwithstanding. 
Developers building for LLP64 platforms such as Win32 greatly appreciate
this decision.

svn path=/trunk/; revision=37195
2011-05-17 00:08:47 +00:00
Michael Tüxen 55f70620c0 Add support for capturing from multiple interfaces.
This patch is basedon work done by Irene Ruengeler.

This feature is considered experimental at the moment.
However, you need to use the -t command line option
to use the feature. When not providing it, the old
method will be used.

svn path=/trunk/; revision=37191
2011-05-16 21:56:12 +00:00
Chris Maynard 36506f2f55 #include <conio.h> when compiling under Windows with DEBUG_DUMPCAP defined.
svn path=/trunk/; revision=37187
2011-05-16 19:56:27 +00:00
Michael Tüxen 37b16db8f2 Use correct variable...
svn path=/trunk/; revision=37180
2011-05-16 16:27:42 +00:00
Michael Tüxen 64297b9be0 Fix compilation on windows (hopefully).
svn path=/trunk/; revision=37179
2011-05-16 15:25:33 +00:00
Michael Tüxen 70ae440e15 Make remote capturing settings a per interface thing. You can now
configure that you want to capture on multiple remote interfaces
on mulitple hosts.
Improve some #ifdef mess in dumpcap.

svn path=/trunk/; revision=37178
2011-05-16 15:19:54 +00:00
Michael Tüxen 122452f864 Make pcap samping a per interface setting.
Use consistent naming of variables on capture_options.
Make pcap sampling independent of remote capturing, since
it seems to work local pcap devices using winpcap (at
least that is what the documentation says).

svn path=/trunk/; revision=37176
2011-05-16 14:12:35 +00:00
Michael Tüxen 9a2ba01e85 Don't use debug output.
BTW: Why does compilation fail with it being enabled?

svn path=/trunk/; revision=37173
2011-05-16 00:19:47 +00:00
Michael Tüxen 2d2815b5d1 Fix compilation on Windows (hopefully).
svn path=/trunk/; revision=37172
2011-05-15 23:41:21 +00:00
Michael Tüxen 03d7987ba6 Change internal data structures to store and handle mulitple
pcap devices / pipes to capture from and open and close them.
However, capturing currently happens only on the last specified
interface.
So this does not add user visible functionality except that
some bugs are fixed. For example a crash when capturing on
a pipe and saving in pcapng format.

svn path=/trunk/; revision=37171
2011-05-15 22:54:52 +00:00
Michael Tüxen 520750df8a Fix a copy/paste error.
svn path=/trunk/; revision=37122
2011-05-13 13:04:13 +00:00
Michael Tüxen cfe3d2d0da Get -L and -d working with multiple interface. Internally get some functions
using the array of interface data.
Improve output of -L by printing the interface name.

svn path=/trunk/; revision=37120
2011-05-13 11:28:51 +00:00
Michael Tüxen 108e75ab4a Add a comment what needs to be changed when adopting wireshark and tshark.
svn path=/trunk/; revision=37111
2011-05-13 05:14:00 +00:00
Michael Tüxen c64c481e06 Add support for multiple interfaces when processing the -L option.
This is based on work of Irene Ruengeler.

svn path=/trunk/; revision=37098
2011-05-12 19:25:44 +00:00
Michael Tüxen 3501febf60 Initialize the glib thread system on all platforms, not only on Windows.
This requires to be linked against a different library. This is only
required for dumpcap, but the configure files currently doesn't check
this in a target specific way. So use these libs for all binaries.

svn path=/trunk/; revision=37095
2011-05-12 18:55:24 +00:00
Michael Tüxen a58caaf6f7 Add some more details (name of the interface and number of captured packets)
to the message showed when dumpcap is finishing.

This patch is the first one of a series which will add support for
capturing on multiple interfaces to dumpcap.

This patch is based on work of Irene Ruengeler.

svn path=/trunk/; revision=37094
2011-05-12 18:03:04 +00:00
Jeff Morriss c3f165c779 Forgot to remove my editor's tabs before committing...
svn path=/trunk/; revision=37002
2011-05-05 21:41:51 +00:00
Jeff Morriss 1792f8e3a6 Apply rev 14059 to non-Windows: update the display with new packets every 500
msec (instead of every 1000msec).

svn path=/trunk/; revision=36999
2011-05-05 20:46:02 +00:00
Jakub Zawadzki 5969e0e1c1 Add return instructions for system without support for G_GNUC_NORETURN (e.g. some older gcc compilers).
Reported by Anders Broman on -dev list.

svn path=/trunk/; revision=36797
2011-04-22 07:15:45 +00:00
Guy Harris 4fdcc5c180 Rename ws_stat to ws_stat64, and make it take a pointer to a ws_statb64
as an argument, along the lines of ws_fstat64, and, on Windows, make it
use _wstati64, to handle 64-bit file sizes.

svn path=/trunk/; revision=36547
2011-04-10 20:59:10 +00:00
Bill Meier f09b320711 Fix a comment; Use consistent indentatation & formatting.
svn path=/trunk/; revision=36225
2011-03-21 16:57:11 +00:00
Bill Meier 80b7f99b1c Fix Bug #5716: "dumpcap: -q option behavior doesn't match documentation"
Rework code slightly to print "Packets captured: " at 'dumpcap -q ...' exit.
Also: SigInfo now prints: "Packets captured:  n" iso "n Packets captured".

svn path=/trunk/; revision=36052
2011-02-24 19:26:38 +00:00
Gerald Combs a6bbdaa849 Fix some dead code and zero division issues found by Clang scan-build.
In convert_string_case() use g_utf8_strup() instead of converting each
character by hand. Hopefully this won't cause any unexpected changes in
behavior.

svn path=/trunk/; revision=36006
2011-02-18 22:43:48 +00:00
Guy Harris b4f663a29b On Windows, try putting __declspec(noreturn) in front of declarations of
routines that don't return.  (This requires that some files include
config.h to get WS_MSVC_NORETURN declared properly.)

svn path=/trunk/; revision=35989
2011-02-17 23:11:49 +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
Jaap Keuter 3656ecb823 Free dumpcap from linking to wiretap.
svn path=/trunk/; revision=35353
2011-01-04 07:06:01 +00:00
Gerald Combs 155e17c603 Add a comment about the pipe read timeout on Windows.
svn path=/trunk/; revision=34947
2010-11-18 17:29:02 +00:00
Gerald Combs 11a29504b7 Set the pipe read timeout to 100 milliseconds instead of 100 microseconds.
Should fix bug 5309.

svn path=/trunk/; revision=34938
2010-11-17 23:51:31 +00:00
Chris Maynard 3595bb0293 If pcap_geterr() returns "read error: PacketReceivePacket failed", report that
the "network adapter on which the capture was being done is no longer running".
Fixes bug 2623 reported by Anthony Coulter.

svn path=/trunk/; revision=34915
2010-11-16 21:08:08 +00:00
Chris Maynard b60572a009 Use more meaningful temp file name. Fixes bug 1882.
Template chosen is: wireshark_<iface>_YYYYmmddHHMMSS_XXXXXX ... where
    <iface> is the interface name (or UUID part of the interface if applicable)
    YYYYmmddHHMMSS are as described in "man strftime".
    XXXXXX is a template filled in with random characters.  See "man mkstemp".

svn path=/trunk/; revision=34902
2010-11-16 15:37:37 +00:00
Guy Harris ae8a7c8b19 OS X 10.6.5 is out, and it re-incorporates the libpcap workaround for
the BPF BIOCSRTIMEOUT bug in 64-bit mode, so we don't need to do our own
workaround in 10.6.5 or later.

svn path=/trunk/; revision=34841
2010-11-11 07:34:12 +00:00
Stig Bjørlykke 2cedc69849 Fixed "Compiled with" information in the About box.
svn path=/trunk/; revision=34601
2010-10-21 07:13:43 +00:00
Guy Harris 5770f7fe86 PIPE_READ_TIMEOUT should be in microseconds, not milliseconds.
As it's a constant, we can do the split into seconds and microseconds at
compile time, so do that (so that it works even if we happen to make
PIPE_READ_TIMEOUT >= 1 second).

svn path=/trunk/; revision=34283
2010-09-30 01:40:03 +00:00
Guy Harris 7fab58179a Always use a timeout of 250ms for pipes when not using threads; that way
we know it's < 1s, and don't have to worry about properly setting tv_sec
and tv_usec for select().

Get rid of unneeded pointer variable.

svn path=/trunk/; revision=34282
2010-09-30 01:01:25 +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
Sake Blok f17c5ac01f As mentioned on the users-mailinglist[1], it could be useful to have groups read access to the ringbuffer that dumpcap creates. That way, a group of people can access the capture files without having to use root access.
[1]  http://www.wireshark.org/lists/wireshark-users/201008/msg00235.html

svn path=/trunk/; revision=33978
2010-08-28 11:05:51 +00:00
Sake Blok 42a0f16cef We change the owner and group of the first file, so we also want to change owner and group of the rest of the files in the ringbuffer.
svn path=/trunk/; revision=33977
2010-08-28 09:44:18 +00:00
Gerald Combs 5aae07254f Forward-port r33953.
Move the SetDllDirectory calls to ws_init_dll_search_path. If
SetDllDirectory fails, pass the Wireshark program path to
SetCurrentDirectory.

svn path=/trunk/; revision=33958
2010-08-27 19:24:44 +00:00
Gerald Combs b73454e8bd Fix !Windows compilation.
svn path=/trunk/; revision=33917
2010-08-25 00:20:50 +00:00
Gerald Combs ad4ffa5d49 Partial fix for bug 5133. On Windows, call SetDllDirectory at startup if
it's present in Wireshark and dumpcap. This takes care of the airpcap.dll
PoC but we need to load wpcap.dll from a full path. We might want to
call SetDllDirectory from our other executables as well.

svn path=/trunk/; revision=33916
2010-08-24 23:39:29 +00:00
Jörg Mayer 3a8eea122f Add #ifdef HAVE_BPF_IMAGE
around
show_filter_code(capture_options *capture_opts)

To fix a warning about an unused function.


svn path=/trunk/; revision=33519
2010-07-14 13:22:34 +00:00
Guy Harris 6582e265a8 Fix warnings.
svn path=/trunk/; revision=33517
2010-07-14 08:56:35 +00:00
Guy Harris 61ffcf2618 Fix build errors.
svn path=/trunk/; revision=33515
2010-07-14 08:27:26 +00:00
Guy Harris 6a8c39c59f Define print_caps() before we use it.
svn path=/trunk/; revision=33514
2010-07-14 04:31:52 +00:00
Guy Harris b277e17e7b Ensure, at compile time, that the error-message-buffer argument to
open_captur_device() is an array of PCAP_ERRBUF_SIZE chars.  That means
we don't need to pass the size.

Unfortunately, pcap_compile() didn't always take a "const char *" as the
filter string argument, even though it didn't modify the argument; don't
pass it a "const char *".

Don't print the secondary error message if it's empty.

svn path=/trunk/; revision=33513
2010-07-14 04:30:37 +00:00
Guy Harris 31c8eaf95e Define relinquish_all_capabilities() before we use it.
If we get an "XXX is not one of the DLTs supported by this device" error
when we try to set the link-layer header type, don't tell the user to
report it to the Wireshark developers, as that's probably just the
result of them giving a link-layer header type that the device doesn't
support.

svn path=/trunk/; revision=33512
2010-07-14 02:14:54 +00:00
Guy Harris c85fa2cd46 We must also set the link-layer header type before compiling the capture
filter, as that affects the generated code.

svn path=/trunk/; revision=33510
2010-07-14 00:50:25 +00:00
Guy Harris 4d6cb744df Add a "-d" flag to dumpcap, to print out the generated code for the
capture filter in human-readable form.  (Well, readable by humans who
know BPF machine language, at least. :-))

svn path=/trunk/; revision=33509
2010-07-13 23:26:07 +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
Guy Harris 80fda10f18 Make -q not a capture option again - it's used by tshark even when not
capturing, and thus even when we build without pcap.

svn path=/trunk/; revision=32988
2010-05-27 01:13:49 +00:00