path: root/epan/dissectors/packet-sua.c
AgeCommit message (Collapse)AuthorFilesLines
2021-10-07to_str: scope tvb_ip6_to_strEvan Huus1-1/+1
2021-10-07to_str: scope tvb_ip_to_strEvan Huus1-1/+1
2021-09-01tvbuff: convert helper methods to pinfo->poolEvan Huus1-2/+2
A few of them just needed scratch memory, so allocate and free it manually after doing any exception-raising checks. A few others were returning memory, and needed conversion to accept a wmem scope argument.
2021-06-16dissectors: Replace g_log() with ws_log()João Valverde1-2/+2
2021-04-30Cast away the return value of g_strlcpy() and g_strlcat().Guy Harris1-2/+2
Most of the time, the return value tells us nothing useful, as we've already decided that we're perfectly willing to live with string truncation. Hopefully this keeps Coverity from whining that those routines could return an error code (NARRATOR: They don't) and thus that we're ignoring the possibility of failure (as indicated, we've already decided that we can live with string truncation, so truncation is *NOT* a failure).
2020-09-07Yet more spelling fixes.Martin Mathieson1-4/+4
Includes small updates to the script and wireshark dictionary. Probably the last spelling fixes from me for a while.
2020-08-31More spelling fixes, last part of 2nd pass of dissectors.Martin Mathieson1-1/+1
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-3/+3
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-12Fix up some broken links to specs from dissectors.Martin Mathieson1-2/+2
check_dissector_urls.py was written and used to find URLs within epan/dissectors/*.c and try to fetch them using 'requests'. Will be commmitted separately. Most of the changes were to adapt to reorganisation of IETF or 3gpp2 links, but many of the broken links are for websites or companies that no longer exist. Change-Id: Ie9afdb95099218402a61626a0cd5193c6f781b96 Reviewed-on: https://code.wireshark.org/review/36769 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-1/+1
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-3/+3
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-31Dissectors don't need a journey of self discovery.Michael Mann1-4/+2
They already know who they are when they register themselves. Saving the handle then to avoid finding it later. Not sure if this will increase unnecessary register_dissector functions (instead of using create_dissector_handle in proto_reg_handoff function) when other dissectors copy/paste, but it should make startup time a few microseconds better. Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43 Reviewed-on: https://code.wireshark.org/review/19481 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>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-13Convert AT_SS7PC to a "dissector address type"Michael Mann1-4/+8
The formatting of the address type is determined by a preference in packet-mtp3.c, so just make MTP3 register the address type. Use address_type_get_by_name in other dissectors (and export_pdu) to use the address type. Change-Id: Ifb32d7de27aeaa23cee8e803e25ffb3c905547b5 Reviewed-on: https://code.wireshark.org/review/15856 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>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-3/+1
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-2/+2
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-02[SUA] Change the dissector table sua.prop.tags to use ↵AndersBroman1-1/+1
DISSECTOR_TABLE_ALLOW_DUPLICATE Change-Id: Iaabd69e5779534c1cf73b2c1ab1b957bb30c44d3 Reviewed-on: https://code.wireshark.org/review/12373 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-14register_dissector -> new_register_dissectorMichael Mann1-13/+7
Picking off "easy" dissectors that only have one or two exit points at most. This concludes a "first pass" over the dissector directory. Change-Id: If5ce5484214be50fe541cba478da1de62e354297 Reviewed-on: https://code.wireshark.org/review/11830 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-1/+1
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't include "file.h" if you don't need it.Guy Harris1-0/+2
It ends up dragging in libwireshark headers, which programs not linking with libwireshark shouldn't do. In particular, including <epan/address.h> causes some functions that refer to libwireshark functions to be defined if the compiler doesn't handle "static inline" the way GCC does, and you end up requiring libwireshark even though you shouldn't require it. Move plurality() to wsutil/str_util.h, so that non-libwireshark code can get it without include epan/packet.h. Fix includes as necessary. Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3 Reviewed-on: https://code.wireshark.org/review/11545 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-4/+4
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> 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-07-22Use pinfo pool and not packet pool for AT_STRINGZ addressesPascal Quantin1-2/+2
Change-Id: I474e6554b352147702eac32d5574f8ab4a1ab84d Reviewed-on: https://code.wireshark.org/review/9745 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: Anders Broman <a.broman58@gmail.com>
2015-06-22Remove a bunch of deprecated tvb_length callsEvan Huus1-3/+3
Change-Id: I9362e0fdc4519ba5f3d656152966e7030f478839 Reviewed-on: https://code.wireshark.org/review/9022 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-08Eliminate proto_tree_add_text from some dissectors.Michael Mann1-27/+31
Change-Id: Ief4c377d56748e1a8ed0ef7fe5ba03b9be00cd8d Reviewed-on: https://code.wireshark.org/review/6267 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21Have a heur_dissector_list_t be an opaque handle.Guy Harris1-1/+1
This allows dissector lists to be looked up by name, so they can be shared by multiple dissectors. (This means that there's no "udplite" heuristic dissector list, but there shouldn't be one - protocols can run atop UDP or UDPLite equally well, and they share a port namespace and uint dissector table, so they should share a heuristic dissector table as well.) Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7 Reviewed-on: https://code.wireshark.org/review/5936 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-26Remove sccp_info member from packet_info structure.Michael Mann1-15/+12
sccp_msg_info_t* is now passed from SCCP dissector to its subdissectors through dissector data parameter. Change-Id: Iab4aae58f8995e844f72e02e9f2de36e83589fc0 Reviewed-on: https://code.wireshark.org/review/5442 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-22Cleanup packet-sccp.c in preparation of trying to remove sccp_info member of ↵Michael Mann1-6/+12
packet_info. Convert a handful of global variables into function parameters that get passed through the dissector, so we shouldn't be dependent on pinfo->sccp_info anymore. Removal of pinfo->sccp_info will be done in a separate patch (when the dissectors that use it can be updated). packet-sua.c may need similar treatment. Change-Id: If0001638d666afc07e04b02aa32ef31d6223a5de Reviewed-on: https://code.wireshark.org/review/5343 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>
2014-09-29Add editor modelines and adjust indentation as needed.Bill Meier1-0/+13
Change-Id: Id57d264299f2026d703c5b08bace4b24b32f184c Reviewed-on: https://code.wireshark.org/review/4371 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-17Escape some characters like \n when appending textMichael Tüxen1-2/+2
This patch escapes some characters like \n when showing text contained in a packet by appending it to a protocol item. Change-Id: Ice0040040ec7ab573dd9a412f8c0c197a566a031 Reviewed-on: https://code.wireshark.org/review/3095 Petri-Dish: Michael Tüxen <tuexen@wireshark.org> Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-07-09convert to proto_tree_add_subtree[_format]Michael Mann1-49/+30
Change-Id: I8d66b1bc7dbdfee3d4bf6fd3b3c21c6323b66f44 Reviewed-on: https://code.wireshark.org/review/2946 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-6/+6
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-6/+6
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-1/+1
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-4/+4
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-1/+3
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-06Convert ep_address_to_str -> address_to_str(wmem_packet_scope, ...) for all ↵Michael Mann1-2/+2
dissectors Change-Id: I7489e2fb3a1f2630ca17b0a5fe1aa873992f1061 Reviewed-on: https://code.wireshark.org/review/975 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-04Change tvb_get_string() -> tvb_get_string_enc and ENC_ASCII -> ENC_UTF_8AndersBroman1-2/+2
Change-Id: I07ecca5612ae9fa2b053a62c69014612c5125d5e Reviewed-on: https://code.wireshark.org/review/962 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-21fix some warnings.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=54334
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-12Try to fix "initializer element is not computable at load time"Anders Broman1-25/+55
svn path=/trunk/; revision=53962
2013-12-10- Forward declaration of register functions.Anders Broman1-0/+3
svn path=/trunk/; revision=53918
2013-11-23Remove old (2009) and no-longer-necessary compatibility macro.Evan Huus1-2/+2
svn path=/trunk/; revision=53527
2013-09-22emem -> wmem conversion:Pascal Quantin1-2/+2
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-16Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-3/+3
hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either: 1. Case sensitivity differences between hf_ field name and formatted string. 2. Unnecessary whitespace between hf_ field name and colon in formatted string There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed. svn path=/trunk/; revision=52098