Commit Graph

403 Commits

Author SHA1 Message Date
Michael Tüxen 68204c94a4 From Anders: Add support for options in the SHB.
From me: Some whitespace changes.

svn path=/trunk/; revision=41026
2012-02-14 17:07:52 +00:00
Anders Broman e553c70fe8 From Michael Mann:
help page update (pcapng is now the default file format).

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

svn path=/trunk/; revision=40658
2012-01-23 07:48:53 +00:00
Guy Harris 3864d5d19d Add an additional DONT_HAVE_PCAP return value from get_interface_list()
and capture_interface_list().  Return it if, on Windows, we ask for the
interface list but don't have WinPcap installed.  Handle it like
CANT_GET_INTERFACE_LIST.

svn path=/trunk/; revision=40334
2011-12-29 22:49:49 +00:00
Guy Harris 21f5ea24e4 Just hard-code the error for "can't load WinPcap"; the one that
cant_load_winpcap_err() has some redundant gunk in it.

svn path=/trunk/; revision=40333
2011-12-29 22:06:22 +00:00
Guy Harris 71c7f43d37 On Windows, if we can't open a capture device, check whether WinPcap is
loaded and, if not, report that as the problem, rather than suggesting
that you didn't specify the proper interface.

svn path=/trunk/; revision=40332
2011-12-29 21:59:24 +00:00
Guy Harris d892f00916 Show a "Capturing on ..." message similar to TShark.
svn path=/trunk/; revision=39989
2011-11-22 19:07:49 +00:00
Guy Harris 939feef06f If we're not running as a child process, report the interfaces on which
we're capturing.  (We do not require a -i flag; the message could be
useful if you don't specify the interface, as it lets you know which
interface was chosen, which might not be the interface you'd think it
would be.  Yes, that's arguably a libpcap bug, which I plan to look at;
it should probably try to figure out which interfaces are "active" if
possible, and prefer those.)

Use cmdarg_err() for invalid capture filters and other capture errors.

svn path=/trunk/; revision=39983
2011-11-22 10:08:26 +00:00
Guy Harris 46575653fd Don't set variables if we don't look at them later. All praise Clang
Cat.

svn path=/trunk/; revision=39876
2011-11-16 02:18:30 +00:00
Gerald Combs aa0c9c965c Try to fix the GLib thread API deprecations listed in bug 6552.
svn path=/trunk/; revision=39776
2011-11-09 23:43:50 +00:00
Stig Bjørlykke 612dcc3c6b As reported by Michael Speck:
Removed last occurrences of USE_THREADS.

svn path=/trunk/; revision=39775
2011-11-09 20:45:06 +00:00
Gerald Combs 7d442f4c22 Change the use of threads from "mostly always, depending on your
configure options and Gtk+ and GLib versions" to "always".

svn path=/trunk/; revision=39751
2011-11-07 23:42:53 +00:00
Chris Maynard 367cb50bd3 Minor formatting changes to the dumpcap -h output.
svn path=/trunk/; revision=39166
2011-09-27 18:19:23 +00:00
Bill Meier a58121db53 Fix vi "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748


svn path=/trunk/; revision=39076
2011-09-21 16:44:10 +00:00
Bill Meier 9c6aca43f2 Windows: GetTickCount() returns a DWORD (not a time_t);
Fixes a problem on Windows wherein specifying a capture file
time duration for autostop or file-switching would stop
working after some period of time.

The reason:
GetTickCount returns DWORD (unsigned int) which
 wraps "every 49.7 days";

and: The GetTickCount() return value was being stored in a time_t which is
 int64 on Windows;

thus:
 The test for elapsed time (using signed integers) didn't work correctly after
 the time had wrapped.

Fixes Bug #6280: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6280


svn path=/trunk/; revision=38921
2011-09-07 18:25:54 +00:00
Stephen Fisher dc3c5c8b63 Attempt to fix coverity id 1212: MISSING_BREAK by inserting "FALLTHROUGH"
comment.


svn path=/trunk/; revision=38785
2011-08-29 21:36:48 +00:00
Jeff Morriss bf95c7b5e4 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :
getopt() can/should normally be found in unistd.h, so:

- When testing for getopt(), define that we HAVE_GETOPT instead of
  HAVE_GETOPT_H (to avoid confusion).
- Don't attempt to include getopt.h: not all OS's have it (for example,
  Solaris 9 does not).
- (All the places which need getopt already include unistd.h (if we have it).)

If this breaks things on some OS, we might need (a real) HAVE_GETOPT_H check.

svn path=/trunk/; revision=38437
2011-08-09 21:02:10 +00:00
Jörg Mayer c15ff441c6 Replace deprecated glib functions.
In order to compile the whole project with -DG_DISABLE_DEPRECATED
the mate plugin needs to replace its usage of GMemChunk.
All other places should be clean.

