Commit Graph

370 Commits

Author SHA1 Message Date
Roland Knall 3fb32662a8 InterfaceList: Add button to toggle hidden interfaces
Add a button to the context menu, to allow for easy display of hidden
interfaces, and make that a storable preference

Change-Id: I8df5562b3ce8119b0ed38f9893c1879127f40c47
Reviewed-on: https://code.wireshark.org/review/18005
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-20 15:50:44 +00:00
Michael Mann 739bdfb45f Some Pref <-> Decode As bugfixes.
1. If a deprecated port preference is found, populate the new port preference with the value
2. Mark preferences as changed to trigger preference callback at startup.

Change-Id: Ic271841686617e847d2e0ed8800bbb0fa874df47
Reviewed-on: https://code.wireshark.org/review/18274
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-18 23:03:23 +00:00
Dario Lombardo 5546400b55 frame: print debug line according to new console preference.
Change-Id: I4e4b7d08e7765c43904469bbf8ba5c0581428382
Reviewed-on: https://code.wireshark.org/review/18231
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-17 09:22:18 +00:00
Stig Bjørlykke c59f7fc8fe dmp: Fix UDP ports preference conversion
The preferences change in 2eb7b05b had a typo for the old preference name.

Change-Id: Ie4d85160050f5bea01b59a1803011b49a6c4d748
Reviewed-on: https://code.wireshark.org/review/18213
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-10-16 11:29:38 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 02:51:18 +00:00
Michael Mann 31a35aa9e6 Cleanup from adding Decode As TCP preferences.
1. Fix bug caught by scan build (module not read)
2. Remove range preference call that should have been part of original patch.

Change-Id: I24b1fb253548bffddc4c8ebfc3ede666d8fd9dcd
Reviewed-on: https://code.wireshark.org/review/18143
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-12 00:56:15 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Roland Knall 99097dd3c6 Interface List: Change display to view/model
This changes the underlying model of the main interface tree.
Because of that, we can resort to a view/model approach, enlisting
the global interfaces list as only data source.

The interface list works identical to the old list, but allows
for filtering of the displayed interfaces by type. Only types, which
are present and whose interfaces are not hidden, are being displayed
for selection.

Change-Id: If8475b227daa026dc0ad3d25bc7fe050d5bf2ac3
Reviewed-on: https://code.wireshark.org/review/17940
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-01 13:18:51 +00:00
Michael Mann 3120536012 Have TPKT support a TCP port range preference instead of having "subdissectors?" register their own.
There are a number of dissectors who are subdissectors of TPKT (and OSITP) that are
not called by TCP dissector directly, yet can possibly register a TCP port "on the
behalf" of TPKT.  Just allow TPKT to support a range of ports to possibly include
these protocols.
Remove the preferences from these dissectors, but add backwards compatibility for
the preferences by hooking into set_prefs and have the preferences just hook into
Decode As functionality directly.

Change-Id: Ic1b4959d39607f2b6b20fa6508da8d87d04cf098
Reviewed-on: https://code.wireshark.org/review/17476
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-16 14:58:24 +00:00
Peter Wu 1ea6b4fe2e prefs: fix crash with -o column.foo:x
The gui.column module is somehow special, it has no name since it is
part of the gui module. This causes a crash when trying to invoke
`strcmp(module->name /* NULL */, "mgcp")`.

Always look up prefs inside gui_column_module when the given prefs
module is "column" instead of matching two specific names.

Change-Id: I47e354d11b6fd01818b0627a249b506a8f9510cc
Reviewed-on: https://code.wireshark.org/review/16937
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-07 12:32:48 +00:00
Michael Mann 907d49483d Fix some of the checkAPIs.pl warnings for g_warning.
1. Create ws_g_warning for legitimate uses of g_warning
2. Use proto_tree_add_debug_text
3. Comment some out

Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5
Reviewed-on: https://code.wireshark.org/review/16678
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>
2016-07-26 04:08:50 +00:00
Gerald Combs e5a1afc6f9 Qt: Preferences dialog performance improvements.
Fill in advanced and module tree item text when requested.

Create ModulePreferencesScrollAreas only when we need to show them.

