Commit Graph

241 Commits

Author SHA1 Message Date
Guy Harris af0f49e80d Use pcapng as the name of the file format.
At one point, I remember a discussion resulting in the official name of
the next-generation replacement for pcap format being changed to
"pcapng", with no hyphen.

Make Wireshark reflect that.

Change-Id: Ie66fb13a0fe3a8682143106dab601952e9154e2a
Reviewed-on: https://code.wireshark.org/review/25214
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-09 00:38:51 +00:00
Dario Lombardo e80b40adbe extcap: remove conditional compilation.
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>
2018-01-08 05:50:15 +00:00
Gerald Combs 0f3aa8522e Qt: Move sized toolbar images to stock_icons.
The sized (WWxHH) icons in the toolbar directory aren't limited to
toolbars. Create a "stock_icons" directory and move them and their
related SVGs there.

Change-Id: I2c1852499594aa738371c79542f24bd3351653bb
Reviewed-on: https://code.wireshark.org/review/25133
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-05 03:27:15 +00:00
Michael Mann ead32b5628 Populate Remote Interfaces with data from recent file
Remote Interfaces have been saved in the recent_common file however
they were never populated by the GUI.

Bug: 8557
Change-Id: Ib68a75ce02f5b5e2c115b72d58c3e781a5122f9f
Reviewed-on: https://code.wireshark.org/review/25039
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-29 07:44:37 +00:00
Guy Harris 8aa14236f8 Have the frame_tvbuff.c routines not use the global cfile.
Have the routines that create them take a pointer to a struct
packet_provider_data, store that in the tvbuff data, and use it to get
the wtap from which packets are being read.

While we're at it, don't include globals.h in any header files, and
include it in source files iff the source file actually uses cfile.  Add
whatever includes that requires.

Change-Id: I9f1ee391f951dc427ff62c80f67aa4877a37c229
Reviewed-on: https://code.wireshark.org/review/24733
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 08:31:41 +00:00
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
NULL checks were removed for following free functions:

- g_free "If mem is NULL it simply returns"
  https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free

- g_slist_free(_full)? "NULL is considered to be the empty list"
  https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html

- g_strfreev "If str_array is NULL, this function simply returns."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev

- g_slice_free "If mem is NULL, this macro does nothing."
  https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free

- g_match_info_free "not NULL... otherwise does nothing"
  https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free

- dfilter_free defined in Wireshark code. Returns early when passed NULL
  epan/dfilter/dfilter.c

They were also removed around calls to g_strdup where applicable:

- g_strdup "If str is NULL it returns NULL."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup

Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04
Reviewed-on: https://code.wireshark.org/review/23406
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 12:38:51 +00:00
Mikael Kanstrup 879920a2eb iface_lists: Remove locked field
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-28 16:53:32 +00:00
Ahmad Fatoum be69761c78 Fix requesting hardware timestamps without -k
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-22 12:18:12 +00:00
Sake Blok 3803e00367 Add option to use wall-clock intervals
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-07-03 16:41:37 +00:00
Guy Harris d0865fd619 Allow bigger snapshot lengths for D-Bus captures.
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except
for D-Bus captures.  Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for
them, because that's the largest possible D-Bus message size.  See

	https://bugs.freedesktop.org/show_bug.cgi?id=100220

for an example of the problems caused by limiting the snapshot length to
256KB for D-Bus.

Have a snapshot length of 0 in a capture_file structure mean "there is
no snapshot length for the file"; we don't need the has_snap field in
that case, a value of 0 mean "no, we don't have a snapshot length".

In dumpcap, start out with a pipe buffer size of 2KB, and grow it as
necessary.  When checking for a too-big packet from a pipe, check
against the appropriate maximum - 128MB for DLT_DBUS, 256KB for
everything else.

Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20
Reviewed-on: https://code.wireshark.org/review/21952
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>
2017-06-05 05:28:26 +00:00
Michael Mann 4e05adcfb2 GTK: Bugfix not allowing extcap capture filters to be verified.
Matches Id45052f21ebb290bf92c201370584156a65f2e19