svn path=/trunk/; revision=38392
2011-08-07 18:15:45 +00:00
Michael Tüxen 52f555d857 Use the threads based workaround only on windows (with thread support enabled),
since the workaround is only intended to work on windows.

svn path=/trunk/; revision=38059
2011-07-16 12:45:47 +00:00
Michael Tüxen c481dda78c Fix compilation on non-windows platforms defining USE_THREADS.
svn path=/trunk/; revision=38044
2011-07-15 14:31:27 +00:00
Michael Tüxen c51aafc3aa Handle the case where dumpcap is compiled without thread support, which
is the default.

svn path=/trunk/; revision=38043
2011-07-15 12:20:00 +00:00
Gerald Combs a533d70be0 On Windows enable threads everywhere instead of just in dumpcap. If
threads are enabled use them to check the recent file list. Fixes bug
3810.

svn path=/trunk/; revision=38033
2011-07-14 23:18:02 +00:00
Guy Harris da461f18ad Alas, the libpcap API didn't use "void *" where it should have; squelch
some warnings from Clang.

svn path=/trunk/; revision=37934
2011-07-08 02:02:37 +00:00
Chris Maynard 91f30ab64f From Jakub Zawadzki via bug 6002: Don't set state to STATE_EXPECT_DATA if there's no data to read.
Reference: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6002


svn path=/trunk/; revision=37924
2011-07-06 16:22:11 +00:00
Gerald Combs 9661c3fdde Disable DEBUG_CHILD_DUMPCAP.
svn path=/trunk/; revision=37864
2011-07-02 15:44:17 +00:00
Jakub Zawadzki 5c801f3820 Revert r37857, r37861
svn path=/trunk/; revision=37862
2011-07-01 22:26:02 +00:00
Jakub Zawadzki fafa84d23e Try to get more information about AV.
svn path=/trunk/; revision=37861
2011-07-01 22:00:59 +00:00
Jakub Zawadzki aeb81605de Catch system exceptions from pcap_open_live() :)
svn path=/trunk/; revision=37857
2011-07-01 20:07:34 +00:00
Michael Tüxen be3a756582 Add paranoid debug output in open_capture_device().
svn path=/trunk/; revision=37847
2011-06-30 21:02:11 +00:00
Gerald Combs 031a28f65e Log the success or failure of pcap_open/pcap_create/pcap_open_live.
svn path=/trunk/; revision=37846
2011-06-30 20:17:26 +00:00
Gerald Combs f04a525e79 Temporarily enable dumpcap debugging.
svn path=/trunk/; revision=37844
2011-06-30 17:41:46 +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
Gerald Combs 710c5d67f7 Update suite-clopts.sh to match dumpcap's error output. Add a comment
to dumpcap.c about keeping the errors synced.

svn path=/trunk/; revision=37805
2011-06-27 16:09:49 +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 2c8c178f71 Improve the report of illegal capture filters. Also show the interface description.
svn path=/trunk/; revision=37802
2011-06-27 11:30:39 +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 23659efce6 Add pcap_options to the pcap_queue elements. This lets us keep interface
IDs in one place and fixes a bug which resulted in only writing
interface ID 0 to NG enhanced packet blocks.

svn path=/trunk/; revision=37773
2011-06-23 18:54:07 +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
Guy Harris 5ed5745664 Sigh. Cast away a warning.
svn path=/trunk/; revision=37676
2011-06-15 21:22:30 +00:00
Guy Harris 2bada9a24f Constify some arguments.
Technically, %p must be given a void * as an argument (although the
representation of pointers on all platforms we deal with is the same for
all pointed-to types).

svn path=/trunk/; revision=37675
2011-06-15 20:21:45 +00:00
Jakub Zawadzki f6bda7f43a Remove not used cap_pipe_err_str.
svn path=/trunk/; revision=37662
2011-06-13 15:28:37 +00:00
Michael Tüxen 71325b8ac2 When doing remote capturing using WinPCap, dumpcap crashes inside the WinPCap
library when no capture filter is used. Then cfilter is NULL and 
capture_loop_init_filter() does not call compile_capture_filter() and
pcap_setfilter(). Providing an empty string instead of NULL works around
the problem.

svn path=/trunk/; revision=37588
2011-06-07 12:23:15 +00:00
Michael Tüxen 8f8f0e9ad6 Get rid of has_cfilter to simplify the handling of multiple interfaces.
svn path=/trunk/; revision=37478
2011-05-31 14:49:21 +00:00
Michael Tüxen 6516aa9864 Improve handling of command line errors.
svn path=/trunk/; revision=37477
2011-05-31 14:45:55 +00:00
Michael Tüxen 31c756a6d1 Initialize pcap using an empty array instead of NULL. So no special
check is needed.