Change-Id: I5aa7d5dba8f5d20de088de3a9d1ee9d58e779269
Reviewed-on: https://code.wireshark.org/review/16181
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-28 06:53:35 +00:00
Gerald Combs e2e84563ee Use getc_unlocked in a few places.
Use getc_unlocked or _fgetc_nolock instead of getc in a few places. This
reduces startup time by about 100ms here.

Change-Id: I59ceb09678457c871cce79fcc3ce71998fe4f5af
Reviewed-on: https://code.wireshark.org/review/14518
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>
2016-06-13 16:18:25 +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 ed6eecd79e [GTK] Check for xdg-open at run time
Remove HTML_VIEWER compile-time setting.

If xdg-open doesn't exist use user web browser preference as fallback.

Change-Id: I3b4a4a1a36b0192d75f2c97595f37d0d88a0941e
Reviewed-on: https://code.wireshark.org/review/14805
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-09 23:40:51 +00:00
João Valverde e005bc819c Remove synchronous DNS name resolution
Change-Id: Ie5e670b769eb0674950f3679ef511047641c2873
Reviewed-on: https://code.wireshark.org/review/14751
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-04 06:49:55 +00:00
Uli Heilmeier e1d54cfc3e IEEE 802.1Q/VLAN: Resolve ID to a describing name
A vlans file in the personal preference directory add an option to resolve
VLAN IDs to a describing name.

Format of vlan file is
123\tName of VLAN

To enable the resolving the preference nameres.vlan_name must be set
to TRUE.

Bug: 11209
Change-Id: I3f00b4897aace89c03c57b68b6c4b6c8b7d4685a
Reviewed-on: https://code.wireshark.org/review/14471
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-03-18 05:41:36 +00:00
Peter Wu e6f59d04aa prefs: set correct context for a preference
When a pref is renamed (e.g. from eth.qinq_ethertype to
vlan.qinq_ethertype), the latter module must be marked as changed.
Otherwise the pref has no effect as the vlan handoff routine is not
called.

For consistency, set the module for preferences migrated from smpp (the
gsm-sms-ud dissector does not have a handoff routine for these prefs,
so it has no functional effect for that dissector).

Undoes I89f4a2d125e18d113edec4bf35599f128249e913, fixes
I2a49dce93fdc7fab4ab3dc52dad90288c2d17434.

Change-Id: I255b49db23c7958f9fb2214c54f3f35386fa5e9a
Reviewed-on: https://code.wireshark.org/review/13851
Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2016-02-10 05:11:40 +00:00
Alexis La Goutte 6d88e9e116 prefs.c: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I89f4a2d125e18d113edec4bf35599f128249e913
Reviewed-on: https://code.wireshark.org/review/13726
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-08 06:08:12 +00:00
Dario Lombardo 9f28bce07d prefs: fix a leak.
This change fix a leak in the prefs subsystem when setting a preference as obsolete.
Found by valgrind.

==5779== 1 bytes in 1 blocks are definitely lost in loss record 7 of 3,421
==5779==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5779==    by 0xA7FE610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==5779==    by 0xA815B0E: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==5779==    by 0x65E01DF: register_string_like_preference (prefs.c:1052)
==5779==    by 0x65E054E: prefs_register_string_preference (prefs.c:1096)
==5779==    by 0x688D010: proto_register_dtls (packet-dtls.c:1828)
==5779==    by 0x71C4C34: register_all_protocols (register.c:350)
==5779==    by 0x65EEFA7: proto_init (proto.c:521)
==5779==    by 0x65CD621: epan_init (epan.c:126)
==5779==    by 0x115330: main (tshark.c:1220)

Bug: 12096
Change-Id: I8f36114e2098b0255b4e774c6e0f35b64da6d366
Reviewed-on: https://code.wireshark.org/review/13798
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-08 06:04:13 +00:00
Stig Bjørlykke 07ef89691c prefs: Add missing newline for filter expressions heading
Change-Id: I005904ffddf4542248c1994a0786340383b62192
Reviewed-on: https://code.wireshark.org/review/13660
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-02 11:20:03 +00:00
Roland Knall 927ffaa794 extcap: Add Save functionality to options dialog
This patch creates the functionality of saving all parameters
for extcap devices in the general preference section.

