Commit Graph

394 Commits

Author SHA1 Message Date
Peter Wu c9b0e9c813 Report syntax errors in UAT prefs parsing
Add the cause for a syntax error while parsing UATs. Example output:

    $ tshark -ouat:ssl_keys:,
    tshark: Invalid -o flag "uat:ssl_keys:,": ssl_keys:1: No IP address given.
    $ tshark -ouat:unknown:,
    tshark: Invalid -o flag "uat:unknown:,": Unknown preference

Change-Id: I549406c4e31a81d29f487ef47bdb3c22da084947
Reviewed-on: https://code.wireshark.org/review/21748
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-26 17:31:01 +00:00
Ahmad Fatoum b478df61f5 Qt: Provide both file save and open preferences
This is a breaking change.

prefs_register_filename_preference hasn't been differentiating
between files to be saved and ones to be opened.

On GTK, a neutral dialog is used, so no problems there.
On Qt, a save dialog has been always used, even in dissectors that
were reading configuration files without modification.

prefs_register_filename_preference now takes an argument to indicate
whether UI could be a save dialog with a warning on overwriting
a file, or whether it's a general purpose open file dialog.

Qt now does this. Previously no warning was shown on overwriting a file,
so it may be used for opening files too without irritating the user.
This has been changed, as non-destructive reads should now use
the open dialog.

Dissectors were changed accordingly.

Change-Id: I9087fefa5ee7ca58de0775d4fe2c0fdcfa3a3018
Reviewed-on: https://code.wireshark.org/review/21086
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-04-17 10:51:10 +00:00
Guy Harris cbc2c84a27 Catch attempts to pass unregistered protocols to prefs routines.
That way, you don't end up with "(none)" being used as the filter name
and getting confusing error messages.

Change-Id: Ifc77d4434d82dabebe74118742938cfa5234791d
Reviewed-on: https://code.wireshark.org/review/21118
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15 21:46:55 +00:00
Guy Harris ccef2d8860 Make prefs_register_subtree() static too.
It's not used outside epan/prefs.c, and it probably shouldn't be.

Change-Id: I8a10961a33b93db1de982eec264c134f9f3bc66c
Reviewed-on: https://code.wireshark.org/review/21096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14 20:44:50 +00:00
Guy Harris 6dd6fc9eff Make prefs_register_module() static.
It's not used outside epan/prefs.c, and it *shouldn't* be used outside
epan/prefs.c - there are other APIs that call it, and handle the details
of picking the right name, title, description, etc..

Change-Id: Ib95b4811d50c2bf1c480f115ee998274252243c9
Reviewed-on: https://code.wireshark.org/review/21095
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14 20:06:37 +00:00
Guy Harris c398858205 Give a better error message for invalid characters in preference module names.
And make the message for an invalid character in a preference name more
like it, by putting the offending name in quotes.

Change-Id: I40db8b87eae5e46a1d49213a9a45861b6b3565af
Reviewed-on: https://code.wireshark.org/review/21092
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14 19:34:54 +00:00
Guy Harris 62b342443d Pull the error-reporting code for preference files into read_prefs().
No need to duplicate it in N different programs.

Update comments while we're at it.

Change-Id: I3096cbe5448a19363eff6303bdd54e522dae9336
Reviewed-on: https://code.wireshark.org/review/20973
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09 03:03:25 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Stig Bjørlykke 14e19128dc Qt: Disable pane menu items if not used in layout
If a pane is not used in the layout it should not be possible to show
and hide this from the menu, as this may give unexpected results.

Change-Id: I335168e66e1dffc89992cad480dd7daaea7e9d59
Reviewed-on: https://code.wireshark.org/review/20140
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-02-16 20:53:22 +00:00
Dario Lombardo 523c09f31f addr_resolv: remove leak.
Change-Id: If4676b2982efae593084dbe951d8e0bb97189917
Reviewed-on: https://code.wireshark.org/review/19966
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-08 15:36:51 +00:00
Dario Lombardo a2ce68451e prefs: free memory on cleanup.
Change-Id: I723032974e34940715ccde5c3744f8c572c6dfda
Reviewed-on: https://code.wireshark.org/review/19895
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-07 14:45:10 +00:00
Gerald Combs e9cf760c0c GTK: Wrap static preference labels.
In the GTK+ prefrences dialog, enable wrapping and set a maximum width.
This should keep labels from making the dialog unusably wide.

Make a couple of enum preferences drop-downs instead of radio buttons.
Note that we might want to make the drop-down vs radio button behavior
automatic.