svn path=/trunk/; revision=37445
2011-05-28 12:48:21 +00:00
Stig Bjørlykke 54356d4ccb Initialize global_ld.pcaps before we setup signal handlers, which
uses this list to cleanup.

svn path=/trunk/; revision=37425
2011-05-27 06:52:32 +00:00
Gerald Combs ebc0c3e33f Don't call g_log(); as the comment indicates it can cause problems.
svn path=/trunk/; revision=37418
2011-05-26 23:20:35 +00:00
Gerald Combs 093fce7576 Don't call pcap_breakloop() if we're not capturing anything. Fixes a
crash found by Stig.

Add debugging output to capture_cleanup_handler() on non-Windows
systems.

svn path=/trunk/; revision=37417
2011-05-26 22:12:27 +00:00
Chris Maynard a4f53c991c Append received percentage after received/dropped counts.
svn path=/trunk/; revision=37415
2011-05-26 20:05:11 +00:00
Michael Tüxen 1e70d66184 Provide consistent counters for received and dropped packets.
svn path=/trunk/; revision=37414
2011-05-26 19:22:16 +00:00
Michael Tüxen 90ddc2f3b1 Fix the handling of pipes on Windows platforms.
This should fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5939

svn path=/trunk/; revision=37413
2011-05-26 18:12:41 +00:00
Chris Maynard 77c9577a29 Change "captured/dropped" terminology to "received/dropped". Also, unless
we're a capture child, always report the final caputure count regardless of the
'quiet' setting.  This ensures that each interface prints its statistics on a
new line, rather than the first one being printed on the same line as the
packet count in the case when we're not 'quiet'.

svn path=/trunk/; revision=37410
2011-05-26 14:33:55 +00:00
Gerald Combs a24687ce8e Move the Windows argument list conversion code to a common routine.
svn path=/trunk/; revision=37372
2011-05-24 00:07:56 +00:00
Michael Tüxen bfb7d262e8 Use appropriate temporary filename when capturing from multiple interfaces.
svn path=/trunk/; revision=37344
2011-05-21 20:57:00 +00:00
Michael Tüxen 17dd51831f As suggested on the dev list: Use pcapng and threads
when capturing on multiple interfaces even if not specified
on the command line.

svn path=/trunk/; revision=37343
2011-05-21 18:51:25 +00:00
Gerald Combs 9be282951b Pass a pcap_options * instead of a pcap_options **.
svn path=/trunk/; revision=37341
2011-05-21 00:10:57 +00:00
Michael Tüxen eb3ebb5412 Drop privileges after opening all pcap devices, not after the first one...
svn path=/trunk/; revision=37311
2011-05-19 20:48:58 +00:00
Michael Tüxen b51eba6e47 Actually use the defaults from the last commit message.
... and switch off debug output.

svn path=/trunk/; revision=37285
2011-05-19 05:51:52 +00:00
Michael Tüxen e960be113f Add a queue and byte limit to the capture queue. Current default
values: 1000 packets, 1 MB. Should be made configurable via
command line options.

svn path=/trunk/; revision=37284
2011-05-19 05:49:46 +00:00
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
Guy Harris b0bfae2a85 Don't send ^T output to the standard error if we're a capture child.
Make SIGINFO a restart-the-system-call signal, so reads etc. don't
return an error.

svn path=/trunk/; revision=32968
2010-05-26 04:29:36 +00:00
Guy Harris 7a630c61a1 Add a -q flag to dumpcap, to squelch its reporting of the packet count,
and add support for SIGINFO, so, if your OS supports SIGINFO, you can
get the packet count by typing ^T.

svn path=/trunk/; revision=32958
2010-05-26 00:19:27 +00:00
Guy Harris 71de391514 Pull the big pile of code that handles the
capture-stopping/file-switching operation into a routine.  Move a few
variables into the loop_data structure so that routine can get at them.

svn path=/trunk/; revision=32949
2010-05-25 20:14:22 +00:00
Guy Harris 72ed0558f2 Don't have -M affect -v yet; if we end up, for example, having dumpcap
being the only program that needs to be linked with *pcap, that's when
we'd want to fetch that information, but there might be other libraries
(e.g., the POSIX capabilities library) that it might be linked with but
that programs that use it aren't linked with.

Don't commit to the output formats of -M, as they are, as noted, subject
to change from release to release.

svn path=/trunk/; revision=32904
2010-05-19 23:27:35 +00:00
Guy Harris c1e651802e -S doesn't require an interface, either.
svn path=/trunk/; revision=32883
2010-05-19 02:55:05 +00:00
Guy Harris ccac912244 Regularize indentation a bit.
Let pcap_statustostr()'s result suffice for most PCAP_ERROR_ errors. 
Don't mention the capture device name multiple times in the error
message.  Treat positive returns from pcap_can_set_rfmon() other than 0
or 1 as weird returns, not error returns.

