aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mqtt.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+1
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-09-11mqtt: Only suback has failure in QoS valuesStig Bjørlykke1-1/+1
Change-Id: Ib308090dfc0911a9bb7580e601cab0bfbfe58efe Reviewed-on: https://code.wireshark.org/review/17644 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-11mqtt: Fix subscribe/suback QoS valuesStig Bjørlykke1-8/+6
Change-Id: I15424b768e6e0fe2e8268db69b82d81351146155 Reviewed-on: https://code.wireshark.org/review/17643 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-11mqtt: Added elements from version 3.1.1Stig Bjørlykke1-79/+144
Added version 3.1.1 CONNACK session present flag and SUBACK failure indication. Adjusted SUBSCRIBE and SUBACK QoS values. Added string length values. Removed the message type subtree as it had no purpose. Put the message type in the top tree mqtt node instead. Removed unused code and fixed code layout. Change-Id: I8a9ae26ac9a2af04dc6f8d08ac46aa305c225c4f Reviewed-on: https://code.wireshark.org/review/17590 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>
2016-03-25Add MQTT over SSL port.Jakub Zawadzki1-1/+5
Change-Id: If44d33e739bc02425aea437e34ea8531b4223691 Reviewed-on: https://code.wireshark.org/review/14617 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-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-03-20MQTT: Prevent subsequent messages from overwriting the Info columnAlexander Stein1-1/+3
Without a fence col_add_fstr will overwrite the whole column on each message. Instead of adding a fence and adding the message info use col_append_sep_str which also supports a separator out of the box. e.g. "Connect Command, Publish Message, Disconnect Req" Change-Id: I346d9b659a044143cd31f08081ad145b9186307c Signed-off-by: Alexander Stein <alexanders83@web.de> Reviewed-on: https://code.wireshark.org/review/7771 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-03-20MQTT: Dissect on default port automaticallyAlexander Stein1-1/+1
There is a IANA reserved port number for MQTT: 1883 Change-Id: I9bc3c83b9d7eda291728fe7311f4b7a817d3a833 Signed-off-by: Alexander Stein <alexanders83@web.de> Reviewed-on: https://code.wireshark.org/review/7770 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-20MQTT: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-15/+15
Change-Id: I730b752680c85777a074a6b2bb4aef0c9f4d3ff5 Reviewed-on: https://code.wireshark.org/review/7265 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-1/+2
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus() to make TCP-based dissection easier. Bug: 9851 Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3 Reviewed-on: https://code.wireshark.org/review/6778 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-1/+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-08-25Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
Change-Id: I4a2ba6902acc0cbd224a8926eeb7bd0b62b4d29e Reviewed-on: https://code.wireshark.org/review/3825 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04convert to proto_tree_add_subtree[_format]Michael Mann1-2/+1
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc Reviewed-on: https://code.wireshark.org/review/2852 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-23Improve handling of short MQTT PDUs.Bill Meier1-1/+17
This is a "good-enough" fix for now until a more comprehensive fix is committed to handle the case of the (variable size) PDU length field being split across TCPO segments. Change-Id: I57e8f5e9d7a9855fac320e8843b82a273ffb7cc5 Reviewed-on: https://code.wireshark.org/review/1748 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-23Fix format warning.Evan Huus1-1/+1
Change-Id: I6627af8d90299d599db779bde0061191fc514fb3 Reviewed-on: https://code.wireshark.org/review/1307 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23packet-mqtt.c: Minor cleanupBill Meier1-73/+71
- Create/use an extended value string; - Use ...add_text() instead of ..._add_string() for a packet details "header" line (Removes a filter named "mqtt" (not the 'protocol' filter)); - Fix what is (IMO) a slightly misleading display of "Connect Flags"; - Remove two lines of duplicate code; - Localize some variables; - Remove some unneeded initializers; - Set tab-stops, etc in editor mode-lines to 8; - 'offset++' ==> 'offset += 1'; - Do some minor whitespace changes. Change-Id: Ia891c6893643790dbb26510f060c4fb6dfe1fe3a Reviewed-on: https://code.wireshark.org/review/1304 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-14Fix no previous prototype warnings.AndersBroman1-0/+3
Change-Id: I859597ebc957a58f659800ef63318f94e80feabf Reviewed-on: https://code.wireshark.org/review/1104 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-09Added support for MQTT protocol. Bug 9930Michael Mann1-0/+587
Change-Id: I04fc3a6225c56af9905f4f9bbbca5bc10f214843 Reviewed-on: https://code.wireshark.org/review/873 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>