The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / capture_opts.c @ master

History | View | Annotate | Download (47 KB)

# Date Author Comment
88a3b302 08/26/2014 10:58 AM Pascal Quantin

Extcap: prevent a GLib assert when interface_opts.extcap_args is NULL

I was able to trigger it when trying to change the options of extcap_example.py interface

Change-Id: I9ecff51d47b3ef6e178637b31d49af46a1928acd
Reviewed-on: https://code.wireshark.org/review/3822...

97546165 08/24/2014 04:04 AM Graham Bloice

Modify includes of config.h so that out-of-tree builds, i.e. CMake
don't pick up the in-tree copy.

Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71
Reviewed-on: https://code.wireshark.org/review/3798
Petri-Dish: Graham Bloice <>...

bed29af4 08/20/2014 11:34 PM Roland Knall

Extcap Capture Interface

Extcap is a plugin interface, which allows for the usage
of external capture interfaces via pipes using a predefined
configuration language which results in a graphical gui.
This implementation seeks for a generic implementation,...
f6ce0cda 07/22/2014 07:53 PM Guy Harris

Get rid of NO_INTERFACES_FOUND - it's not an error.

It just means "pcap didn't give me any interfaces, and didn't report an
error". Hopefully, in the future, there will be pcap APIs that
distinguish between the (admittedly unlikely, these days) case of "there...

e11db2ea 07/14/2014 10:25 AM Graham Bloice

Rename parameter if_index to stop clang warning:

capture_opts.c:1017:61: error: declaration of 'index' shadows a global declaration [-Werror=shadow]

Change-Id: Ie409b4fa7abeb85e460bea398735cdc98d9034b1
Reviewed-on: https://code.wireshark.org/review/3041...

55733ea1 07/12/2014 10:06 AM Martin Kaiser

fix scan_local_interfaces()

when we delete an interface from all_ifaces, delete it from ifaces as well
remove its selected status if it was selected

at the moment, an interface that was used for capturing before will
never be removed from the list of interfaces even if it becomes...

9e6487f2 07/04/2014 03:25 AM Guy Harris

Move utility routines for capturing into a libcaputils static library.

Some of those routines are used only in dumpcap; others are used in
TShark and Wireshark as well.

Change-Id: I9d92483f2fcff57a7d8b6bf6bdf2870505d19fb7
Reviewed-on: https://code.wireshark.org/review/2841...

df583372 06/29/2014 09:36 PM Guy Harris

Move capture_ui_utils.[ch] to libui.

Change-Id: Id0f3d4d60a1acc7aa64fd3737b8f16df5bca4e5a
Reviewed-on: https://code.wireshark.org/review/2708
Reviewed-by: Guy Harris <>

fe42762f 06/29/2014 07:03 PM Guy Harris

Move some more stuff into wsutil.

Move the routines to parse numerical command-line arguments there.

Make cmdarg_err() and cmdarg_err_cont() routines in wsutil that just
call routines specified by a call to cmdarg_err_init(), and have
programs supply the appropriate routines to it....

adf6b1a8 06/23/2014 08:28 PM Guy Harris

For capchild headers, include <capchild/XXX.h>.

Change-Id: I780c69ee637dcd9846756a2e2d6a35baf02d826d
Reviewed-on: https://code.wireshark.org/review/2594
Reviewed-by: Guy Harris <>

29659139 03/04/2014 09:27 AM Alexis La Goutte

Remove all $Id$ from top of file

(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <>

5f78d0f4 03/02/2014 04:53 AM Roland Knall

Fix ui/iface_lists.c - type attribute is not copied

temp is a clone of the local if_info, but the type
attribute is not copied correctly
Additionally, the if_type member is exposed via the
capture options

Change-Id: Id53f0dfd1e127921e1b89bbf78cb431ee257a96c...

65db8287 12/03/2013 05:16 PM Jakub Zawadzki

When including <epan/prefs.h> don't force inclusion of <epan/uat.h>

svn path=/trunk/; revision=53769

93f15d64 12/02/2013 02:17 PM Chris Maynard

Specify SI units for the max filesize autostop condition. For now, keep the capture buffer size in IEC units, but document it as such.
#BACKPORT)

svn path=/trunk/; revision=53728

4558ff0e 11/25/2013 09:43 PM Guy Harris

Add a comment explaining what setting
capture_opts->default_options.linktype to -1 means.

svn path=/trunk/; revision=53591

36e13a4c 10/23/2013 11:31 AM Michael Mann

Bugfix "Restart the running live capture" when using multiple files makes a long filename. Bug 2274 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2274)

