Jörg Mayer
3685b4db6f
Remove some trailing whitespace
...
svn path=/trunk/; revision=43425
2012-06-21 13:23:45 +00:00
Michael Tüxen
1b0a5c58e2
Fix compilation on FreeBSD.
...
svn path=/trunk/; revision=43343
2012-06-18 21:50:59 +00:00
Chris Maynard
c3dadc73f3
Fix Coverity CID 708961: Resource leak, by closing the socket if the connect() fails. While there, print a human-readable error message on Windows like we do for other platforms. Lastly, be sure to specify FORMAT_MESSAGE_IGNORE_INSERTS in the dwFlags arg to all FormatMessage() calls where FORMAT_MESSAGE_FROM_SYSTEM is also specified. (Ref: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/28/6564257.aspx )
...
svn path=/trunk/; revision=43171
2012-06-09 03:36:15 +00:00
Chris Maynard
11204066a8
Some minimal documentation of remote capture interface formats for both rpcap and the new TCP feature from bug 2788.
...
svn path=/trunk/; revision=43156
2012-06-08 13:55:14 +00:00
Chris Maynard
74f85a07c0
Add another cast to make Windows buildbots happy.
...
svn path=/trunk/; revision=43155
2012-06-08 13:23:14 +00:00
Anders Broman
14c0648ce4
Add a cast.
...
svn path=/trunk/; revision=43154
2012-06-08 12:27:22 +00:00
Anders Broman
6a1f6be63b
From Alexey Neyman Forward ported by Michael Mann:
...
Allow captures over TCP connections.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2788
svn path=/trunk/; revision=43153
2012-06-08 11:54:26 +00:00
Chris Maynard
6272bd1578
In cap_pipe_open_live(), be sure to call ws_close(fd) before returning due to a couple of error condtions. Fixes Coverity CID 702395 Resource leak.
...
svn path=/trunk/; revision=42844
2012-05-25 01:32:26 +00:00
Guy Harris
fb8054f131
Expand a comment.
...
Clear the struct sigaction *before* we fill in any fields in it.
svn path=/trunk/; revision=42706
2012-05-18 04:06:35 +00:00
Gerald Combs
bdb614e264
Fix a bunch of uninitialized variables found by Coverity Scan. CIDs
...
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411,
and 702412.
svn path=/trunk/; revision=42658
2012-05-16 16:29:12 +00:00
Bill Meier
9d4b7ad9fe
From Evan Huus:
...
In get_capture_device_open_failure_messages() in dumpcap.c, there are some
statements that should have been guarded by ifdefs, causing a little
unnecessary work on some platforms, and a bunch of unused-variable warnings
from static analyzers. The patch fixes the problem.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7228
svn path=/trunk/; revision=42454
2012-05-07 00:49:39 +00:00
Michael Tüxen
e08a45d705
Set also the pcap buffer, if the default of 1 MB is used. This bug was
...
reported by Guy.
svn path=/trunk/; revision=42246
2012-04-25 21:19:31 +00:00
Michael Tüxen
3c866b04d0
Report the packets captured and the packets dropped (either by libpcap or by dumpcap).
...
svn path=/trunk/; revision=42245
2012-04-25 21:09:33 +00:00
Michael Tüxen
8ea1984ddc
Allow writing ISB with given recv/drop counters.
...
No functional change by this commit.
svn path=/trunk/; revision=42242
2012-04-25 20:50:38 +00:00
Michael Tüxen
d2526de5f8
Fix the packet counters.
...
This fixes the inconsistencies reported on the command line by dumpcap
as indicated by
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7191
svn path=/trunk/; revision=42236
2012-04-25 17:43:44 +00:00
Michael Tüxen
0fe7859ca4
Fix locking problem.
...
svn path=/trunk/; revision=42235
2012-04-25 16:05:29 +00:00
Guy Harris
04cd90e99e
From Evan Huus: add a missing free. Fixes bug 7092.
...
svn path=/trunk/; revision=42070
2012-04-14 17:45:03 +00:00
Guy Harris
5ef71a27ff
Fix tpo.
...
svn path=/trunk/; revision=41941
2012-04-04 19:46:45 +00:00
Guy Harris
43ca745bb9
Work around that WinPcap bug for another pcap_open() call.
...
svn path=/trunk/; revision=41938
2012-04-04 19:26:07 +00:00
Guy Harris
9c781b0939
Work around WinPcap bug wherein pcap_open() returns -1 without putting
...
an error message into errbuf (the bug has been reported to
winpcap-bugs).
Should fix bug 6922.
svn path=/trunk/; revision=41937
2012-04-04 19:13:39 +00:00
Anders Broman
ba7c0cb1b9
From Jose Pedro Oliveira:
...
dumpcap.c: code cleaning
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718
svn path=/trunk/; revision=41535
2012-03-13 15:27:22 +00:00
Anders Broman
cbde63643e
From Jose Pedro Oliveira:
...
Enforce the modelines in dumpcap.c and in pcapio.c
svn path=/trunk/; revision=41505
2012-03-12 15:40:57 +00:00
Guy Harris
6486942282
Fix function name in debugging message.
...
svn path=/trunk/; revision=41488
2012-03-11 19:59:08 +00:00
Gerald Combs
7a8df2f485
In pcapng.c use the units per second value from the interface instead of
...
the default.
Add support for reading nseclibpcap files to dumpcap.
svn path=/trunk/; revision=41455
2012-03-10 00:24:42 +00:00
Anders Broman
bb71a9c96a
Forward interface_opts.descr (currently empty) when writing IDB:s
...
svn path=/trunk/; revision=41454
2012-03-09 15:29:35 +00:00
Anders Broman
9d03324d91
From Jose Pedro Oliveira: Make dumpcap write the if_tsresol option (using the default value) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718
...
svn path=/trunk/; revision=41444
2012-03-09 05:02:27 +00:00
Gerald Combs
57eeea4b20
Add a note about using GetSystemTimePreciseAsFileTime.
...
svn path=/trunk/; revision=41382
2012-03-06 21:11:31 +00:00
Guy Harris
26f694ddee
Fix comment.
...
svn path=/trunk/; revision=41347
2012-03-05 06:43:44 +00:00
Anders Broman
ad6640344f
From Jose Pedro Oliveira: Fix typos
...
svn path=/trunk/; revision=41330
2012-03-03 16:17:20 +00:00
Gerald Combs
8334ec2b43
Another small commit to test migration.
...
svn path=/trunk/; revision=41251
2012-03-01 02:18:35 +00:00
Gerald Combs
380f3f54a7
Add a comment noting that we need to add support for files with
...
nanosecond timestamps. (Also test the recent anonymous repository
migration.)
svn path=/trunk/; revision=41248
2012-02-29 20:32:12 +00:00
Michael Tüxen
050c0a14c9
Don't use deprecated API on glib 2.31.18 and higher.
...
This should fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6884
svn path=/trunk/; revision=41247
2012-02-29 18:04:23 +00:00
Michael Tüxen
412c5a903c
As discussed with Anders: Only write a single ISB at the end. Proivde
...
start/end time in the ISBs.
svn path=/trunk/; revision=41160
2012-02-23 12:57:17 +00:00
Anders Broman
8fff390455
- Write ISB(s) at start and end of capture.
...
- Read all options.
- Prepare to write ISB.
svn path=/trunk/; revision=41137
2012-02-22 14:41:02 +00:00
Anders Broman
af2100d4c3
Expand the API for ISB:s
...
svn path=/trunk/; revision=41136
2012-02-22 10:01:16 +00:00
Michael Tüxen
f7dc80cb18
Whitespace changes.
...
svn path=/trunk/; revision=41124
2012-02-21 18:01:01 +00:00
Michael Tüxen
41df09c92a
Whitespace changes.
...
svn path=/trunk/; revision=41115
2012-02-21 16:28:42 +00:00
Anders Broman
1cf19ea95f
From Jose Pedro Oliveira:
...
dumpcap: only free os_version_str after the
libpcap_write_interface_description_block() calls.
svn path=/trunk/; revision=41114
2012-02-21 16:14:57 +00:00
Anders Broman
5df11d41bb
Extend libpcap_write_interface_description_block() wiyh more options
...
all exept os curently unused.
svn path=/trunk/; revision=41108
2012-02-21 13:35:04 +00:00
Anders Broman
ce86c08b58
From Jose Pedro Oliveira shb_os value: get_os_version_info() instead of get_runtime_version_info()
...
svn path=/trunk/; revision=41095
2012-02-21 05:52:50 +00:00
Anders Broman
29a14da188
Jose Pedro Oliveira: get_os_version_info() is more apropriate for shb_os
...
svn path=/trunk/; revision=41086
2012-02-20 21:17:43 +00:00
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