forked from osmocom/wireshark
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>
This commit is contained in:
parent
b4093428ad
commit
203d875d3b
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue