aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-nwk.c
diff options
context:
space:
mode:
authorChris Brandson <chris.brandson@gmail.com>2014-11-07 14:11:02 -0800
committerAnders Broman <a.broman58@gmail.com>2014-12-17 11:53:26 +0000
commitdf639f509e812fff3c5eb4bdf4f77988c6ec122b (patch)
tree2d6733280c8596f2dfacc878c878b469d301428f /epan/dissectors/packet-zbee-nwk.c
parentc5b720708e75562d1b8676fd5ab75f9d7b338652 (diff)
Fixed bug in ZigBee (zbee) decryption, added Key Establishment cluster and moved IAS, Thermostat and Poll clusters out of the ZCL foundation dissector.
Removed attrID and cmdID ZCL cluster functions. Bug in ZCL HVAC attribute registration. Fixed bug in ZCL command ID field registration. Update Manufacturer Codes and Profile Ids to ZigBee-053874r26 Oct 2014 Fixed broken fragmented ZigBee packet collection and reassembly Use protocol fields for Thermostat schedule transitions. Added support for Key Establishment Cluster (CBKE) at SE 1.2a Updated Message cluster to SE 1.2a spec Added attribute reporting status which is common to all SE 1.2a clusters Added SE 1.2a tunnel cluster support ZigBee Smart Energy (SE) decryption appears to have been broken for some time. For SE you do not know the Link Key until after successful completion of Key Establishment and then manually enter it into preferences. Entry in preferences was broken such that when the new Link Key was entered all existing link keys would be lost. This lead to the loss of the Network Key as well when the Transport Key message was re-processed without the Pre-Configured Link Key. The Link Key 'key ring' has been moved to the UAT post-update callback so that it will always be updated correctly after changes to the link keys in preferences The attribute reporting status attribute which is common to all SE clusters was accidentally shared, now each cluster has it's own instance ZigBee security added key display for decrypted packets ZigBee Security Preferences fixed UAT type for Label so key label is editable again Added definition for Retail Service profile Added dissection for profile-wide (General Command Frame) commands when the profile is unknown Added zbee-zcl-misc.c to precommit check whitelist as it contains ias and hvac clusters avoiding proliferation of too many small files Change-Id: I53d85ba9d782db6a0e7e78c51b0bc7cdcdbca3ad Reviewed-on: https://code.wireshark.org/review/5565 Petri-Dish: Alexis La Goutte <alexis.lagoutte@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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c
index 2d7e96a941..b859e42a4f 100644
--- a/epan/dissectors/packet-zbee-nwk.c
+++ b/epan/dissectors/packet-zbee-nwk.c
@@ -649,7 +649,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
* Ensure that the payload exists. There are no valid ZigBee network
* packets that have no payload.
*/
- if (offset >= tvb_length(tvb)) {
+ if (offset >= tvb_captured_length(tvb)) {
/* Non-existent or truncated payload. */
expert_add_info(pinfo, proto_root, &ei_zbee_nwk_missing_payload);
THROW(BoundsError);
@@ -659,7 +659,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
payload_tvb = dissect_zbee_secure(tvb, pinfo, nwk_tree, offset);
if (payload_tvb == NULL) {
/* If Payload_tvb is NULL, then the security dissector cleaned up. */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
/* Plaintext payload. */
@@ -680,7 +680,7 @@ dissect_zbee_nwk_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
call_dissector(data_handle, payload_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_nwk */
/*FUNCTION:------------------------------------------------------
@@ -807,7 +807,7 @@ static void dissect_zbee_nwk_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
} /* switch */
/* There is excess data in the packet. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* There are leftover bytes! */
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = NULL;
@@ -1488,7 +1488,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset += 3;
/* Get and display the update ID. */
- if(tvb_length_remaining(tvb, offset)) {
+ if(tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(beacon_tree, hf_zbee_beacon_update_id, tvb, offset, 1, ENC_NA);
offset += 1;
}
@@ -1504,7 +1504,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
}
/* Check for leftover bytes. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* Bytes leftover! */
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = NULL;
@@ -1519,7 +1519,7 @@ static int dissect_zbee_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
call_dissector(data_handle, leftover_tvb, pinfo, root);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbee_beacon */
/*FUNCTION:------------------------------------------------------
@@ -1612,7 +1612,7 @@ static int dissect_zbip_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset += 16;
/* Check for leftover bytes. */
- if (offset < tvb_length(tvb)) {
+ if (offset < tvb_captured_length(tvb)) {
/* TODO: There are TLV's to parse. */
/* Bytes leftover! */
tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1627,7 +1627,7 @@ static int dissect_zbip_beacon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Dump the leftover to the data dissector. */
call_dissector(data_handle, leftover_tvb, pinfo, root);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* dissect_zbip_beacon */
/*FUNCTION:------------------------------------------------------
@@ -1973,7 +1973,7 @@ void proto_register_zbee_nwk(void)
register_init_routine(proto_init_zbee_nwk);
/* Register the protocol with Wireshark. */
- proto_zbee_nwk = proto_register_protocol("ZigBee Network Layer", "ZigBee NWK", ZBEE_PROTOABBREV_NWK);
+ proto_zbee_nwk = proto_register_protocol("ZigBee Network Layer", "ZigBee", ZBEE_PROTOABBREV_NWK);
proto_zbee_beacon = proto_register_protocol("ZigBee Beacon", "ZigBee Beacon", "zbee_beacon");
proto_zbip_beacon = proto_register_protocol("ZigBee IP Beacon", "ZigBee IP Beacon", "zbip_beacon");
proto_register_field_array(proto_zbee_nwk, hf, array_length(hf));