Change-Id: Ib72a2c8d5cfb99324be86f2218b6d57a395fa22c
Reviewed-on: https://code.wireshark.org/review/19980
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>
2017-02-07 05:15:28 +00:00
Stig Bjørlykke 7f4d8491f3 prefs: Preserve UTF-8 characters in preferences.
When saving preferences the strings in string lists must not be
escaped with g_strescape() because this will destroy UTF-8 characters.

Because this strings only should use printable characters we manually
escape quote and backslash, and skip non-printable.

Bug: 13342
Change-Id: I57e492dff746a5ecc0aee809f946a615ad110b4d
Reviewed-on: https://code.wireshark.org/review/19738
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-27 05:06:39 +00:00
Michael Mann 21a3b8cc71 Internalize struct preference
Move "struct preference" into prefs.c, essentially creating a "private"
structure to handle preferences. The 2 motivating factors were:
1. Better memory management so that clients/users of API don't have to worry
about it.
2. Hide the ugliness of the union stuff and make it transparent to the API.

A few bugs related to preference <-> Decode As integration were fixed
while in the neighborhood.

Change-Id: I509b9a236235d066b139c98222b701475e0ed365
Reviewed-on: https://code.wireshark.org/review/19578
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-01-22 10:43:57 +00:00
Dario Lombardo 805ddd1add uat: add a reset callback.
This function will free the resources allocated by the caller.

Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4
Reviewed-on: https://code.wireshark.org/review/19375
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>
2017-01-12 12:39:15 +00:00
Michael Mann 165c8b0422 Refactor range preference.
Refactored so that all handling of ranges in struct preference
can be internal to prefs.c

Change-Id: I68577909f9c07b23a16ab3443a523355d4645314
Reviewed-on: https://code.wireshark.org/review/19577
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-01-07 15:35:18 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Roland Knall 9d47bf9939 InterfaceList: Add check for remote interface
Add a check, to allow the filtering of remote only interfaces. Also
add the necessary options to the type menu.

Change-Id: Ib82519362454094f64abf1cbe6d7bc917990d7ac
Reviewed-on: https://code.wireshark.org/review/19438
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-12-27 11:55:51 +00:00
Michael Mann 96d15102f5 Remove individual post-dissect enable preferences.
Use Analyze -> Enabled Protocol dialog interface.  Added support
for backwards compatibility of preference.

Change-Id: I32b3fce9d18083d9324197e3fd7ddc7eb888d1fb
Reviewed-on: https://code.wireshark.org/review/19422
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-25 15:04:21 +00:00
Michael Mann 78d56e5dd7 Cleanup transum post-dissector.
1. Enable/disable preference not needed - just use Enabled Protocol
dialog interface.  Added support for backwards compatibility of preference.
2. Add value_string for calculation values
3. Create an structured array of "hfs of interest" so they can more easily
be extended.
4. Convert a bunch of arrays into hash tables and lists.  For the amount
of wasted space they were taking up, we can live with the very slight
performance degrade.  Also puts less limits on number of things to process.

Change-Id: I7399789d62432b507062ed9cdc20ad974b9dde1b
Reviewed-on: https://code.wireshark.org/review/19406
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-12-25 08:06:53 +00:00
Michael Mann a942468e07 Make more infiniband subdissectors heuristic.
1. Convert the Mellanox encapsulation header into a heuristic dissector.
2. Convert EtherType header dissection into a heuristic dissector.
3. Convert "heuristic preferences" to use deprecated_heur_dissector_pref.

Ping-Bug: 5061
Ping-Bug: 2672
Change-Id: Iabcac1af8e07f3f6f25f825ed56b2036c3285783
Reviewed-on: https://code.wireshark.org/review/19317
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-12-19 14:19:48 +00:00
Gerald Combs 333832ebf7 Prefs: Use g_utf8_strlen instead of strlen.
Change-Id: I99e2906b3c31f4aebcda44f4433f0fdd457ced3b
Reviewed-on: https://code.wireshark.org/review/19008
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-12-02 01:09:54 +00:00
Gerald Combs cbf89c8ed8 Check preference titles and descriptions.
When registering preferences, make sure our titles and descriptions are
valid UTF-8. Make sure our titles are short and only contain printable
characters.

Fix problematic titles and descriptions.

Change-Id: I20d3f93438f2b3c30266f934297feb79897f2ee5
Reviewed-on: https://code.wireshark.org/review/18998
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: Michael Mann <mmann78@netscape.net>
2016-12-01 01:26:39 +00:00
Michael Mann fb9a356e46 Add prefs_get_uint_value and prefs_get_range_value
This allows dissectors to not need to know about the internal preference structure.

Change-Id: I1ae67248cd0b0132aefc225ea0a9befaf9afdde2
Reviewed-on: https://code.wireshark.org/review/18864
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-11-22 16:47:47 +00:00
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