svn path=/trunk/; revision=32882
2010-05-19 02:47:16 +00:00
Guy Harris ece9788353 Squelch an unused-variable warning.
svn path=/trunk/; revision=32856
2010-05-18 03:35:20 +00:00
Guy Harris 0910d319cd Move some routines around, fix and shuffle comments.
svn path=/trunk/; revision=32854
2010-05-18 02:48:51 +00:00
Guy Harris 1bf60839c9 Move get_pcap_linktype() into dumpcap - it's not used elsewhere.
svn path=/trunk/; revision=32853
2010-05-18 02:36:02 +00:00
Guy Harris c58680fd40 Only negative return values from pcap_activate() are errors; positive
return values are success-with-a-warning.

Report those errors with a string.

svn path=/trunk/; revision=32852
2010-05-18 01:48:46 +00:00
Guy Harris e3038273ca Don't write the SP_SUCCESS messages unless -Z was specified.
Add support for a machine-readable "-v" output, which prints only the
pcap version string.

Give a little more information about the machine-readable format, but
note that it's primarily intended for consumption by Wireshark and
TShark and is subject to change.

Properly hyphenate "pcap-ng".

svn path=/trunk/; revision=32851
2010-05-18 00:20:30 +00:00
Guy Harris 14c40a21aa Make -Z always generate machine-readable output, and don't bother
supplying -M along with -Z.  (We keep -M around for debugging use; it's
documented, unlike -Z.)

svn path=/trunk/; revision=32850
2010-05-17 23:56:00 +00:00
Guy Harris 859c6e4d3e If dumpcap is run with -D, don't select a default interface; it's not
necessary.

If it's run with -D and -M, and we found no interfaces, don't treat that
as an error; let the code that reads our output just indicate it as "no
interfaces available", so *its* caller can decide whether to report an
error or not (in some cases in Wireshark, it's obvious that there are no
interfaces, e.g. there aren't any listed on the welcome screen, so
popping up a dialog is pointless).

svn path=/trunk/; revision=32849
2010-05-17 23:13:24 +00:00
Guy Harris 991c5e9898 When dumpcap is run to get an interface list, interface capabilities, or
interface statistics, have its error messages come out as sync-pipe
errors, have it send a sync-pipe "success" message on success, and have
the callers get that message and display it.

svn path=/trunk/; revision=32843
2010-05-17 18:40:23 +00:00
Guy Harris 9307251bb8 Um, no, the problem with the Leopard x86 build is that we first do a
build without libpcap, to make sure that works, and then do a build with
libpcap, to put into a binary release.  It's the former that's failing;
I'll back out the previous change and then work on that.

svn path=/trunk/; revision=32801
2010-05-14 00:49:28 +00:00
Guy Harris 0e54136213 See whether the Leopard x86 buildbot is upset because of the name
if_capabilities_t - it doesn't fail on Snow Leopard, even if I undefine
HAVE_PCAP_CREATE, and doesn't fail on the Leopard PPC buildbot, either.

svn path=/trunk/; revision=32799
2010-05-14 00:10:15 +00:00
Guy Harris 1c18115bd3 Fetch an indication of whether the interface supports capturing in
monitor mode at the same time that we fetch its list of link-layer
types.  Support fetching that list in monitor mode, as the list may be
different in regular and monitor mode.  If the interface supports
monitor mode, when printing the list of link-layer types, indicate
whether they're fetched in monitor mode or not, as tcpdump 4.1.x does.

svn path=/trunk/; revision=32789
2010-05-13 17:37:39 +00:00
Guy Harris 5be9fa156f If we have pcap_open(), and we're *not* opening an rpcap URL, open the
device, don't just execute whatever comes after the open code as an else
clause.

svn path=/trunk/; revision=32761
2010-05-11 20:19:35 +00:00
Guy Harris 55dc4be5ba Include inet_v6defs.h after include the Windows socket headers, so it
knows whether AF_INET6 is needed.

svn path=/trunk/; revision=32722
2010-05-08 01:37:36 +00:00
Guy Harris 3debd13524 Include inet_v6defs.h if needed to declare inet_ntop().
svn path=/trunk/; revision=32720
2010-05-08 01:15:56 +00:00
Guy Harris 547b9e48a2 The default capture buffer size is, in fact, *nominally* 1MB; however,
libpcap/WinPcap and the capture mechanism atop which they run might
either silently limit the buffer size to a smaller value or raise it to
a higher value - that's the part that's platform-dependent.

