aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-nwk-gp.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-06-26 22:51:11 -0400
committerMichael Mann <mmann78@netscape.net>2014-06-28 12:05:43 +0000
commit7bf6862ecf0d0a508bf097f3b52d07bd19128272 (patch)
tree08dfcfd08ae0ba90383451f2a2f1d321aba7cb23 /epan/dissectors/packet-zbee-nwk-gp.c
parent929afd23a77b27b28fe3ca17cb063725467d387a (diff)
convert to proto_tree_add_subtree[_format]
Change-Id: Ia7014003a3cff5181295172978d6c613c3b83b0b Reviewed-on: https://code.wireshark.org/review/2676 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk-gp.c')
-rw-r--r--epan/dissectors/packet-zbee-nwk-gp.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/epan/dissectors/packet-zbee-nwk-gp.c b/epan/dissectors/packet-zbee-nwk-gp.c
index b85b9c83b3..4d1bf3538d 100644
--- a/epan/dissectors/packet-zbee-nwk-gp.c
+++ b/epan/dissectors/packet-zbee-nwk-gp.c
@@ -829,7 +829,6 @@ dissect_zbee_nwk_gp_cmd_attr_reporting(tvbuff_t *tvb, packet_info *pinfo _U_, pr
zbee_nwk_green_power_packet *packet _U_, guint offset)
{
guint16 cluster_id;
- proto_item *ti;
proto_tree *field_tree;
/* Get cluster ID and add it into the tree. */
@@ -838,8 +837,8 @@ dissect_zbee_nwk_gp_cmd_attr_reporting(tvbuff_t *tvb, packet_info *pinfo _U_, pr
offset += 2;
/* Create subtree and parse ZCL Write Attribute Payload. */
- ti = proto_tree_add_text(tree, tvb, offset, 2, "Attribute reporting command for cluster: 0x%02X", cluster_id);
- field_tree = proto_item_add_subtree(ti, ett_zbee_nwk_cmd_options);
+ field_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_zbee_nwk_cmd_options, NULL,
+ "Attribute reporting command for cluster: 0x%02X", cluster_id);
dissect_zcl_write_attr(tvb, pinfo, field_tree, &offset, cluster_id);
return offset;
@@ -1026,20 +1025,18 @@ dissect_zbee_nwk_gp_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
guint offset = 0;
guint8 cmd_id = tvb_get_guint8(tvb, offset);
- proto_item *cmd_root = NULL;
- proto_tree *cmd_tree = NULL;
+ proto_item *cmd_root;
+ proto_tree *cmd_tree;
zbee_nwk_green_power_packet *packet = (zbee_nwk_green_power_packet *)data;
/* Create a subtree for the command. */
- if (tree) {
- cmd_root = proto_tree_add_text(tree, tvb, offset, tvb_length(tvb), "Command Frame: %s",
- val_to_str_ext_const(cmd_id,
+ cmd_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_zbee_nwk_cmd, &cmd_root,
+ "Command Frame: %s", val_to_str_ext_const(cmd_id,
&zbee_nwk_gp_cmd_names_ext,
"Unknown Command Frame"));
- cmd_tree = proto_item_add_subtree(cmd_root, ett_zbee_nwk_cmd);
- /* Add the command ID. */
- proto_tree_add_uint(cmd_tree, hf_zbee_nwk_gp_command_id, tvb, offset, 1, cmd_id);
- }
+ /* Add the command ID. */
+ proto_tree_add_uint(cmd_tree, hf_zbee_nwk_gp_command_id, tvb, offset, 1, cmd_id);
+
offset += 1;
/* Add the command name to the info column. */
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(cmd_id, &zbee_nwk_gp_cmd_names_ext, "Unknown command"));