aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-lwm.c
AgeCommit message (Collapse)AuthorFilesLines
2020-12-03packet-lwm:Move gcry_cipher_open() and gcry_cipher_close() out of loopMoshe Kaplan1-4/+4
Instead of calling gcry_cipher_open() and gcry_cipher_close() in a loop, call gcry_cipher_reset to avoid creating and releasing contexts. Besides the performance improvement, this should also fix Coverity 1450453, which detects the multiple calls to gcry_cipher_close() as a double-free.
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-07-20ZigBee: Add touchlink commissioning dissectors.Owen Kirby1-0/+11
Change-Id: I745fa77626dd242d9a6f1bd79c6ae52d507f844a Reviewed-on: https://code.wireshark.org/review/22380 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-13Make Libgcrypt a mandatory dependencyPeter Wu1-10/+0
Removed all guards for HAVE_LIBGCRYPT, change autotools and CMake to error out if it is not available. Update release notes, developer documentation and README with the new status. Clarify relation with GnuTLS in macosx-setup.sh. Install Libgcrypt via brew script. Motivation for this change is that many dissectors depend on Libgcrypt and having it optional increases the maintenance burden (there have been several compile issues in the past due to the optional status). Furthermore, wsutil has crypto code that can be replaced by Libgcrypt. Change-Id: Idf0021b8c4cd5db70b8766f7dcc2a8b3acbf042f Link: https://www.wireshark.org/lists/wireshark-dev/201702/msg00011.html Reviewed-on: https://code.wireshark.org/review/20030 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-31Dissectors don't need a journey of self discovery.Michael Mann1-2/+4
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-04-22Do not mix wmem and glib allocatorsPascal Quantin1-2/+1
Change-Id: I0e845668a1b9dbec93ea920a8585ecfe60f001d1 Reviewed-on: https://code.wireshark.org/review/15044 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: Anders Broman <a.broman58@gmail.com>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-13/+8
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-02-14LWM: Fix "Assigned value is garbage or undefined"João Valverde1-0/+1
From scan-build: packet-lwm.c:466:33: warning: Assigned value is garbage or undefined Change-Id: Ib9e1cfd3f9462d0bbb5a87ae4d323c333878323d Reviewed-on: https://code.wireshark.org/review/13937 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> Reviewed-by: João Valverde <j@v6e.pt>
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-11-02wsgcrypt.h checks internally if we HAVE_LIBGCRYPTMartin Kaiser1-3/+0
we can #include <wsutils/wsgcrypt.h> without doing the check ourselves Change-Id: I248431bdb6cfa1bd85b794ec04ce1e4fcd3a7d2d Reviewed-on: https://code.wireshark.org/review/11483 Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2015-08-21LWM: fix compilation without libgcryptLuke Mewburn1-15/+29
Add HAVE_LIBGCRYPT compilation guards. Move gcrypt-related variables into the scope they're used. Change-Id: I81a2c8a54514fb51de53640fa8eceeddb2bf24d9 Reviewed-on: https://code.wireshark.org/review/10118 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: Anders Broman <a.broman58@gmail.com>
2015-08-17Add Decryption support for LwmeshSelvamegala1-12/+133
Bug: 10783 Change-Id: Id598838f036b1f312791d9dddbf3767dcbfd1aee Reviewed-on: https://code.wireshark.org/review/9937 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-07-17Remove all preferences related to enabling/disabling heuristic dissectors.Michael Mann1-1/+1
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector. Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled. Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22 Reviewed-on: https://code.wireshark.org/review/9610 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12Add "user presentable" and "unique string ids" to heuristic table entries.Michael Mann1-1/+1
This allows better presentation of heuristic dissectors to the end user. Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6 Reviewed-on: https://code.wireshark.org/review/9602 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
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-06-29proto_tree_add_subtree[_format]Michael Mann1-4/+2
Change-Id: Id00f456479415adf0a219af6c9a2108d4b3642d0 Reviewed-on: https://code.wireshark.org/review/2702 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-1/+1
Hopefully that name makes it clear what the routiner's purpose is, and will encourage people to use it rather than using dissector_add_uint() with a bogus integer value. Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8 Reviewed-on: https://code.wireshark.org/review/2483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-22Tighten heuristic checks for IEEE 802.15.4 protocols, and add Decode-As by ↵Owen Kirby1-19/+16
PANID for when we still get it wrong. Change-Id: Icc2b274d2478a9426da881998bbbbfb3bf34ec4a Reviewed-on: https://code.wireshark.org/review/1167 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-22Fix gcc "warning: no previous prototype ... [-Wmissing-prototypes]Bill Meier1-0/+1
Change-Id: Icdbc626dca876244b603c58cba05d0847d5d6a6f Reviewed-on: https://code.wireshark.org/review/1276 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-07(Benign) Don't use "address-of" operator on arg of VALS() (not that it makes ↵Bill Meier1-1/+1
any actual difference).. Change-Id: I0766d0f130648aaa5a58d9f4062fa24e898cbdc3 Reviewed-on: https://code.wireshark.org/review/545 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.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>
2014-01-31Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+0
Change-Id: Id7bab3a69514f159eda8d1285ca7f8f2d42e34ad Reviewed-on: https://code.wireshark.org/review/61 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-01-24Mark a few function parameters as unused....Bill Meier1-3/+3
svn path=/trunk/; revision=54950
2014-01-24Rework and simplify the code to follow the principle of "dissect asBill Meier1-381/+258
much as possible" rather than dissecting nothing if the length of a set of fields (e.g., a "command") seems wrong or if an exception occurs fetching data before previous fields have been displayed. In general: just fetch/dissect from start to end: If there is missing data, a Wireshark exception will eventually occur; Add lwm subtrees under the lwm protocol tree (*not* as protocols under the top (outermost) tree. Fix a bug which caused an exception to be reported as: "[Packet size limited during capture: LwMesh truncated]" rather than as the correct: "[Malformed...]" col_...() and expert...() functions shouldn't be called under 'if(tree)'; Register the heuristic dissector using "IEEE802154_PROTOABBREV_WPAN" (like certain other dissectors) rather than using "wpan"; missmatch --> mismatch Fix some long lines. svn path=/trunk/; revision=54949
2014-01-23Please GCC 4.3.2 that complains about a wrong 'variable may be used ↵Pascal Quantin1-2/+2
uninitialized in this function' error svn path=/trunk/; revision=54927
2014-01-21- Remove unneeded #includes;Bill Meier1-69/+53
- "Once-only" test not needed in proto_reg_handoff..(); - Set COL_PROTOCOL, clear COL_INFO at the begining of the dissector before fetching data from the tvb; - Use tvb_reported_length; - Use col_set_str/col_append_str where appropriate; - Zigbee --> lwm; - Fix typo; - Reformat some whitespace for consistency. ToDo: - Review use of col_...() and expert...() under 'if (tree)'; - Review use of col_clear(..., COL_INFO) after text already added to COL_INFO; - Review certain tvb fetches to ensure no fetches using a negative offset; svn path=/trunk/; revision=54871
2014-01-21Add properties ....Bill Meier1-1/+1
svn path=/trunk/; revision=54869
2014-01-20From Lubos via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9638Alexis La Goutte1-0/+977
New Dissector For Lightweight Mesh protocol A dissector for ATMEL Lightweight Mesh protocol (lwm). The protocol is carried on the top of 802.15.4 frame. From me: * Add Modelines info * Fix indent (use 4 spaces) * Remove trailing whitespace svn path=/trunk/; revision=54856