svn path=/trunk/; revision=32718
2010-05-08 00:39:07 +00:00
Guy Harris 077ff72ac1 As with the list of data link types, so with the list of interfaces; move
the code to print the machine-readable format into dumpcap, and have the
code in capture_opts.c just print the human-readable format.

svn path=/trunk/; revision=32714
2010-05-07 19:24:32 +00:00
Guy Harris 13bf4a0c55 Add routines vfprintf_stderr() and fprintf_stderr() to print to the
standard error and, in Wireshark on Windows, create a console if
necessary.  Have the cmdarg_err routines use them.

Use *fprintf_stderr() to print the output of -L, rather than using
cmdarg_err_cont(), so that we don't get extra newlines in the output (it
should look similar to the output of tcpdump).

svn path=/trunk/; revision=32711
2010-05-07 08:40:02 +00:00
Guy Harris cc05b9250d For TShark and Wireshark, get the list of link-layer types for an
interface by running dumpcap, so that if you need privileges to open an
interface, and dumpcap has those privileges, neither TShark nor
Wireshark need them.

svn path=/trunk/; revision=32710
2010-05-07 08:06:25 +00:00
Guy Harris 4cd5e44340 Oops, -B disappeared from the list of dumpcap options in the change to
support multiple, err, optional options.

svn path=/trunk/; revision=32705
2010-05-07 01:50:22 +00:00
Guy Harris 20cbf81d39 Beginnings of monitor mode support with libpcap 1.x.
svn path=/trunk/; revision=32702
2010-05-07 01:22:33 +00:00
Guy Harris 4c5b8c5277 Instead, say that the default is platform-dependent.
svn path=/trunk/; revision=32701
2010-05-07 00:28:42 +00:00
Guy Harris 96f67d9517 Now that we support -B on various UN*X platforms as well as Windows, we
can no longer state what the default is (it's platform-dependent).

svn path=/trunk/; revision=32700
2010-05-07 00:16:52 +00:00
Guy Harris 7dbbb8c572 Just check for pcap_create(); it first appeared in libpcap 1.0.0, and
pcap_set_buffer_size() did as well, so there aren't any libpcap releases
with pcap_create() but not pcap_set_buffer_size().

Only do one check for pcap_create.

svn path=/trunk/; revision=32695
2010-05-06 23:33:41 +00:00
Gerald Combs 6ee96dc4a4 Fix compilation.
svn path=/trunk/; revision=32694
2010-05-06 23:29:55 +00:00
Anders Broman f9981411f1 Checking in Stigs changes from
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=475
BUT not activating the check for 
pcap_create()
pcap_set_buffer_size()
This should make it possible to build with support for setting the buffersize if not capturing 802.11 traffic.

The code for handling the 'B' option should be OK in any case.

svn path=/trunk/; revision=32688
2010-05-06 18:34:30 +00:00
Gerald Combs f2a66480df Revert r31529. Timing out while waiting for the pcap file header causes
more problems than it solves.

svn path=/trunk/; revision=32544
2010-04-23 17:22:51 +00:00
Guy Harris 7b41a72801 Expand the comment explaining the workaround for the Snow Leopard
timeout bug.

Make the code for the workaround assume any 10.6.x release other than
10.6.2 requires it; that way we don't have to update the code until
either

	1) Apple fixes the bug in a later 10.6.x update

or

	2) Apple comes out with a major release that still has, or
	   reintroduces, the bug.

svn path=/trunk/; revision=32349
2010-04-01 00:27:25 +00:00
Michael Tüxen d87005b114 Enable pcap timeout workaround for Mac OS X 10.6.3, since the bug seems to be
back.

svn path=/trunk/; revision=32348
2010-03-31 23:37:42 +00:00
Guy Harris 2b321eaf56 From Hilko Bengen: support capturing from UNIX-domain sockets.
Update a comment.

svn path=/trunk/; revision=32177
2010-03-13 00:29:30 +00:00
Guy Harris 25d49313cc "capture-pcap-util.h" include <pcap.h>, and <pcap.h>, for better or
worse, has no include-once guards; include it only once.

svn path=/trunk/; revision=32110
2010-03-04 07:19:43 +00:00
Guy Harris 167ab3a98c In Wireshark and TShark, run dumpcap to get interface lists and lists of
link-layer header types for interfaces; if special privileges are
necessary to open capture devices, Wireshark and TShark shouldn't have
those privileges, but dumpcap should.

svn path=/trunk/; revision=32104
2010-03-04 01:12:04 +00:00
Guy Harris cde1496de2 Squelch some compiler warnings.
svn path=/trunk/; revision=32074
2010-03-01 23:43:47 +00:00
Guy Harris 3b845dcce0 Move a routine into dumpcap - it's not used outside dumpcap.
svn path=/trunk/; revision=32042
2010-02-27 23:32:08 +00:00
Gerald Combs 97c480741d If we're using threads, time out when reading the file header.
svn path=/trunk/; revision=31529
2010-01-14 22:45:12 +00:00
Guy Harris 89d7efc44a Only do the 1-second timeout in OS X 10.6 and 10.6.1; the bug is fixed
in 10.6.2.

