aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2018-09-14 20:42:00 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2018-09-15 18:22:16 +0000
commit203d875d3bf40280a3aefd31a549f8f937b5a50d (patch)
tree4d587b1be667ba9aa2fddf7e74648d57c389b43a
parentb4093428ad5152bfa8d1d0c46e95a8ade35dfaf5 (diff)
lwm2mtlv: Show resource name in a generated item
Change-Id: I9892755f8a97e535ba893ec7987df3a0bf39870a Reviewed-on: https://code.wireshark.org/review/29663 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r--epan/dissectors/packet-lwm2mtlv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/dissectors/packet-lwm2mtlv.c b/epan/dissectors/packet-lwm2mtlv.c
index a363314..325155f 100644
--- a/epan/dissectors/packet-lwm2mtlv.c
+++ b/epan/dissectors/packet-lwm2mtlv.c
@@ -32,6 +32,7 @@ static void parseArrayOfElements(tvbuff_t *tvb, proto_tree *tlv_tree, const char
static int proto_lwm2mtlv = -1;
static int hf_lwm2mtlv_object_name = -1;
+static int hf_lwm2mtlv_resource_name = -1;
static int hf_lwm2mtlv_header = -1;
static int hf_lwm2mtlv_type_type = -1;
static int hf_lwm2mtlv_type_length_of_identifier = -1;
@@ -716,6 +717,11 @@ addValueTree(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const
{
guint valueOffset = 1 + element->length_of_identifier + element->length_of_length;
+ if (resource && (element->type == RESOURCE || element->type == RESOURCE_ARRAY)) {
+ proto_item *ti = proto_tree_add_string(tlv_tree, hf_lwm2mtlv_resource_name, tvb, 0, 0, resource->name);
+ PROTO_ITEM_SET_GENERATED(ti);
+ }
+
if ( element->type == RESOURCE || element->type == RESOURCE_INSTANCE ) {
proto_tree_add_item(tlv_tree, hf_lwm2mtlv_value, tvb, valueOffset, element->length_of_value, ENC_NA);
addValueInterpretations(tvb, tlv_tree, element, resource);
@@ -912,6 +918,11 @@ void proto_register_lwm2mtlv(void)
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
+ { &hf_lwm2mtlv_resource_name,
+ { "Resource Name", "lwm2mtlv.resource_name",
+ FT_STRING, BASE_NONE, NULL, 0,
+ NULL, HFILL }
+ },
{ &hf_lwm2mtlv_header,
{ "TLV header", "lwm2mtlv.header",
FT_NONE, BASE_NONE, NULL, 0x0,