For now, multiselect and fileselect do not save their values
but patches for this will be provided in the future

Also, all preferences are stored as strings to make handling
easier. This might change in the future, but for the first version
it will stick.

Restore to Defaults is not implemented as of yet, and will be
in a future version, once the preference storing is finalized

Bug: 11666
Change-Id: I178346405146d2e43f4f3481c05c92c0b3595af5
Reviewed-on: https://code.wireshark.org/review/13451
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-01 12:12:41 +00:00
Michael Mann 850f5d3be0 Remove the deprecated column types so users don't think they still exist.
Bug: 11559
Change-Id: I51836dc9a4fa399835c7bdabcba577ebd40327ad
Reviewed-on: https://code.wireshark.org/review/13538
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>
2016-01-27 07:54:24 +00:00
Peter Wu a7c025fd14 Fix missing validation (crash) for certain prefs
The gui.layout_type preference is part of the Layout submodule (which is
part of the gui module. The Layout submodule has a special apply
callback that validates its prefs. These validations were never called
though because the prefix is "gui" and as a result that module would be
marked as changed.

Fix this crash by calling the validation function on the submodules
instead holding the pref, not its parent.

Change-Id: I2a49dce93fdc7fab4ab3dc52dad90288c2d17434
Reviewed-on: https://code.wireshark.org/review/13154
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-01-25 18:16:14 +00:00
Stig Bjørlykke 77046c0c2d Qt: Add some window title variables
Add some variables to be used in custom window title.

%P = profile name
%V = version info

Change-Id: I049717432a4d3523b541bb4f6f882c75abc38ddb
Reviewed-on: https://code.wireshark.org/review/13419
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-21 18:22:05 +00:00
João Valverde d3e480ac76 Fix warnings for epan/prefs.c [-Wcast-qual]
Change-Id: I86032d624ee37edc86a868eb2aaaffce81a8807b
Reviewed-on: https://code.wireshark.org/review/12719
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>
2016-01-08 15:28:45 +00:00
Guy Harris ee9f102aa9 No need for toolkit-dependent color initialization.
We're not allocating colors ourselves in GTK+ (and haven't been doing so
since at least 1.12), and all color_t values are valid colors, so
we don't need any toolkit-specific processing to fill in a color_t.

While we're at it, catch read errors when reading color filter files.

Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b
Reviewed-on: https://code.wireshark.org/review/12985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01 04:15:29 +00:00
Guy Harris 93f9416c36 Get rid of the "pixel" member of a color_t.
Now that we're letting GTK+/GDK allocate colors behind the scenes, if it
allocates them at all, there's no reason to save the allocated color in
the toolkit-independent color value.

Change-Id: I99df32bd6b07924f41f3d855d2ddecb3dc8d5201
Reviewed-on: https://code.wireshark.org/review/12983
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01 02:05:07 +00:00
Alexis La Goutte 936359053a Qt: Add gui.prepend_window_title option
Bug: 11102
Change-Id: I659b6be4652a65542c217370e01340e4696c0e31
Reviewed-on: https://code.wireshark.org/review/12653
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>
2015-12-29 18:01:27 +00:00
Michal Labedzki 9bb3f6be4c Qt: Add missing multi-field column validation
GTK already has it, but Qt forgot about it, so multi-field custom column
works ok if previously saved in GTK-shark. Invalid validation prevent from
modifying and saving multi-field custom column in Qt version.

While at it, rename "custom field" to "custom fields" to ensure
we think about multi-field custom column.

Change-Id: I99588150ccb38be11b75f5dd5b0f6443e7055ebb
Reviewed-on: https://code.wireshark.org/review/12685
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-20 08:21:02 +00:00
Guy Harris 85e3750b06 Get rid of the argument to filter_expression_init().
It's always TRUE.

Clean up indentation while we're at it.