svn path=/trunk/; revision=31081
2009-11-26 04:17:18 +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
Stig Bjørlykke b82f3a8037 Cast a pointer to avoid a warning.
svn path=/trunk/; revision=30229
2009-10-01 11:09:27 +00:00
Stig Bjørlykke ee37f6194f Initialize magic to avoid a warning about a possible uninitialized read.
svn path=/trunk/; revision=30188
2009-09-29 06:57:11 +00:00
Jeff Morriss af6fca176d Don't use SIGUSR1 to tell dumpcap to exit, use SIGINT: SIGINT is traditionally
used for this purpose and using it also prevents the 2 signals the child gets:
	- the user's Ctrl-C (which is sent as a SIGINT to both *shark and its
	  child dumpcap)
	- the signal *shark generates to shut down the child

from colliding (and running 2 signal handlers in the child).

It might be possible for tshark to not send the signal at all when it gets
SIGINT, but it doesn't do any harm now.

Also, do not call g_log() within the signal handler: doing so can cause
aborts (if g_log is being called by the process when the signal comes, the
2nd entrance into g_log is detected as a recursion).

This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2767

svn path=/trunk/; revision=29881
2009-09-13 17:46:10 +00:00
Kovarththanan Rajaratnam 0ef69d922a Use Wireshark/GLib attribute specifiers instead of checking for __GNUC__ explicitly
svn path=/trunk/; revision=29804
2009-09-08 18:02:43 +00:00
Michael Tüxen 4a50092991 Use a timeout of a second for Mac OS X, when building
a 64-bit application. Workaround a bug in Mac OS X...

svn path=/trunk/; revision=29641
2009-08-31 19:13:50 +00:00
Anders Broman 5cba22a89b Make the windows build compile.
svn path=/trunk/; revision=29591
2009-08-28 05:17:14 +00:00
Gerald Combs 3b4fb8e340 Properly set our file descriptor when we're capturing from a pipe on
non-Windows systems.

svn path=/trunk/; revision=29590
2009-08-27 23:55:48 +00:00
Gerald Combs 4812f29640 Check for INVALID_HANDLE_VALUE instead of NULL on Windows. This keeps
us from feeding a NULL pointer to pcap_compile if we can't open our
pipe. Fix up a couple of error messages.

