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.h @ master

History | View | Annotate | Download (12.6 KB)

# Date Author Comment
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,...
35b44875 07/24/2014 11:00 PM Guy Harris

Handle empty interface lists when the list changes.

Don't assume that a change to the interface list is from a non-empty
interface list to a different non-empty interface list.

Change-Id: I94054ca0cf2661704aff1869385aa2155c19677d
Reviewed-on: https://code.wireshark.org/review/3193...

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

c7b45d0a 07/11/2014 12:29 AM Irene Ruengeler

GTK Remote Capturing

Move the GTK files necessary for managing the recnet remote host from capture_dlg.c to recent.c in order to use them in QT, too.

Change-Id: I3f3fd31ce928162de08c6db7309ef2a9b1e97760
Reviewed-on: https://code.wireshark.org/review/2955...

fdc7e5af 07/08/2014 09:26 AM Martin Kaiser

better description of ifaces and all_ifaces

Change-Id: I148beb52574b0f7d990722901b72653c71026cb8
Reviewed-on: https://code.wireshark.org/review/2939
Reviewed-by: Martin Kaiser <>
Tested-by: Martin Kaiser <>

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

213189ef 06/23/2014 07:58 PM Guy Harris

Move the routines to talk to dumpcap into a static libcapchild.

This pulls some stuff out of the top-level directory, and means we don't
have to build them once for every program using them.

Change-Id: I37b31fed20f2d5c3563ecd2bae9fd86af70afff5
Reviewed-on: https://code.wireshark.org/review/2591...

b2622e11 06/20/2014 07:43 PM Guy Harris

Move the "capture-comment" long option to LONGOPT_CAPTURE_COMMON.

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

b3885a93 06/20/2014 05:51 PM Guy Harris

Fix builds without pcap.

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

85ad72c6 06/20/2014 05:48 PM Guy Harris

Add long names for -a, -b, and -p.

