aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-27prefs: Fix null defererences, remove obsolete functionHEADmasterJohn Thacker1-13/+10
Null dereference check to fix Coverity CIDs 1399640 and 1399641. Remove a function that has been unused for a decade.
2024-02-27Remove PREF_DECODE_AS_UINTJohn Thacker1-104/+6
PREF_DECODE_AS_UINT has been unused since all auto port preferences were made ranges by 8604d03a98607bf8dc62e3ee152f8c8289c4052b Remove it. Ping #14319
2024-02-25Fix lots of spellingsMartin Mathieson1-1/+1
2024-02-24Qt: Only set Packet List style sheet when relevant prefs changeJohn Thacker1-1/+7
Add a colorsChanged signal/slot, more precise than the generic preferencesChanged signal, and only call it when one of the color related preferences have changed. Connect it to the packetList::colorsChanged() function, instead of calling that whenever preferencesChanged() is called. We could eventually move the signals and slots some of the other GUI widgets to this. Send that signal before handling preferences that change dissection and freeze the packet list, so that when we restore the column widths due to Qt bug 122109 it takes effect. The packet_list_hover_style preference affects colors, not the layout, despite its presence in the GUI layout module.
2024-02-24Qt: If no preferences have changed, don't signalJohn Thacker1-0/+6
Enforce the requirement, already mentioned in the headers, that preference and preference module effect flags must be nonzero so that the application knows that a preference has changed. (Lua, for example, needs this.) Use this and avoid sending the PreferencesChanged signal when preferences have not changed.
2024-02-23extcap: Use extcap.cfg as extcap config file nameJohn Thacker1-2/+4
"extcap" by itself can be the name of a directory that stores extcap programs, especially if the default profile is being used. Add an extension to the default file name so it doesn't clash. Follow up to 4fb2ef8af871682905b29cc1f3dbbfaba41c9e38
2024-02-20prefs: Always write main prefs fileJohn Thacker1-16/+20
If writing a separate extcap preferences file fails, always write the main preference file. If there's a directory of the same name as a module, silently ignore it. Followup to !14436
2024-02-19prefs: Backwards and forwards compability for hiding columnsJohn Thacker1-10/+111
Continue to write the format-based hidden preference for now. Read both preferences; if the index-based preference is read, use it. If not, fall back to the format-based preference. Followup to 41930060b04146198966e1b775c4527b70cab6f2
2024-02-18extcap: Really don't load extcap interfaces if disabledJohn Thacker1-2/+80
If the capture.no_extcap preference is set, really don't load the extcap interfaces. Previously, the extcap interfaces were loaded before the preference was read, because otherwise the extcap preferences wouldn't be registered and properly read out of the configuration file. Wait until after that preference is read to register the extcap preferences and then re-read just the extcap module preferences from the configuration files. Make sure to check other times when the preference may be changed, such as switching profiles. Write extcap prefs to a separate file so that they don't get lost if the extcap interfaces aren't loaded and the prefs are then written out. Continue writing them to the main file for backwards compability. Related to #15295. Cuts ~100 ms off the loading time of Wireshark in a normal situation if the capture.no_extcap preference is set, more if an extcap has some kind of issue that makes it take a long time to load.
2024-02-14prefs: Read the old hidden column preferenceJohn Thacker1-0/+90
Read the old obsolete hidden column preference and apply it. This will convert it to the new value (and remove it) if preferences are saved. Follow up to 41930060b04146198966e1b775c4527b70cab6f2
2024-02-11prefs: Use column index, not format, for hidden stateJohn Thacker1-60/+22
Obsolete the existing column hidden preference, and use the column index instead of the format for remembering the hidden state. Fix #15529
2024-02-08Qt: added preference for hiding 'Welcom page' -> 'Open'Jan Wiesemann1-0/+5
This commit adds a additional preference to hide the 'Open' (recently opened files) section on the welcome page.
2024-01-29Logray: Make the Syscalls profile the defaultGerald Combs1-10/+13
2024-01-02Qt: Add capture comment to custom titleStig Bjørlykke1-0/+2
Add custom title option %C to show the first capture comment from command line argument. Ping: #19296
2023-11-30Add "Use monitor mode on all 802.11 devices if possible"John Thacker1-0/+4
Similar to the -I option, but as a pref (defaulting to false, which is current behavior) that sets the default for 802.11 devices to use monitor mode. (Note this depends on commit c25e0f9084d1108ea51952eb97531027c1291d38 being merged to work properly.) Also add the checkbox in capture options, only enabled if at least one device supports monitor mode, that enables and disables monitor mode on all devices that support it when toggled. Fix #11011
2023-11-26Qt: Add side-by-side layout preference option for Packet DialogJohn Thacker1-0/+12
Like the option to show the bytes, this isn't in a preference dialog (other than Advanced preferences) because it's easiest to change it from a Packet Dialog itself. Fix #18731
2023-11-26prefs: Add prefs_register_dissector_preference()Stig Bjørlykke1-3/+31
Use this preference to get color code validation and autocompletion for string preferences used for configuring a dissector name.
2023-11-12Qt: add command line options support in the TLS Keylog LauncherPeter Wu1-6/+6
Add support for command line parameters, rename the preference to match. Use the correct `SSLKEYLOGFILE` environment variable name in the text. Rename SSL to TLS, we are no longer in 1999. Clarify that applications other than browsers can be selected. Various dialog text improvements. Move the Launch button to the right to make it stand out more. Relates to #19471
2023-10-31prefs: GUI preferences don't affect dissectionJohn Thacker1-0/+15
The GUI preferences don't affect dissection in general and shouldn't require a costly redissection. We used to have a PREF_EFFECT_GUI, but it seems that nothing needed to check it because any changes were noticed in other ways, so it was removed. (d95213afb0b78f98757d188ef041730fc4a4e3e8) Bring it back, because the Lua set_preference assumes that *some* effect flag is returned when a preference is changed. We have to set this separately for each submodule too, because the effect flags are reset to PREF_EFFECT_DISSECTION regardless of the parent module. The changes to columns, fonts, and colors are also handled separately without special effect flags; the layout submodule does have its own effect flag. Fix #17629
2023-10-31Prefs: Fix TCP sequence analysis override pref handlingJohn Thacker1-14/+90
When a preference dialog is used, we don't want to write to each frame data the value of the TCP sequence analysis override preference immediately, because that means that the changes take effect even if the dialog is Rejected. The redissection isn't triggered, but that's worse in some ways, because it puts things in an inconsistent state. Instead, stash the list of frame datas to possibly override in the pref, and then override them when unstashing preferences. Delete the least when cleaning the preferences. (Storing the pointers should be fine, because the preference dialogs are modal.) This also allows us to correctly have the TCP sequence analysis override preference report whether or not any frame data's override value was changed, and avoids doing a full redissection any time the preference dialog is opened, even if nothing is changed. The TCP sequence analysis override preference doesn't need to be written to a file or read from the file or command line, because it's different for every frame, and reset to default (0) for each new frame when a file is read. Related to #17629
2023-08-23Qt: Add Browser SSL keylog dialogJoão Valverde1-0/+6
Adds a new menu under Tools to launch a browser with the SSLKEYLOGFILE environment variable set. Adds a new GUI preference to store the browser path specific to the SSL Keylog dialog (which may be different from the user's preferred system browser).
2023-08-18Move autoscroll preference behavior to recentJohn Thacker1-4/+1
Make whether or not we are autoscrolling a "recent" item. Make the selection of automatically scrolling in the Capture Options tab actually have an effect (right now it does nothing.) Switching to a recent also means that the command line "-l" option actually turns on automatic scrolling if the recent value is off (currently it has no effect because it is always later overridden by the preference value). Document our behavior that autoscrolling, if turned on, temporarily turns off when manually scrolling upwards or Go'ing directly to a packet (so that a user can examine a chosen packet.) This temporary effect does not change the "recent" status, which changes only when the user directly turns the behavior on or off (through the capture window, the button or menu item, or the -l command line option.)
2023-07-25epan: Register dynamic column fields and make them filterableJohn Thacker1-0/+3
Make the text of each registered column a FT_STRING field that can be filtered, prefixed with _ws.col - these work in display filters, filters in taps, coloring rules, Wireshark read filters, and in the -Y, -R, -e, and -j options to tshark. Use them as the default "Apply as Filter" value for the columns that aren't handled by anything else currently. Because only the columns formats that actually correspond to columns get filled in (invisible columns work), register and deregister the fields when the columns change. Use the lower case version of the rest of the COL_* define for each column as the field name. This adds a number of conditions to "when are the columns needed", including when the main display filter or any filter on a tap is using one of these fields. Custom columns are currently not implemented. For custom columns, the tree then has to be further primed with any fields used by the custom columns as well. (Perhaps that should happen in epan_dissect_run() - are there any cases where we construct the columns and don't want to prime with any field that custom columns contains? Possibly in taps that we know only use build in columns.) Thus, for performance reasons, you're better off matching an ordinary field if possible; it takes extra time to generate the columns and many of them are numeric types. (Note that you can always convert a non-string field to a string field if you want regex matching, consult the *wireshark-filter(4)* man page.) It does save a bit on typing (especially for a multifield custom column) and remembering the column title might be easier in some cases. The columns are set before the color filters, which means that you can have a color filter that depends on a built-in column like Info or Protocol. Remove the special handling for the -e option to tshark. Note that the behavior is a little different now, because fixed field names are used instead of the titles (using the titles allowed illegal filter names, because it wasn't going through the filter engine.) For default names, this means that they're no longer capitalized, so "_ws.col.info" instead of "_ws.col.Info" - hopefully a small price in exchange for the filters working everywhere. The output format for -T fields remains the same; all that special handling is removed (except for remembering if someone asked for a column field to know that columns should be constructed.) They're also set before the postdissectors, so postdissectors can have access. Anything that depends on whether a packet and previous packets are displayed (COL_DELTA_TIME_DIS or COL_CUMULATIVE_BYTES) doesn't work the way most people expect, so don't register fields for those. (The same is already true of color filters that use those, along with color filters that use the color filter fields.) Fix #16576. Fix #17971. Fix #4684. Fix #13491. Fix #13941.
2023-07-18epan: Add default log column preferencesGerald Combs1-11/+25
Add default log column preferences. They're currently specific to the Cloudtrail dissector and need to be generalized, but it's a good starting point. Don't clobber hard-coded custom column settings.
2023-06-17Convert wmem to C99 typesGerald Combs1-4/+4
Ping #19116.
2023-06-09Add a preference for ignoring duplicate framesGilbert Ramirez1-0/+15
Sometimes you have a capture file that has many duplicate frames because of how the capture was made, and its convenient to ignore the duplicates so you can concentrate on the data and not all the TCP warnings. This adds a preference in the "Protocols" section to ignore duplicates. This currently only works while reading a capture file *not* during a live capture.
2023-05-08prefs: Remove type of GUI preferenceStig Bjørlykke1-22/+13
The type of GUI preference is unused. Remove prefs.gui and rename prefs.gui_qt_* to prefs.gui_*.
2023-05-05prefs: Describe converted pref names properlyJohn Thacker1-3/+11
The Column prefs were moved to a submodule, so the name needs to be obtained from the parent module instead of the module found, unlike other modules. The Column preference names themselves were also changed in addition to the module. Wait until checking both the module name and the preference name before printing a warning to the user that a preference has been converted to a new name, so that the correct name is displayed. This also means that we print the warning message now for the preferences that just had their names changed, not the modules. Fix #19043
2023-04-29epan: move deprecated column check to column fileJohn Thacker1-117/+5
Move the deprecated column check functions from the prefs file to the (Wireshark internal use) column files. Make them public so that the recent file checking can use them. This keeps column handling in one place. Make the recent file column width checking able to convert a deprecated column to a custom column the same as the main prefs file.
2023-04-10IO Graph: Hide LegendDeveloper Alexander1-0/+6
Allows the user to hide the legend of the IO Graph. This becomes handy as the legend may hide some graphs and it is unfortunately not very helpful in many cases.
2023-04-07MaxMindDB: Move pref to Name Resolution prefsJohn Thacker1-0/+3
Move MaxMind lookups to a global Name Resolution preference. That's a bit of a misnomer (it's not name resolution, but it is using external sources of data to update information about a network object), but the MaxMind DB path location is already there. This means that MaxMind lookups can be disabled with the '-n' option, and enabled with a 'g' for the '-N' option. This is significant for tshark, because MaxMind lookups are now synchronous. Disabling the new global preference also keeps the Endpoints window from doing MaxMind lookups; currently, even if the IPv4 and IPv6 GeoIP prefs are disabled the data is still looked up and inserted in the Endpoints window. Fix #14692
2023-03-14capture: Set update interval in capture opts, default to 100msJohn Thacker1-0/+8
Reduce the default update interval for dumpcap to notify its parent of new packets (or to check if we've met file duration, etc.) from 500 ms to 100 ms, and put in the capture options. This makes the GUI appear to update more in real time rather than in visible batches of packets. This also reduces the amount of ring buffer space needed in cases where we're doing dissection, and dissection is able to keep up, but the files can be deleted before tshark gets to them because of the notification lag. (See #1650.)
2023-02-19sshdump: add capability to use doas on remote hostJaap Keuter1-6/+17
2023-02-09Preferences: Support configuring debounce timersMoshe Kaplan1-0/+13
2023-01-07Qt: Add a pref for column text caching, and have it affect sortingJohn Thacker1-0/+6
Introduce a preference for the number of rows whose column text can be cached, and allow sorting of the packet list only when the number of displayed rows can fit in the cache. This preference only has an effect for sorting based on columns that require dissection and caching the column text. This reduces the number of dissections from O(N log N) to N. Subsequent sorts are even faster. Columns based on frame data are unaffected, as they sort much faster as dissection is not required. Set the size of the QCache introduced in 8c6854fb653cf58df39 based on this preference. Send a temporary status message to the status bar if we try to sort but there are too many rows, explaining why sorting did not happen and that the layout preferences can be changed. Ping #18741
2022-12-29prefs: report load error in gui popupChuck Craft1-1/+1
ws_warning logs to console which most users will never see. https://ask.wireshark.org/question/30035/new-computer-setup-custom-columns/
2022-11-01TCP: Overriding of the automatic SEQ AnalysisEugène Adell1-0/+43
2022-10-11wslog: rename console open preference enumJoão Valverde1-2/+2
2022-10-11wslog: Fix console_open registry key nameJoão Valverde1-12/+11
Fix "OpenConsole" registry key to "ConsoleOpen". Add a common macro for the key name.
2022-10-11Windows: Store "gui.console_open" in the Windows registryJoão Valverde1-7/+82
This removes the last dependency of the logging subsystem on the preferences module. The latter is started much later than the former and this is an issue. The Windows-only preference "gui.console_open" is stored in the registry as HKEY_LOCAL_USER\Software\Wireshark\ConsoleOpen. The semantics are exactly the same. The preference is read by the logging subsystem for initialization and then again by the preferences (read/write) so the user can configure it as before. The code to store the preference also in the preferences file was kept, for backward compatibility and because it is not incompatible with using the Registry concurrently. The elimination of the prefs dependency also allows moving the Windows console logic to wsutil and add the functionality to wslog directly, thereby eliminating the superfluous Wireshark/Logray custom log handler. To be able to read the ws_log_console_open global variable from libwireshark it becomes necessary to add a new export macro symbol called WSUTIL_EXPORT.
2022-08-17TCP: Use RFC 6994 for experimental optionsMichael Tuexen1-0/+2
Modernize the handling of experimental TCP options based on RFC 6994. In particular use ExID instead of magic (which in the context of RFC 6994 are the last two bytes of a 32-bit ExID) and add a desciption of ExID based on the current state of the IANA registry.
2022-08-09prefs: More cleanup, auto prefsJohn Thacker1-0/+7
Remove callback function from pref registrations for dissectors that don't need a callback. In other dissectors, move registration that only needs to be done once inside the check for initialization, avoiding some console messages when preferences are changed ("Duplicate dissectors (anonymous) and (anonymous) for protocol...") and the like. Add a couple auto preferences for dissectors missed in previous waves. Ping #14319
2022-08-06prefs: More port prefs to auto prefs with rangesJohn Thacker1-0/+4
Move the rest of the SCTP port preferences to auto prefs with ranges. Ping #14319.
2022-08-06Prefs: Convert some SCTP port preferences to auto prefsJohn Thacker1-0/+9
Convert SCTP port preferences in dissectors starting m-z. Preferences that were already the name of the table can just be removed from the dissector and they will migrate. Preferences with a different name are added to deprecated_port_prefs in epan/prefs.c (Since that function handles them there is no need to mark them as obsolete.) Also change a few TCP and UDP single ports reigstered with preferences and callbacks that used the sample dissector as a template. Uses more auto preferences, makes more port preferences ranges, and reduces the number of preference callbacks. Ping #14319
2022-08-04prefs: Remove prefs_register_decode_as_preferenceJohn Thacker1-17/+0
All Decode As auto preferences are registered as ranges now, so remove this internal function. Ping #14319.
2022-07-31prefs: Convert most RTP dissectors to use "auto" PT preferencesJohn Thacker1-2/+21
Similar to commit 2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c, replace the RTP payload type preferences with automatic dissectors. This reduces the number of preference module callbacks.
2022-07-29prefs: Fix deprecated_port_pref migrationJohn Thacker1-81/+87
prefs_find_module() looks up a module by module name, which is the same as the protocol filter name, case-insensitively. dissector_table_get_dissector_handle() looks up a dissector handle in the table by the protocol short name (which is the module _title_) deprecated_port_pref() used the same string for both lookups. For some protocols this worked, because the short name is the same as the filter name only with different capitalization. For others, it either wouldn't find the module to add to the migrated preference, or wouldn't find the dissector handle in order to set Decode As properly. Fix this, by using the module title for the second lookup, and changing all the module_name values to be correct. For good measure, change all the module names that happened to work because they're differently-cased versions of the filter name in order to avoid confusion when new entries are added.
2022-07-07prefs: Remove custom column expression limitJohn Thacker1-20/+13
Custom column expressions do not need to be limited to COL_MAX_LEN. The size of the expression does not have any necessary relationship to the size of the column contents, especially in the common case of many semantically equivalent different fields from different protocols, only one of which appears in any given frame. The only place that actually does limit the length of custom custom expressions is in reading the preferences. Use a GString instead of allocating a buffer to COL_MAX_LEN when constructing the string. In normal cases, this should decrease temporary memory usage. Fix #16905
2022-06-18Prefs: Change the default UI layout to type "2".Gerald Combs1-2/+2
Make the default UI layout "packet list on top, packet detail and bytes side by side". This is more space efficient on modern displays and is the first thing I change when using the default profile.
2022-03-17Qt: Disable Sorting for the packet ListRoland Knall1-0/+6
Allows the sorting to be disabled to avoid painful recalculations if the sorting has been clicked on by accident. Fixes #16786