Change-Id: I2b097d176ec3ce0637af95d66d2f58b834c79ea2
Reviewed-on: https://code.wireshark.org/review/21783
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-29 17:00:45 +00:00
Michael Mann d14b8f6fc5 GTK: Don't allow extcap capture filters to be verified.
There isn't an API to do it and if WinPcap isn't present it can
cause a crash.

Change-Id: I5338f854acb26f0822ac027e6c853a550da3f7b1
Reviewed-on: https://code.wireshark.org/review/21758
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-25 22:18:52 +00:00
Joerg Mayer 57d15713db Prevent crash/assert on access to "uninitialized" device.if_info.name.
While this is one possible way to fix it, it probably is not the "right"
way to do it. I just don't know which one would be right. I regard
several options to be cleaner:
- Remove if_info from interface_t altogether and add the required fields
  to interface_t directly.
- Never use device.if_info.name but always use device.name (same with
  friendly_name)
- Initialize both fields the same (same with friendly_name)
- Also not nice: device is optically a struct, not a pointer. So into the
  function, when we create a new struct (that's where the error "is made"),
  the same name continues to be used.

Not improving my confidence into my solution:
- I haven't bee able to figure out why the automated Windows builds don't
  crash/assert.

Last but not least: The two qt/gtk functions should probably have their common
core extracted into a common function.

Change-Id: I1b36d1765d1a1ec975927cb5785a1540ba4952f5
Ping-Bug: 13448
Reviewed-on: https://code.wireshark.org/review/20721
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-03-29 20:12:58 +00:00
Pascal Quantin 2141eafa64 GTK: the maximum packet size is WTAP_MAX_PACKET_SIZE, not 65535
Change-Id: I4b78a3bff7ed158eef2008e52ec8abc9f7a8d1d3
Reviewed-on: https://code.wireshark.org/review/20748
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-28 05:02:31 +00:00
Joerg Mayer 244b30179c Move #if 0 up to include the now unused struct definition
Change-Id: I5500a091608af61d7f8091ba133db558c148a853
Reviewed-on: https://code.wireshark.org/review/20719
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-03-26 16:54:01 +00:00
Joerg Mayer c78c8dc842 Rename a few variables to look more similar to the qt implementation
Reset auth_str for each round of the loop.

Change-Id: Ib5be6a3d172c28d7b1634fdba3e72c83622405dd
Reviewed-on: https://code.wireshark.org/review/20698
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2017-03-24 13:46:18 +00:00
Joerg Mayer 2ff5931287 Clean up gtk/capture_dlg.c insert_new_rows a bit.
Hopefully no semantic changes.

Change-Id: I1e43a971851ad944aa1e18c42131b6e180017656
Reviewed-on: https://code.wireshark.org/review/20689
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-24 07:21:01 +00:00
Guy Harris 0fdbaa4f18 Make GTK compile with HAVE_PCAP_REMOTE on macOS with clang-800.0.42.1.
Change-Id: I36bf1e39541fc55bc315f12f56dfd7ed7e0cc207
Reviewed-on: https://code.wireshark.org/review/20632
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-19 18:01:43 +00:00
Joerg Mayer ed234da840 Make GTK compile with HAVE_PCAP_REMOTE on Linux with gcc6
Change-Id: I87cbe47d34b768cb50be6580f85e8175103686c0
Reviewed-on: https://code.wireshark.org/review/20620
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-03-19 16:18:46 +00:00
Guy Harris c46f8b6fb3 Get rid of unused variable.
Change-Id: I684ce34b33e8abc596b9109068e302db57f85115
Reviewed-on: https://code.wireshark.org/review/20220
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-21 03:24:30 +00:00
Guy Harris 2798f7c9c4 Have all the remote host list routines' names begin with recent_.
Some did, some didn't - make it consistent.

Clean up some header comments while we're at it.

Change-Id: I978c84167cce3c8f1c0280898aa4d0b60958325b
Reviewed-on: https://code.wireshark.org/review/20218
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-21 02:46:26 +00:00
Guy Harris 72e2c3acfa Have a routine to iterate over the remote host list.
Have a routine that iterates over the remote host list if it exists.

Remove the routine to get the remote host list; all accesses should be
through functions in ui/remote.c.

Change-Id: Idddceba76b50ce85ef8557e132d7552191c2fddc
Reviewed-on: https://code.wireshark.org/review/20217
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-21 02:31:27 +00:00
Gerald Combs 9cece7c081 GTK+: Yell at the user less.
Change some exclamation points in error and warning messages to periods.

Change-Id: Ie084c40cf54362b43462bf4f6a29134caa101387
Reviewed-on: https://code.wireshark.org/review/19744
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-01-23 18:53:07 +00:00
Dario Lombardo 8d0af2f578 Gtk: remove atoi calls and use ws_strtoi functions.
Change-Id: Ie38bdd27d9e3810e3a64b985dfd5621a3aa6d073
Reviewed-on: https://code.wireshark.org/review/18445
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-26 21:45:03 +00:00
Michael Mann ee7f9c33f6 Pacify GTK checkAPIs.pl warnings.
Add "Wireshark" macros to old-gtk-compat.h for GTK APIs that have been deprecated.
The macros are setup by version number to limit their proliferation (not that I
suspect much development will really be done there since GTK is deprecated).
Just want to make buildbots happy for the time being.

Change-Id: I095f850065166a0bc2e2456fb2e886ab64fdd97d
Reviewed-on: https://code.wireshark.org/review/16635
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-24 20:03:29 +00:00
Michael Mann 57ef06e242 *_stdup_printf -> strdup for "single string only" formatting.
Done for performance improvements.

This could probably be done in checkAPIs.pl, but this was just
a quick manual check with grepping.

Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d
Reviewed-on: https://code.wireshark.org/review/15751
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-06 06:03:58 +00:00
João Valverde 394eaa1c20 Add GResource message to configure script
Use more descriptive naming while at it.

Change-Id: Ic89562cb9fa2cd5e315992f12ad9e46f2361da0b
Reviewed-on: https://code.wireshark.org/review/14057
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-25 04:50:59 +00:00
Guy Harris b32a5ee98c Don't add the wiretap directory to the list of include directories.
If you include something from the wiretap directory, always precede it
with wiretap/.

Fix some includes of files in the top-level directory to use a path
relative to the current directory, not relative to the wiretap
directory.

This makes it a bit clearer what's being included.

Change-Id: Ib99655a13c6006cf6c3112e9d4db6f47df9aff54
Reviewed-on: https://code.wireshark.org/review/13990
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-02-18 12:55:26 +00:00
Michael Mann 444dfda793 Allow "capture info data" to not be a singleton.
It was buried as a static variable in capture_info.c, and functions were refactored to allow a pointer to the info_data_t structure to be passed in. TShark and GTK will have their own single (global) copy of the structure, while it opens up Qt to have multiple instances.

Change-Id: Ic2d7a2ad574de43f457cb18b194d6bc3fffb6120
Reviewed-on: https://code.wireshark.org/review/12691
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-12-19 14:22:56 +00:00
Alexis La Goutte 4e43fc490a capture_dlg (gtk): The use of 'if (A) {...} else if (A) {...}' pattern was detected found by PVS Studio (V517)
MIN_PACKET_SIZE is define on caputils/capture-pcap-util.h to 1

Change-Id: Ib6486608cf3e0eac898ba859cf46e9d403d493d0
Reviewed-on: https://code.wireshark.org/review/12364
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-13 12:54:04 +00:00
Mikael Kanstrup 3120d1f801 Fix memory leaks in all_ifaces when interface list changes
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-12-11 10:38:32 +00:00
Mikael Kanstrup 9107fb6039 Fix memory leaks related to hide_interface function
Valgrind report leaks like these:
6 bytes in 6 blocks are definitely lost in loss record 2,197 of 46,703
  at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0xA5C1610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5D8B0E: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0x69A211: ManageInterfacesDialog::localAccepted() (manage_interfaces_dialog.cpp:454)
  by 0x69A500: ManageInterfacesDialog::on_buttonBox_accepted() (manage_interfaces_dialog.cpp:211)
  by 0x71DB32: ManageInterfacesDialog::qt_metacall(QMetaObject::Call, int, void**) (manage_interfaces_dialog.moc.cpp:245)
  by 0xBEBE36C: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
  by 0xBEBE2A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
  by 0xAF87E41: QAbstractButton::clicked(bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
  by 0xAD11095: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
  by 0xAD11BAD: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
  by 0xAD11D23: QAbstractButton::mouseReleaseEvent(QMouseEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)

96 bytes in 4 blocks are definitely lost in loss record 42,458 of 52,779
  at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0xA5C1610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5D722D: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5B84F3: g_list_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0x731F9A: hide_interface (iface_lists.c:426)
  by 0x69A211: ManageInterfacesDialog::localAccepted() (manage_interfaces_dialog.cpp:454)
  by 0x69A4F0: ManageInterfacesDialog::on_buttonBox_accepted() (manage_interfaces_dialog.cpp:211)
  by 0x71DB22: ManageInterfacesDialog::qt_metacall(QMetaObject::Call, int, void**) (manage_interfaces_dialog.moc.cpp:245)
  by 0xBEBE36C: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
  by 0xBEBE2A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
  by 0xAF87E41: QAbstractButton::clicked(bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
  by 0xAD11095: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)

These are caused by leaks inside hide_interface function and among
its users. Fixed by letting hide_interface function free its
resources properly and making sure the users follow the pattern.

Change-Id: I91527b83d36dc38b402d0f4a1db4b7db40fd83f9
Reviewed-on: https://code.wireshark.org/review/12113
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-11-25 12:03:33 +00:00
João Valverde 2d7b0fc7d0 [GTK] Replace deprecated gdk_pixbuf_new_from_inline()
Use GResource instead, if available. Add autotools and cmake compile time
checks for build requirements (GIO >= 2.32 and GDK-Pixbuf >= 2.26).

Merge all the various static pixbuf csource header files into
a single pixbuf-csource.h header with external linkage through use of the
tools/make-pixbuf-csource.pl script.

Fix inline pixbuf build target for some image paths (broken for GTK
in gb4a4de7).

Add missing 'expert_ok.png' file to distribution (GTK only).

Minor improvements to style/structure of ui/gtk/Makefile.am.

Bug: 10750
Change-Id: I031296b666ee8b92730400dfa6f71f9ee4304863
Reviewed-on: https://code.wireshark.org/review/10992
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-12 07:14:32 +00:00
Gerald Combs d9e530bc17 Use address functions instead of ADDRESS macros in ui.
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the ui directory.

Change-Id: I10e95e66c8da5b880133452ebc484c53046e87ba
Reviewed-on: https://code.wireshark.org/review/11199
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:46:12 +00:00
Stig Bjørlykke b0a8fa59f8 Initialize extcap for pipes
Change-Id: Ia731f281ee9af171c759d7f6f7c614c350cbb4e7
Reviewed-on: https://code.wireshark.org/review/10178
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-22 11:55:21 +00:00
Pascal Quantin 6452caa3b3 Fix retrieval of data link type supported by remote interfaces with authentication
Make use of -A parameter when querying data link types supported by a given interface with dumpcap.
Ensure to pass the authentication parameters configured for a remote interface when calling capture_get_if_capabilities()

Bug: 11366
Change-Id: I4efea615084a82108e4a12a64e8c46817f30a5c6
Reviewed-on: https://code.wireshark.org/review/9690
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-22 07:10:10 +00:00
AndersBroman 9421af309b Try to fix: warning C6244: Local declaration of 'airpcap_if_list' hides
previous declaration.

Change-Id: Id0c3b74ac52c427d9c1efdf749dc410bc5bb450f
Reviewed-on: https://code.wireshark.org/review/9460
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-02 15:28:03 +00:00
Guy Harris c67bc03355 Let capture_dev_user_pmode_find() say "not found".
"Not found" is different from "found, and false".  Have it return a
boolean "did I find the property" indication and, if it did, supply the
property value through a pointer.

Change-Id: Iaa942ea346410b35e512ff1a3821cbf60c88dfd6
Reviewed-on: https://code.wireshark.org/review/7916
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-04 21:03:34 +00:00
Guy Harris 083f6b6e6d Have a #define for whether the capture buffer size can be set.
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-25 03:22:33 +00:00
Guy Harris 493ddd5963 OK, this appears to be what's intended.
Include a column to describe what's intended.  If that's *not* what's
intended, fix the comment and the twisty little maze of #defines.

Change-Id: Ic5d120c401d8aba23a19e9d042b1460621b80e0b
Reviewed-on: https://code.wireshark.org/review/7815
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25 02:41:41 +00:00
Guy Harris 77bc38e498 Clean up handling of buffer size.
Instead of a twisty little maze of #if, #ifdefs, and #elifs, all
different, define HAVE_BUFFER_SIZE upfront iff we can set the buffer
size - i.e., if this is Win32, and thus we're using WinPcap, or if we
have pcap_create() and thus pcap_set_buffer_size() - and use that to
govern whether to have a buffer size setting or not.

Always put the buffer size setting in the right vertical box.  If that
doesn't work well for some configurations of available interface knobs,
feel free to change the checks, but please make it less opaque what's
going on (include a comment if necessary).

Change-Id: I384c601982b470ae08de271431eac06d6c925332
Reviewed-on: https://code.wireshark.org/review/7814
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25 01:30:28 +00:00
Roland Knall 8a3bd9ee38 Win32: Compilation error if winpcap remote capturing disabled
If HAVE_PCAP_REMOTE is not set, this code is not defined and therefore will not be
compiled correctly.

Change-Id: Ie08a6f99598d46cfa38e2448ea979a8a9aa7c7fc
Reviewed-on: https://code.wireshark.org/review/7803
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-24 23:59:41 +00:00
Guy Harris 1b4120846e Centralize the code to set the active_dlt value for a device.
We were doing it similarly, but not the same, in several places; make a
common routine for it.

Have that code check to make sure the DLT_ value in question is actually
supported by the device; if not, pick the first supported DLT_ value, if
any; this keeps it from, for example, picking a bad DLT_ value if your
defaults were set based on monitor mode being on but monitor mode
actually being off, or vice versa.

Change-Id: I1722bfeaf60429bc5c6f665fdea3d466052b13bd
Reviewed-on: https://code.wireshark.org/review/7795
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-23 00:00:42 +00:00
Guy Harris f0311abe72 Rename update_interface_list() and remove local interface code from it.
It's only used to update the remote interface list, and never updates
anything else (it sets iftype_id to CAPTURE_IFREMOTE and never changes
it, so all tests for whether iftype_id is == or >= CAPTURE_IFREMOTE
succeed); remove the code that would be executed if, somehow, iftype_id
got stomped on, and rename it to update_remote_interface_list().

Change-Id: I3bd80fb19bb14ef5bdf2c1a77a10f1f32bb62aba
Reviewed-on: https://code.wireshark.org/review/7773
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-03-21 10:06:14 +00:00
Guy Harris da3e4f92d5 Make the snapshot-length member of interface_t an int.
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>
2015-03-19 06:38:44 +00:00
Guy Harris 096e5231ff Fix parsing of interface properties strings.
The first entry in the list does not have a leading comma, so a strstr()
for ",{ifname}(" will not work.  Instead, use g_strsplit() with a comma
for all of the preferences.

Have common code for all the "uncomplicated" preferences.  Have a
specialized handler for the one "complicated" preference.

Change-Id: I2144a98ab0cb70db56eaaba88175d6e03885de2a
Reviewed-on: https://code.wireshark.org/review/7741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-18 23:58:54 +00:00
Bill Meier 3c9c9bc299 capture_dlg.c: Fix (possibly valid) "Using uninitialized memory" MSVC2013 Code Analysis warning
Change-Id: I849b731420d779b68ab4335eb8d06482ecd649e7
Reviewed-on: https://code.wireshark.org/review/7068
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-11 17:03:53 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-06 07:38:18 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00