(The name for -p matches what's in the tcpdump trunk.)

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

cc4710ac 06/20/2014 05:39 PM Guy Harris

Also define LONGOPT_CAPTURE_COMMON as nothing if we don't have pcap.

While we're at it, simplify the #ifdefs and #defines in capture_opts.h -
don't do the same tests twice.

Change-Id: I2079167f31789470ef77120054d769d5914745e3
Reviewed-on: https://code.wireshark.org/review/2496...

5537c53f 06/20/2014 05:32 PM Guy Harris

"-d" isn't common to all capturing programs, it's dumpcap-specific.

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

26bbee3f 06/20/2014 05:00 PM Guy Harris

Add some long options for capture short options.

The names match tcpdump trunk's names for the corresponding options.

Also have capture_opts.h provide a #define for the part of the short
option string that corresponds to the capture short options that all our...

312ed109 06/20/2014 03:19 PM Guy Harris

Add --help and --version long options.

Also, make the convention for long-only options be that their
case-statement values start at 128, so they avoid colliding with any
ASCII code points, including control characters.

Make the tables of long options "static const" while we're at it, and...

df8c4bf2 06/12/2014 01:54 AM Irene Ruengeler

Capture Interfaces Dialog:

- allow to change the interface options in the table
- save the options to preferences when the dialog is left
- add a field for setting a capture filter for all selected interfaces
- add a "Compile BPF" button and a window to show the compiled filter output...

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

945d6d04 11/25/2013 09:25 PM Guy Harris

Add a comment about the "default options".

svn path=/trunk/; revision=53590

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

6c5e1618 08/01/2013 04:57 PM Martin Kaiser

add --capture-comment to tshark
make sure that getopt() does not permute tshark's argv[] array

svn path=/trunk/; revision=51089

b50424fa 07/27/2013 05:23 PM Guy Harris

Clean up indentation.

svn path=/trunk/; revision=50953

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

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

c1d34d4b 05/21/2013 09:19 PM Guy Harris

On OS X, get the interface type from the System Configuration framework.

svn path=/trunk/; revision=49486

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

Add interface options preferences.

svn path=/trunk/; revision=48275

cb42bc9f 03/07/2013 04:16 AM Irene Rüngeler

Add buffersize and snap length to the preferences.

svn path=/trunk/; revision=48163

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

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

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...
ff2977fd 08/01/2012 07:35 PM Gerald Combs

It looks like we haven't inserted anything into the cap_settings_history
hash table since r40715. Remove it and its associated functions.

C++-ize iface_lists.h.

svn path=/trunk/; revision=44197

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

7f516235 03/21/2012 02:31 AM Guy Harris

scan_local_interfaces() isn't in capture_opts.c; don't declare it in
capture_opts.h. (It arguably belongs somewhere other than in a file in
ui/gtk, but, if so, move it there, e.g. to something in ui.)

svn path=/trunk/; revision=41712

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

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

36209e87 01/25/2012 01:03 PM Bill Meier

Fix error when building QtShark:

...\capture_opts.h(94) : error C2461: 'remote_host' : constructor syntax missing formal parameters

svn path=/trunk/; revision=40723

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

6b178bd4 12/28/2011 07:08 PM Gerald Combs

Add 'extern "C"' wrappers and #include guards to various header files.

svn path=/trunk/; revision=40321

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

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

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

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

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

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

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

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

b0b7697d 06/30/2010 08:12 PM Guy Harris

From Petr Lautrbach: when capturing, return the exit status of dumpcap,
so we give a non-zero exit status for invalid interfaces or capture
filters.

From me: don't exit immediately if dumpcap failed, print out information
from taps and the like.

svn path=/trunk/; revision=33393

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

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

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

20cbf81d 05/06/2010 09:22 PM Guy Harris

Beginnings of monitor mode support with libpcap 1.x.

svn path=/trunk/; revision=32702

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

6de58c28 04/27/2009 04:11 AM Michael Tüxen

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

f441b894 06/23/2008 11:38 PM Guy Harris

Add gtk/capture_globals.h, to declare global_capture_opts, so files that
don't need global_capture_opts don't need to have it declared and thus
don't need capture_options defined.

Include gtk/capture_globals in the files in question.

Change some more capture_opts references to refer to...

2a6564de 06/23/2008 04:34 PM Guy Harris

Rename a variable to avoid collisions with a global variable, as noted
by John Smith.

svn path=/trunk/; revision=25549

e731e24b 06/19/2008 08:09 PM Guy Harris

capture_opts_print_statistics() has nothing to do with capture options
setting, and is used only in dumpcap.c, and needs to get at information
set by dumpcap's signal handlers so it can respond to ^C; move it to
dumpcap.c, rename it print_statistics_loop(), and make it set ld.go to...

08bbd29c 12/04/2007 06:19 AM Tomas Kukosa

Support for RPCAP features in GUI (from Boris Misenov, see Bug 1366)
- retrieving the list of remote PCAP interfaces
- password authentication support
- UDP data fransfer
- packet sampling (available in WinPcap 4.x)
etc.

fix problem if non-default rpcap port is used...

92802883 08/29/2007 08:24 PM Gerald Combs

Change the "--enable-setuid-install" option to install dumpcap and TShark
setuid instead of Wireshark. Remove the "DANGEROUS" notices, but leave it
disabled by default. Whine if the user runs Wireshark or TShark as root.
Add a preference to disable the whining. Add a "setuid-root" script that...

8043464c 08/22/2007 02:56 PM Jeff Morriss

gcc 4 doesn't like my macro for getting the interface description: it says there's an invalid lvalue in it. I don't see what's wrong with it, but replace the macro with a function. Also: don't include the .xpm files in gtk/main.c if we're building without PCAP (as they're not used in that configuration)....

2f77efce 08/22/2007 12:30 PM Jeff Morriss

Fix bug http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1757 :

Try to call get_interface_descriptive_name() as little as possible (storing
the result in capture_opts) to avoid a performance hit during live capture
(especially if you have lots of interfaces) and to avoid leaking memory....

89a2966c 08/02/2007 05:45 PM Gerald Combs

Add a "-S" flag to dumpcap, which prints out interface statistics. Use
this in the GUI rather than calling pcap_stats() directly. This gets rid
of the last pcap_open_live() call in the GUI code. Update
README.packaging.

svn path=/trunk/; revision=22443

c02e0c7b 07/20/2007 05:43 PM Gerald Combs

Remove the "-I" flag from dumpcap, and add a "-M" flag used to specify
that "-D" and "-L" should produce machine-readable output. Use this to
move an indirect get_pcap_linktype() call from the GUI to dumpcap.

svn path=/trunk/; revision=22367

e9f1a0b6 06/10/2007 11:58 PM Gerald Combs

One more step in privilege separation.

Add a capture_interface_list(), which works similar to
get_interface_list() except that it forks dumpcap instead of calling
the pcap routines directly. Use it in the GUI.

Add a "-I" flag to dumpcap, which prints out verbose interface...

a28b428a 08/26/2006 02:36 PM Guy Harris

Go back to setting the capture filter to an empty string when we start;
that obviates the need to check for a null capture filter string, and
fixes bug 1055.

Keep track of whether it was set from the command line, though, so we
can catch attempts to set the filter more than once, and attempts to set...

89f022b1 05/21/2006 01:12 AM Ronnie Sahlberg

name change

svn path=/trunk/; revision=18197

2de9620e 04/02/2006 08:52 PM Guy Harris

In Tethereal, don't save to a temporary file if "-w" isn't specified,
even if doing a live capture; just print the packets without saving
them.

In dumpcap:

default to the capturing the entire packet;
don't do the "Press any key" stuff when debugging on UN*X;...
cf94760f 02/11/2006 06:25 PM Ulf Lamping

the point of no return ...

using dumpcap as the capture child for Ethereal.

dumpcap is a plain console application now, even for Win32 (so no WinMain, create_console and special piping stuff reguired). The undocumented command line option -Z will switch dumpcap into "child mode", using binary instead of plain text output messages to communicate with a parent Ethereal....

e4e8df5e 02/09/2006 09:05 PM Ulf Lamping

remove all calls to exit() from the capture_opts.c and replace them by status return values (0,1 or 2).

This way makes it much easier to debug, e.g. to set a common breakpoint if a command line parameter fails.

svn path=/trunk/; revision=17240

15f90510 01/06/2006 08:29 PM Ulf Lamping

move output_to_pipe flag from tethereal's loop_data into capture_opts, so it can be used by dumpcap (capture_loop.c) as well

svn path=/trunk/; revision=16972

b06bd208 12/18/2005 06:18 PM Jörg Mayer

warning: function declaration isn't a prototype

svn path=/trunk/; revision=16852

79217bab 12/13/2005 05:48 PM Ulf Lamping

HUGE STEP (hopefully toward the right direction):
remove a lot of redundant code from tethereal and use (move) stuff from capture_loop.c instead.

concentrate common capture related code in capture_opts.c, e.g. trying to find the right interface to capture from (command line option, preference, first usable) instead of duplicating this code over several files....

e1ee12bc 12/05/2005 04:26 PM Ulf Lamping

add capture_opts_trim(), as this sequence is used three times now (will replace the other appearances later) ...

svn path=/trunk/; revision=16683

d2a024af 12/03/2005 02:32 PM Ulf Lamping

split capture.h into capture.h, capture_loop.h and capture_opts.h and place the parts into the corresponding files

svn path=/trunk/; revision=16664