Implement dissector for User Descriptor Response.
Fix Number OfChild foield or Parent_Annce.
Fix name of User Descriptor Response cluster.
Change-Id: Ia48277a76bc7742021a407a45ca18e2c51a35046
Reviewed-on: https://code.wireshark.org/review/16570
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
guint i;
guint64 ext_addr;
- n_children = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, (int)1, NULL);
+ n_children = zbee_parse_uint(tree, hf_zbee_zdp_number_of_children, tvb, &offset, (int)1, NULL);
zbee_append_info(tree, pinfo, ", # children %d :", n_children);
for (i = 0 ; i < n_children ; ++i)
{
zdp_dump_excess(tvb, offset, pinfo, tree);
} /* dissect_zbee_zdp_parent_annce */
+
+/**
+ *ZigBee Device Profile dissector for the parent announce rsp
+ *
+ *@param tvb pointer to buffer containing raw packet.
+ *@param pinfo pointer to packet information fields
+ *@param tree pointer to data tree Wireshark uses to display packet.
+*/
+void
+dissect_zbee_zdp_rsp_parent_annce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ guint offset = 0;
+ guint n_children;
+ guint i;
+ guint64 ext_addr;
+ guint8 status;
+
+ status = zdp_parse_status(tree, tvb, &offset);
+ n_children = zbee_parse_uint(tree, hf_zbee_zdp_number_of_children, tvb, &offset, (int)1, NULL);
+ zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
+ zbee_append_info(tree, pinfo, ", # children %d :", n_children);
+ for (i = 0 ; i < n_children ; ++i)
+ {
+ ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, (int)sizeof(guint64), NULL);
+ if (i == 0)
+ {
+ zbee_append_info(tree, pinfo, n_children == 1 ? " %s" : " %s ...", eui64_to_display(wmem_packet_scope(), ext_addr));
+ }
+ }
+
+ /* Dump any leftover bytes. */
+ zdp_dump_excess(tvb, offset, pinfo, tree);
+} /* dissect_zbee_zdp_rsp_parent_annce */
+
/**
*ZigBee Device Profile dissector for the end set user
*
int hf_zbee_zdp_ieee_join_list_start = -1;
int hf_zbee_zdp_ieee_join_list_count = -1;
int hf_zbee_zdp_ieee_join_list_ieee = -1;
+ int hf_zbee_zdp_number_of_children = -1;
/* Routing Table */
int hf_zbee_zdp_rtg = -1;
int hf_zbee_zdp_rtg_next_hop = -1;
int hf_zbee_zdp_rtg_status = -1;
+
/* Subtree indicies. */
static gint ett_zbee_zdp = -1;
gint ett_zbee_zdp_endpoint = -1;
{ ZBEE_ZDP_RSP_ACTIVE_EP, "Active Endpoint Response" },
{ ZBEE_ZDP_RSP_MATCH_DESC, "Match Descriptor Response" },
{ ZBEE_ZDP_RSP_COMPLEX_DESC, "Complex Descriptor Response" },
- { ZBEE_ZDP_RSP_USER_DESC, "User Descriptor Request" },
+ { ZBEE_ZDP_RSP_USER_DESC, "User Descriptor Response" },
{ ZBEE_ZDP_RSP_DISCOVERY_CACHE, "Discovery Cache Response" },
{ ZBEE_ZDP_RSP_CONF_USER_DESC, "Set User Descriptor Confirm" },
{ ZBEE_ZDP_RSP_SYSTEM_SERVER_DISC, "Server Discovery Response" },
{ ZBEE_ZDP_RSP_FIND_NODE_CACHE, "Find Node Cache Response" },
{ ZBEE_ZDP_RSP_EXT_SIMPLE_DESC, "Extended Simple Descriptor Response" },
{ ZBEE_ZDP_RSP_EXT_ACTIVE_EP, "Extended Active Endpoint Response" },
+ { ZBEE_ZDP_RSP_PARENT_ANNCE, "Parent Announce Response" },
{ ZBEE_ZDP_RSP_END_DEVICE_BIND, "End Device Bind Response" },
{ ZBEE_ZDP_RSP_BIND, "Bind Response" },
{ ZBEE_ZDP_RSP_UNBIND, "Unbind Response" },
case ZBEE_ZDP_RSP_EXT_ACTIVE_EP:
dissect_zbee_zdp_rsp_ext_active_ep(zdp_tvb, pinfo, zdp_tree);
break;
+ case ZBEE_ZDP_RSP_PARENT_ANNCE:
+ dissect_zbee_zdp_rsp_parent_annce(zdp_tvb, pinfo, zdp_tree);
+ break;
case ZBEE_ZDP_RSP_END_DEVICE_BIND:
dissect_zbee_zdp_rsp_end_device_bind(zdp_tvb, pinfo, zdp_tree);
break;
{ "IEEE", "zbee_zdp.ieee_joining_list.ieee", FT_EUI64, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
+ { &hf_zbee_zdp_number_of_children,
+ { "NumberOfChildren", "zbee_zdp.n_children", FT_UINT8, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
};
/* APS subtrees */
#define ZBEE_ZDP_RSP_FIND_NODE_CACHE 0x801c /* ZigBee 2006 & later. */
#define ZBEE_ZDP_RSP_EXT_SIMPLE_DESC 0x801d /* ZigBee 2007 & later. */
#define ZBEE_ZDP_RSP_EXT_ACTIVE_EP 0x801e /* ZigBee 2007 & later. */
+#define ZBEE_ZDP_RSP_PARENT_ANNCE 0x801f /* r21 */
#define ZBEE_ZDP_RSP_END_DEVICE_BIND 0x8020
#define ZBEE_ZDP_RSP_BIND 0x8021
#define ZBEE_ZDP_RSP_UNBIND 0x8022
extern int hf_zbee_zdp_ieee_join_list_start;
extern int hf_zbee_zdp_ieee_join_list_count;
extern int hf_zbee_zdp_ieee_join_list_ieee;
+extern int hf_zbee_zdp_number_of_children;
/* Routing Table */
extern int hf_zbee_zdp_rtg;
extern void dissect_zbee_zdp_req_discovery_cache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void dissect_zbee_zdp_device_annce (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void dissect_zbee_zdp_parent_annce (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+extern void dissect_zbee_zdp_rsp_parent_annce (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void dissect_zbee_zdp_req_set_user_desc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 version);
extern void dissect_zbee_zdp_req_system_server_disc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void dissect_zbee_zdp_req_store_discovery (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);