Yes this solution leaks memory, but I think the handful of bytes leaked is worth fixing this nuisance. Won't backport until leak is fixed though....

bc654875 08/29/2013 02:15 PM Chris Maynard

Handle the 2GiB boundary case of the max filesize autostop condition properly so that we avoid overflow conditions and so that we ensure we don't capture more than 2GiB. Also, document the max filesize autostop value of 2GIB as well as indicating that it's truly GiB and not GB....

8905991b 07/27/2013 12:28 PM Martin Kaiser

only one --capture-comment option may be given to dumpcap

svn path=/trunk/; revision=50946

82ea635a 07/27/2013 12:25 PM Martin Kaiser

command line option --capture-comment for dumpcap

svn path=/trunk/; revision=50945

e04a12af 07/27/2013 12:13 PM Martin Kaiser

add capture_comment to the capture_options structure

svn path=/trunk/; revision=50943

c780d974 06/27/2013 01:27 PM Luis Ontanon

forgot from the las commit...

svn path=/trunk/; revision=50191

78e334b8 06/04/2013 12:36 AM Anders Broman

From Mike Garratt:
Friendly Names support causing unnecessary delay when Wireshark starts.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8034

svn path=/trunk/; revision=49752

8596d17d 05/22/2013 03:44 AM Guy Harris

Pull the capture-session state information out of capture_opts and put
it into a separate capture_session structure. capture_opts should
contain only user-specified option information (and stuff directly
derived from it, such as the "capturing from a pipe" flag)....

1ca63098 05/22/2013 12:49 AM Guy Harris

Rename capture_opts_trim_iface() to
capture_opts_default_iface_if_necessary(), to reflect what it actually
does.

svn path=/trunk/; revision=49491

13a80ce3 05/13/2013 07:23 PM Guy Harris

Don't fill in err_str if we're not going to use it.

(This helps flag capture_interface_list() calls that should perhaps be
checked to see whether an error should be reported if they fail.)

svn path=/trunk/; revision=49281

1f1e288b 05/13/2013 06:52 PM Guy Harris

Eliminate some includes of ui/simple_dialog.h by files that don't use
anything from it.

svn path=/trunk/; revision=49278

39779a7b 04/25/2013 01:47 AM Guy Harris

Send the output of the -D and -L options to the standard output rather
than the standard error.

In Wireshark on Windows, create a console before doing so and destroy it
before exiting. Don't do that in TShark or dumpcap, as those are
console-mode programs on Windows....

44e6a88b 03/13/2013 08:38 AM Irene Rüngeler

Add interface options preferences.

svn path=/trunk/; revision=48275

d0992bf8 02/28/2013 10:27 AM Jeff Morriss

Add a #define for the default capture buffer size and use it.

svn path=/trunk/; revision=47942

6cbcb0d9 02/27/2013 03:38 PM Anders Broman

Increase the default buffer size to 2MB.

svn path=/trunk/; revision=47920

8ed7a73e 12/26/2012 12:57 AM Guy Harris

Fix a bunch of warnings.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings....

20211340 12/11/2012 10:25 PM Jeff Morriss

Make the "-g" argument to tshark actually work (by passing it to dumpcap).

svn path=/trunk/; revision=46515

bd976ae6 11/22/2012 01:02 AM Guy Harris

On UN*X, if an interface has a description, use it as the "friendly
name". If it doesn't have a description, on OS X, use the System
Configuration framework to attempt to get a "friendly name" for
interfaces.

If a loopback device doesn't have a friendly name, give it "Loopback" as...

ca74add1 11/21/2012 01:11 PM Guy Harris

In capture_opts_add_iface_opt(), only require us to get the interface
list if the user specified a number; otherwise, if we couldn't get the
list, just use what the user specified, so they can specify interfaces
in order to test them to see why they're not showing up in the list....

4c019d68 11/21/2012 12:33 PM Guy Harris

If we don't find the specified interface name in the list, use it
anyway, so that, for example, if an interface doesn't show up in the
list for some reason, the user can try specifying it explicitly for
testing purposes.

svn path=/trunk/; revision=46109

d415d3d8 11/21/2012 12:14 PM Guy Harris

On error, have capture_opts_trim_iface() return the exit status that
should be used (on success, have it return 0). Exit with that exit
status; if the problem is that we couldn't get the interface list or if
there are no interfaces in that list, return 2, as that's not a...

