aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-componentstatus.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-06-23 20:39:28 -0400
committerMichael Mann <mmann78@netscape.net>2014-06-24 23:42:13 +0000
commit29ecd114bfd3ba01ee340ffa084eeeafb886f750 (patch)
tree7eddcc9b3c8c7d41294be2aaf60c86befbd49a0b /epan/dissectors/packet-componentstatus.c
parent83da877fffaa3de727809918070dafb4d590e1fd (diff)
convert to proto_tree_add_subtree[_format]
Change-Id: I5f573dffabb8685a8e5a334ff2bfb24d9838daa6 Reviewed-on: https://code.wireshark.org/review/2601 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-componentstatus.c')
-rw-r--r--epan/dissectors/packet-componentstatus.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/epan/dissectors/packet-componentstatus.c b/epan/dissectors/packet-componentstatus.c
index da18b24fba..8de35bc6d8 100644
--- a/epan/dissectors/packet-componentstatus.c
+++ b/epan/dissectors/packet-componentstatus.c
@@ -157,7 +157,6 @@ static void
dissect_componentstatusprotocol_componentstatusreport_message(tvbuff_t *message_tvb, proto_tree *message_tree)
{
tvbuff_t *association_tvb;
- proto_item *association_item;
proto_tree *association_tree;
/* gint associations; - variable set but not used, so commented out */
int i;
@@ -173,9 +172,8 @@ dissect_componentstatusprotocol_componentstatusreport_message(tvbuff_t *message_
offset = COMPONENTSTATUSREPORT_ASSOCIATIONARRAY_OFFSET;
i = 1;
while(tvb_reported_length_remaining(message_tvb, offset) >= COMPONENTASSOCIATION_LENGTH) {
- association_item = proto_tree_add_text(message_tree, message_tvb, offset, COMPONENTASSOCIATION_LENGTH,
- "Association #%d", i++);
- association_tree = proto_item_add_subtree(association_item, ett_association);
+ association_tree = proto_tree_add_subtree_format(message_tree, message_tvb, offset, COMPONENTASSOCIATION_LENGTH,
+ ett_association, NULL, "Association #%d", i++);
association_tvb = tvb_new_subset(message_tvb, offset,
MIN(COMPONENTASSOCIATION_LENGTH, tvb_length_remaining(message_tvb, offset)),
COMPONENTASSOCIATION_LENGTH);
@@ -234,15 +232,10 @@ dissect_componentstatusprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ComponentStatusProtocol");
- /* In the interest of speed, if "tree" is NULL, don't do any work not
- necessary to generate protocol tree items. */
- if (tree) {
- /* create the componentstatusprotocol protocol tree */
- componentstatusprotocol_item = proto_tree_add_item(tree, proto_componentstatusprotocol, message_tvb, 0, -1, ENC_NA);
- componentstatusprotocol_tree = proto_item_add_subtree(componentstatusprotocol_item, ett_componentstatusprotocol);
- } else {
- componentstatusprotocol_tree = NULL;
- };
+ /* create the componentstatusprotocol protocol tree */
+ componentstatusprotocol_item = proto_tree_add_item(tree, proto_componentstatusprotocol, message_tvb, 0, -1, ENC_NA);
+ componentstatusprotocol_tree = proto_item_add_subtree(componentstatusprotocol_item, ett_componentstatusprotocol);
+
/* dissect the message */
dissect_componentstatusprotocol_message(message_tvb, pinfo, componentstatusprotocol_tree);
return(tvb_length(message_tvb));