Commit Graph

110 Commits

Author SHA1 Message Date
Michael Tüxen 91df20357a Make sure that the interfaces listed in ifaces really exist.
Some protection code in capture / options.
Obtained from Irene Ruengeler.


svn path=/trunk/; revision=38142
2011-07-21 15:23:46 +00:00
Gerald Combs 8cbaab380e Having a non-NULL capture_opts->save_file might make us crash less.
svn path=/trunk/; revision=37983
2011-07-11 22:51:46 +00:00
Gerald Combs 5467d67f2a In version_info.c, assume we always have the "matches" operator. In
capture_opts.c, assume our output filename has been passed through
arg_list_utf_16to8().

svn path=/trunk/; revision=37974
2011-07-11 19:15:57 +00:00
Guy Harris 4bdb1926c5 Oops, indented one of the "Promiscuous" ones.
svn path=/trunk/; revision=37850
2011-06-30 23:34:53 +00:00
Guy Harris 88f7858de3 Line up the colons.
svn path=/trunk/; revision=37849
2011-06-30 22:41:54 +00:00
Guy Harris bf89288f87 It's not made from semolina. :-)
svn path=/trunk/; revision=37848
2011-06-30 22:21:16 +00:00
Michael Tüxen 185305aea6 Cleanup.
svn path=/trunk/; revision=37840
2011-06-30 06:31:52 +00:00
Michael Tüxen 52abc59011 Code cleanup.
svn path=/trunk/; revision=37820
2011-06-28 16:57:42 +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 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
Michael Tüxen 29c8afa6d3 Really print the rpcap username when logging, not
the rpcap password.
This only affects remote capturing.

svn path=/trunk/; revision=37681
2011-06-16 07:33:24 +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 d37d757dbc It is not an error (anymore) to specify multiple capture filters.
This was
wireshark -i lo0 -f sctp -i en0 -f udp -k
will work.

svn path=/trunk/; revision=37287
2011-05-19 11:58:18 +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 448fdb60b3 * Fix a bug when printing a pointer.
* Remove number_of_ifaces, since ifaces->len can be used instead.

svn path=/trunk/; revision=37174
2011-05-16 00:55:04 +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 a80b7e5fea Use the same default value for the snaplen in the new array as in the
old way.

svn path=/trunk/; revision=37113
2011-05-13 06:04:28 +00:00
Michael Tüxen 2d6cd58f91 Add support for handling multiple interfaces as command line
parameters. An array of interface specific data is handled
in addition to the current way.
This change should not have any effect right now, it will
be used by dumpcap when supporting multiple interfaces
(and tshark/wireshark... in the future).


svn path=/trunk/; revision=37082
2011-05-12 16:54:16 +00:00
Michael Tüxen 93377f5236 Another whitespace cleanup.
svn path=/trunk/; revision=37076
2011-05-12 12:06:19 +00:00
Michael Tüxen 4b303018d1 Clean up some indentation. A purely whitespace change.
svn path=/trunk/; revision=37073
2011-05-12 10:58:14 +00:00
Guy Harris fb3f152076 Back out Jeff Morris's change to make the autostop file size 64-bit - it
didn't change the GUI code for setting the autostop file size, and that
broke the build.

svn path=/trunk/; revision=36552
2011-04-11 01:30:36 +00:00
Guy Harris 4ad4d3e678 Jeff Morris's change to make the autostop file size 64-bit. Fixes bug
5691.

svn path=/trunk/; revision=36551
2011-04-11 00:01:08 +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
Chris Maynard 42d40ee494 Use fprintf_stderr() instead of printf() so "wireshark -D" works (on Windows).
svn path=/trunk/; revision=36387
2011-03-28 22:10:41 +00:00
Michael Tüxen 5da016099a Make HAVE_PCAP_REMOTE and HAVE_PCAP_SETSAMPLING independent
as in other places of the code. Such that this is consistently
used. While there, clean up some whitespaces.

This fix was provided by Irene Ruengeler which testing
remote capturing (with multiple interfaces).

svn path=/trunk/; revision=36112
2011-03-01 17:29:09 +00:00
Stephen Fisher 390927ce12 Follow up to rev 34073: Since "-b files:0" is no longer necessary to
override the default of turning on a multiple file ring buffer, require
a positive integer to be specified for the files value.


svn path=/trunk/; revision=34082
2010-09-08 18:47:14 +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
Gerald Combs 8598c522b2 Set RINGBUFFER_MAX_NUM_FILES to 100000. Use it to generate file names.
Add RINGBUFFER_WARN_NUM_FILES and use it to print a warning. Print
warnings when we change the number of ringbuffer files.

svn path=/trunk/; revision=32998
2010-05-27 18:00:46 +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 7a630c61a1 Add a -q flag to dumpcap, to squelch its reporting of the packet count,
and add support for SIGINFO, so, if your OS supports SIGINFO, you can
get the packet count by typing ^T.

svn path=/trunk/; revision=32958
2010-05-26 00:19:27 +00:00
Guy Harris 9307251bb8 Um, no, the problem with the Leopard x86 build is that we first do a
build without libpcap, to make sure that works, and then do a build with
libpcap, to put into a binary release.  It's the former that's failing;
I'll back out the previous change and then work on that.

