dissector/mqtt: Add the protocol version string

Add the protocol version string:
- 3 maps to MQTT v3.1
- 4 maps to MQTT v3.1.1

Change-Id: I8cf1ba0c1bcabd5718467946b33082e4eb5a37ed
Signed-off-by: Flavio Santes <flavio.santes@1byt3.com>
Reviewed-on: https://code.wireshark.org/review/23938
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Flavio Santes 2017-10-16 01:11:48 -04:00 committed by Stig Bjørlykke
parent 5967621d19
commit 1a8143172c
1 changed files with 12 additions and 2 deletions

View File

@ -47,6 +47,10 @@
#define MQTT_DEFAULT_PORT 1883 /* IANA registered under service name as mqtt */
#define MQTT_SSL_DEFAULT_PORT 8883 /* IANA registered under service name secure-mqtt */
/* MQTT Protocol Versions */
#define MQTT_PROTO_V31 3
#define MQTT_PROTO_V311 4
#define MQTT_HDR_SIZE_BEFORE_LEN 1
/* MQTT MEssage Types */
@ -76,6 +80,12 @@
void proto_register_mqtt(void);
void proto_reg_handoff_mqtt(void);
static const value_string mqtt_protocol_version_vals[] = {
{ MQTT_PROTO_V31, "MQTT v3.1" },
{ MQTT_PROTO_V311, "MQTT v3.1.1" },
{ 0, NULL }
};
static const value_string mqtt_msgtype_vals[] = {
{ MQTT_RESERVED, "Reserved" },
{ MQTT_CONNECT, "Connect Command" },
@ -602,8 +612,8 @@ void proto_register_mqtt(void)
NULL, HFILL }},
{ &hf_mqtt_proto_ver,
{ "Version", "mqtt.ver",
FT_UINT8, BASE_DEC, NULL, 0,
NULL, HFILL }},
FT_UINT8, BASE_DEC, VALS(mqtt_protocol_version_vals), 0,
"MQTT version", HFILL }},
/* Connect Flags */
{ &hf_mqtt_conflags,
{ "Connect Flags", "mqtt.conflags",