fbaac133 11/19/2012 08:12 PM Guy Harris

We don't use get_windows_interface_friendlyname() in capture_opts.c, so
we don't need to include capture_win_ifnames.h.

Clean up white space.

svn path=/trunk/; revision=46095

92aff2d5 11/19/2012 04:41 PM Jeff Morriss

Failure to find the interface should cause *shark to exit with a status of 1, not 2.

svn path=/trunk/; revision=46089

89c33a82 11/19/2012 04:32 PM Jeff Morriss

As suggested by Evan: just make the variable a size_t instead of casting away the warning.

svn path=/trunk/; revision=46088

06efe50e 11/19/2012 04:00 PM Jeff Morriss

I'm pretty confident the string length will fit in 32 bits; cast away the "possible loss of data" warning on the Win64 build.

svn path=/trunk/; revision=46087

28474fe8 11/19/2012 03:07 PM Anders Broman

From Mike Garratt:
Friendly Names for interfaces on Windows

Notes on the changes the patch covers:
  • if_info_t struct: addition of friendly_name
  • Dumpcap Interface list format changes:
    + Win32: "dumpcap -D" shows friendly_name in place of descript if known...
3551a86c 09/19/2012 09:29 PM Jeff Morriss

We always HAVE_CONFIG_H so don't bother checking whether we have it or not.

svn path=/trunk/; revision=45015

bb1e018d 08/15/2012 04:08 AM Irene Rüngeler

Fix for bug #7634. Print 'unspecified' in case a string is NULL.

svn path=/trunk/; revision=44512

bf81b42e 06/28/2012 06:56 PM Jakub Zawadzki

Update Free Software Foundation address.

