diff options
author | Michael Mann <mmann78@netscape.net> | 2014-07-06 19:32:03 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-07-07 00:03:35 +0000 |
commit | 4d58904a09c972cff7a114f33db2532d958997cb (patch) | |
tree | 575156761f6f48bf7825513ea87d39cb569267ed /epan/dissectors/packet-udld.c | |
parent | 79fcc6a1a36e0637ce21f65a7e27bc6d90213509 (diff) |
convert to proto_tree_add_subtree[_format]
Change-Id: Ie10ac4f5f04a23344d183e095bbafb23c6409144
Reviewed-on: https://code.wireshark.org/review/2904
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-udld.c')
-rw-r--r-- | epan/dissectors/packet-udld.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/epan/dissectors/packet-udld.c b/epan/dissectors/packet-udld.c index b1e9786c59..7107f57bcb 100644 --- a/epan/dissectors/packet-udld.c +++ b/epan/dissectors/packet-udld.c @@ -111,10 +111,10 @@ dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_clear(pinfo->cinfo, COL_INFO); if (tree) { - proto_item *flags_ti; + proto_item *flags_ti; proto_tree *flags_tree; - ti = proto_tree_add_item(tree, proto_udld, tvb, offset, -1, ENC_NA); + ti = proto_tree_add_item(tree, proto_udld, tvb, offset, -1, ENC_NA); udld_tree = proto_item_add_subtree(ti, ett_udld); /* UDLD header */ @@ -161,10 +161,9 @@ dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) length - 4)); if (tree) { - tlvi = proto_tree_add_text(udld_tree, tvb, offset, - length, "Device ID: %s", + tlv_tree = proto_tree_add_subtree_format(udld_tree, tvb, offset, + length, ett_udld_tlv, NULL, "Device ID: %s", tvb_format_stringzpad(tvb, offset + 4, length - 4)); - tlv_tree = proto_item_add_subtree(tlvi, ett_udld_tlv); proto_tree_add_uint(tlv_tree, hf_udld_tlvtype, tvb, offset + TLV_TYPE, 2, type); proto_tree_add_uint(tlv_tree, hf_udld_tlvlength, tvb, @@ -193,10 +192,9 @@ dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvb_format_stringzpad(tvb, offset + 4, length - 4)); if (tree) { - tlvi = proto_tree_add_text(udld_tree, tvb, offset, - real_length, "Port ID: %s", + tlv_tree = proto_tree_add_subtree_format(udld_tree, tvb, offset, + real_length, ett_udld_tlv, NULL, "Port ID: %s", tvb_format_text(tvb, offset + 4, real_length - 4)); - tlv_tree = proto_item_add_subtree(tlvi, ett_udld_tlv); proto_tree_add_uint(tlv_tree, hf_udld_tlvtype, tvb, offset + TLV_TYPE, 2, type); proto_tree_add_uint(tlv_tree, hf_udld_tlvlength, tvb, @@ -215,11 +213,10 @@ dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case TYPE_DEVICE_NAME: case TYPE_SEQUENCE_NUMBER: default: - tlvi = proto_tree_add_text(udld_tree, tvb, offset, - length, "Type: %s, length: %u", + tlv_tree = proto_tree_add_subtree_format(udld_tree, tvb, offset, + length, ett_udld_tlv, NULL, "Type: %s, length: %u", val_to_str(type, type_vals, "Unknown (0x%04x)"), length); - tlv_tree = proto_item_add_subtree(tlvi, ett_udld_tlv); proto_tree_add_uint(tlv_tree, hf_udld_tlvtype, tvb, offset + TLV_TYPE, 2, type); proto_tree_add_uint(tlv_tree, hf_udld_tlvlength, tvb, |