aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
AgeCommit message (Collapse)AuthorFilesLines
2011-12-29Add an additional DONT_HAVE_PCAP return value from get_interface_list()Guy Harris1-0/+2
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-29Just hard-code the error for "can't load WinPcap"; the one thatGuy Harris1-7/+15
cant_load_winpcap_err() has some redundant gunk in it. svn path=/trunk/; revision=40333
2011-12-29On Windows, if we can't open a capture device, check whether WinPcap isGuy Harris1-12/+26
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-11-22Show a "Capturing on ..." message similar to TShark.Guy Harris1-15/+34
svn path=/trunk/; revision=39989
2011-11-22If we're not running as a child process, report the interfaces on whichGuy Harris1-6/+18
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-16Don't set variables if we don't look at them later. All praise ClangGuy Harris1-3/+0
Cat. svn path=/trunk/; revision=39876
2011-11-09Try to fix the GLib thread API deprecations listed in bug 6552.Gerald Combs1-0/+12
svn path=/trunk/; revision=39776
2011-11-09As reported by Michael Speck:Stig Bjørlykke1-6/+1
Removed last occurrences of USE_THREADS. svn path=/trunk/; revision=39775
2011-11-07Change the use of threads from "mostly always, depending on yourGerald Combs1-30/+22
configure options and Gtk+ and GLib versions" to "always". svn path=/trunk/; revision=39751
2011-09-27Minor formatting changes to the dumpcap -h output.Chris Maynard1-3/+3
svn path=/trunk/; revision=39166
2011-09-21Fix vi "modeline" so it works;Bill Meier1-1/+1
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748 svn path=/trunk/; revision=39076
2011-09-07Windows: GetTickCount() returns a DWORD (not a time_t);Bill Meier1-3/+3
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-08-29Attempt to fix coverity id 1212: MISSING_BREAK by inserting "FALLTHROUGH"Stephen Fisher1-0/+1
comment. svn path=/trunk/; revision=38785
2011-08-09Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5608 :Jeff Morriss1-3/+1
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-07Replace deprecated glib functions.Jörg Mayer1-3/+5
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-07-16Use the threads based workaround only on windows (with thread support enabled),Michael Tüxen1-34/+34
since the workaround is only intended to work on windows. svn path=/trunk/; revision=38059
2011-07-15Fix compilation on non-windows platforms defining USE_THREADS.Michael Tüxen1-0/+2
svn path=/trunk/; revision=38044
2011-07-15Handle the case where dumpcap is compiled without thread support, whichMichael Tüxen1-3/+15
is the default. svn path=/trunk/; revision=38043
2011-07-14On Windows enable threads everywhere instead of just in dumpcap. IfGerald Combs1-4/+0
threads are enabled use them to check the recent file list. Fixes bug 3810. svn path=/trunk/; revision=38033
2011-07-08Alas, the libpcap API didn't use "void *" where it should have; squelchGuy Harris1-2/+2
some warnings from Clang. svn path=/trunk/; revision=37934
2011-07-06From Jakub Zawadzki via bug 6002: Don't set state to STATE_EXPECT_DATA if ↵Chris Maynard1-2/+6
there's no data to read. Reference: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6002 svn path=/trunk/; revision=37924
2011-07-02Disable DEBUG_CHILD_DUMPCAP.Gerald Combs1-1/+0
svn path=/trunk/; revision=37864
2011-07-01Revert r37857, r37861Jakub Zawadzki1-21/+0
svn path=/trunk/; revision=37862
2011-07-01Try to get more information about AV.Jakub Zawadzki1-1/+11
svn path=/trunk/; revision=37861
2011-07-01Catch system exceptions from pcap_open_live() :)Jakub Zawadzki1-0/+11
svn path=/trunk/; revision=37857
2011-06-30Add paranoid debug output in open_capture_device().Michael Tüxen1-0/+26
svn path=/trunk/; revision=37847
2011-06-30Log the success or failure of pcap_open/pcap_create/pcap_open_live.Gerald Combs1-0/+1
svn path=/trunk/; revision=37846
2011-06-30Temporarily enable dumpcap debugging.Gerald Combs1-0/+1
svn path=/trunk/; revision=37844
2011-06-28Replace all strerror() with g_strerror().Stig Bjørlykke1-23/+23
Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812
2011-06-27Update suite-clopts.sh to match dumpcap's error output. Add a commentGerald Combs1-0/+4
to dumpcap.c about keeping the errors synced. svn path=/trunk/; revision=37805
2011-06-27Report the correct interface when there is a problem with a capture filter.Michael Tüxen1-1/+3
This patch is from Irene Ruengeler. svn path=/trunk/; revision=37804
2011-06-27Improve the report of illegal capture filters. Also show the interface ↵Michael Tüxen1-15/+21
description. svn path=/trunk/; revision=37802
2011-06-27Get rid of old non-interface specific settings which are now interfaceMichael Tüxen1-3/+0
specifc. This finalizes the change of the infrastructure. This patch is based on work by Irene Ruengeler. svn path=/trunk/; revision=37794
2011-06-23Add pcap_options to the pcap_queue elements. This lets us keep interfaceGerald Combs1-20/+18
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-17Make pcap-ng the default. Add a compile-time option to prefer pcap-ng orGerald Combs1-1/+2
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-15Sigh. Cast away a warning.Guy Harris1-1/+7
svn path=/trunk/; revision=37676
2011-06-15Constify some arguments.Guy Harris1-3/+3
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-13Remove not used cap_pipe_err_str.Jakub Zawadzki1-10/+2
svn path=/trunk/; revision=37662
2011-06-07When doing remote capturing using WinPCap, dumpcap crashes inside the WinPCapMichael Tüxen1-1/+6
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-05-31Get rid of has_cfilter to simplify the handling of multiple interfaces.Michael Tüxen1-2/+2
svn path=/trunk/; revision=37478
2011-05-31Improve handling of command line errors.Michael Tüxen1-17/+18
svn path=/trunk/; revision=37477
2011-05-28Initialize pcap using an empty array instead of NULL. So no specialMichael Tüxen1-8/+5
check is needed. svn path=/trunk/; revision=37445
2011-05-27Initialize global_ld.pcaps before we setup signal handlers, which Stig Bjørlykke1-0/+3
uses this list to cleanup. svn path=/trunk/; revision=37425
2011-05-26Don't call g_log(); as the comment indicates it can cause problems.Gerald Combs1-6/+1
svn path=/trunk/; revision=37418
2011-05-26Don't call pcap_breakloop() if we're not capturing anything. Fixes aGerald Combs1-5/+12
crash found by Stig. Add debugging output to capture_cleanup_handler() on non-Windows systems. svn path=/trunk/; revision=37417
2011-05-26Append received percentage after received/dropped counts.Chris Maynard1-7/+10
svn path=/trunk/; revision=37415
2011-05-26Provide consistent counters for received and dropped packets.Michael Tüxen1-22/+36
svn path=/trunk/; revision=37414
2011-05-26Fix the handling of pipes on Windows platforms.Michael Tüxen1-117/+113
This should fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5939 svn path=/trunk/; revision=37413
2011-05-26Change "captured/dropped" terminology to "received/dropped". Also, unlessChris Maynard1-18/+14
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-24Move the Windows argument list conversion code to a common routine.Gerald Combs1-10/+1
svn path=/trunk/; revision=37372