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