aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-05Fix whitespace/indentation to match editor modelines.Bill Meier1-1155/+1155
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca Reviewed-on: https://code.wireshark.org/review/3452 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-21[WIP] Add a conversation dialog.Gerald Combs1-11/+5
Items are sorted by value. Move common conversation code to ui/conversation_hash.[ch]. Add a conversation_type_e enum along with convenience functions for fetching titles, tap names, etc. We have a single main dialog instead of a main dialog + individual protocol dialogs. It de-clutters the statistics menu and results in simpler code. Conversation type tabs can be added and removed within the dialog itself. The tab list is sticky and saved with the current profile when the dialog closes. Data can be copied as CSV or YAML. Add a FilterAction class and a corresponding filterAction slot to MainWindow. Use it for the Conversations context menu. Add an addressResolutionChanged signal and related plumbing. Get rid of the iterator members in the conversation item struct. Update the GTK+ code accordingly. Excercise for the reader: - Update TShark to use the common hash code. Ping-Bug: 9231 Ping-Bug: 8703 Ping-Bug: 6727 Change-Id: I8728d771fc5b1a85937bed9d898e53c3ecc3a544 Reviewed-on: https://code.wireshark.org/review/2987 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-20start support for the Japanese language in the Qt versionMartin Kaiser1-0/+1
just the framework and some simple translations Change-Id: I7653a9c6ab26b391bfe2942d088d233996030576 Reviewed-on: https://code.wireshark.org/review/3134 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-15Make the state variable an enum, and add a case for the IN_SKIP value.Guy Harris1-2/+10
Also indicate what the states mean. Change-Id: Ie1701bb2fb33334bcd66d325d1368c2a15cbb7e8 Reviewed-on: https://code.wireshark.org/review/3061 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-14Treat CR-LF at the end of a line like LF.Guy Harris1-1/+14
That way, if we're reading a Windows-format file on UN*X, we handle it the same way we'd handle a UN*X-format file. This handles bug 10272 for the preference file and the "recent" files; there are other configuration files that may need code changes as well. Change-Id: Iec15a8fac276929ce8b53ae16070e9f2855f574c Reviewed-on: https://code.wireshark.org/review/3042 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-11As opposed to *loudly* silently?Guy Harris1-4/+4
Change-Id: I5c6843ac2c665a4c8c8822084377fee661405d34 Reviewed-on: https://code.wireshark.org/review/2992 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-11Change comments to reflect current reality.Guy Harris1-5/+13
Change-Id: If4e220457d2040eaa35dd5e55a0f43fc9da5e347 Reviewed-on: https://code.wireshark.org/review/2991 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-23[WIP] qt: Add support for Polish languageMichal Labedzki1-0/+1
Change-Id: Ib63937e741b737f171a9b383a9cbabb55dfdd8ef Reviewed-on: https://code.wireshark.org/review/2553 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-12Capture Interfaces Dialog:Irene Ruengeler1-0/+4
- allow to change the interface options in the table - save the options to preferences when the dialog is left - add a field for setting a capture filter for all selected interfaces - add a "Compile BPF" button and a window to show the compiled filter output - try to address Alexis' and Evan's comments Change-Id: Ic1272e29183ec80e2d2f4b3e494c79dabe2c3b6f Reviewed-on: https://code.wireshark.org/review/1946 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04(Trivial) Fix a typo.Bill Meier1-1/+1
Change-Id: I111d3af8d9f1a96ebbe3f4b19ab1597a93348058 Reviewed-on: https://code.wireshark.org/review/1952 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-29prefs: prevent double-free on changing prefsPeter Wu1-0/+2
Prevent double-free when changing profiles. After switching from the default profile to a profile without a preferences file, saved_at_version will be freed, but a new version will not be inserted (because the prefs file is empty). On a subsequent switch to another profile, the saved_at_version field is freed again leading to a crash. Bug: 9463 Change-Id: Ia9e0936e32603b4676a37dc428bda40c264a6eaa Reviewed-on: https://code.wireshark.org/review/1425 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29prefs: spelling fix, simplify codePeter Wu1-11/+4
Found spelling error "a another". All those dynamic allocations and magic numbers are horrible and unnecessary. Simplify the gtk code rewording the message and merging strings. Simplify the version code by using fscanf to take care of matching the first line of a preference file. Change-Id: I1e75803aacaa494ba5005791bcbd023e0807aaaa Reviewed-on: https://code.wireshark.org/review/1424 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-27prefs: fix ASAN error due to invalid indirectionPeter Wu1-29/+14
For pref_current, indirection of pref->varp.string will cause a read of size 8. This will cause a global buffer overflow error for all smaller types, for example lbmc_use_heuristic_subdissectors (size 4). Reproduce: compile Wireshark with -fsanitize=address, open Preferences and select OK or Apply. Result: ASAN crash. To fix this, only indirect a pointer if the storage size is known, a void pointer stores the address of the constant value (pref_default, pref_stashed) or the address to the value (pref_current). Note that pointers of different types are of equal size, I could take valp.pref_(anything). While at it, remove superfluous 'break' keywords where a 'return' keyword is present. Change-Id: I05a69e8f14a1ecb4e5d2a0c0f0b71ed3f0a41d70 Reviewed-on: https://code.wireshark.org/review/1286 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-08Do not try to use unknown/non-existent webbrowserMichal Labedzki1-0/+4
Some systems do not have webbrowser or have strange browser. Do not try to use it and dislayed URL for user information. Change-Id: I3f5bcca6701b20cafa942629cbee78aa1fc689b1 Reviewed-on: https://code.wireshark.org/review/516 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-28Fix bug which (somewhat) randomly caused UAT pref to not display on a proto ↵Bill Meier1-0/+1
pref page. Introduced in ga2b2dd4b (SVN #53880) Change-Id: I3dd24ab5e1b45367b03b8096a5892f346782217f Reviewed-on: https://code.wireshark.org/review/433 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-27Fix prefs.c: Argument with 'nonnull' attribute passed null (redux)Hadriel Kaplan1-10/+15
Change-Id: I795df36039278283008132d647aaf51e76dbe218 Reviewed-on: https://code.wireshark.org/review/424 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-25Remove trailing whitespaceBill Meier1-4/+4
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0 Reviewed-on: https://code.wireshark.org/review/385 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-01-14Don't cast away constness.Guy Harris1-1/+1
svn path=/trunk/; revision=54802
2013-12-10Get the "Decode As" dialog working, albeit with a few warts. It differsGerald Combs1-5/+1
from the GTK flavor in two major ways: - The "Decode As" and "User Specified Decodes" dialog have been unified. - You can modify the decode as behavior at any time, not just when you have a packet selected. Revert part of 53498 so that we can move items marked /*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/ from epan/decode_as.h to ui/decode_as_utils.h. Move "save" code from decode_as_dlg.c to decode_as_utils.c as well. In packet-dcerpc.c don't register a table named "ethertype". We might want to add checks for duplicate table names. To do: - Add support for ranges? - Either add support for DCERPC or make DCERPC use a regular dissector table. - Fix string selectors (i.e. BER). svn path=/trunk/; revision=53910
2013-12-09Add a function and an enum to register an uat preference for QT only.Irene Rüngeler1-0/+17
svn path=/trunk/; revision=53880
2013-11-29Stats_tree enhancements for sorting, averages and burst rate. Bug 9452 ↵Michael Mann1-1/+104
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452) From Deon van der Westhuysen - Bug fix: object leak in stats_tree after a tap reset (for example apply statistics preferences with a stats_tree window open) - Bug fix: correct sample code in README.stats_tree - Add: slash in plug-in name now creates submenu as docs describe (was a bug?) - Add: menu separator before the stat_tree registered plug-ins - Add: stats_tree can now calculate averages for nodes; automatically calculated for range nodes. Add section in README.stats_tree describing averages. - Add: stats_tree can now calculate burst rate of each node (like rate but with a shorter, sliding time window) - Add: sorting for stats_tree plug-ins. Can sort on node name, count, average, min, max values and burst rate. - Add: preferences for stats_tree system (default sort column, burst calc params) - Add: stats_tree window copy to clipboard and export and plain text, csv and XML. - Added sample of new functionality in $srcdir/plugins/stats_tree/pinfo_stats_tree.c - Moved all stats_tree sample plug-ins to "IP Statistics" submenu. svn path=/trunk/; revision=53657
2013-11-22Move common "decode as" preference code to epan.Gerald Combs1-0/+5
We presumably want "decode as" behavior to be consistent across UIs so call load_decode_as_entries() from read_prefs(). svn path=/trunk/; revision=53498
2013-11-17Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris1-1/+1
packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
2013-11-07Add Packet Editor PreferenceAlexis La Goutte1-0/+5
svn path=/trunk/; revision=53134
2013-10-25Fix up some formatting and white space.Jeff Morriss1-67/+136
svn path=/trunk/; revision=52848
2013-10-25Fix CID 715143: assert that the preference we were looking for was found. ItJeff Morriss1-0/+1
should be which is why this is an assertion not a NULL check. svn path=/trunk/; revision=52847
2013-10-25Fix CID 715144: assert that the preference we were looking for was found. ItJeff Morriss1-0/+2
should be which is why this is an assertion not a NULL check. svn path=/trunk/; revision=52846
2013-09-09From Dean Lee via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8597 ↵Alexis La Goutte1-0/+1
Qtshark: Chinese Simp translation From me : Add to the (new) Qtshark Language selector svn path=/trunk/; revision=51871
2013-09-09Add Preference to change Language (in QtShark)Alexis La Goutte1-0/+14
Need restart application to change language svn path=/trunk/; revision=51869
2013-08-13When freeing the preferences of a module, also free the preferences of itsEvan Huus1-2/+7
submodule. svn path=/trunk/; revision=51328
2013-07-31Fix the most egregious of the newly exposed leaks, about 28KB.Evan Huus1-1/+1
svn path=/trunk/; revision=51047
2013-07-31Convert preferences to wmem. Exposes some more memory leaks that didn't show upEvan Huus1-19/+19
before. svn path=/trunk/; revision=51046
2013-07-29Clean up white space a bit, make the description of the capture columnGuy Harris1-58/+63
type depend on what values are supported, add some comments. Regularize the curly bracket style a bit. svn path=/trunk/; revision=50998
2013-07-25Add a UAT dialog. Make UAT preferences uat_t * instead of void *.Gerald Combs1-2/+2
C++-ize the UAT headers. Add an ElidedLabel widget. Use it in the File Set, Profile, and UAT dialogs. Update the Qt README. svn path=/trunk/; revision=50896
2013-07-21Don't report a syntax error if a preference name without a "." isGuy Harris1-13/+3
specified, report it as "no such preference" instead. That should be less confusing; see http://stackoverflow.com/questions/17757659/how-to-apply-and-override-preferences-with-tshark for an example of confusion. #BACKPORT 1.10, 1.8 svn path=/trunk/; revision=50745
2013-07-19From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942 :Pascal Quantin1-11/+7
Fix segmentation fault when reading pref file svn path=/trunk/; revision=50737
2013-07-18Temporarily disable offending code triggering a segmentation fault on Linux ↵Pascal Quantin1-0/+2
(see bug 8942) svn path=/trunk/; revision=50725
2013-07-18From Cal Turney:Anders Broman1-21/+55
Unrecognized preferences and color filters created in proprietary or older versions are discarded when saved. If the user attempts to save the preferences or colorfilters file, a popup is displayed that warns that unrecognized prefs or color filters have been detected and will be discarded if the save operation is allowed to proceed. In the case of Preferences, the popup message includes the version at which the file was last saved. A "Continue without Saving" button is provided so that the user can save the profile under a different name. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942 svn path=/trunk/; revision=50716
2013-07-17Backing out r50690 (exept simple_dialog)Anders Broman1-50/+21
struct FILE is different on windows vs *nix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942 svn path=/trunk/; revision=50691
2013-07-17From Cal Turney:Anders Broman1-21/+50
Unrecognized preferences and color filters created in proprietary or older versions are discarded when saved. If the user attempts to save the preferences or colorfilters file, a popup is displayed that warns that unrecognized prefs or color filters have been detected and will be discarded if the save operation is allowed to proceed. In the case of Preferences, the popup message includes the version at which the file was last saved. A "Continue without Saving" button is provided so that the user can save the profile under a different name. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942 svn path=/trunk/; revision=50690
2013-07-16Fix one that got missed.Guy Harris1-1/+1
svn path=/trunk/; revision=50660
2013-07-16Revert r50655 for this file.Chris Maynard1-13/+13
svn path=/trunk/; revision=50659
2013-07-16This should fix warning: to be safe all intermediate pointers in cast from ↵Chris Maynard1-33/+33
'gchar **' to 'const char **' must be 'const' qualified. svn path=/trunk/; revision=50655
2013-07-14Fix some of the preferences leaks. Don't strdup the defaults, as they will beEvan Huus1-10/+9
strduped again immediately when they are registered. To make this safe, tweak the flow a bit so that they are guaranteed to be registered immediately after being set here. svn path=/trunk/; revision=50563
2013-07-09prefs.c: In function 'capture_column_set_cb':Anders Broman1-1/+0
prefs.c:1745: warning: unused variable 'syntax_error' svn path=/trunk/; revision=50457
2013-07-09From Cal Turney:Anders Broman1-92/+139
Wireshark crashes when switching from a v1.11.0 profile to a v1.4.6 prof and then to a v1.5.1 profile. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8884 #BACKPORT 1.10 svn path=/trunk/; revision=50455
2013-06-30From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8876 :Jeff Morriss1-5/+8
Errors in preferences preceding "gui.console_open" are not immediately displayed in the console: If a gui.console_open is set to "AUTOMATIC" or "ALWAYS" and an error or warning occurs in a preference previous to it, the warning is not displayed in the console window because the window is not yet open. However, if the user switches to another profile and returns, the messages will be displayed. Fix: Move the gui.console_open to the top of the list in prefs_register_modules() of prefs.c. Existing preferences files can be corrected by saving them. svn path=/trunk/; revision=50269
2013-06-28Make colors used by colorize_filter_te_as_* as preferences. Bug 5413 ↵Michael Mann1-0/+21
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5413) svn path=/trunk/; revision=50203
2013-06-03From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8707 :Jeff Morriss1-10/+12
As suggested by Jakub, don't use strlen() when g_string->len will do. From me: Don't assume that just because we "got_val" that the value has a length. Checking it first eliminates this warning from Valgrind: ==11954== Invalid read of size 1 ==11954== at 0x61D1466: read_prefs_file (prefs.c:3012) ==11954== by 0x61D1841: read_prefs (prefs.c:2955) ==11954== by 0x409901: main (tshark.c:1137) ==11954== Address 0xc05244f is 1 bytes before a block of size 16 alloc'd ==11954== at 0x4A08A6E: realloc (vg_replace_malloc.c:662) ==11954== by 0x3CF8C4D736: g_realloc (in /usr/lib64/libglib-2.0.so.0.3400.2) ==11954== by 0x3CF8C66226: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2) ==11954== by 0x3CF8C66ACE: g_string_insert_c (in /usr/lib64/libglib-2.0.so.0.3400.2) ==11954== by 0x61D1566: read_prefs_file (gstring.h:139) ==11954== by 0x61D1841: read_prefs (prefs.c:2955) ==11954== by 0x409901: main (tshark.c:1137) svn path=/trunk/; revision=49731