diff options
author | Flavio Santes <flavio.santes@1byt3.com> | 2017-11-06 22:01:22 -0500 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2017-11-08 17:26:47 +0000 |
commit | 87431fef2836c8d77ea694844cd5dff0e8b801f8 (patch) | |
tree | d626e8cd8ffa63501ea289d76b6434c241e80450 /epan/dissectors/packet-mqtt.c | |
parent | af285603ee82ae9644340c2f2871b293a8480c39 (diff) |
dissector/mqtt: Add 'Subscription Options/Retain Handling' text descriptions
Change-Id: I6dea2e9c190095105dc1441197ad00c9b3a66f89
Signed-off-by: Flavio Santes <flavio.santes@1byt3.com>
Reviewed-on: https://code.wireshark.org/review/24272
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/dissectors/packet-mqtt.c')
-rw-r--r-- | epan/dissectors/packet-mqtt.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/epan/dissectors/packet-mqtt.c b/epan/dissectors/packet-mqtt.c index 345d84b75d..802344ca38 100644 --- a/epan/dissectors/packet-mqtt.c +++ b/epan/dissectors/packet-mqtt.c @@ -267,6 +267,20 @@ static const value_string mqtt_property_vals[] = { { 0, NULL } }; +/* MQTT v5.0 Subscription Options, Retain Handling option */ +#define SUBSCRIPTION_RETAIN_SEND 0x00 +#define SUBSCRIPTION_RETAIN_SEND_DONT_EXIST 0x01 +#define SUBSCRIPTION_RETAIN_DONT_SEND 0x02 +#define SUBSCRIPTION_RETAIN_RESERVED 0x03 + +static const value_string mqtt_subscription_retain_handling[] = { + { SUBSCRIPTION_RETAIN_SEND, "Send msgs at subscription time" }, + { SUBSCRIPTION_RETAIN_SEND_DONT_EXIST, "Send msgs if subscription does not exist" }, + { SUBSCRIPTION_RETAIN_DONT_SEND, "Do not send msgs at subscription time" }, + { SUBSCRIPTION_RETAIN_RESERVED, "Reserved" }, + { 0, NULL } +}; + static mqtt_message_decode_t *mqtt_message_decodes = NULL; static guint num_mqtt_message_decodes = 0; @@ -1179,10 +1193,9 @@ void proto_register_mqtt(void) { "Retain As Published", "mqtt.subscription_options_rap", FT_BOOLEAN, 8, TFS(&tfs_set_notset), MQTT_MASK_SUBS_RAP, NULL, HFILL }}, - /* xxx */ { &hf_mqtt_subscription_retain, { "Retain Handling", "mqtt.subscription_options_retain", - FT_UINT8, BASE_HEX, NULL, MQTT_MASK_SUBS_RETAIN, + FT_UINT8, BASE_DEC, VALS(mqtt_subscription_retain_handling), MQTT_MASK_SUBS_RETAIN, NULL, HFILL }}, { &hf_mqtt_subscription_reserved, { "Reserved", "mqtt.subscription_options_reserved", |