aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordsrsupport <eugene.exarevsky@dsr-company.com>2016-09-06 17:56:15 +0300
committerAnders Broman <a.broman58@gmail.com>2016-10-16 15:24:30 +0000
commitdc1cd7889da85938b016c6bfec932dd595b7e18b (patch)
treeac8f9410ceaa356372f3063e1dc34654cf28fac6
parentb240082cf4ca297149a119694e9eb4d205bccc02 (diff)
ZigBee MAC and ZDO dissectors: put useful information into column description for Association req and ZDo Node Desc Resp.
I added that information to column description because I always need it when analyzing logs. For Association request it is joining device type (FFD or RFD), for Node Descriptor Response this is stack version (r21 or legacy). Change-Id: Ic7ca237b1f4b598f9354b406f105c2befe45140d Reviewed-on: https://code.wireshark.org/review/17534 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-ieee802154.c4
-rw-r--r--epan/dissectors/packet-zbee-zdp-discovery.c4
-rw-r--r--epan/dissectors/packet-zbee-zdp.c10
-rw-r--r--epan/dissectors/packet-zbee-zdp.h2
4 files changed, 15 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index 9be986e24a..f757856ecf 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -2384,6 +2384,7 @@ static const true_false_string tfs_cinfo_power_src = { "AC/Mains Power", "Batter
static void
dissect_ieee802154_assoc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ieee802154_packet *packet)
{
+ guint8 cap;
proto_tree *subtree;
static const int * capability[] = {
&hf_ieee802154_cinfo_alt_coord,
@@ -2395,6 +2396,9 @@ dissect_ieee802154_assoc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
NULL
};
+ cap = tvb_get_guint8(tvb, 0);
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", (cap & IEEE802154_CMD_CINFO_DEVICE_TYPE) ? tfs_cinfo_device_type.true_string : tfs_cinfo_device_type.false_string);
+
/* Create a subtree for this command frame. */
subtree = proto_tree_add_subtree(tree, tvb, 0, 1, ett_ieee802154_cmd, NULL,
val_to_str_const(packet->command_id, ieee802154_cmd_names, "Unknown Command"));
diff --git a/epan/dissectors/packet-zbee-zdp-discovery.c b/epan/dissectors/packet-zbee-zdp-discovery.c
index 6c1f5c882f..25fde7a0c4 100644
--- a/epan/dissectors/packet-zbee-zdp-discovery.c
+++ b/epan/dissectors/packet-zbee-zdp-discovery.c
@@ -481,7 +481,7 @@ dissect_zbee_zdp_req_store_node_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tr
/*device =*/ zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, (int)sizeof(guint16), NULL);
ext_addr = zbee_parse_eui64(tree, hf_zbee_zdp_ext_addr, tvb, &offset, (int)sizeof(guint64), NULL);
- zdp_parse_node_desc(tree, ett_zbee_zdp_node, tvb, &offset, version);
+ zdp_parse_node_desc(tree, NULL, ett_zbee_zdp_node, tvb, &offset, version);
zbee_append_info(tree, pinfo, ", Device: %s", eui64_to_display(wmem_packet_scope(), ext_addr));
@@ -783,7 +783,7 @@ dissect_zbee_zdp_rsp_node_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
status = zdp_parse_status(tree, tvb, &offset);
device = zbee_parse_uint(tree, hf_zbee_zdp_device, tvb, &offset, (int)sizeof(guint16), NULL);
if (status == ZBEE_ZDP_STATUS_SUCCESS) {
- zdp_parse_node_desc(tree, ett_zbee_zdp_node, tvb, &offset, version);
+ zdp_parse_node_desc(tree, pinfo, ett_zbee_zdp_node, tvb, &offset, version);
}
zbee_append_info(tree, pinfo, ", Device: 0x%04x", device);
diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c
index 9c8582b4e4..3b1834c54d 100644
--- a/epan/dissectors/packet-zbee-zdp.c
+++ b/epan/dissectors/packet-zbee-zdp.c
@@ -26,6 +26,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <wsutil/bits_ctz.h>
#include "packet-zbee.h"
#include "packet-zbee-nwk.h"
@@ -724,7 +725,7 @@ zdp_parse_server_flags(proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *of
*@param offset offset into the tvb to find the node descriptor.
*/
void
-zdp_parse_node_desc(proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset, guint8 version)
+zdp_parse_node_desc(proto_tree *tree, packet_info *pinfo, gint ettindex, tvbuff_t *tvb, guint *offset, guint8 version)
{
proto_item *ti;
proto_item *field_root = NULL;
@@ -775,13 +776,18 @@ zdp_parse_node_desc(proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offse
/* Get and display the server flags. */
if (version >= ZBEE_VERSION_2007) {
+ guint16 ver_flags;
const int * descriptors[] = {
&hf_zbee_zdp_dcf_eaela,
&hf_zbee_zdp_dcf_esdla,
NULL
};
- zdp_parse_server_flags(field_tree, ett_zbee_zdp_server, tvb, offset);
+ ver_flags = zdp_parse_server_flags(field_tree, ett_zbee_zdp_server, tvb, offset) & ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV;
+ if (ver_flags) {
+ zbee_append_info(tree, pinfo, ", Rev: %d",
+ (ver_flags >> ws_ctz(ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV)));
+ }
zbee_parse_uint(field_tree, hf_zbee_zdp_node_max_outgoing_transfer, tvb, offset, 2, NULL);
proto_tree_add_bitmask_with_flags(field_tree, tvb, *offset, hf_zbee_zdp_dcf, ett_zbee_zdp_descriptor_capability_field, descriptors, ENC_NA, BMT_NO_APPEND);
*offset += 1;
diff --git a/epan/dissectors/packet-zbee-zdp.h b/epan/dissectors/packet-zbee-zdp.h
index 9f98078391..216825ef4c 100644
--- a/epan/dissectors/packet-zbee-zdp.h
+++ b/epan/dissectors/packet-zbee-zdp.h
@@ -336,7 +336,7 @@ extern guint zbee_parse_uint (proto_tree *tree, int hfindex, tvbuf
extern guint64 zbee_parse_eui64 (proto_tree *tree, int hfindex, tvbuff_t *tvb, guint *offset, guint length, proto_item **ti);
extern void zbee_append_info (proto_item *item, packet_info *pinfo, const gchar *format, ...) G_GNUC_PRINTF(3, 4);
-extern void zdp_parse_node_desc (proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset, guint8 version);
+extern void zdp_parse_node_desc (proto_tree *tree, packet_info *pinfo, gint ettindex, tvbuff_t *tvb, guint *offset, guint8 version);
extern void zdp_parse_power_desc (proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset);
extern void zdp_parse_simple_desc (proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset, guint8 version);
extern void zdp_parse_complex_desc (proto_tree *tree, gint ettindex, tvbuff_t *tvb, guint *offset, guint length);