Change-Id: I11f5b849274b68bbda4fa32a8d909d6d5e71cbb1
Reviewed-on: https://code.wireshark.org/review/12732
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-19 19:21:08 +00:00
Guy Harris 3efb965493 Get rid of a couple of extra blank lines.
Change-Id: I57fd59a065e987e0e188b0898a874116e7cc56e8
Reviewed-on: https://code.wireshark.org/review/12722
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-19 03:39:08 +00:00
Guy Harris 146fd0fa84 Remove a comment that didn't need to be copied and pasted.
Change-Id: Id05c3fbf0c667ae2b2e349b73eba62a23d9e9e9e
Reviewed-on: https://code.wireshark.org/review/12721
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 20:51:49 +00:00
Guy Harris 4d3d6af643 prefs_register_modules() is used only in epan/prefs.c; make it static.
Change-Id: If2a5ad5c836c5dfddb4f6c4ffa41c52e52f2b671
Reviewed-on: https://code.wireshark.org/review/12717
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 09:28:01 +00:00
Guy Harris 487dfe1e28 More common code for string-like preferences.
Change-Id: I0143c40cabc0e60265aad2004884cb24cd41a8ac
Reviewed-on: https://code.wireshark.org/review/12714
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 03:50:44 +00:00
Guy Harris d222dd3989 Provide routines to set string-like and range preferences from a string.
That gets rid of some duplicate code.

Change-Id: I4b65c6c73929d18602f6b0425e4f3dbbabbf0127
Reviewed-on: https://code.wireshark.org/review/12713
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 03:19:03 +00:00
Gerald Combs 76dd8a27b7 Start deprecating the capture info API.
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-13 04:25:13 +00:00
Balint Reczey 9a9b1c9bba Spelling fixes for errors found by lintian
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20
Reviewed-on: https://code.wireshark.org/review/11945
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-07 07:11:54 +00:00
Mikael Kanstrup 9a2d16bac7 Fix memory leak in write_prefs
Valgrind reports leaks like these:
384 bytes in 8 blocks are definitely lost in loss record 43,909 of 46,703
  at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0xD6A055F: __vasprintf_chk (vasprintf_chk.c:80)
  by 0xA5FD0FB: g_vasprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5D8C7F: g_strdup_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5D8D1B: g_strdup_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0x6854FA6: write_prefs (prefs.c:4941)
  by 0x733A9A: prefs_main_write (preference_utils.c:266)
  by 0x5F8A5C: CaptureInterfacesDialog::saveOptionsToPreferences() (capture_interfaces_dialog.cpp:851)
  by 0x5F93CD: CaptureInterfacesDialog::on_manage_clicked() (capture_interfaces_dialog.cpp:858)
  by 0x7182AC: CaptureInterfacesDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (capture_interfaces_dialog.moc.cpp:316)
  by 0x718822: CaptureInterfacesDialog::qt_metacall(QMetaObject::Call, int, void**) (capture_interfaces_dialog.moc.cpp:413)
  by 0xBEBE36C: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)

When storing user preferences the constructed pathname of user's
preferences file is not freed properly.

Change-Id: I5cdc53ca836503af048e1d06e4614d83ef8921ac
Reviewed-on: https://code.wireshark.org/review/12114
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 14:18:47 +00:00
Stig Bjørlykke 0ae19656e1 Qt: Fixed column issues when changing profile.
Always initialize prefs.col_list in pre_init_prefs.
When switching to a profile without a saved 'preferences' file we
have to initialize prefs.col_list to default values to avoid reusing
settings from the profile we leave.
This was introduced in 5012cf84e6

Emit columnsChanged() before preferencesChanged().
This because columnsChanged() rebuilds cap_file_->cinfo which is used
in preferencesChanged() to align columns (and possible other actions).
Doing this in the wrong order will give an inconsistency and a
heap-buffer-overflow if having different number of columns.

Bug: 11493
Change-Id: I5792dfc0ede11b9457b96f092af8da00453787b1
Reviewed-on: https://code.wireshark.org/review/11971
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-20 07:57:25 +00:00
Balint Reczey c297df134b More spelling fixes found by lintian
Change-Id: Id218dec9e5a721d6c63fd34962ffe50b6ab8dd56
Reviewed-on: https://code.wireshark.org/review/11946
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Diederik de Groot <dkgroot@talon.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-20 05:47:29 +00:00
Matthieu Coudron c2afc9edec Change prototype of callbacks passed to wmem_tree_foreach so that they
accept the node key as a first parameter.

