From 3f189bed2f343893a4b9df626875a930e03c91e1 Mon Sep 17 00:00:00 2001 From: Flavio Santes Date: Mon, 6 Nov 2017 14:54:02 -0500 Subject: [PATCH] dissector/mqtt: Dissect the Subscription Identifier Property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia60b9c344fd572193374f57299b1829f17dfa24e Signed-off-by: Flavio Santes Reviewed-on: https://code.wireshark.org/review/24267 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- epan/dissectors/packet-mqtt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epan/dissectors/packet-mqtt.c b/epan/dissectors/packet-mqtt.c index 71820dc0ed..b73ab89d38 100644 --- a/epan/dissectors/packet-mqtt.c +++ b/epan/dissectors/packet-mqtt.c @@ -203,6 +203,7 @@ static const value_string match_criteria[] = { #define PROP_PAYLOAD_FORMAT_INDICATOR 0x01 #define PROP_PUBLICATION_EXPIRY_INTERVAL 0x02 +#define PROP_SUBSCRIPTION_IDENTIFIER 0x0B #define PROP_SESSION_EXPIRY_INTERVAL 0x11 #define PROP_SERVER_KEEP_ALIVE 0x13 #define PROP_REQUEST_PROBLEM_INFORMATION 0x17 @@ -221,6 +222,7 @@ static const value_string match_criteria[] = { static const value_string mqtt_property_vals[] = { { PROP_PAYLOAD_FORMAT_INDICATOR, "Payload Format Indicator" }, { PROP_PUBLICATION_EXPIRY_INTERVAL, "Publication Expiry Interval" }, + { PROP_SUBSCRIPTION_IDENTIFIER, "Subscription Identifier" }, { PROP_SESSION_EXPIRY_INTERVAL, "Session Expiry Interval" }, { PROP_SERVER_KEEP_ALIVE, "Server Keep Alive" }, { PROP_REQUEST_PROBLEM_INFORMATION, "Request Problem Information" }, @@ -489,6 +491,13 @@ static guint32 dissect_mqtt_properties(tvbuff_t *tvb, proto_tree *mqtt_tree, gui proto_tree_add_item(mqtt_prop_tree, hf_mqtt_prop_num, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; + case PROP_SUBSCRIPTION_IDENTIFIER: + { + guint8 vbi_offset = dissect_uleb128(tvb, offset, &vbi); + proto_tree_add_uint64(mqtt_prop_tree, hf_mqtt_prop_num, tvb, offset, vbi_offset, vbi); + offset += vbi_offset; + break; + } default: proto_tree_add_item(mqtt_prop_tree, hf_mqtt_prop_unknown, tvb, offset, bytes_to_read - offset, ENC_UTF_8|ENC_NA); offset += (bytes_to_read - offset);