svn path=/trunk/; revision=32801
2010-05-14 00:49:28 +00:00
Guy Harris 0e54136213 See whether the Leopard x86 buildbot is upset because of the name
if_capabilities_t - it doesn't fail on Snow Leopard, even if I undefine
HAVE_PCAP_CREATE, and doesn't fail on the Leopard PPC buildbot, either.

svn path=/trunk/; revision=32799
2010-05-14 00:10:15 +00:00
Guy Harris 1c18115bd3 Fetch an indication of whether the interface supports capturing in
monitor mode at the same time that we fetch its list of link-layer
types.  Support fetching that list in monitor mode, as the list may be
different in regular and monitor mode.  If the interface supports
monitor mode, when printing the list of link-layer types, indicate
whether they're fetched in monitor mode or not, as tcpdump 4.1.x does.

svn path=/trunk/; revision=32789
2010-05-13 17:37:39 +00:00
Guy Harris dc09d61a92 Prune some includes.
svn path=/trunk/; revision=32721
2010-05-08 01:18:12 +00:00
Guy Harris 077ff72ac1 As with the list of data link types, so with the list of interfaces; move
the code to print the machine-readable format into dumpcap, and have the
code in capture_opts.c just print the human-readable format.

svn path=/trunk/; revision=32714
2010-05-07 19:24:32 +00:00
Guy Harris 13bf4a0c55 Add routines vfprintf_stderr() and fprintf_stderr() to print to the
standard error and, in Wireshark on Windows, create a console if
necessary.  Have the cmdarg_err routines use them.

Use *fprintf_stderr() to print the output of -L, rather than using
cmdarg_err_cont(), so that we don't get extra newlines in the output (it
should look similar to the output of tcpdump).

svn path=/trunk/; revision=32711
2010-05-07 08:40:02 +00:00
Guy Harris cc05b9250d For TShark and Wireshark, get the list of link-layer types for an
interface by running dumpcap, so that if you need privileges to open an
interface, and dumpcap has those privileges, neither TShark nor
Wireshark need them.

svn path=/trunk/; revision=32710
2010-05-07 08:06:25 +00:00
Guy Harris 9a84de8932 Handle -I in the options processing.
svn path=/trunk/; revision=32703
2010-05-07 01:25:53 +00:00
Guy Harris 7dbbb8c572 Just check for pcap_create(); it first appeared in libpcap 1.0.0, and
pcap_set_buffer_size() did as well, so there aren't any libpcap releases
with pcap_create() but not pcap_set_buffer_size().

Only do one check for pcap_create.

svn path=/trunk/; revision=32695
2010-05-06 23:33:41 +00:00
Anders Broman f9981411f1 Checking in Stigs changes from
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=475
BUT not activating the check for 
pcap_create()
pcap_set_buffer_size()
This should make it possible to build with support for setting the buffersize if not capturing 802.11 traffic.

The code for handling the 'B' option should be OK in any case.

svn path=/trunk/; revision=32688
2010-05-06 18:34:30 +00:00
Guy Harris f05fb51aba Squelch some compiler warnings.
svn path=/trunk/; revision=32111
2010-03-04 09:37:05 +00:00
Guy Harris 167ab3a98c In Wireshark and TShark, run dumpcap to get interface lists and lists of
link-layer header types for interfaces; if special privileges are
necessary to open capture devices, Wireshark and TShark shouldn't have
those privileges, but dumpcap should.

svn path=/trunk/; revision=32104
2010-03-04 01:12:04 +00:00
Bill Meier e4d6610bd5 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31729
2010-01-29 16:09:25 +00:00
Michael Tüxen 6de58c28f0 Add -n option to dumpcap. It will save the capture files in
pcapng format instead of pcap. The default is to use pcap.

svn path=/trunk/; revision=28170
2009-04-27 08:11:10 +00:00
Guy Harris 1514fcff5f Have the minimum snapshot length be 1 byte, and have a snapshot length
of 0 mean 65535, similar to what tcpdump does.

Fixes bug 2731.

svn path=/trunk/; revision=27526
2009-02-23 19:00:30 +00:00
Guy Harris 44f8cae6ab If we don't have any of the pcap_datalink_XXX_to_YYY routines,
substitute our own (I wrote them all, so I can steal them from the
BSD-licensed libpcap if I want :-)).  This means that
linktype_name_to_val() and linktype_val_to_name() are always available,
and we don't need to #ifdef use of them.

Use pcap_datalink_val_to_description() to get the description for a
particular DLT_ value, rather than mapping the DLT_ value to a
WTAP_ENCAP_ value and getting the description for the latter.

svn path=/trunk/; revision=27074
2008-12-21 23:22:12 +00:00
Stig Bjørlykke 483f45be1c Use correct type when printing remote_port.
svn path=/trunk/; revision=26676
2008-11-03 12:09:11 +00:00
Stig Bjørlykke ee2b7fd393 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26642
2008-10-31 10:30:17 +00:00
Stig Bjørlykke 2eb5983b47 Do not only update the argument name, but also where it's used.
svn path=/trunk/; revision=25566
2008-06-23 21:58:16 +00:00