forked from osmocom/wireshark
ZigBee ZDP cluster display
Added cluster names to binding requests and match descriptor. Cluster IDs now display in HEX. Change-Id: I1be4339e324ba4c98ce65016f5a2e60590235d71 Reviewed-on: https://code.wireshark.org/review/24437 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
bceae3cff2
commit
462048b2d3
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include "packet-zbee.h"
|
||||
#include "packet-zbee-zdp.h"
|
||||
#include "packet-zbee-aps.h"
|
||||
|
||||
|
||||
/**************************************
|
||||
|
@ -168,7 +169,7 @@ dissect_zbee_zdp_req_bind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
|
|||
guint offset = 0;
|
||||
guint64 src64;
|
||||
/*guint8 src_ep;*/
|
||||
/*guint16 cluster;*/
|
||||
guint16 cluster;
|
||||
guint8 dst_mode;
|
||||
guint16 dst = 0;
|
||||
guint64 dst64 = 0;
|
||||
|
@ -176,7 +177,9 @@ dissect_zbee_zdp_req_bind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
|
|||
|
||||
src64 = zbee_parse_eui64(tree, hf_zbee_zdp_bind_src64, tvb, &offset, (int)sizeof(guint64), NULL);
|
||||
/*src_ep =*/ zbee_parse_uint(tree, hf_zbee_zdp_bind_src_ep, tvb, &offset, (int)sizeof(guint8), NULL);
|
||||
/*cluster =*/ zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, ZBEE_HAS_2006(version)?(int)sizeof(guint16):(int)sizeof(guint8), NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, ZBEE_HAS_2006(version)?(int)sizeof(guint16):(int)sizeof(guint8), &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
|
||||
if (version >= ZBEE_VERSION_2007) {
|
||||
dst_mode = zbee_parse_uint(tree, hf_zbee_zdp_addr_mode, tvb, &offset, (int)sizeof(guint8), &ti);
|
||||
if (tree) {
|
||||
|
@ -208,6 +211,8 @@ dissect_zbee_zdp_req_bind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
|
|||
zbee_append_info(tree, pinfo, ", Dst: %s", eui64_to_display(wmem_packet_scope(), dst64));
|
||||
}
|
||||
|
||||
zbee_append_info(tree, pinfo, ", %s (Cluster ID: 0x%04x)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"), cluster);
|
||||
|
||||
/* Dump any leftover bytes. */
|
||||
zdp_dump_excess(tvb, offset, pinfo, tree);
|
||||
} /* dissect_zbee_zdp_req_bind */
|
||||
|
@ -227,7 +232,7 @@ dissect_zbee_zdp_req_unbind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
guint offset = 0;
|
||||
guint64 src64;
|
||||
/*guint8 src_ep;*/
|
||||
/*guint16 cluster;*/
|
||||
guint16 cluster;
|
||||
guint8 dst_mode;
|
||||
guint16 dst = 0;
|
||||
guint64 dst64 = 0;
|
||||
|
@ -235,7 +240,9 @@ dissect_zbee_zdp_req_unbind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
src64 = zbee_parse_eui64(tree, hf_zbee_zdp_bind_src64, tvb, &offset, (int)sizeof(guint64), NULL);
|
||||
/*src_ep =*/ zbee_parse_uint(tree, hf_zbee_zdp_bind_src_ep, tvb, &offset, (int)sizeof(guint8), NULL);
|
||||
/*cluster =*/ zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8), NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8), &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
|
||||
if (version >= ZBEE_VERSION_2007) {
|
||||
dst_mode = zbee_parse_uint(tree, hf_zbee_zdp_addr_mode, tvb, &offset, (int)sizeof(guint8), &ti);
|
||||
if (tree) {
|
||||
|
@ -267,6 +274,8 @@ dissect_zbee_zdp_req_unbind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
zbee_append_info(tree, pinfo, ", Dst: %s", eui64_to_display(wmem_packet_scope(), dst64));
|
||||
}
|
||||
|
||||
zbee_append_info(tree, pinfo, ", %s (Cluster ID: 0x%04x)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"), cluster);
|
||||
|
||||
/* Dump any leftover bytes. */
|
||||
zdp_dump_excess(tvb, offset, pinfo, tree);
|
||||
} /* dissect_zbee_zdp_req_unbind */
|
||||
|
@ -340,7 +349,8 @@ dissect_zbee_zdp_req_store_bak_bind_entry(tvbuff_t *tvb, packet_info *pinfo, pro
|
|||
|
||||
src64 = zbee_parse_eui64(tree, hf_zbee_zdp_bind_src64, tvb, &offset, (int)sizeof(guint64), NULL);
|
||||
src_ep = zbee_parse_uint(tree, hf_zbee_zdp_bind_src_ep, tvb, &offset, (int)sizeof(guint8), NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8), NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8), &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
dst_mode = zbee_parse_uint(tree, hf_zbee_zdp_addr_mode, tvb, &offset, (int)sizeof(guint8), &ti);
|
||||
|
||||
if (dst_mode == ZBEE_ZDP_ADDR_MODE_GROUP) {
|
||||
|
@ -359,7 +369,7 @@ dissect_zbee_zdp_req_store_bak_bind_entry(tvbuff_t *tvb, packet_info *pinfo, pro
|
|||
|
||||
zbee_append_info(tree, pinfo, ", Src: %s", eui64_to_display(wmem_packet_scope(), src64));
|
||||
zbee_append_info(tree, pinfo, ", Src Endpoint: %d", src_ep);
|
||||
zbee_append_info(tree, pinfo, ", Cluster: %d", cluster);
|
||||
zbee_append_info(tree, pinfo, ", %s (Cluster ID: 0x%04x)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"), cluster);
|
||||
|
||||
/* Dump any leftover bytes. */
|
||||
zdp_dump_excess(tvb, offset, pinfo, tree);
|
||||
|
@ -385,7 +395,8 @@ dissect_zbee_zdp_req_remove_bak_bind_entry(tvbuff_t *tvb, packet_info *pinfo, pr
|
|||
|
||||
src64 = zbee_parse_eui64(tree, hf_zbee_zdp_bind_src64, tvb, &offset, (int)sizeof(guint64), NULL);
|
||||
src_ep = zbee_parse_uint(tree, hf_zbee_zdp_bind_src_ep, tvb, &offset, (int)sizeof(guint8), NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8), NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_cluster, tvb, &offset, (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8), &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_zdp_cluster_names, "Unknown Device Profile Cluster"));
|
||||
dst_mode = zbee_parse_uint(tree, hf_zbee_zdp_addr_mode, tvb, &offset, (int)sizeof(guint8), &ti);
|
||||
|
||||
if (dst_mode == ZBEE_ZDP_ADDR_MODE_GROUP) {
|
||||
|
@ -404,7 +415,7 @@ dissect_zbee_zdp_req_remove_bak_bind_entry(tvbuff_t *tvb, packet_info *pinfo, pr
|
|||
|
||||
zbee_append_info(tree, pinfo, ", Src: %s", eui64_to_display(wmem_packet_scope(), src64));
|
||||
zbee_append_info(tree, pinfo, ", Src Endpoint: %d", src_ep);
|
||||
zbee_append_info(tree, pinfo, ", Cluster: %d", cluster);
|
||||
zbee_append_info(tree, pinfo, ", %s (Cluster ID: 0x%04x)", val_to_str(cluster, zbee_zdp_cluster_names, "Unknown Device Profile Cluster"), cluster);
|
||||
|
||||
/* Dump any leftover bytes. */
|
||||
zdp_dump_excess(tvb, offset, pinfo, tree);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <epan/addr_resolv.h>
|
||||
#include "packet-zbee.h"
|
||||
#include "packet-zbee-zdp.h"
|
||||
#include "packet-zbee-aps.h"
|
||||
|
||||
/**************************************
|
||||
* DISCOVERY REQUESTS
|
||||
|
@ -182,12 +183,14 @@ dissect_zbee_zdp_req_active_ep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
void
|
||||
dissect_zbee_zdp_req_match_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 version)
|
||||
{
|
||||
proto_item *ti;
|
||||
proto_tree *field_tree = NULL;
|
||||
guint offset = 0, i;
|
||||
guint sizeof_cluster = (version >= ZBEE_VERSION_2007)?(int)sizeof(guint16):(int)sizeof(guint8);
|
||||
|
||||
guint16 device;
|
||||
guint16 profile;
|
||||
guint16 cluster;
|
||||
guint8 in_count;
|
||||
guint8 out_count;
|
||||
|
||||
|
@ -200,14 +203,20 @@ dissect_zbee_zdp_req_match_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
|
|||
field_tree = proto_tree_add_subtree(tree, tvb, offset, in_count*sizeof_cluster,
|
||||
ett_zbee_zdp_match_in, NULL, "Input Cluster List");
|
||||
}
|
||||
for (i=0; i<in_count; i++) zbee_parse_uint(field_tree, hf_zbee_zdp_in_cluster, tvb, &offset, sizeof_cluster, NULL);
|
||||
for (i=0; i<in_count; i++) {
|
||||
cluster = zbee_parse_uint(field_tree, hf_zbee_zdp_in_cluster, tvb, &offset, sizeof_cluster, &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
}
|
||||
|
||||
/* Add the output cluster list. */
|
||||
out_count = zbee_parse_uint(tree, hf_zbee_zdp_out_count, tvb, &offset, (int)sizeof(guint8), NULL);
|
||||
if (tree && out_count) {
|
||||
field_tree = proto_tree_add_subtree(tree, tvb, offset, out_count*sizeof_cluster, ett_zbee_zdp_match_out, NULL, "Output Cluster List");
|
||||
}
|
||||
for (i=0; i<out_count; i++) zbee_parse_uint(field_tree, hf_zbee_zdp_out_cluster, tvb, &offset, sizeof_cluster, NULL);
|
||||
for (i=0; i<out_count; i++) {
|
||||
cluster = zbee_parse_uint(field_tree, hf_zbee_zdp_out_cluster, tvb, &offset, sizeof_cluster, &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
}
|
||||
|
||||
zbee_append_info(tree, pinfo, ", Nwk Addr: 0x%04x, Profile: 0x%04x", device, profile);
|
||||
|
||||
|
@ -1237,12 +1246,14 @@ dissect_zbee_zdp_rsp_find_node_cache(tvbuff_t *tvb, packet_info *pinfo, proto_tr
|
|||
void
|
||||
dissect_zbee_zdp_rsp_ext_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
proto_item *ti;
|
||||
guint offset = 0;
|
||||
guint i;
|
||||
guint sizeof_cluster = (int)sizeof(guint16);
|
||||
|
||||
guint8 status;
|
||||
guint16 device;
|
||||
guint16 cluster;
|
||||
/*guint8 endpt;*/
|
||||
guint8 in_count;
|
||||
guint8 out_count;
|
||||
|
@ -1257,10 +1268,12 @@ dissect_zbee_zdp_rsp_ext_simple_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tr
|
|||
|
||||
/* Display the input cluster list. */
|
||||
for (i=idx; (i<in_count) && tvb_bytes_exist(tvb, offset, sizeof_cluster); i++) {
|
||||
zbee_parse_uint(tree, hf_zbee_zdp_in_cluster, tvb, &offset, sizeof_cluster, NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_in_cluster, tvb, &offset, sizeof_cluster, &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
} /* for */
|
||||
for (i-=in_count; (i<out_count) && tvb_bytes_exist(tvb, offset, sizeof_cluster); i++) {
|
||||
zbee_parse_uint(tree, hf_zbee_zdp_out_cluster, tvb, &offset, sizeof_cluster, NULL);
|
||||
cluster = zbee_parse_uint(tree, hf_zbee_zdp_out_cluster, tvb, &offset, sizeof_cluster, &ti);
|
||||
proto_item_append_text(ti, " (%s)", val_to_str(cluster, zbee_aps_cid_names, "Unknown Cluster"));
|
||||
} /* for */
|
||||
|
||||
zbee_append_info(tree, pinfo, ", Nwk Addr: 0x%04x", device);
|
||||
|
|
|
@ -1366,7 +1366,7 @@ void proto_register_zbee_zdp(void)
|
|||
NULL, HFILL }},
|
||||
|
||||
{ &hf_zbee_zdp_cluster,
|
||||
{ "Cluster", "zbee_zdp.cluster", FT_UINT16, BASE_DEC, NULL, 0x0,
|
||||
{ "Cluster", "zbee_zdp.cluster", FT_UINT16, BASE_HEX, NULL, 0x0,
|
||||
NULL, HFILL }},
|
||||
|
||||
{ &hf_zbee_zdp_table_size,
|
||||
|
|
Loading…
Reference in New Issue