summaryrefslogtreecommitdiff
path: root/ui/decode_as_utils.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-306/+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/+410
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-04-21Link version code statically againJoão Valverde1-1/+1
This allows keeping the code-sharing with the static linking. This "fixes" a hypothetical ABI mismatch with wsutil and avoids pulling more external dependencies to wsutil than strictly necessary. A nice side-effect is that libwsutil no longer depends on version.h. Follow up to f95976eefcbeb5d24df383c29d29ef888b503945. Change-Id: I8f0d6a557ab3f7ce6f0e2c269124c89f29d6ad23 Reviewed-on: https://code.wireshark.org/review/15002 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-21tshark: load decode_as_entries fileMichael Mann1-10/+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-02-16const gpointer -> gconstpointerJoão Valverde1-1/+1
'const gpointer' is the same as 'void *const'. Replace with gconstpointer where straightforward (assuming that was the intent) and use gpointer everywhere else for clarity (that does not change *API* constness contract; it just means a variable is not declared immutable inside the called funtion). Change-Id: Iad2ef13205bfb4ff0056b2bce056353b58942267 Reviewed-on: https://code.wireshark.org/review/13945 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-21decode_as_utils: Fix warning [-Wcast-qual]João Valverde1-2/+2
Change-Id: Ia30c3fd579a72b3bff882cb03c06de12bcd743b3 Reviewed-on: https://code.wireshark.org/review/13442 Reviewed-by: João Valverde <j@v6e.pt>
2016-01-04PPP: fix registration of CRTP (CNTCP) protocolPascal Quantin1-1/+2
Also protect against any badly registered protocol Bug: 11958 Change-Id: I0c03f50c2c5478a9524ad06e669510ffb5739b21 Reviewed-on: https://code.wireshark.org/review/13041 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-23ui: Plug memory leak in decode_build_reset_list.Stig Bjørlykke1-5/+6
The strings passed to decode_build_reset_list() is not freed, so ensure we cleanup in decode_clear_all(). Change-Id: Ib68bde71403e260199482831272beb161fe033f9 Reviewed-on: https://code.wireshark.org/review/12836 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>
2015-01-01Remove unneeded includes from ui folderMartin Mathieson1-1/+0
Change-Id: Ifd1eebff9080cd3867e44e4dcb2d2681370ed60a Reviewed-on: https://code.wireshark.org/review/6128 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-31Move the version_info.c stuff to wsutil/ws_version_info.c.Guy Harris1-2/+1
Change-Id: I3a5c7e219974bfb924819b43b4d445eaf00e5bde Reviewed-on: https://code.wireshark.org/review/6153 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-06Adjust some whitespace to match editor modelines.Bill Meier1-2/+2
Change-Id: Ia22cac3ebd7a454c156f98d967e6fd61f708a2b3 Reviewed-on: https://code.wireshark.org/review/4489 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-04Write out decode_as entries from the actual dissector tables.Guy Harris1-16/+66
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-08-04Squelch a compiler warning.Guy Harris1-2/+2
Change-Id: I8916bb3cc136c03c39fbdaf5d7bb61c3dae137e6 Reviewed-on: https://code.wireshark.org/review/3422 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-04Add in a missing newline.Guy Harris1-1/+1
Change-Id: I704be0f8a87c939b5058d574da833b237a32148d Reviewed-on: https://code.wireshark.org/review/3419 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-04Support both decimal and hex values for uint dissectors.Guy Harris1-1/+12
And, while we're at it, reject entries with invalid numbers. Change-Id: Ifefe28396cfe391d2d5c7f7ff335d0f041e35a03 Reviewed-on: https://code.wireshark.org/review/3417 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-12Get rid of more tvb_get_nstringz* calls.Guy Harris1-1/+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-13Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=54044
2013-12-10Fix prototypes.Gerald Combs1-2/+2
svn path=/trunk/; revision=53917
2013-12-10Fix compilation on Windows.Gerald Combs1-1/+4
svn path=/trunk/; revision=53912
2013-12-10Get the "Decode As" dialog working, albeit with a few warts. It differsGerald Combs1-0/+294
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