wmem_tree accepts all sort of keys (strings, integers, soon ranges),
thus it is of interest for various purposes (testing, greedy search) to
know the key of the node.

Change-Id: Ie748b917bef91f0b1ba8cce15bd1b471922641dc
Reviewed-on: https://code.wireshark.org/review/11683
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-11 00:22:37 +00:00
Guy Harris 0b05086754 Apple calls it just "OS X" these days.
Change-Id: I98905988ceb394d27307d1cbe883d8fe95ac23e4
Reviewed-on: https://code.wireshark.org/review/11703
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-10 21:08:45 +00:00
Guy Harris 0162e54075 Clean up includes of unistd.h, fcntl.h, and sys/stat.h.
Have wsutil/file_util.h include them on UN*X, just as it includes io.h
on Windows, so we can have a rule of "if you do file operations, include
<wsutil/file_util.h> and use the routines in it".

Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't
necessary (whether because of the addition of them to wsutil/file_util.h
or because they weren't needed in the first place).

Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f
Reviewed-on: https://code.wireshark.org/review/11619
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-07 21:52:23 +00:00
Gerald Combs 9f8d00c174 Add preferences for related packets and the scroll bar minimap.
Add gui.packet_list_show_related and gui.packet_list_show_minimap.
Show_related enables and disables the related packet delegate.
Show_minimap enables and disables the minimap. Start calling it the
"intelligent scroll bar" since that's the best suggestion for a name
I've seen so far.

Leave them out of the Appearance preference pane for now.

Change-Id: I5869c446fda5c8e62d6b1e49a74d63ba3b117b0f
Reviewed-on: https://code.wireshark.org/review/11332
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-27 23:28:56 +00:00
Peter Wu c647faa8a9 Fix various memleaks
Found by starting Wireshark within an empty profile, opening
Preferences, search for Protocol "IEEE 802.11" (because it has radio
buttons), then close everything again.

Many fixes are trivial, but the various recent_read_* functions in
recent.c were changed to return a boolean such that the result can
always be checked even if errno==0.

QButtonGroup leak was hinted by Clang Static Analyzer, all other
memleaks were found using ASAN/LSan.

Change-Id: Ia73f5d4c09d92f22e72377be59e23342f8ad7211
Reviewed-on: https://code.wireshark.org/review/10776
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-04 15:45:02 +00:00
Guy Harris 32e785f813 The official #define for 32-bit and 64-bit Windows is _WIN32.
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-09-02 22:59:10 +00:00
Stig Bjørlykke ecc4f756bd Added Reload Lua plugins.
This is initial support for reloading Lua plugins without
restarting the application.

Still todo:
- Deregister FileHandlers
- Support deregister ProtoField with existing abbrev (same_name_hfinfo)
- Add a progress dialog when reloading many plugins
- Search for memory leakages in wslua functions

Change-Id: I48870d8741251705ca15ffe1068613fcb0cb18c1
Reviewed-on: https://code.wireshark.org/review/5028
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 12:09:07 +00:00
Gerald Combs 9fd3bcc25e Add an elide mode preference for the Qt packet list.
Change-Id: I081cc1e9b2a0eea7f0a3ef1157561c50beb4c4db
Reviewed-on: https://code.wireshark.org/review/9902
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06 21:06:34 +00:00
Hadriel Kaplan 190e313e9d DNS: move DNS name resolution pref to Name Resolution prefs
Move the boolean flag for using captured DNS packet info for name resolution
to the Name Resolution preferences settings, as it was rather surprising to
disable Name Resolution preferences and still have names being resolved. Also
disble them all if the '-n' command line switch is used, and re-enable it for
a 'd' character in the '-N' option.

Bug: 10337
Change-Id: Ie4d47bab0100db3360cc447cd3e446b2e39aa917
Reviewed-on: https://code.wireshark.org/review/9786
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-25 17:05:01 +00:00