svn path=/trunk/; revision=29587
2009-08-27 15:46:53 +00:00
Bill Meier 1826a02933 Add #include <stdio.h> in a few places for Solaris
svn path=/trunk/; revision=29576
2009-08-27 02:53:13 +00:00
Gerald Combs 4c7f40f3f5 Add a compile-time option to use a separate thread for reading from
pipes. Enable this by default on Windows. Remove code that tried to
use WaitForSingleObject on a pipe (which Windows doesn't support). Use
native file handles and system calls on Windows (which fixes a problem
with partial reads I ran into during testing).

This should fix bug 1759.

svn path=/trunk/; revision=29574
2009-08-26 23:16:37 +00:00
Balint Reczey 98d79569e0 From Rob Leslie <rob@mars.org>:
[PATCH] Fix dumpcap believing error on ^C i.e. pcap_breakloop()
When ^C was pressed during a packet capture, dumpcap believed a pcap
error had occurred.  We check the return value more closely to avoid
this problem.

svn path=/trunk/; revision=29510
2009-08-22 22:49:59 +00:00
Gerald Combs e0ebc32195 Updates to create_tempfile:
- Use g_get_tmp_dir, just like get_tempfile_path.
  - Don't make the caller worry about the path buffer length.

svn path=/trunk/; revision=28915
2009-07-01 23:36:51 +00:00
Gerald Combs 59a767f0b2 Unfortunately, r28452 seems to cause more problems than it fixes. Back
out the change for now.

svn path=/trunk/; revision=28852
2009-06-26 21:25:09 +00:00
Balint Reczey 1f8c72ff25 Set SIGPIPE handler every time the program starts.
This hopefully fixes bug 1740.

svn path=/trunk/; revision=28549
2009-05-31 18:38:28 +00:00
Gerald Combs f7f2a08def From Benjamin Tse via bug 2200:
I've created a new bug rather than reopening 1181 as the scope is constrained
somewhat more.

Basically, when capturing from a named pipe the wireshark display lags by one
packet. This is especially frustrating when the packets arrive at low rates.

tshark is fine. But the packet count in dumpcap also lags by one.

Looking at the code, the problem appears to be in cap_pipe_select(). It
attempts to use WaitForSingleObject() on the named pipe but AFAICT this never
blocks.

I've attached a diff for some code that fixes the issue for me. The semantics
of overlapped IO in Win32 is quite different from the select/read model - hence
the other changes!

I've tested this fix on WinXP, 2k server and 2003 server. I've also checked
that my changes compile on a Freespire box that I have lying around.


From me:

Adapt the changes for dumpcap, which is where the affected code now lives.

svn path=/trunk/; revision=28452
2009-05-22 19:52:30 +00:00
Michael Tüxen 6de58c28f0 Add -n option to dumpcap. It will save the capture files in
pcapng format instead of pcap. The default is to use pcap.

svn path=/trunk/; revision=28170
2009-04-27 08:11:10 +00:00
Michael Tüxen f5547c0d78 Make ringbuffer.[ch] file format agnostic.
Move write routines to dumpcap.c
This is a preparation for pcapng support.

svn path=/trunk/; revision=28155
2009-04-26 15:51:25 +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
Bill Meier 013db77404 Use wireshark (instead of ether) for temp file name prefix.
svn path=/trunk/; revision=27992
2009-04-08 12:22:12 +00:00
Jaap Keuter 69463d1fd0 From Toralf Förster:
Small cleanup of preprocessor logic.

svn path=/trunk/; revision=27212
2009-01-11 18:16:50 +00:00
Jaap Keuter da34ecd34a From Ronald W. Henderson:
dumpcap should terminate if exactly the maximum number of packets have been captured 
(or greater) as specified by the user: "-c <capture packet count>". The current behavior 
waits until an additional packet is captured until this threshold check occurs.

svn path=/trunk/; revision=27208
2009-01-11 12:26:32 +00:00
Balint Reczey 4942a20da4 From Pavol Rusnak (bug 1740):
Set SA_RESTART flag when setting SIGPIPE handler.

svn path=/trunk/; revision=26851
2008-11-26 12:54:39 +00:00
Stig Bjørlykke 32d411be1d Do not set buffer size for remote interfaces or when using default value.
Do not get link-layer for remote interfaces.

svn path=/trunk/; revision=26683
2008-11-03 21:38:53 +00:00
Stig Bjørlykke 841e3a0a3f Fixed some "ignoring return value" warnings.
This is the last commit to make it compile clean on Ubuntu 8.10.

svn path=/trunk/; revision=26654
2008-10-31 17:43:51 +00:00
Balint Reczey c2ce5dcbf6 Based on patch from Sergio Barjola:
Enable the default action for SIGPIPE
This fixes bug 2888 and 1740

svn path=/trunk/; revision=26621
2008-10-30 11:48:13 +00:00
Guy Harris e8ba2515de The packet counts and drop counts reported by libpcap are unsigned.
Clean up indentation a bit.

svn path=/trunk/; revision=26037
2008-08-19 05:10:16 +00:00
Gerald Combs cb3022d098 If we can't open open an interface in Windows, instead of talking about
specific issues (one of which no longer applies), point the user at the 
wiki.

svn path=/trunk/; revision=25833
2008-07-25 22:29:02 +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
Guy Harris f8b7863753 Fix some references to the global loop_data structure that weren't
changed in the previous checkin.

svn path=/trunk/; revision=25573
2008-06-24 03:33:51 +00:00
Guy Harris 802d9abf4f Rename the global "ld" structure to "global_ld", to avoid collisions
with the "ld" pointer argument (and to point out that it's a global
variable).

svn path=/trunk/; revision=25554
2008-06-23 21:22:11 +00:00
Guy Harris ee78dbb925 Get rid of the static capture_opts pointer - it collides with parameter
names, as noted by John Smith.

svn path=/trunk/; revision=25542
2008-06-23 20:21:46 +00:00
Guy Harris e731e24b51 capture_opts_print_statistics() has nothing to do with capture options
setting, and is used only in dumpcap.c, and needs to get at information
set by dumpcap's signal handlers so it can respond to ^C; move it to
dumpcap.c, rename it print_statistics_loop(), and make it set ld.go to
TRUE before looping and loop only as long as ld.go is TRUE.

That fixes bug 2592 (at least on Mac OS X, and probably on other UN*Xes;
it should fix it on Windows as well).

svn path=/trunk/; revision=25492
2008-06-20 00:09:47 +00:00
Anders Broman 36d89bb79c Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25368
2008-05-23 05:55:34 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.

While doing that, rename the eth_* functions to ws_*.

svn path=/trunk/; revision=25354
2008-05-22 15:46:27 +00:00
Bill Meier 398e06e875 Fix a few typos.
svn path=/trunk/; revision=24724
2008-03-24 18:32:15 +00:00
Gerald Combs ec74de5957 dumpcap.c: Fix a typo.
INSTALL: Add entries for libcap.

svn path=/trunk/; revision=24722
2008-03-24 16:22:30 +00:00
Bill Meier e843df87f6 Fix (aka workaround) for bug #2228.
Essentially: if using libcap, drop capabilities
after doing pcap_open_live. 
See comment in main() for details.

svn path=/trunk/; revision=24716
2008-03-22 19:04:26 +00:00
Gerald Combs c288c1ae05 Don't call cap_set_proc() unless we were started with elevated
privileges.  Otherwise, we might print

dumpcap: cap_set_proc() fail return: Operation not permitted

to stderr.

svn path=/trunk/; revision=24704
2008-03-20 19:18:33 +00:00
Bill Meier 2c07da3195 Fix for handling dumpcap errmsgs when wireshark does 'dumpcap -D -M', etc
svn path=/trunk/; revision=24507
2008-02-29 18:48:29 +00:00
Jeff Morriss 404c087195 Use plain old strcmp() instead of g_ascii_strcasecmp() when searching for -Z.
On glib-1.2 systems g_ascii_strcasecmp() is in libwireshark (which we don't
want to include in dumpcap) and anyway our code should be the only thing
calling dumpcap with "-Z"--so hopefully there's no need for doing a
case-insensitive comparison.

(This is another argument for adding a "utils" library.)

svn path=/trunk/; revision=24462
2008-02-25 20:43:03 +00:00
Bill Meier 8d4f01eea7 Ensure tshark/wireshark always get good err msgs from dumpcap:
1. Clean up dumpcap 'as a child' err msg handling so that:
   - all err msgs are properly formatted when being sent 
     back to the parent.
   - any log Critical, Warning, etc messages
     are sent back to parent and are properly formatted.
2. Change handling of -w <...> slightly in capture_opts.c
   so that wireshark provides a good error message if
   there is a 'write permissions' issue on the file.
   (Previously the error popup said only 
   "Child exited with status 2").
   This fixes bug #2288.

Add some conditionalized DEBUG_CHILD_DUMPCAP code for
   dumpcap debug logging to a file.

svn path=/trunk/; revision=24446
2008-02-23 19:59:38 +00:00
Guy Harris 8d8800f3e9 dumpcap doesn't need stuff declared in capture.h; it just needs what's
declared in capture_opts.h.

svn path=/trunk/; revision=24352
2008-02-16 08:44:33 +00:00
Guy Harris 7eac554d02 One include of epan/unicode-utils.h suffices - and the routines it
declares are called only on Windows.

svn path=/trunk/; revision=24351
2008-02-16 08:38:23 +00:00
Guy Harris 7aa5f3f1ad Directly call capture_loop_packet_cb(), rather than making a pointer to
the callback function part of the loop_data structure - we always call
capture_loop_packet_cb().

svn path=/trunk/; revision=24350
2008-02-16 08:09:56 +00:00
Guy Harris 95f3802ae9 If we don't have libcap, relinquish special privileges just after
opening the capture device.  That somewhat fixes bug 2273, although the
second and subsequent files don't have the right group ownership,
probably because of the problem described in the comment before
relinquish_special_privs_perm().

We should also relinquish special privileges *before* trying to open the
capture pipe, so that we can't open a pipe to which the real user
doesn't have access.

svn path=/trunk/; revision=24347
2008-02-16 03:18:36 +00:00
Guy Harris 4aac1e2c0b Pull capture_loop.c into dumpcap.c, as dumpcap is the only program that
does capturing any more.  (We will be inserting a call to give up
privileges after the pcap_open_live(), which should fix 2273; we're
currently only giving up privileges on platforms with libcap.)

svn path=/trunk/; revision=24345
2008-02-16 02:39:58 +00:00
Bill Meier 8f6398d5ba Fix typo in help text
svn path=/trunk/; revision=24148
2008-01-20 23:12:12 +00:00
Tomas Kukosa 08bbd29c71 Support for RPCAP features in GUI (from Boris Misenov, see Bug 1366)
- retrieving the list of remote PCAP interfaces
  - password authentication support
  - UDP data fransfer
  - packet sampling (available in WinPcap 4.x)
  etc.

fix problem if non-default rpcap port is used

svn path=/trunk/; revision=23750
2007-12-04 11:19:29 +00:00
Bill Meier bfc4f6d466 Rename Windows ConsoleCtrHandlerRoutine --> capture_cleanup to match SVN #23537 change
svn path=/trunk/; revision=23540
2007-11-22 00:33:22 +00:00
Guy Harris d722f061f4 Catch SIGINT, SIGHUP, and SIGTERM on UN*X, so we cleanly exit if, for
example, we're ^C'ed.  This should fix bug 2003.

svn path=/trunk/; revision=23538
2007-11-21 22:49:02 +00:00