aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
AgeCommit message (Collapse)AuthorFilesLines
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
2011-05-21Use appropriate temporary filename when capturing from multiple interfaces.Michael Tüxen1-5/+9
svn path=/trunk/; revision=37344
2011-05-21As suggested on the dev list: Use pcapng and threadsMichael Tüxen1-2/+7
when capturing on multiple interfaces even if not specified on the command line. svn path=/trunk/; revision=37343
2011-05-21Pass a pcap_options * instead of a pcap_options **.Gerald Combs1-4/+4
svn path=/trunk/; revision=37341
2011-05-19Drop privileges after opening all pcap devices, not after the first one...Michael Tüxen1-12/+20
svn path=/trunk/; revision=37311
2011-05-19Actually use the defaults from the last commit message.Michael Tüxen1-3/+3
... and switch off debug output. svn path=/trunk/; revision=37285
2011-05-19Add a queue and byte limit to the capture queue. Current defaultMichael Tüxen1-8/+61
values: 1000 packets, 1 MB. Should be made configurable via command line options. svn path=/trunk/; revision=37284
2011-05-17Dear GLib Developers:Guy Harris1-1/+1
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-16Add support for capturing from multiple interfaces.Michael Tüxen1-26/+185
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#include <conio.h> when compiling under Windows with DEBUG_DUMPCAP defined.Chris Maynard1-0/+6
svn path=/trunk/; revision=37187