diff options
author | Owen Kirby <osk@exegin.com> | 2017-06-23 15:15:46 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-07-20 07:32:36 +0000 |
commit | 79e801806aedbbb74f642fafd9f54c02e60677f5 (patch) | |
tree | fe4f3c03368560588fa0b4693154eed6b15869af /epan/dissectors/packet-zbee-nwk.c | |
parent | 07f27d8238021b6e485699369383a58f95984a4e (diff) |
ZigBee: Add touchlink commissioning dissectors.
Change-Id: I745fa77626dd242d9a6f1bd79c6ae52d507f844a
Reviewed-on: https://code.wireshark.org/review/22380
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>
Diffstat (limited to 'epan/dissectors/packet-zbee-nwk.c')
-rw-r--r-- | epan/dissectors/packet-zbee-nwk.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c index a986bfee36..593f7b8428 100644 --- a/epan/dissectors/packet-zbee-nwk.c +++ b/epan/dissectors/packet-zbee-nwk.c @@ -396,17 +396,27 @@ dissect_zbee_nwk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void ieee802154_packet *packet = (ieee802154_packet *)data; guint16 fcf; guint ver; + guint type; /* All ZigBee frames must always have a 16-bit source and destination address. */ if (packet == NULL) return FALSE; - if (packet->src_addr_mode != IEEE802154_FCF_ADDR_SHORT && packet->src_addr_mode != IEEE802154_FCF_ADDR_EXT) return FALSE; - if (packet->dst_addr_mode != IEEE802154_FCF_ADDR_SHORT) return FALSE; /* If the frame type and version are not sane, then it's probably not ZigBee. */ fcf = tvb_get_letohs(tvb, 0); ver = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_VERSION); + type = zbee_get_bit_field(fcf, ZBEE_NWK_FCF_FRAME_TYPE); if ((ver < ZBEE_VERSION_2004) || (ver > ZBEE_VERSION_2007)) return FALSE; - if (!try_val_to_str(zbee_get_bit_field(fcf, ZBEE_NWK_FCF_FRAME_TYPE), zbee_nwk_frame_types)) return FALSE; + if (!try_val_to_str(type, zbee_nwk_frame_types)) return FALSE; + + /* All interpan frames should originate from an extended address. */ + if (type == ZBEE_NWK_FCF_INTERPAN) { + if (packet->src_addr_mode != IEEE802154_FCF_ADDR_EXT) return FALSE; + } + /* All other ZigBee frames must have 16-bit source and destination addresses. */ + else { + if (packet->src_addr_mode != IEEE802154_FCF_ADDR_SHORT) return FALSE; + if (packet->dst_addr_mode != IEEE802154_FCF_ADDR_SHORT) return FALSE; + } /* Assume it's ZigBee */ dissect_zbee_nwk(tvb, pinfo, tree, packet); |