aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/decode_as_dialog.cpp
AgeCommit message (Collapse)AuthorFilesLines
2018-10-10Qt: Add back pathLabel in some dialogsStig Bjørlykke1-0/+19
Add the pathLabel for Coloring Rules, Decode As, Display Filters and Capture Filter. Put the absolute file path into the pathLabel if the file exists. This aligns with UAT dialogs and frames. Change-Id: I72bd06e31bab220de0a0ef8df99df9a4daed667c Reviewed-on: https://code.wireshark.org/review/30089 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-08Qt: Add clear all button to Decode AsStig Bjørlykke1-0/+17
Add a clear all button to easily remove all existing entries. Change-Id: I76e7ee2b7b85a9b4e5f9f5a788a89f38f70ee8ce Reviewed-on: https://code.wireshark.org/review/30052 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01Fix comment end after SPDX identifierStig Bjørlykke1-1/+2
Move */ to a separate line below the SPDX identifier. Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f Reviewed-on: https://code.wireshark.org/review/27211 Reviewed-by: Anders Broman <a.broman58@gmail.com>
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-02-02Qt: use SPDX identifiers.Dario Lombardo1-14/+1
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3 Reviewed-on: https://code.wireshark.org/review/25563 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-16Refactor Decode As dialog to use a model/delegateMichael Mann1-569/+45
The model provides a lot more flexibility and abstracting the data from the view (dialog) Noticeable changes from user perspective: 1. Value column doesn't always have a combobox. If registered decode as structure doesn't support multiple values, a simple edit box is used. 2. Existing value will always be a choice (default) in the Value combobox. 3. Duplicate values in Value combobox have been removed (for things like UDP port where source port and dest. port are same) 4. When adding/copying a decode as item, only first column (table) is editable, not the whole column. 5. Separator always present in Current protocol column to distinguish "none" from rest of protocols. 6. "Current" protocol defaults to "default value" when first added to the list instead of "none". Noticeable changes from developer perspective: 1. Code is much more spread out, but most new additions (like DCE/RPC support) should be limited to the model class (maybe delegate). The dialog class probably won't change much anymore. 2. decode_as_dialog.ui is much less useful because information is provided through model and delegate. Change-Id: I70a667cab2c07d251ab370430bc51e5c1f4a3a02 Reviewed-on: https://code.wireshark.org/review/22625 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-07-26Qt: Move utils to separate utils directoryRoland Knall1-2/+2
Following the move for widgets directory, moving utils to the utils directory. Guidelines for this directory are: - Generic use but not a widget - Utility functionality used by many classes Note: additionally all includes affected by this move have been changed to absolute path includes, instead of relative ones. Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b Reviewed-on: https://code.wireshark.org/review/22602 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-22Internalize struct preferenceMichael Mann1-28/+18
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-12Qt: Remove unneccessary Q_DECLARE_METATYPERoland Knall1-3/+5
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls to QVariant conversions with VariantPointer where necessary Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec Reviewed-on: https://code.wireshark.org/review/19611 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-01-07Refactor range preference.Michael Mann1-2/+2
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-2/+2
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-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-0/+52
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-02-28Qt: Add dialog geometry restoreStig Bjørlykke1-1/+3
Add GeometryStateDialog class to handle load and save dialog geometry. The QDialog class name will be used as window name. For shared classes the UAT name or the statistics title or abbr will be used. Change-Id: I5a019598307fb3861518f41e733de834788184d8 Reviewed-on: https://code.wireshark.org/review/14139 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-21tshark: load decode_as_entries fileMichael Mann1-1/+9
With Wireshark 2.0, some dissector preferences were removed in favor of 'Decode As' functionality. But the settings saved in the GUI are not loaded in tshark, preventing their use without an explicit call to '-d' option. Let's load decode_as_entries file by default and have it overridden by the '-d' option if required. Ping-Bug: 12124 Change-Id: I134a424cb6cf8fc89b7096a659ef1605314a70a2 Reviewed-on: https://code.wireshark.org/review/13956 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-20Qt: Resize columns to contents in DecodeAsMichal Labedzki1-0/+6
If user first time run DecodeAs columns width are not enough, so content are trimmed. Do resizing whenever add new item. Change-Id: I378e2a5b2134479d961f3f00d398d8052f7e556d Reviewed-on: https://code.wireshark.org/review/13392 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-11-04Refactor DCE/RPC dissection to include a real dissector table.Michael Mann1-0/+4
This is hopefully just the first step in getting DCE/RPC dissection to use "standard" APIs instead of homegrown ones. For starters, it allows Decode As functionality to be less hacky (although incomplete in Qt) Change-Id: Ia0923a3d8d514ab7acce32e26ee7e08f6e24feca Reviewed-on: https://code.wireshark.org/review/11468 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05Qt: fix crash when double clicking on a row in 'Decode As' dialogPascal Quantin1-19/+2
No need to register for the destroyed() signal: it is emitted after the new QComboBox object is created and resetting pointers to NULL is useless as they are locals initialized in the constructor Bug: 11532 Change-Id: Ie707cafa370053df846a4732aed20c182e030c40 Reviewed-on: https://code.wireshark.org/review/10792 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-05Move utf8_entities.h to wsutilJoão Valverde1-1/+1
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0 Reviewed-on: https://code.wireshark.org/review/10786 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-29Decode as (Qt): fix dereference of null pointer found by Clang analyzerPascal Quantin1-5/+10
Also fix usage of 'Decode As' window when no file is opened (broken by gf189cb8) Change-Id: I06ff83394cf31763cecfbbedd99ce7438488872a Reviewed-on: https://code.wireshark.org/review/10665 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-19Fix 'Decode As' when used with IPv6-in-IPv6 packetsPascal Quantin1-2/+25
Add the ability to identify an instance of the dissector table to be modified by 'Decode As' thanks to pinfo->curr_layer_num For now only IPv6 makes use of it but it could be extended to any other protocol Also get rid of ipv6.nxt protocol: it is not required for 'Decode As' functionality and was colliding with ipv6.nxt field Change-Id: I3c7403c77328ad7170e13af028d178f962a2b508 Reviewed-on: https://code.wireshark.org/review/10552 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-19Qt: set default current protocol in 'Decode As' window to none instead of HTTPPascal Quantin1-2/+2
It makes more sense (not trying to decode UDP/TCP ports as HTTP) and is consistent across dissectors tables (while currently we have an empty field for tables other than UDP/TCP) Change-Id: I794529f0f46b4197437a1d258f808991ae2338ad Reviewed-on: https://code.wireshark.org/review/10571 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-04Qt: fix Decode As dialog when using octal or hexadecimal typesPascal Quantin1-1/+1
Change-Id: Ie022573f6a7b11a0f74abfa47b2667f5b2844cc3 Reviewed-on: https://code.wireshark.org/review/10387 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-08-29Fix a GHashTable assertion in DecodeAsDialog.Gerald Combs1-9/+31
Make sure we don't call g_hash_table_removed from g_hash_table_foreach, which generates an assertion error. Bug: 11426 Change-Id: I00283c97b0fc63551b901c0fd526b60c0fb80ace Reviewed-on: https://code.wireshark.org/review/10296 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-26Don't emit app signals from dialogs.Gerald Combs1-1/+1
Emitting PacketDissectionChanged from a dialog on can render the main window unusable on OS X. A workaround for this was added to the preferences dialog in g8fc2327. Generalize the workaround and use it elsewhere. Fix the "Enabled Protocols" action name while we're here. Bug: 11361 Bug: 11448 Change-Id: I89e98daaaedc877d3b13b0d33b6f3be033e323d7 Reviewed-on: https://code.wireshark.org/review/10271 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06Use int_to_qstring in a few more places.Gerald Combs1-1/+2
Change-Id: Id324fe21f436a233088d106553db2ed6f6e410ac Reviewed-on: https://code.wireshark.org/review/9899 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-07-17Qt: Fix DecodeAs for String tablesMichal Labedzki1-1/+3
It seems that string object die to early. Add space when it can live. Change-Id: I4e776134ce6782bd6e854ab2bc3c188e80530839 Reviewed-on: https://code.wireshark.org/review/9677 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-07-07Finish removal of Q_UNUSED.Joerg Mayer1-12/+4
Todo: qcustomplot via upstream Change-Id: I19cf98f1281ecb1f6efbb7d36c997d5aa43f5baf Reviewed-on: https://code.wireshark.org/review/9547 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-06-25Qt: use <> for including the generated ui_*.h filesMartin Kaiser1-1/+1
this should make Visual Studio pick up the generated include files from the build directory instead of the source directory (which may contain lefovers from an in-tree build) Change-Id: Ie3de4cdd85a2865e203118a42ab10f443372f03b Reviewed-on: https://code.wireshark.org/review/9129 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-23Qt: change default behavior of 'Decode As' windowPascal Quantin1-4/+16
Up to know Qt 'Decode As' window was saving manual configuration automatically, contrary to GTK UI. This can be misleading when decoding protocols without a fixed identifier (port number, USB bus/device id, ...). Opening a new trace might lead to previous and now irrelevant settings being applied. Make this optional and add a Save button to permanently store the current configuration. Change-Id: I077c560f9e71cab16a74247e2e9d87523c0ed85e Reviewed-on: https://code.wireshark.org/review/9058 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-03-19Unused parameters are done differently in C++.Guy Harris1-1/+1
Change-Id: If6324e7ee57156e067c2584b80df835620f94ac0 Reviewed-on: https://code.wireshark.org/review/7744 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-15Qt: Sort names in DecodeAs dialogMichal Labedzki1-0/+1
This should increase user experience. Change-Id: Id2713e7c5af8ca0f0d87e3ae52542b4f189ace9a Reviewed-on: https://code.wireshark.org/review/7681 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-03-14Qt: Fix DecodeAsMichal Labedzki1-9/+107
Previously DecodeAs neither save its changes nor changes dissector tables. Do that and redissect packets to refresh view. Bug: 10553 Change-Id: Icd8453c9650f0265852f6b6b58bc483b35570a15 Reviewed-on: https://code.wireshark.org/review/7676 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-10Qt/C++: Change a bunch of includes to forward declarations.Gerald Combs1-0/+1
In theory this this should reduce compilation times. On my particular system it makes no difference but hopefully it will elsewhere. Change-Id: I570177d3ca4eec691c82d46b4dbbce74092aac1d Reviewed-on: https://code.wireshark.org/review/7060 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-31Qt: Convert more dialog titles.Gerald Combs1-0/+1
Change-Id: I9c3e3471a92b7af9347a541bece3d9405d37dce0 Reviewed-on: https://code.wireshark.org/review/6193 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-15Enable case-insensitive string dissector tablesEvan Huus1-2/+2
Permit passing TRUE as the parameter during table registration to achieve that effect. Use it in RTP media type table. Bug: 10708 Change-Id: I892fb1a421d349f0c05197dec90f14fc34ad6b97 Reviewed-on: https://code.wireshark.org/review/5695 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-04Write out decode_as entries from the actual dissector tables.Guy Harris1-13/+1
Have a save_decode_as_entries() routine in ui/decode_as_utils.c, that does all the work of saving the entries by iterating through all the changed entries with dissector_all_tables_foreach_changed(). When doing so, write out the selector for integral values in decimal, as older versions of Wireshark only handled decimal values, and some of those older versions are EOLed and won't be fixed. Change-Id: I2dab461604524b98e3515867839a4b86c86c5d7b Reviewed-on: https://code.wireshark.org/review/3426 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-12Get rid of more tvb_get_nstringz* calls.Guy Harris1-3/+5
Add an FT_STRINGZPAD type, for null-padded strings (typically fixed-length fields, where the string can be up to the length of the field, and is null-padded if it's shorter than that), and use it. Use IS_FT_STRING() in more cases, so that less code needs to know what types are string types. Add a tvb_get_stringzpad() routine, which gets null-padded strings. Currently, it does the same thing that tvb_get_string_enc() does, but that might change if we don't store string values as null-terminated strings. Change-Id: I46f56e130de8f419a19b56ded914e24cc7518a66 Reviewed-on: https://code.wireshark.org/review/1082 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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>
2013-12-23From Ville Skyttä: Spelling FixesBill Meier1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9591 svn path=/trunk/; revision=54387
2013-12-13Simplify column sizing.Gerald Combs1-10/+5
svn path=/trunk/; revision=54068
2013-12-10QComboBox::setCurrentText() exits in Qt3 and Qt5 but not Qt4.Gerald Combs1-3/+3
svn path=/trunk/; revision=53920
2013-12-10Add "Decode As" to the packet list and protocol tree context menus.Gerald Combs1-1/+3
Automatically add a new item if "Decode As" is triggered from the context menus. svn path=/trunk/; revision=53915
2013-12-10Get the "Decode As" dialog working, albeit with a few warts. It differsGerald Combs1-50/+411
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-11-22Fix typo in top filenameAlexis La Goutte1-1/+1
svn path=/trunk/; revision=53505
2013-11-22Mark a parameter unused.Gerald Combs1-0/+1
svn path=/trunk/; revision=53501
2013-11-22Add an initial "Decode As" dialog. Currently read-only.Gerald Combs1-0/+167
Fixup some of the Statistics menu items. svn path=/trunk/; revision=53499