aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.h
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-09Dumpcap+Qt: Add support for `-a packets:NUM` and `-b packets:NUM`.Gerald Combs1-1/+4
Add the ability to rotate files after a specified number of packets (`-b packets:NUM`). Move some condition checks to capture_loop_write_packet_cb. Add `-a packets:NUM` in order to be consistent. It is functionally equivalent to the `-c` flag. Add a corresponding "packets" option to the Capture Interfaces dialog Output tab. Add initial tests for autostop and ringbuffer conditions. Change-Id: I66eb968927ed287deb8edb96db96d7c73526c257 Reviewed-on: https://code.wireshark.org/review/30534 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-01Move condition logic to dumpcap.cGerald Combs1-3/+3
Move the condition logic from capture_stop_conditions.c to dumpcap.c. Remove capture_stop_conditions.[ch] and conditions.[ch]. Switch duration values to doubles. Change-Id: Ifa74fb13ec8fc923b0721597a6cf071d72069ea0 Reviewed-on: https://code.wireshark.org/review/30440 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-13Put the interface descrptions into the IDB when capturing to pcapng.Guy Harris1-3/+3
capture_opts_add_iface_opt(), when called in a program acting as a capture child, will fetch the description for the interface, and will also generate a "display name" for the interface. In the process, we clean up capture_opts_add_iface_opt() a bit, combining duplicate code. We rename console_display_name to just display_name, as it may also be used in the title bar of Wireshark when capturing. Change-Id: Ifd18955bb3cb41df4c0ed4362d4854068c825b96 Reviewed-on: https://code.wireshark.org/review/29117 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16Eliminate some unneeded header checks.Guy Harris1-3/+1
sys/stat.h and sys/types.h date back to V7 UNIX, so they should be present on all UN*Xes, and we're assuming they're available on Windows, so, unless and until we ever support platforms that are neither UN*Xes nor Windows, we don't need to check for them. Remove the CMake checks for them, remove the HAVE_ values from cmakeconfig.h.in, and remove all tests for the HAVE_ values. Change-Id: I90bb2aab37958553673b03b52f4931d3b304b9d0 Reviewed-on: https://code.wireshark.org/review/27603 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16Not GTK+-only any more.Guy Harris1-1/+1
Change-Id: Id286252e4e59e141fce962020813f522f0b817bb Reviewed-on: https://code.wireshark.org/review/27571 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-02More spawned process handling updates.Gerald Combs1-1/+1
Document ws_pipe.h. Define invalid PIDs in one place. Extcap didn't use stdin before 1a0987904f. Make sure we close it. Change-Id: I7a69cd9b5137ae82435e64628a22e4d812d58f89 Reviewed-on: https://code.wireshark.org/review/26226 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-02Generalize our process spawning code.Gerald Combs1-7/+1
Move the contents of extcap_spawn to ws_pipe. Rename various extcap_* prefixes to ws_pipe_*. Open stdin when we spawn processes. Change-Id: I9286295443ee955bb6328b0ed6f945ee0bb2a798 Reviewed-on: https://code.wireshark.org/review/26216 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-08extcap: remove conditional compilation.Dario Lombardo1-4/+0
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9 Reviewed-on: https://code.wireshark.org/review/25186 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09Start using SPDX license identifiers.Gerald Combs1-13/+1
A while back Graham pointed out the SPDX project (spdx.org), which is working on standardizing license specifications: https://www.wireshark.org/lists/wireshark-dev/201509/msg00119.html Appendix V of the specification describes a short identifier (SPDX-License-Identifier) that you can use in place of boilerplate in your source files: https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b Start the conversion process with our top-level C and C++ files. Change-Id: Iba1d835776714deb6285e2181e8ca17f95221878 Reviewed-on: https://code.wireshark.org/review/24302 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-28iface_lists: Remove locked fieldMikael Kanstrup1-1/+0
It seems the locked field of interface_t was used to avoid simultaneous updates of interface entries from either multiple threads or most likely the recursive UI update callbacks case later identified. Since 802362e ("Avoid recursive scan_local_interfaces operation") the recursive callback behavior is no longer happening. And as code does not have consistent checks the locked field can anyway hardly protect a multi-threaded case if such a case exists. Remove the unnecessary locked field. Ping-Bug: 13864 Change-Id: Idc393f702b82aa6014dd636572d00f0d67120bf3 Reviewed-on: https://code.wireshark.org/review/23262 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-08-28extcap: Interface Toolbar support on WindowsHåkon Øye Amundsen1-0/+2
Add support for extcap control pipes on Windows. Improved read loop in InterfaceToolbarReader. Delay opening control pipes until extcap has opened the fifo pipe. Make extcap_example.py work on Windows. Bug: 13833 Change-Id: I4b47d25452637759b8a3be53be48eee5365bc0e4 Reviewed-on: https://code.wireshark.org/review/23211 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-23extcap: Create unique pipe names for each interfaceStig Bjørlykke1-0/+7
On Windows the pipe names does not get random characters appended. Add the interface name and pipe type to make it unique. This partly fixes the issue with capturing from multiple extcap interfaces on Windows. Ping-Bug: 13653 Ping-Bug: 13833 Change-Id: I4290b37cf789bf77608993682a803aca29513d28 Reviewed-on: https://code.wireshark.org/review/23158 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-22Fix requesting hardware timestamps without -kAhmad Fatoum1-0/+1
The interface_options struct passed to dumpcap is populated differently when running Wireshark with and without -k. Previously, only with -k was there a valid pointer in interface_opts.timestamp_type Fixes: aca55a2 ("Add hardware timestamping support") Signed-off-by: Ahmad Fatoum <ahmad.fatoum@siemens.com> Change-Id: Ic7ecc5a1190c28197d6a7271f1b353f74d43ca61 Reviewed-on: https://code.wireshark.org/review/23160 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-22Add hardware timestamping supportAhmad Fatoum1-12/+25
pcap provides a pcap_set_tstamp_type function, which can be used to request hardware timestamps from a supporting kernel. This patch adds support for aforementioned function as well as two new command line options to dumpcap, wireshark and tshark: --list-time-stamp-types List time stamp types supported for the interface --time-stamp-type <type> Change the interface's timestamp method Name choice mimics those used by tcpdump(1), which already supports this feature. However, unlike tcpdump, we provide both options unconditionally. If Wireshark was configured without pcap_set_tstamp_type being available, --list-time-stamp-types reports an empty list. Change-Id: I418a4b2b84cb01949cd262aad0ad8427f5ac0652 Signed-off-by: Ahmad Fatoum <ahmad.fatoum@siemens.com> Reviewed-on: https://code.wireshark.org/review/23113 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-03Add option to use wall-clock intervalsSake Blok1-0/+2
Add the "interval" option to "-b". Each new capture starts at the exact start of a time interval. For instance, using -b interval:3600 will start a new capture file at each whole hour. Changed the duration option in the GUI interfaces to use the new interval option. Change-Id: I0180c43843f5d2f0c2f50153c9ce42ac7fa5aeae Reviewed-on: https://code.wireshark.org/review/22428 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Sake Blok <sake.blok@SYN-bit.nl>
2017-04-25Qt: Add interface toolbar supportStig Bjørlykke1-0/+2
An extcap utility can provide configuration for controls to use in a GUI interface toolbar. This controls are bidirectional and can be used to control the extcap utility while capturing. This is useful in scenarios where configuration can be done based on findings in the capture process, setting temporary values or give other inputs without restarting current capture. Todo: - Add support for Windows Change-Id: Ie15fa67f92eb27d8b73df6bb36f66b9a7d81932d Reviewed-on: https://code.wireshark.org/review/19982 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-03-19Fix various compile warnings turning error on Linux with gcc6 whenJoerg Mayer1-13/+13
compiling with HAVE_PCAP_REMOTE (and ENABLE_ECHLD) Change-Id: If5524f2d3dcacca9c82a46167480c8436dd8b1b2 Reviewed-on: https://code.wireshark.org/review/20615 Petri-Dish: Jörg Mayer <jmayer@loplof.de> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-02-02capture_opts: free memory on exit to avoid leak.Dario Lombardo1-0/+4
This required a restyle of the way the different apps exit. Change-Id: Iedf728488954cc415b620ff0284d2e60f38f87d2 Reviewed-on: https://code.wireshark.org/review/19780 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-30Have routines for parsing options that affect dissection.Guy Harris1-14/+2
Have them handle -d, -t, --disable-protocol, --disable-heuristic, and --enable-heuristic for TShark and both flavors of Wireshark. Change-Id: I612c276b1f9df8a2092202d23ab3d48be7857e85 Reviewed-on: https://code.wireshark.org/review/18583 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-24Move --fullscreen out of LONGOPT_CAPTURE_COMMON.Guy Harris1-2/+3
It's not a capture option, so it doesn't belong there. Change-Id: I8aa6719a5a8e90c734c7acfc01b1ba2818498de3 Reviewed-on: https://code.wireshark.org/review/18427 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-23Qt: add fullscreen feature.Dario Lombardo1-1/+3
The feature activates/deactivates fullscreen mode of Qt UI. A new menu item has been added as well as a shortcut (F11 or Ctrl+Cmd+F) according to browsers common shortcut. Change-Id: I01906b494d0a13ce70d27c00ebbe03e6ec87cbd7 Reviewed-on: https://code.wireshark.org/review/18332 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-05extcap: Remove g_spawn_helper supportRoland Knall1-0/+1
Move g_spawn to separate file and implement functions to use Windows based method of spawning, instead of the glib based version Change-Id: Ibae03d834ec86531eba37dc8768fbf17ddadf57f Reviewed-on: https://code.wireshark.org/review/16049 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-06-28Pull quit_after_cap out of the global capture options.Guy Harris1-1/+0
Really, all the GUI-related options should be pulled out, so they're not cluttering up dumpcap and tshark. Change-Id: I0276dee2be48bae3498a819d8c0c2747fe1352e7 Reviewed-on: https://code.wireshark.org/review/16180 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-13Start deprecating the capture info API.Gerald Combs1-1/+1
The GTK+ UI has a capture info dialog which shows a summary of captured protocols, including IPX (!), NetBIOS (!!) and VINES (!!OMG!!). It's been disabled by default since 2006 (g59aa9e40). Remove the preference in the Qt UI capture pane. It's still available via the advanced prefs. Add comments in various parts of the code noting that the capture_info routines and structs are GTK+ only. Also note that if we *do* want to add a Qt capture info dialog we'll probably want to modernize the information we show. Change-Id: I3c63f6f01b60f0767fb33602a7f0c3b537dbde51 Reviewed-on: https://code.wireshark.org/review/10991 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-12Remove -Wwrite-strings compiler flagJoão Valverde1-14/+14
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are not useful, they're impossible to fix in a sane way and therefore are being handled with casts of static strings to (char *). This just moves the warning to [-Wcast-qual] and a compiler pragma is in turn required (and used) to squelch that warning. Remove the Wwrite-strings warning. Let that responsibility fall on the programmer (as is done by casting). Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5 Reviewed-on: https://code.wireshark.org/review/12162 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-11Fix memory leaks in all_ifaces when interface list changesMikael Kanstrup1-0/+3
Valgrind report leaks of several allocations like these: 590 bytes in 50 blocks are possibly lost in loss record 29,818 of 31,670 at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xCB9C8A7: __vasprintf_chk (vasprintf_chk.c:82) by 0xA3D8DCA: g_vasprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) by 0xA3B846C: g_strdup_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) by 0xA3B850B: g_strdup_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) by 0x6F4B51: scan_local_interfaces (iface_lists.c:254) by 0x6EF3D8: iface_mon_handler2 (iface_monitor.c:113) by 0xBE56F1D: ??? (in /lib/libnl-3.so.200.3.0) by 0xBA16F19: ??? (in /usr/lib/libnl-route-3.so.200.3.0) by 0xBE54E5E: nl_cache_parse (in /lib/libnl-3.so.200.3.0) by 0xBE585CA: nl_msg_parse (in /lib/libnl-3.so.200.3.0) by 0x6EF372: iface_mon_handler (iface_monitor.c:123) When the list of network interfaces is updated allocations done for global_capture_opts.all_ifaces elements leak memory. Fixed by introducing a helper function to be used for removing an interface_t element from all_ifaces array. While at it also fixed misc leaks when updating individual allocated records of all_ifaces elements. Change-Id: I035e6936a44edeef2ebe4780931c14cde99e93a4 Reviewed-on: https://code.wireshark.org/review/12209 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-09-02The official #define for 32-bit and 64-bit Windows is _WIN32.Guy Harris1-1/+1
It's _WIN32, with a leading underscore, not WIN32. See, for example: https://sourceforge.net/p/predef/wiki/OperatingSystems/ and https://msdn.microsoft.com/en-us/library/b0084kay.aspx *Some* environments may also define WIN32, but we shouldn't depend on that. Replace all-caps "WIN32" referring to Windows in comments and other text with "Windows" or "Win32". (The two are pretty much equivalent, these days; nobody much cares about Win16, not that we ever ran on it, and 64-bit Windows is just a 64-bitified Win32.) Change-Id: Id327bcd4b1e9baa4f27055eff08c2d9e594d6f70 Reviewed-on: https://code.wireshark.org/review/10367 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-17Add new long options to GUIs to allow arbitrary protocols and heuristics to ↵Jim Young1-2/+8
be disabled via command-line Future: Allow multiple protocols to be disabled in one option statement (perhaps using a comma or colon delmited set of names in <proto_name>) instead of having to specify --disable-protocol <proto_name> multiple times. Change-Id: I9b8f960acf75298ebb098d9b667fca49dca52306 Reviewed-on: https://code.wireshark.org/review/9631 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-25Have a #define for whether the capture buffer size can be set.Guy Harris1-3/+3
It can be set if either 1) this is Windows (where we're assumed to be using WinPcap, which includes calls to set the buffer size) or 2) we have pcap_create() (in which case we also have pcap_set_buffer_size(), at least in a normal libpcap release). Use that rather than testing "defined(_WIN32) || defined(HAVE_PCAP_CREATE)"; that makes it a bit more obvious what's being tested. Change-Id: Id9f8455019d19206b04dd6820a748cb97ae5ad12 Reviewed-on: https://code.wireshark.org/review/7816 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-19Make the snapshot-length member of interface_t an int.Guy Harris1-1/+1
That matches what it is in other structures, and eliminates a compiler warning. While we're at it, remove an empty if statement revealed by that change. Change-Id: I5e8c8f92fdb3567e75800c729443737032a1bcc7 Reviewed-on: https://code.wireshark.org/review/7752 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-14Always put editor-modelines at the end of the file ...Bill Meier1-2/+2
... to ensure that there are no potential issues with respect to editors limiting the number of lines scanned at the end of the file when checking for editor modelines. Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4 Reviewed-on: https://code.wireshark.org/review/4688 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12Add editor modelines; Adjust whitespace as needed.Bill Meier1-118/+131
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad Reviewed-on: https://code.wireshark.org/review/4626 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-04Update capture_opts in extcap_cleanup().Tomasz Moń1-1/+7
This fixes redundant extcap_pid handle close that could occur in capture_opts_del_iface() which resulted in unhandled exception on Windows. Change-Id: I06b680fcb65cd6fd854a25fb1b01248dce3251a1 Reviewed-on: https://code.wireshark.org/review/4447 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-04Wait for extcap to connect to pipe on Windows.Tomasz Moń1-0/+1
This prevents dumpcap from failing with timeout exceeded error message with some extcaps (especially those that display UAC screen) by making sure that extcap connects to pipe before dumpcap is even started. Change-Id: I549da9217c7f4ae89509330ca4fa613a119a9523 Reviewed-on: https://code.wireshark.org/review/4428 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-21Extcap Capture InterfaceRoland Knall1-0/+10
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, which results in a seamless integration with the current system, and does add all external interfaces as simple interfaces. Windows Note: Due to limitations with GTK and Windows, a gspawn-winXX-helper.exe, respective gspawn-winXX-helper-console.exe is needed, which is part of any GTK windows installation. The default installation directory from the build is an extcap subdirectory underneath the run directory. The folder used by extcap may be viewed in the folders tab of the about dialog. The default installation directory for extcap plugins with a pre-build or installer version of wireshark is the extcap subdirectory underneath the main wireshark directory. For more information see: http://youtu.be/Nn84T506SwU bug #9009 Also take a look in doc/extcap_example.py for a Python-example and in extcap.pod for the arguments grammer. Todo: - Integrate with Qt - currently no GUI is generated, but the interfaces are still usable Change-Id: I4f1239b2f1ebd8b2969f73af137915f5be1ce50f Signed-off-by: Mike Ryan <mikeryan+wireshark@lacklustre.net> Signed-off-by: Mike Kershaw <dragorn@kismetwireless.net> Signed-off-by: Roland Knall <rknall@gmail.com> Reviewed-on: https://code.wireshark.org/review/359 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-25Handle empty interface lists when the list changes.Guy Harris1-4/+8
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 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-14Rename parameter if_index to stop clang warning:Graham Bloice1-4/+4
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 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-12fix scan_local_interfaces()Martin Kaiser1-0/+3
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 unavailable as it remains in ifaces and will be re-added to all_ifaces in scan_local_interfaces() new helper function capture_opts_del_iface() to delete an entry from ifaces and free all its components Change-Id: Ie3271a7ed086367e511d3a971f3b68cfc014115d Reviewed-on: https://code.wireshark.org/review/2965 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-11GTK Remote CapturingIrene Ruengeler1-0/+8
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 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-08better description of ifaces and all_ifacesMartin Kaiser1-3/+4
Change-Id: I148beb52574b0f7d990722901b72653c71026cb8 Reviewed-on: https://code.wireshark.org/review/2939 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-04Move utility routines for capturing into a libcaputils static library.Guy Harris1-1/+1
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 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-23Move the routines to talk to dumpcap into a static libcapchild.Guy Harris1-1/+1
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 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Move the "capture-comment" long option to LONGOPT_CAPTURE_COMMON.Guy Harris1-0/+1
Change-Id: I55884d48911de307cde52accfebbda69f2989526 Reviewed-on: https://code.wireshark.org/review/2505 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Fix builds without pcap.Guy Harris1-1/+1
Change-Id: I6c67f9ea9d115a8396af0904ef9a73d2c528dcaa Reviewed-on: https://code.wireshark.org/review/2498 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Add long names for -a, -b, and -p.Guy Harris1-0/+3
(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 <guy@alum.mit.edu>
2014-06-20Also define LONGOPT_CAPTURE_COMMON as nothing if we don't have pcap.Guy Harris1-23/+11
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 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20"-d" isn't common to all capturing programs, it's dumpcap-specific.Guy Harris1-6/+0
Change-Id: I827615d45051c9d66407516b311d3de448de6d07 Reviewed-on: https://code.wireshark.org/review/2495 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Add some long options for capture short options.Guy Harris1-0/+56
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 programs that take capture short options take (those are largely the ones we have in common with tcpdump). Change-Id: Ia209425959c801725850b56a7d63441ee99b5001 Reviewed-on: https://code.wireshark.org/review/2492 Reviewed-by: Guy Harris <guy@alum.mit.edu>