(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536

ea683810 04/23/2012 09:47 AM ruengeler

Remove lines that are not needed.

svn path=/trunk/; revision=42208

0819722a 04/23/2012 08:34 AM ruengeler

Fix bug #7178 reported by aparan

svn path=/trunk/; revision=42206

fa64659e 03/12/2012 11:48 PM Guy Harris

Closing a capture file has nothing to do with the list of interfaces on
which to do a live capture; don't clear the latter list when closing the
capture file.

collect_ifaces() should clear out the existing list of interfaces before
filling that list up with the interfaces selected by the user. In...

3af7f289 03/11/2012 10:53 PM Guy Harris

capture_opts_add_iface_opt() is not used outside capture_opts.c; make it
static.

svn path=/trunk/; revision=41494

6f3ee54d 03/11/2012 04:01 PM Guy Harris

Add a comment to indicate what collect_ifaces() does.

svn path=/trunk/; revision=41490

1a5e1acd 01/25/2012 02:40 PM Guy Harris

Actually, you only have monitor mode support if you have pcap_create() -
without pcap_create() and pcap_activate() you don't have any API to turn
it on.

svn path=/trunk/; revision=40725

91b87318 01/25/2012 09:29 AM Jeff Morriss

monitor_mode_enabled is only available on WIN32 or if we HAVE_PCAP_CREATE.

svn path=/trunk/; revision=40717

14b1a44c 01/25/2012 08:04 AM Michael Tüxen

Third try. This time pipes and stdin are supported and the
test scripts are passed.

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command...

4fece25e 01/24/2012 12:12 PM Michael Tüxen

We need a 3rd try. (After learning how to run the testuite on Windows locally).

svn path=/trunk/; revision=40695

08d67854 01/24/2012 11:05 AM Michael Tüxen

Second try. This time pipes and stdin are supported.

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just...

3864d5d1 12/29/2011 05:49 PM Guy Harris

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

c219f2ee 10/20/2011 03:44 PM Michael Tüxen

Back out infrastructure change. We missed supporting
stdin and pipes.

svn path=/trunk/; revision=39498

95ae2fe1 10/20/2011 02:17 PM Michael Tüxen

Use a global list containing all interfaces and only change
properties of the entries when changes are made in the GUI.
Do not misuse the list of interfaces specified on the command
line anymore.

This patch does not provide any new functionality, it just...

db240c2b 08/29/2011 05:16 PM Gerald Combs

Replace "-Q" with "WIRESHARK_QUIT_AFTER_CAPTURE" as discussed in bug 6256.

svn path=/trunk/; revision=38784

f98587d6 07/21/2011 01:30 PM Michael Tüxen

Undo the checking of command line interfaces. It might the a pipe...

svn path=/trunk/; revision=38146

91df2035 07/21/2011 11:23 AM Michael Tüxen

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

8cbaab38 07/11/2011 06:51 PM Gerald Combs

Having a non-NULL capture_opts->save_file might make us crash less.

svn path=/trunk/; revision=37983

5467d67f 07/11/2011 03:15 PM Gerald Combs

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

4bdb1926 06/30/2011 07:34 PM Guy Harris

Oops, indented one of the "Promiscuous" ones.

svn path=/trunk/; revision=37850

88f7858d 06/30/2011 06:41 PM Guy Harris

Line up the colons.

svn path=/trunk/; revision=37849

bf89288f 06/30/2011 06:21 PM Guy Harris

It's not made from semolina. :-)

svn path=/trunk/; revision=37848

185305ae 06/30/2011 02:31 AM Michael Tüxen

Cleanup.

svn path=/trunk/; revision=37840

52abc590 06/28/2011 12:57 PM Michael Tüxen

Code cleanup.

svn path=/trunk/; revision=37820

421dafd2 06/26/2011 08:09 PM Michael Tüxen

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

8d88f3a7 06/17/2011 01:52 PM Gerald Combs

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....

29c8afa6 06/16/2011 03:33 AM Michael Tüxen

Really print the rpcap username when logging, not
the rpcap password.
This only affects remote capturing.

svn path=/trunk/; revision=37681

8f8f0e9a 05/31/2011 10:49 AM Michael Tüxen

Get rid of has_cfilter to simplify the handling of multiple interfaces.

svn path=/trunk/; revision=37478

d37d757d 05/19/2011 07:58 AM Michael Tüxen

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

70ae440e 05/16/2011 11:19 AM Michael Tüxen

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

122452f8 05/16/2011 10:12 AM Michael Tüxen

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

448fdb60 05/15/2011 08:55 PM Michael Tüxen
  • Fix a bug when printing a pointer.
  • Remove number_of_ifaces, since ifaces->len can be used instead.

svn path=/trunk/; revision=37174

cfe3d2d0 05/13/2011 07:28 AM Michael Tüxen

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

a80b7e5f 05/13/2011 02:04 AM Michael Tüxen

Use the same default value for the snaplen in the new array as in the
old way.

svn path=/trunk/; revision=37113

2d6cd58f 05/12/2011 12:54 PM Michael Tüxen

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...

93377f52 05/12/2011 08:06 AM Michael Tüxen

Another whitespace cleanup.

svn path=/trunk/; revision=37076

4b303018 05/12/2011 06:58 AM Michael Tüxen

Clean up some indentation. A purely whitespace change.

svn path=/trunk/; revision=37073

fb3f1520 04/10/2011 09:30 PM Guy Harris

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

4ad4d3e6 04/10/2011 08:01 PM Guy Harris

Jeff Morris's change to make the autostop file size 64-bit. Fixes bug
5691.

svn path=/trunk/; revision=36551

4fdcc5c1 04/10/2011 04:59 PM Guy Harris

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

42d40ee4 03/28/2011 06:10 PM Chris Maynard

Use fprintf_stderr() instead of printf() so "wireshark -D" works (on Windows).

svn path=/trunk/; revision=36387

5da01609 03/01/2011 12:29 PM Michael Tüxen

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)....

390927ce 09/08/2010 02:47 PM Stephen Fisher

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

f17c5ac0 08/28/2010 07:05 AM Sake Blok

As mentioned on the users-mailinglist1, 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...

8598c522 05/27/2010 02:00 PM Gerald Combs

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

80fda10f 05/26/2010 09:13 PM Guy Harris

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

7a630c61 05/25/2010 08:19 PM Guy Harris

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

9307251b 05/13/2010 08:49 PM Guy Harris

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....

0e541362 05/13/2010 08:10 PM Guy Harris

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

1c18115b 05/13/2010 01:37 PM Guy Harris

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...

dc09d61a 05/07/2010 09:18 PM Guy Harris

Prune some includes.

svn path=/trunk/; revision=32721

077ff72a 05/07/2010 03:24 PM Guy Harris

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

13bf4a0c 05/07/2010 04:40 AM Guy Harris

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...

cc05b925 05/07/2010 04:06 AM Guy Harris

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

9a84de89 05/06/2010 09:25 PM Guy Harris

Handle -I in the options processing.

svn path=/trunk/; revision=32703

7dbbb8c5 05/06/2010 07:33 PM Guy Harris

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

f9981411 05/06/2010 02:34 PM Anders Broman

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....