aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
AgeCommit message (Collapse)AuthorFilesLines
2018-04-17Remove some GTK+-only code.Gerald Combs1-66/+7
Change-Id: Ic2498c7acd6a1a522be45094148402ee34a6b4d1 Reviewed-on: https://code.wireshark.org/review/26958 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-15More PortAudio removal.Gerald Combs1-16/+2
Change-Id: Ib56212e09d41fc76494d8186c77541302700104c Reviewed-on: https://code.wireshark.org/review/26952 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-15MaxMind DB: Shut down our mmdbresolve process.Gerald Combs1-0/+3
Call maxmind_db_pref_cleanup from prefs_cleanup. Change-Id: I0c48e1015a38ab198beea168e12b646336ffe115 Reviewed-on: https://code.wireshark.org/review/26485 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-08Squelch some casting-away-const warnings.Guy Harris1-10/+22
Code *outside* this file isn't allowed to free or overwrite the structure members in question; code *inside* this file only does so when it's appropriate, so we just cast away the warnings. Use free_string_like_preference() in one place where the code was duplicated; add a pref_set_string_like_pref_value() routine to encapsulate the freeing. Remove some unnecessary casts. Change-Id: Ifc30a919cbd331367f5932ad23c3a1ed7cd4579f Reviewed-on: https://code.wireshark.org/review/26352 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-08Constify an argument that doesn't need to be non-const.Guy Harris1-6/+6
Change-Id: I59317862f57a41d1770c1cf6f8ec23662ae1c355 Reviewed-on: https://code.wireshark.org/review/26350 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-06Transition from GeoIP Legacy to MaxMindDB.Gerald Combs1-6/+2
MaxMind is discontinuing its legacy databases in April in favor of GeoIP2, which use a newer database format (MaxMind DB). The reference C library (libmaxminddb) is available under the Apache 2.0 license which isn't quite compatible with ours. Add mmdbresolve, a utility that reads IPv4 and IPv6 addresses on stdin and prints resolved information on stdout. Place it under a liberal license (MIT) so that we can keep libmaxminddb at arm's length. Add epan/maxmind_db.[ch], which spawns mmdbresolve and communicates with it via stdio. Migrate the preferences and documentation to MaxMindDB. Change the IPv4 and IPv6 asnum fields to FT_UINT32s. Change the geographic coordinate fields to FT_DOUBLEs. Bug: 10658 Change-Id: I24aeed637bea1b41d173270bda413af230f4425f Reviewed-on: https://code.wireshark.org/review/26214 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-13Qt: Don't use the term "extcap" interfaces in UIStig Bjørlykke1-2/+2
Use the term "external capture interfaces". Change-Id: I216ce2273737b58e4922c476416333ba16d6cb30 Reviewed-on: https://code.wireshark.org/review/25298 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-12prefs: init capture_no_extcap.Dario Lombardo1-0/+1
Change-Id: Id5706f5268735e051dbd8e824ab909e91fea691b Reviewed-on: https://code.wireshark.org/review/25279 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2018-01-09Convert GUI layout preferences to use preference effects.Michael Mann1-1/+9
Another simple example of how to use preference effects to limit the times a capture file is redissected unnecessarily. Also clean up some of the grammar of preference effect descriptions. Change-Id: I2db92e8e3ee913d3b37162916bd0ef7ac8ecd794 Reviewed-on: https://code.wireshark.org/review/25175 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-09extcap: add preference to prevent interfaces loading.Dario Lombardo1-0/+3
Change-Id: Ia5865a40c75e582f28408a0515c5c0b38e43a916 Reviewed-on: https://code.wireshark.org/review/25188 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-01-09Use pcapng as the name of the file format.Guy Harris1-2/+2
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-08extcap: remove conditional compilation.Dario Lombardo1-4/+0
Change-Id: Ia54bba388755cf27a343fe6d69d244bf1ab897f9 Reviewed-on: https://code.wireshark.org/review/25186 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-07Set captures preferences for PREF_EFFECT_CAPTURE.Michael Mann1-0/+2
This is a simple example of changing preferences that don't affect dissection to something else, so that changing them doesn't cause a file to be redissected unnecessarily Change-Id: I77c64c739e8bbc9f2a202f744f27cb07be4a822b Reviewed-on: https://code.wireshark.org/review/25173 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-06Add ability for preferences to determine what they can change.Michael Mann1-57/+109
Add flags field to preference structure to help determine what areas of Wireshark are affected by a preference changing. The intent is to be able to distinguish dissection from GUI or other changes that are not dissection. The default is to have all preferences affect dissection, but their flags can be changed. This patch doesn't change any flags from the default. Change-Id: Ied5ae961bc3f33f5b730b2892fff3fa0898380b8 Reviewed-on: https://code.wireshark.org/review/25171 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-14Refactor plugin registration and loadingJoão Valverde1-0/+36
Put different types of plugins (libwiretap, libwireshark) in different subdirectories, give libwiretap and libwireshark init routines that load the plugins, and have them scan the appropriate subdirectories so that we don't even *try* to, for example, load libwireshark plugins in programs that only use libwiretap. Compiled plugins are stored in subfolders of the plugin folders, with the subfolder name being the Wireshark minor version number (X.Y). There is another hierarchical level for each Wireshark library (libwireshark, libwscodecs and libwiretap). The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}. Currently we only distribute "epan" (libwireshark) plugins. Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb Reviewed-on: https://code.wireshark.org/review/23983 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2017-12-07Qt: Use QTextLayout in ByteViewText.Gerald Combs1-14/+3
Use QTextLayout to draw each line in ByteViewText instead of drawing fragments ourselves. Build our pixel-to-byte-offset map when we draw our first line, which should hopefully make it more accurate. This should fix layout and hover issues on some systems. Start moving common code to DataPrinter. Mark prefs.gui_hex_dump_highlight_style GTK+ only. Bug: 11844 Change-Id: Ifda16ae7dc1a5ea22570c0bfd0eb20cee621bfc9 Reviewed-on: https://code.wireshark.org/review/24717 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2017-10-26Include VLAN ID in key for ICMP request/response trackingChristopher Maynard1-0/+6
Add global preference to allow for "stricter" conversation tracking Bug: 13518 Change-Id: I166a084c402374fa76dac7bb54f941e2e9c9325a Reviewed-on: https://code.wireshark.org/review/22842 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-12/+12
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-04Qt: add preference to restore display filter after Follow Streamcheloftus1-0/+6
Added new user preference 'restore_filter_after_following_stream', defaults to false. When true, the current display filter is restored after following a stream. Change-Id: I153107761003658c6d7f1464711da7b3adeb60a8 Reviewed-on: https://code.wireshark.org/review/22455 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: Anders Broman <a.broman58@gmail.com>
2017-09-19prefs: Fix leak when parsing empty pref stringMikael Kanstrup1-2/+5
Fix minor leak. When parsing preference string lists and preference is empty a buffer is allocated to hold the string but is then never inserted into the string list as it is empty. This causes a minor leak as no reference is kept to allocated buffer and won't be freed by corresponding clear string list function call. Bug: 14071 Change-Id: I1edcc77095c0f430e03a49491e5281730fbceb95 Reviewed-on: https://code.wireshark.org/review/23598 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-09-15epan: Fix misuse of comma operatorStig Bjørlykke1-1/+1
Change-Id: I349dc9896db0bd306bc92f92eb9d4a65d98d309c Reviewed-on: https://code.wireshark.org/review/23558 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> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
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>