Commit Graph

241 Commits

Author SHA1 Message Date
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