aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-zcl-misc.c
diff options
context:
space:
mode:
authorKenneth Soerensen <knnthsrnsn@gmail.com>2018-03-31 21:23:47 +0200
committerAnders Broman <a.broman58@gmail.com>2018-04-05 05:20:52 +0000
commit62af7654388645a2479193bd1a280b65c1e714e0 (patch)
tree4b12880f9e0b26249574fd481e38c2ab60985a7a /epan/dissectors/packet-zbee-zcl-misc.c
parent2f44216f3aab9a9a31b7b00df50de70d0c6b5f8e (diff)
ZigBee: Allow a different set of attributes for ZCL client and server
Some clusters, for example the Smart Energy Metering cluster, requires a different set of attributes for the ZCL client and server but with overlapping IDs. This change allows to specify a different set of attributes for the ZCL client. To avoid breaking existing clusters that might have client attributes the same set of attributes are used for server and client when zbee_zcl_init_cluster is called. This new client attribute set is used in the Smart Energy Metering cluster in this commit. Change-Id: Ie25ad746dac1ccbb233ae8975ef9047d3fc6a170 Reviewed-on: https://code.wireshark.org/review/26694 Reviewed-by: Martin Boye Petersen <martinboyepetersen@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Paul Zander <p.j.zander@lighting.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-zbee-zcl-misc.c')
-rw-r--r--epan/dissectors/packet-zbee-zcl-misc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/epan/dissectors/packet-zbee-zcl-misc.c b/epan/dissectors/packet-zbee-zcl-misc.c
index 0a5087b9d3..c1091c4a71 100644
--- a/epan/dissectors/packet-zbee-zcl-misc.c
+++ b/epan/dissectors/packet-zbee-zcl-misc.c
@@ -230,7 +230,7 @@ void proto_register_zbee_zcl_thermostat(void);
void proto_reg_handoff_zbee_zcl_thermostat(void);
/* Attribute Dissector Helpers */
-static void dissect_zcl_thermostat_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
+static void dissect_zcl_thermostat_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
static int dissect_zcl_thermostat_schedule(proto_tree *tree, tvbuff_t *tvb, guint offset);
static void dissect_zcl_thermostat_schedule_days(proto_tree *tree, tvbuff_t *tvb, guint offset);
@@ -438,14 +438,15 @@ dissect_zbee_zcl_thermostat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
+ *@param client_attr ZCL client
*/
static void
-dissect_zcl_thermostat_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
+dissect_zcl_thermostat_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
default:
- dissect_zcl_attr_data(tvb, tree, offset, data_type);
+ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_thermostat_attr_data*/
@@ -571,6 +572,7 @@ proto_reg_handoff_zbee_zcl_thermostat(void)
ZBEE_ZCL_CID_THERMOSTAT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_thermostat_attr_id,
+ hf_zbee_zcl_thermostat_attr_id,
hf_zbee_zcl_thermostat_srv_rx_cmd_id,
hf_zbee_zcl_thermostat_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_thermostat_attr_data
@@ -746,7 +748,7 @@ void proto_reg_handoff_zbee_zcl_ias_zone(void);
static int dissect_zbee_zcl_ias_zone (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
/* Attribute Dissector Helpers */
-static void dissect_zcl_ias_zone_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
+static void dissect_zcl_ias_zone_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* ZoneStatus bitmask helper */
static void dissect_zcl_ias_zone_status (proto_tree *tree, tvbuff_t *tvb, guint offset);
@@ -870,9 +872,10 @@ dissect_zbee_zcl_ias_zone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
+ *@param client_attr ZCL client
*/
static void
-dissect_zcl_ias_zone_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
+dissect_zcl_ias_zone_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
/* Dissect attribute data type and data */
switch (attr_id) {
@@ -893,7 +896,7 @@ dissect_zcl_ias_zone_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, g
case ZBEE_ZCL_ATTR_ID_IAS_CIE_ADDRESS:
default:
- dissect_zcl_attr_data(tvb, tree, offset, data_type);
+ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_ias_zone_attr_data*/
@@ -911,6 +914,7 @@ proto_reg_handoff_zbee_zcl_ias_zone(void)
ZBEE_ZCL_CID_IAS_ZONE,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_ias_zone_attr_id,
+ hf_zbee_zcl_ias_zone_attr_id,
hf_zbee_zcl_ias_zone_srv_rx_cmd_id,
hf_zbee_zcl_ias_zone_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_ias_zone_attr_data