aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-thread.c
AgeCommit message (Collapse)AuthorFilesLines
2022-09-13coap, thread: special-case application/octet-stream for CoAP for TMF.Guy Harris1-0/+1
Have a "CoAP for TMF" dissector that the user can use Decode As to assign to a UDP port. Have a "coap_tmf_media_type" dissector table in which the TMF code can register itself for the media type "application/octet-stream". Have the "CoAP for TMF" dissector pass a "this is for TMF" flag to the common dissection code. In the common dissection code, if that flag is set, first try the media type with the "coap_tmf_media_type" dissector table before trying it in the regular "media_type" table. This allows a user to specify UDP ports that 1) should be decoded as CoAP and 2) should have an application/octet-stream payload dissected as a TMF message, which should address concerns raised for Thread in issue
2022-08-09prefs: More cleanup, auto prefsJohn Thacker1-1/+1
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-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-1/+1
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2021-07-26Move epan/wmem/wmem_scopes.h to epan/João Valverde1-1/+1
This header was installed incorrectly to epan/wmem_scopes.h. Instead of creating additional installation rules for a single header in a subfolder (kept for backward compatibility) just rename the standard "epan/wmem/wmem.h" include to "epan/wmem_scopes.h" and fix the documentation. Now the header is installed *correctly* to epan/wmem_scopes.h.
2021-07-21First pass pinfo->pool conversionEvan Huus1-3/+3
Automated find/replace of wmem_packet_scope() with pinfo->pool in all files where it didn't cause a build failure. I also tweaked a few of the docs which got caught up.
2020-10-12thread: Add check for valid CoAP infoStig Bjørlykke1-0/+4
Add a check for valid CoAP info in dissect_thread_coap() before use. It may happen that this is NULL because setting a decode_as rule for application/octet-stream will also catch other packets.
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-1/+1
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-05-01No explicit glib.h include requiredJaap Keuter1-1/+0
Stop including glib.h in dissectors, this will come in implicitly with packet.h including proto.h, an essential include file for dissectors. While at it, config.h is no longer conditional and stdio.h is usually not needed either. Some other cleanups too. Change-Id: I60c12f16d7ef1e6398509293031ffed7460d2c61 Reviewed-on: https://code.wireshark.org/review/36969 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-08-12Thread: Fix URI token passing to CoAP dissectorRobert Cragie1-3/+5
Incorrect token index being passed to Thread CoAP dissector. Change-Id: Ic64060134c655a5e7cfdee0cd0b78b98b60f090e Reviewed-on: https://code.wireshark.org/review/34154 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
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-05-31Thread dissecting for Coap payload: fix to token indexJuhani Puurula1-1/+1
Would previously search for subdissector by second part of URI. Subdissectors in hash table are indexed by first part and search would return NULL. Change-Id: I0af1c4800dd69eae78d51d752c3ac299d248ddf4 Reviewed-on: https://code.wireshark.org/review/27908 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-25media_type: Default decode application/octet-stream as dataStig Bjørlykke1-12/+4
Remove registering media_type application/octet-stream from both thread and uasip because the settings will interfere each other. Enable decoding as for media_type instead. Bug: 14729 Change-Id: I58c527977fe4713418219fc3126ce7a93c4bb641 Reviewed-on: https://code.wireshark.org/review/27789 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-30IEEE 802.15.4: fix decryption results based on uninitialized dataRobert Sauter1-7/+7
Refactor ieee802154_set_mac_key to return the number of keys set and only try to decrypt with the alt_key if actually provided Bug: 14522 Change-Id: I40802dff8c08f7f82b792fb16f5f91aa3b9e20cc Reviewed-on: https://code.wireshark.org/review/26677 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-20packet-thread: fix cast-align warningRobert Sauter1-5/+2
Change-Id: I38381800c8cb227146e9a18285d2b73aec7a97d5 Reviewed-on: https://code.wireshark.org/review/25898 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-17Don't gratuitously cast away constness.Guy Harris1-2/+2
Change-Id: I5c80e50c524db6ee80e1529af447db9a26e02f48 Reviewed-on: https://code.wireshark.org/review/25849 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-17Thread: use wider variables to prevent overflow and infinite loopsPascal Quantin1-4/+4
Bug: 14428 Change-Id: I5536bdca23b24e41c13c0837d1f50d9db26f864a Reviewed-on: https://code.wireshark.org/review/25832 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
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>
2017-11-20Remove unused dissector registration prototypes, fix typoJoão Valverde1-1/+0
Change-Id: Ide5d7f2241db4ac87ed516f91f0bcaca347bb546 Reviewed-on: https://code.wireshark.org/review/24496 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-2/+2
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-10-21Eliminate #include <epan/oui.h> from dissectors that don't need it.Michael Mann1-1/+0
Correct include patch for packet-lldp.c Change-Id: I5e2a267943ccd39616ef323848104fdba23c8f38 Reviewed-on: https://code.wireshark.org/review/24009 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-21Remove oui_vals value_string and epan/oui.cMichael Mann1-1/+1
oui.c is a very small subset of what comes from http://standards.ieee.org/regauth/oui/oui.txt, so use the "full" OUI list (and more) out of the manuf file and convert hf_ fields to just use BASE_OUI. Change-Id: Ic0c2ff618d8a6212f498e3b7475e0a7856c22b5b Reviewed-on: https://code.wireshark.org/review/24007 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-10Thread: replace g_strsplit by wmem_strsplitPascal Quantin1-2/+1
It avoids leaking memory in case an exception is thrown during dissection Change-Id: Ib25c6a82b90ca541db121a79515a087d8d2c332f Reviewed-on: https://code.wireshark.org/review/23468 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>
2017-06-01thread: Fix division by zeroBjörn Ruytenberg1-1/+1
Perform sanity check on channel count. Channel count must be greater than zero to build energy measurements list from Energy List TLV [1]. Zero channel count results in a division by zero in dissect_thread_mc. Do not process Energy List TLV if zero. [1]: OpenThread implementation - https://github.com/openthread/openthread/blob/b89a9dfbc117a9c80e795700b67/include/openthread/commissioner.h#L158 Energy List TLV contains energy measurements. If no channels are present, no energy measurements can exist. Bug: 13747 Change-Id: I53a19dfbeae9ef0421c8c144ef3be4da28413ad3 Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1979 Reviewed-on: https://code.wireshark.org/review/21878 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-05-12Thread CoAP: fix 2 potential infinite loopsPascal Quantin1-2/+2
Bug: 13693 Change-Id: Ie47ca69a9941dbc273bb8f18e300773092a2fc96 Reviewed-on: https://code.wireshark.org/review/21620 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-12packet-thread.c: rename remainder -> remainingMichael Mann1-6/+6
Pacify macOS buildbot Change-Id: I60bdb0ca7b9a1456d6fe12879dec61c5dff19e53 Reviewed-on: https://code.wireshark.org/review/21039 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-04-10MLE and Thread: Additional dissectorsRobert Cragie1-0/+3470
Additional dissectors for Mesh Link Establishment (MLE) and Thread CoAP TMF messages. MLE is also used in ZigBee IP. Change-Id: I5b9c224d7df48855b79ccac67dca7661a51d0a9b Bug: 13495 Reviewed-on: https://code.wireshark.org/review/20594 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>