summaryrefslogtreecommitdiff
path: root/ui/decode_as_utils.h
AgeCommit message (Collapse)AuthorFilesLines
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-38/+0
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-06-19Ability to invoke "Decode As..." as command-line argument for GUIshark.Michael Mann1-0/+8
TShark has had the functionality for awhile. While the GUI version still has ways to change and persist Decode As functionality, adding command line functionality gives the Decode As from initial launch of the GUI. Was also an excuse to refactor a bunch of code out of tshark.c Bug: 5143 Change-Id: Ie67007d75e897bc06cc9afd9b84372a96b93778c Reviewed-on: https://code.wireshark.org/review/16008 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-21tshark: load decode_as_entries fileMichael Mann1-1/+1
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>
2014-10-14Always put editor-modelines at the end of the file ...Bill Meier1-2/+2
... to ensure that there are no potential issues with respect to editors limiting the number of lines scanned at the end of the file when checking for editor modelines. Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4 Reviewed-on: https://code.wireshark.org/review/4688 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12Add editor modelines; Adjust whitespace as needed.Bill Meier1-0/+13
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad Reviewed-on: https://code.wireshark.org/review/4626 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-04Write out decode_as entries from the actual dissector tables.Guy Harris1-19/+4
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-14Fix warning when generate documentation (doxygen)Alexis La Goutte1-0/+2
ui/decode_as_utils.h:42: Warning: The following parameters of decode_build_reset_list(const gchar *table_name, ftenum_t selector_type, gpointer key, gpointer value, gpointer user_data) are not documented: parameter 'selector_type' Change-Id: I8353dae120e87c9651c6611924c1fc652436146d Reviewed-on: https://code.wireshark.org/review/1138 Reviewed-by: Anders Broman <a.broman58@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>
2013-12-10Fix prototypes.Gerald Combs1-2/+2
svn path=/trunk/; revision=53917
2013-12-10Fix compilation on Windows.Gerald Combs1-3/+5
svn path=/trunk/; revision=53912
2013-12-10Get the "Decode As" dialog working, albeit with a few warts. It differsGerald Combs1-0/+93
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