aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-28prefs: fix memleaks with obsolete preference modulesPeter Wu1-7/+11
ASAN reported a memleak in the USB CCID dissector due to the use of prefs_register_protocol_obsolete which caused prefs_cleanup to skip freeing preferences inside such modules. Change-Id: Ib4aecb3a722f958a8a1c5fc636703c1ec977f0cd Reviewed-on: https://code.wireshark.org/review/23230 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-29Qt: Add preference for show file load time in the status barStig Bjørlykke1-0/+6
This will leave more room for messages on smaller screens. Set the default OFF because this is probably only useful for developers. Group Status Bar settings in the Layout frame. Change-Id: Iea9a55b6c088aac10ee7680b1e8a882ed00c73be Reviewed-on: https://code.wireshark.org/review/22824 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-27Qt: Add preference for show selected packet numberStig Bjørlykke1-0/+6
The information about the selected packet number is available from the Number column and from the Frame entry in the Packet Details so make the entry in the status bar optional. Also remove duplicate "Packet:" entry, add the UTF8_MIDDLE_DOT separator and rename the prefix to "Selected Packet:". Bug: 13902 Change-Id: I0e7ba884bdcbdc87a5738223ef92f52e4ac195e5 Reviewed-on: https://code.wireshark.org/review/22807 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-26Add support for comments for a display filter buttonMichael Mann1-1/+2
Add a field to the display filter button UAT to allow comments to be displayed as part of the tooltip to the diplay filter button Bug: 13814 Change-Id: I74459e4102856258d31d6429e2fd924a9f798cd5 Reviewed-on: https://code.wireshark.org/review/22390 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-06-26Convert filter expressions preference data to a UAT.Michael Mann1-26/+40
The filter expressions data was shoved into the preference file in a very loose, non-arrayed form. It's much easier to manage in code (and for users in a separate file) as a UAT. The GTK GUI was hacked to use the existing UAT dialog rather than rewrite the pref_filter_expressions.c to support a UAT. Should be okay since it's deprecated. Change-Id: I688cebb4b7b6594878c1398365e79a205f1902d9 Ping-Bug: 13814 Reviewed-on: https://code.wireshark.org/review/22354 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-06-01prefs: Avoid empty elements in string lists.Stig Bjørlykke1-2/+4
When parsing a comma-separated string list from file we should not add an empty element if this list is empty. Otherwise we would get an empty string in when writing the file back. Change-Id: Iea5a33d20991f8c5daed6811beb8ec97b8b1dbe3 Reviewed-on: https://code.wireshark.org/review/21870 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-01Qt+prefs: Add a dark theme check and default colors.Gerald Combs1-9/+31
Add prefs_set_gui_theme_is_dark and call it in the WiresharkApplication constructor. Add a set of dark syntax color defaults. We could alternatively add a preference for the syntax foreground color, but that would imply adding a preference for the background color as well. Bug: 11131 Bug: 13738 Change-Id: Iefe135ed04e63372ed434c5b9759647c9f4046e3 Reviewed-on: https://code.wireshark.org/review/21827 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-05-26Report syntax errors in UAT prefs parsingPeter Wu1-6/+7
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-04-17Qt: Provide both file save and open preferencesAhmad Fatoum1-15/+26
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-15Catch attempts to pass unregistered protocols to prefs routines.Guy Harris1-0/+8
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-14Make prefs_register_subtree() static too.Guy Harris1-1/+1
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-14Make prefs_register_module() static.Guy Harris1-1/+1
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-14Give a better error message for invalid characters in preference module names.Guy Harris1-4/+6
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-09Pull the error-reporting code for preference files into read_prefs().Guy Harris1-32/+17
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-05A bunch of "{Mac} OS X" -> "macOS" changes.Guy Harris1-2/+2
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-02-16Qt: Disable pane menu items if not used in layoutStig Bjørlykke1-0/+8
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-08addr_resolv: remove leak.Dario Lombardo1-0/+2
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-07prefs: free memory on cleanup.Dario Lombardo1-0/+2
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-07GTK: Wrap static preference labels.Gerald Combs1-0/+4
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-01-27prefs: Preserve UTF-8 characters in preferences.Stig Bjørlykke1-4/+14
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-22Internalize struct preferenceMichael Mann1-39/+518
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-12uat: add a reset callback.Dario Lombardo1-0/+3
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-07Refactor range preference.Michael Mann1-1/+329
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-07Convert range API to always use wmem memory.Michael Mann1-13/+13
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>
2016-12-27InterfaceList: Add check for remote interfaceRoland Knall1-0/+10
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-25Remove individual post-dissect enable preferences.Michael Mann1-0/+2
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-25Cleanup transum post-dissector.Michael Mann1-0/+32
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-19Make more infiniband subdissectors heuristic.Michael Mann1-0/+2
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-02Prefs: Use g_utf8_strlen instead of strlen.Gerald Combs1-1/+1
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-01Check preference titles and descriptions.Gerald Combs1-6/+33
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-11-22Add prefs_get_uint_value and prefs_get_range_valueMichael Mann1-0/+16
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-10-20InterfaceList: Add button to toggle hidden interfacesRoland Knall1-0/+7
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-18Some Pref <-> Decode As bugfixes.Michael Mann1-25/+28
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-17frame: print debug line according to new console preference.Dario Lombardo1-0/+5
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-16dmp: Fix UDP ports preference conversionStig Bjørlykke1-1/+1
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-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-1/+54
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-12Cleanup from adding Decode As TCP preferences.Michael Mann1-0/+1
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-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-10/+314
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-01Interface List: Change display to view/modelRoland Knall1-0/+6
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-09-16Have TPKT support a TCP port range preference instead of having ↵Michael Mann1-0/+58
"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-08-07prefs: fix crash with -o column.foo:xPeter Wu1-3/+3
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-07-26Fix some of the checkAPIs.pl warnings for g_warning.Michael Mann1-10/+11
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-06-28Qt: Preferences dialog performance improvements.Gerald Combs1-3/+3
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-13Use getc_unlocked in a few places.Gerald Combs1-2/+2
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-06*_stdup_printf -> strdup for "single string only" formatting.Michael Mann1-1/+1
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-04-09[GTK] Check for xdg-open at run timeJoão Valverde1-4/+0
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-04Remove synchronous DNS name resolutionJoão Valverde1-2/+2
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-03-18IEEE 802.1Q/VLAN: Resolve ID to a describing nameUli Heilmeier1-0/+3
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-02-10prefs: set correct context for a preferencePeter Wu1-3/+7
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-08prefs.c: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
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>