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>
This commit is contained in:
Kenneth Soerensen 2018-03-31 21:23:47 +02:00 committed by Anders Broman
parent 2f44216f3a
commit 62af765438
12 changed files with 558 additions and 337 deletions

View File

@ -897,7 +897,8 @@ dissect_zbee_nwk_gp_cmd_attr_reporting(tvbuff_t *tvb, packet_info *pinfo _U_, pr
/* Create subtree and parse ZCL Write Attribute Payload. */
field_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_zbee_nwk_cmd_options, NULL,
"Attribute reporting command for cluster: 0x%02X", cluster_id);
dissect_zcl_write_attr(tvb, pinfo, field_tree, &offset, cluster_id, ZBEE_MFG_CODE_NONE);
dissect_zcl_report_attr(tvb, pinfo, field_tree, &offset, cluster_id, ZBEE_MFG_CODE_NONE, ZBEE_ZCL_FCF_TO_CLIENT);
return offset;
} /* dissect_zbee_nwk_gp_cmd_attr_reporting */

View File

@ -56,7 +56,7 @@ void proto_register_zbee_zcl_shade_configuration(void);
void proto_reg_handoff_zbee_zcl_shade_configuration(void);
/* Command Dissector Helpers */
static void dissect_zcl_shade_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_shade_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -130,9 +130,10 @@ dissect_zbee_zcl_shade_configuration(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_shade_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_shade_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
static const int * shade_config_status[] = {
&hf_zbee_zcl_shade_configuration_status_shade_operational,
@ -159,7 +160,7 @@ dissect_zcl_shade_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint
case ZBEE_ZCL_ATTR_ID_SHADE_CONFIGURATION_MOTOR_STEP_SIZE:
case ZBEE_ZCL_ATTR_ID_SHADE_CONFIGURATION_CLOSED_LIMIT:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -235,6 +236,7 @@ proto_reg_handoff_zbee_zcl_shade_configuration(void)
ZBEE_ZCL_CID_SHADE_CONFIG,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_shade_configuration_attr_id,
hf_zbee_zcl_shade_configuration_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_shade_configuration_attr_data
);
@ -279,7 +281,7 @@ void proto_reg_handoff_zbee_zcl_door_lock(void);
/* Command Dissector Helpers */
static void dissect_zcl_door_lock_lock_unlock_door_response (tvbuff_t *tvb, proto_tree *tree, guint *offset);
static void dissect_zcl_door_lock_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_door_lock_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -461,9 +463,10 @@ dissect_zcl_door_lock_lock_unlock_door_response(tvbuff_t *tvb, 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
*/
void
dissect_zcl_door_lock_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_door_lock_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 ) {
@ -492,7 +495,7 @@ dissect_zcl_door_lock_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset,
case ZBEE_ZCL_ATTR_ID_DOOR_LOCK_DOOR_CLOSED_EVENTS:
case ZBEE_ZCL_ATTR_ID_DOOR_LOCK_OPEN_PERIOD:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -571,6 +574,7 @@ proto_reg_handoff_zbee_zcl_door_lock(void)
ZBEE_ZCL_CID_DOOR_LOCK,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_door_lock_attr_id,
hf_zbee_zcl_door_lock_attr_id,
hf_zbee_zcl_door_lock_srv_rx_cmd_id,
hf_zbee_zcl_door_lock_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_door_lock_attr_data

File diff suppressed because it is too large Load Diff

View File

@ -95,7 +95,7 @@ void proto_register_zbee_zcl_appl_idt(void);
void proto_reg_handoff_zbee_zcl_appl_idt(void);
/* Command Dissector Helpers */
static void dissect_zcl_appl_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_appl_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -212,9 +212,10 @@ dissect_zbee_zcl_appl_idt(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_appl_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_appl_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
proto_tree *sub_tree;
guint64 value64;
@ -265,7 +266,7 @@ dissect_zcl_appl_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, g
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -338,6 +339,7 @@ proto_reg_handoff_zbee_zcl_appl_idt(void)
ZBEE_ZCL_CID_APPLIANCE_IDENTIFICATION,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_appl_idt_attr_id,
hf_zbee_zcl_appl_idt_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_appl_idt_attr_data
);
@ -394,7 +396,7 @@ void proto_register_zbee_zcl_met_idt(void);
void proto_reg_handoff_zbee_zcl_met_idt(void);
/* Command Dissector Helpers */
static void dissect_zcl_met_idt_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_met_idt_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -475,9 +477,10 @@ dissect_zbee_zcl_met_idt(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_met_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_met_idt_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 ) {
@ -493,7 +496,7 @@ dissect_zcl_met_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, gu
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -543,6 +546,7 @@ proto_reg_handoff_zbee_zcl_met_idt(void)
ZBEE_ZCL_CID_METER_IDENTIFICATION,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_met_idt_attr_id,
hf_zbee_zcl_met_idt_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_met_idt_attr_data
);
@ -917,7 +921,7 @@ proto_reg_handoff_zbee_zcl_appl_evtalt(void)
ett_zbee_zcl_appl_evtalt,
ZBEE_ZCL_CID_APPLIANCE_EVENTS_AND_ALERT,
ZBEE_MFG_CODE_NONE,
-1,
-1, -1,
hf_zbee_zcl_appl_evtalt_srv_rx_cmd_id,
hf_zbee_zcl_appl_evtalt_srv_tx_cmd_id,
NULL
@ -1272,6 +1276,7 @@ proto_reg_handoff_zbee_zcl_appl_stats(void)
ZBEE_ZCL_CID_APPLIANCE_STATISTICS,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_appl_stats_attr_id,
hf_zbee_zcl_appl_stats_attr_id,
hf_zbee_zcl_appl_stats_srv_rx_cmd_id,
hf_zbee_zcl_appl_stats_srv_tx_cmd_id,
NULL

View File

@ -94,7 +94,7 @@ void proto_register_zbee_zcl_pump_config_control(void);
void proto_reg_handoff_zbee_zcl_pump_config_control(void);
/* Command Dissector Helpers */
static void dissect_zcl_pump_config_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_pump_config_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -218,9 +218,10 @@ dissect_zbee_zcl_pump_config_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
static const int * pump_status[] = {
&hf_zbee_zcl_pump_config_control_status_device_fault,
@ -305,7 +306,7 @@ dissect_zcl_pump_config_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_POWER:
case ZBEE_ZCL_ATTR_ID_PUMP_CONFIG_CONTROL_LIFETIME_ENERGY_CONS:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -476,6 +477,7 @@ proto_reg_handoff_zbee_zcl_pump_config_control(void)
ZBEE_ZCL_CID_PUMP_CONFIG_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_pump_config_control_attr_id,
hf_zbee_zcl_pump_config_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_pump_config_control_attr_data
);
@ -508,7 +510,7 @@ void proto_register_zbee_zcl_fan_control(void);
void proto_reg_handoff_zbee_zcl_fan_control(void);
/* Command Dissector Helpers */
static void dissect_zcl_fan_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_fan_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -581,9 +583,10 @@ dissect_zbee_zcl_fan_control(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tr
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_fan_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_fan_control_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) {
@ -599,7 +602,7 @@ dissect_zcl_fan_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -656,6 +659,7 @@ proto_reg_handoff_zbee_zcl_fan_control(void)
ZBEE_ZCL_CID_FAN_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_fan_control_attr_id,
hf_zbee_zcl_fan_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_fan_control_attr_data
);
@ -694,7 +698,7 @@ void proto_register_zbee_zcl_dehumidification_control(void);
void proto_reg_handoff_zbee_zcl_dehumidification_control(void);
/* Command Dissector Helpers */
static void dissect_zcl_dehumidification_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_dehumidification_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -773,9 +777,10 @@ dissect_zbee_zcl_dehumidification_control(tvbuff_t *tvb _U_, packet_info *pinfo
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_dehumidification_control_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) {
@ -801,7 +806,7 @@ dissect_zcl_dehumidification_control_attr_data(proto_tree *tree, tvbuff_t *tvb,
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_HYSTERESIS:
case ZBEE_ZCL_ATTR_ID_DEHUMIDIFICATION_CONTROL_DEHUM_MAX_COOL:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -862,6 +867,7 @@ proto_reg_handoff_zbee_zcl_dehumidification_control(void)
ZBEE_ZCL_CID_DEHUMIDIFICATION_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_dehumidification_control_attr_id,
hf_zbee_zcl_dehumidification_control_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_dehumidification_control_attr_data
);
@ -894,7 +900,7 @@ void proto_register_zbee_zcl_thermostat_ui_config(void);
void proto_reg_handoff_zbee_zcl_thermostat_ui_config(void);
/* Command Dissector Helpers */
static void dissect_zcl_thermostat_ui_config_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_thermostat_ui_config_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -963,9 +969,10 @@ dissect_zbee_zcl_thermostat_ui_config(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_thermostat_ui_config_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) {
@ -981,7 +988,7 @@ dissect_zcl_thermostat_ui_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guin
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -1037,6 +1044,7 @@ proto_reg_handoff_zbee_zcl_thermostat_ui_config(void)
ZBEE_ZCL_CID_THERMOSTAT_UI_CONFIG,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_thermostat_ui_config_attr_id,
hf_zbee_zcl_thermostat_ui_config_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_thermostat_ui_config_attr_data
);

View File

@ -138,7 +138,7 @@ static void dissect_zcl_color_control_color_loop_set
static void dissect_zcl_color_control_move_color_temp (tvbuff_t *tvb, proto_tree *tree, guint *offset);
static void dissect_zcl_color_control_step_color_temp (tvbuff_t *tvb, proto_tree *tree, guint *offset);
static void dissect_zcl_color_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_color_control_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -888,9 +888,10 @@ decode_color_temperature(gchar *s, guint16 value)
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_color_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_color_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
static const int *capabilities_fields[] = {
&hf_zbee_zcl_color_control_attr_color_capabilities_hs,
@ -1146,7 +1147,7 @@ dissect_zcl_color_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offs
case ZBEE_ZCL_ATTR_ID_COLOR_CONTROL_COMPENSATION_TEXT:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -1534,6 +1535,7 @@ proto_reg_handoff_zbee_zcl_color_control(void)
ZBEE_ZCL_CID_COLOR_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_color_control_attr_id,
hf_zbee_zcl_color_control_attr_id,
hf_zbee_zcl_color_control_srv_rx_cmd_id,
-1,
(zbee_zcl_fn_attr_data)dissect_zcl_color_control_attr_data
@ -1588,7 +1590,7 @@ void proto_register_zbee_zcl_ballast_configuration(void);
void proto_reg_handoff_zbee_zcl_ballast_configuration(void);
/* Command Dissector Helpers */
static void dissect_zcl_ballast_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_ballast_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -1673,9 +1675,10 @@ dissect_zbee_zcl_ballast_configuration(tvbuff_t *tvb _U_, packet_info *pinfo _U_
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_ballast_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_ballast_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
static const int * ballast_status[] = {
&hf_zbee_zcl_ballast_configuration_status_non_operational,
@ -1716,7 +1719,7 @@ dissect_zcl_ballast_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, gui
case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS:
case ZBEE_ZCL_ATTR_ID_BALLAST_CONFIGURATION_LAMP_BURN_HOURS_TRIP_POINT:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -1791,6 +1794,7 @@ proto_reg_handoff_zbee_zcl_ballast_configuration(void)
ZBEE_ZCL_CID_BALLAST_CONFIG,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_ballast_configuration_attr_id,
hf_zbee_zcl_ballast_configuration_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_ballast_configuration_attr_data
);

View File

@ -69,7 +69,7 @@ void proto_register_zbee_zcl_illum_meas(void);
void proto_reg_handoff_zbee_zcl_illum_meas(void);
/* Command Dissector Helpers */
static void dissect_zcl_illum_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_illum_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
static void decode_illum_meas_value (gchar *s, guint16 value);
@ -135,9 +135,10 @@ dissect_zbee_zcl_illum_meas(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre
*@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_illum_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_illum_meas_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 ) {
@ -168,7 +169,7 @@ dissect_zcl_illum_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset,
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_illum_meas_attr_data*/
@ -304,6 +305,7 @@ proto_reg_handoff_zbee_zcl_illum_meas(void)
ZBEE_ZCL_CID_ILLUMINANCE_MEASUREMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_illum_meas_attr_id,
hf_zbee_zcl_illum_meas_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_illum_meas_attr_data
);
@ -348,7 +350,7 @@ void proto_register_zbee_zcl_illum_level_sen(void);
void proto_reg_handoff_zbee_zcl_illum_level_sen(void);
/* Command Dissector Helpers */
static void dissect_zcl_illum_level_sen_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_illum_level_sen_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
static void decode_illum_level_sen_target_level (gchar *s, guint16 value);
@ -414,9 +416,10 @@ dissect_zbee_zcl_illum_level_sen(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot
*@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_illum_level_sen_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_illum_level_sen_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 ) {
@ -437,7 +440,7 @@ dissect_zcl_illum_level_sen_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *of
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_illum_level_sen_attr_data*/
@ -511,6 +514,7 @@ proto_reg_handoff_zbee_zcl_illum_level_sen(void)
ZBEE_ZCL_CID_ILLUMINANCE_LEVEL_SENSING,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_illum_level_sen_attr_id,
hf_zbee_zcl_illum_level_sen_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_illum_level_sen_attr_data
);
@ -558,7 +562,7 @@ void proto_register_zbee_zcl_temp_meas(void);
void proto_reg_handoff_zbee_zcl_temp_meas(void);
/* Command Dissector Helpers */
static void dissect_zcl_temp_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_temp_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
static void decode_temp_meas_value (gchar *s, gint16 value);
@ -616,9 +620,10 @@ dissect_zbee_zcl_temp_meas(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_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_temp_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_temp_meas_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 ) {
@ -644,7 +649,7 @@ dissect_zcl_temp_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset,
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -771,6 +776,7 @@ proto_reg_handoff_zbee_zcl_temp_meas(void)
ZBEE_ZCL_CID_TEMPERATURE_MEASUREMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_temp_meas_attr_id,
hf_zbee_zcl_temp_meas_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_temp_meas_attr_data
);
@ -825,7 +831,7 @@ void proto_register_zbee_zcl_press_meas(void);
void proto_reg_handoff_zbee_zcl_press_meas(void);
/* Command Dissector Helpers */
static void dissect_zcl_press_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_press_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
static void decode_press_meas_value (gchar *s, gint16 value);
@ -893,9 +899,10 @@ dissect_zbee_zcl_press_meas(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre
*@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_press_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_press_meas_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 ) {
@ -946,7 +953,7 @@ dissect_zcl_press_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset,
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_press_meas_attr_data*/
@ -1093,6 +1100,7 @@ proto_reg_handoff_zbee_zcl_press_meas(void)
ZBEE_ZCL_CID_PRESSURE_MEASUREMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_press_meas_attr_id,
hf_zbee_zcl_press_meas_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_press_meas_attr_data
);
@ -1139,7 +1147,7 @@ void proto_register_zbee_zcl_flow_meas(void);
void proto_reg_handoff_zbee_zcl_flow_meas(void);
/* Command Dissector Helpers */
static void dissect_zcl_flow_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_flow_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
static void decode_flow_meas_value (gchar *s, guint16 value);
@ -1197,9 +1205,10 @@ dissect_zbee_zcl_flow_meas(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_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_flow_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_flow_meas_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 ) {
@ -1225,7 +1234,7 @@ dissect_zcl_flow_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset,
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_flow_meas_attr_data*/
@ -1356,6 +1365,7 @@ proto_reg_handoff_zbee_zcl_flow_meas(void)
ZBEE_ZCL_CID_FLOW_MEASUREMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_flow_meas_attr_id,
hf_zbee_zcl_flow_meas_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_flow_meas_attr_data
);
@ -1402,7 +1412,7 @@ void proto_register_zbee_zcl_relhum_meas(void);
void proto_reg_handoff_zbee_zcl_relhum_meas(void);
/* Command Dissector Helpers */
static void dissect_zcl_relhum_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_relhum_meas_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
static void decode_relhum_meas_value (gchar *s, guint16 value);
@ -1460,9 +1470,10 @@ dissect_zbee_zcl_relhum_meas(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tr
*@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_relhum_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_relhum_meas_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 ) {
@ -1488,7 +1499,7 @@ dissect_zcl_relhum_meas_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset
break;
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_relhum_meas_attr_data*/
@ -1614,6 +1625,7 @@ proto_reg_handoff_zbee_zcl_relhum_meas(void)
ZBEE_ZCL_CID_REL_HUMIDITY_MEASUREMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_relhum_meas_attr_id,
hf_zbee_zcl_relhum_meas_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_relhum_meas_attr_data
);
@ -1660,7 +1672,7 @@ void proto_register_zbee_zcl_occ_sen(void);
void proto_reg_handoff_zbee_zcl_occ_sen(void);
/* Command Dissector Helpers */
static void dissect_zcl_occ_sen_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_occ_sen_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/*************************/
/* Global Variables */
@ -1724,9 +1736,10 @@ dissect_zbee_zcl_occ_sen(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_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_occ_sen_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_occ_sen_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
static const int *occupancy[] = {
&hf_zbee_zcl_occ_sen_occupancy_occupied,
@ -1753,7 +1766,7 @@ dissect_zcl_occ_sen_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, gu
case ZBEE_ZCL_ATTR_ID_OCC_SEN_USONIC_UNOCC_TO_OCC_DELAY:
case ZBEE_ZCL_ATTR_ID_OCC_SEN_USONIC_UNOCC_TO_OCC_THOLD:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_occ_sen_attr_data*/
@ -1814,6 +1827,7 @@ proto_reg_handoff_zbee_zcl_occ_sen(void)
ZBEE_ZCL_CID_OCCUPANCY_SENSING,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_occ_sen_attr_id,
hf_zbee_zcl_occ_sen_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_occ_sen_attr_data
);

View File

@ -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

View File

@ -432,7 +432,7 @@ proto_reg_handoff_zbee_zcl_ias_ace(void)
ett_zbee_zcl_ias_ace,
ZBEE_ZCL_CID_IAS_ACE,
ZBEE_MFG_CODE_NONE,
-1,
-1, -1,
hf_zbee_zcl_ias_ace_srv_rx_cmd_id,
hf_zbee_zcl_ias_ace_srv_tx_cmd_id,
NULL
@ -469,7 +469,7 @@ void proto_register_zbee_zcl_ias_wd(void);
void proto_reg_handoff_zbee_zcl_ias_wd(void);
/* Command Dissector Helpers */
static void dissect_zcl_ias_wd_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_ias_wd_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
static void dissect_zcl_ias_wd_start_warning (tvbuff_t *tvb, proto_tree *tree, guint *offset);
static void dissect_zcl_ias_wd_squawk (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -662,15 +662,16 @@ dissect_zcl_ias_wd_squawk(tvbuff_t *tvb, proto_tree *tree, guint *offset)
*@param offset pointer to buffer offset
*@param attr_id attribute identifier
*@param data_type attribute data type
*@param client_attr ZCL client
*/
void
dissect_zcl_ias_wd_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_ias_wd_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) {
case ZBEE_ZCL_ATTR_ID_IAS_WD_MAX_DURATION:
default:
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
@ -748,6 +749,7 @@ proto_reg_handoff_zbee_zcl_ias_wd(void)
ZBEE_ZCL_CID_IAS_WD,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_ias_wd_attr_id,
hf_zbee_zcl_ias_wd_attr_id,
hf_zbee_zcl_ias_wd_srv_rx_cmd_id,
-1,
(zbee_zcl_fn_attr_data)dissect_zcl_ias_wd_attr_data

View File

@ -103,7 +103,7 @@ void proto_register_zbee_zcl_keep_alive(void);
void proto_reg_handoff_zbee_zcl_keep_alive(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_keep_alive_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_keep_alive_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/*************************/
/* Global Variables */
@ -132,9 +132,10 @@ static gint ett_zbee_zcl_keep_alive = -1;
*@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_keep_alive_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_keep_alive_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) {
@ -155,7 +156,7 @@ dissect_zcl_keep_alive_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset,
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_keep_alive_attr_data*/
@ -227,6 +228,7 @@ proto_reg_handoff_zbee_zcl_keep_alive(void)
ZBEE_ZCL_CID_KEEP_ALIVE,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_keep_alive_attr_id,
hf_zbee_zcl_keep_alive_attr_id,
-1, -1,
(zbee_zcl_fn_attr_data)dissect_zcl_keep_alive_attr_data
);
@ -1375,7 +1377,7 @@ void proto_register_zbee_zcl_price(void);
void proto_reg_handoff_zbee_zcl_price(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_price_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_price_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_price_get_current_price (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -1561,9 +1563,10 @@ static const int * ett_zbee_zcl_price_tariff_type_mask[] = {
*@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_price_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_price_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -1573,7 +1576,7 @@ dissect_zcl_price_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guin
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_price_attr_data*/
@ -3547,6 +3550,7 @@ proto_reg_handoff_zbee_zcl_price(void)
ZBEE_ZCL_CID_PRICE,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_price_attr_id,
hf_zbee_zcl_price_attr_id,
hf_zbee_zcl_price_srv_rx_cmd_id,
hf_zbee_zcl_price_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_price_attr_data
@ -3594,7 +3598,7 @@ void proto_register_zbee_zcl_drlc(void);
void proto_reg_handoff_zbee_zcl_drlc(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_drlc_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_drlc_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/*************************/
/* Global Variables */
@ -3623,9 +3627,10 @@ static gint ett_zbee_zcl_drlc = -1;
*@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_drlc_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_drlc_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -3635,7 +3640,7 @@ dissect_zcl_drlc_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_drlc_attr_data*/
@ -3784,6 +3789,7 @@ proto_reg_handoff_zbee_zcl_drlc(void)
ZBEE_ZCL_CID_DEMAND_RESPONSE_LOAD_CONTROL,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_drlc_attr_id,
hf_zbee_zcl_drlc_attr_id,
hf_zbee_zcl_drlc_srv_rx_cmd_id,
hf_zbee_zcl_drlc_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_drlc_attr_data
@ -3795,16 +3801,16 @@ proto_reg_handoff_zbee_zcl_drlc(void)
/* ########################################################################## */
/* Attributes */
#define zbee_zcl_met_attr_names_VALUE_STRING_LIST(XXX) \
/* Client: Notification AttributeSet / Server: Reading Information Set */ \
XXX(ZBEE_ZCL_ATTR_ID_MET_FUNC_NOTI_FLAGS_CUR_SUM_DEL, 0x0000, "Client: Functional Notification Flags / Server: Current Summation Delivered" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_2_CUR_SUM_RECV, 0x0001, "Client: Notification Flags 2 / Server: Current Summation Received" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_3_CUR_MAX_DE_DEL, 0x0002, "Client: Notification Flags 3 / Server: Current Max Demand Delivered" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_4_CUR_MAX_DE_RECV, 0x0003, "Client: Notification Flags 4 / Server: Current Max Demand Received" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_5_DFT_SUM, 0x0004, "Client: Notification Flags 5 / Server: DFTSummation" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_6_DAI_FREE_TIME, 0x0005, "Client: Notification Flags 6 / Server: Daily Freeze Time" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_7_POW_FAC, 0x0006, "Client: Notification Flags 7 / Server: Power Factor" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_8_READ_SNAP_TIME, 0x0007, "Client: Notification Flags 8 / Server: Reading Snapshot Time" ) \
#define zbee_zcl_met_attr_server_names_VALUE_STRING_LIST(XXX) \
/* Reading Information Set */ \
XXX(ZBEE_ZCL_ATTR_ID_MET_CUR_SUM_DEL, 0x0000, "Current Summation Delivered" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CUR_SUM_RECV, 0x0001, "Current Summation Received" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CUR_MAX_DE_DEL, 0x0002, "Current Max Demand Delivered" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CUR_MAX_DE_RECV, 0x0003, "Current Max Demand Received" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_DFT_SUM, 0x0004, "DFTSummation" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_DAILY_FREEZE_TIME, 0x0005, "Daily Freeze Time" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_POWER_FACTOR, 0x0006, "Power Factor" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_READ_SNAP_TIME, 0x0007, "Reading Snapshot Time" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CUR_MAX_DEMAND_DEL_TIME, 0x0008, "Current Max Demand Delivered Time" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CUR_MAX_DEMAND_RECV_TIME, 0x0009, "Current Max Demand Received Time" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_DEFAULT_UPDATE_PERIOD, 0x000A, "Default Update Period" ) \
@ -4672,9 +4678,25 @@ proto_reg_handoff_zbee_zcl_drlc(void)
/* Smart Energy */ \
XXX(ZBEE_ZCL_ATTR_ID_SE_ATTR_REPORT_STATUS_MET, 0xFFFE, "Attribute Reporting Status" )
VALUE_STRING_ENUM(zbee_zcl_met_attr_names);
VALUE_STRING_ARRAY(zbee_zcl_met_attr_names);
static value_string_ext zbee_zcl_met_attr_names_ext = VALUE_STRING_EXT_INIT(zbee_zcl_met_attr_names);
VALUE_STRING_ENUM(zbee_zcl_met_attr_server_names);
VALUE_STRING_ARRAY(zbee_zcl_met_attr_server_names);
static value_string_ext zbee_zcl_met_attr_server_names_ext = VALUE_STRING_EXT_INIT(zbee_zcl_met_attr_server_names);
#define zbee_zcl_met_attr_client_names_VALUE_STRING_LIST(XXX) \
/* Notification AttributeSet*/ \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_FUNC_NOTI_FLAGS, 0x0000, "Functional Notification Flags" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_2, 0x0001, "Notification Flags 2" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_3, 0x0002, "Notification Flags 3" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_4, 0x0003, "Notification Flags 4" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_5, 0x0004, "Notification Flags 5" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_6, 0x0005, "Notification Flags 6" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_7, 0x0006, "Notification Flags 7" ) \
XXX(ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_8, 0x0007, "Notification Flags 8" ) \
/* Smart Energy */ \
XXX(ZBEE_ZCL_ATTR_ID_SE_ATTR_REPORT_STATUS_MET_CLNT, 0xFFFE, "Attribute Reporting Status" )
VALUE_STRING_ENUM(zbee_zcl_met_attr_client_names);
VALUE_STRING_ARRAY(zbee_zcl_met_attr_client_names);
/* Server Commands Received */
#define zbee_zcl_met_srv_rx_cmd_names_VALUE_STRING_LIST(XXX) \
@ -4802,7 +4824,7 @@ void proto_register_zbee_zcl_met(void);
void proto_reg_handoff_zbee_zcl_met(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_met_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_met_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_met_request_mirror_rsp (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -4823,7 +4845,8 @@ static int proto_zbee_zcl_met = -1;
static int hf_zbee_zcl_met_srv_tx_cmd_id = -1;
static int hf_zbee_zcl_met_srv_rx_cmd_id = -1;
static int hf_zbee_zcl_met_attr_id = -1;
static int hf_zbee_zcl_met_attr_server_id = -1;
static int hf_zbee_zcl_met_attr_client_id = -1;
static int hf_zbee_zcl_met_attr_reporting_status = -1;
static int hf_zbee_zcl_met_func_noti_flags = -1;
@ -4949,19 +4972,20 @@ static gint ett_zbee_zcl_met_noti_flags_5 = -1;
*@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_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
case ZBEE_ZCL_ATTR_ID_SE_ATTR_REPORT_STATUS_MET:
proto_tree_add_item(tree, hf_zbee_zcl_met_attr_reporting_status, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
if (client_attr) {
switch (attr_id) {
/* applies to all SE clusters */
case ZBEE_ZCL_ATTR_ID_SE_ATTR_REPORT_STATUS_MET_CLNT:
proto_tree_add_item(tree, hf_zbee_zcl_met_attr_reporting_status, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
case ZBEE_ZCL_ATTR_ID_MET_FUNC_NOTI_FLAGS_CUR_SUM_DEL:
if (data_type == ZBEE_ZCL_32_BIT_BITMAP) {
case ZBEE_ZCL_ATTR_ID_MET_CLNT_FUNC_NOTI_FLAGS:
proto_item_append_text(tree, ", Functional Notification Flags");
static const int* func_noti_flags[] = {
@ -4990,14 +5014,9 @@ dissect_zcl_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_met_func_noti_flags, ett_zbee_zcl_met_func_noti_flags, func_noti_flags, ENC_LITTLE_ENDIAN);
*offset += 4;
}
else {
dissect_zcl_attr_data(tvb, tree, offset, data_type);
}
break;
break;
case ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_2_CUR_SUM_RECV:
if (data_type == ZBEE_ZCL_32_BIT_BITMAP) {
case ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_2:
proto_item_append_text(tree, ", Notification Flags 2");
static const int* noti_flags_2[] = {
@ -5022,14 +5041,9 @@ dissect_zcl_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_met_noti_flags_2, ett_zbee_zcl_met_noti_flags_2, noti_flags_2, ENC_LITTLE_ENDIAN);
*offset += 4;
}
else {
dissect_zcl_attr_data(tvb, tree, offset, data_type);
}
break;
break;
case ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_3_CUR_MAX_DE_DEL:
if (data_type == ZBEE_ZCL_32_BIT_BITMAP) {
case ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_3:
proto_item_append_text(tree, ", Notification Flags 3");
static const int* noti_flags_3[] = {
@ -5045,14 +5059,9 @@ dissect_zcl_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_met_noti_flags_3, ett_zbee_zcl_met_noti_flags_3, noti_flags_3, ENC_LITTLE_ENDIAN);
*offset += 4;
}
else {
dissect_zcl_attr_data(tvb, tree, offset, data_type);
}
break;
break;
case ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_4_CUR_MAX_DE_RECV:
if (data_type == ZBEE_ZCL_32_BIT_BITMAP) {
case ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_4:
proto_item_append_text(tree, ", Notification Flags 4");
static const int* noti_flags_4[] = {
@ -5074,14 +5083,9 @@ dissect_zcl_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_met_noti_flags_4, ett_zbee_zcl_met_noti_flags_4, noti_flags_4, ENC_LITTLE_ENDIAN);
*offset += 4;
}
else {
dissect_zcl_attr_data(tvb, tree, offset, data_type);
}
break;
break;
case ZBEE_ZCL_ATTR_ID_MET_NOTI_FLAGS_5_DFT_SUM:
if (data_type == ZBEE_ZCL_32_BIT_BITMAP) {
case ZBEE_ZCL_ATTR_ID_MET_CLNT_NOTI_FLAGS_5:
proto_item_append_text(tree, ", Notification Flags 5");
static const int* noti_flags_5[] = {
@ -5100,15 +5104,25 @@ dissect_zcl_met_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_met_noti_flags_5, ett_zbee_zcl_met_noti_flags_5, noti_flags_5, ENC_LITTLE_ENDIAN);
*offset += 4;
}
else {
dissect_zcl_attr_data(tvb, tree, offset, data_type);
}
break;
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
}
else {
switch (attr_id) {
/* applies to all SE clusters */
case ZBEE_ZCL_ATTR_ID_SE_ATTR_REPORT_STATUS_MET:
proto_tree_add_item(tree, hf_zbee_zcl_met_attr_reporting_status, tvb, *offset, 1, ENC_NA);
*offset += 1;
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
}
} /*dissect_zcl_met_attr_data*/
@ -5469,8 +5483,12 @@ proto_register_zbee_zcl_met(void)
{
static hf_register_info hf[] = {
{ &hf_zbee_zcl_met_attr_id,
{ "Attribute", "zbee_zcl_se.met.attr_id", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &zbee_zcl_met_attr_names_ext,
{ &hf_zbee_zcl_met_attr_server_id,
{ "Attribute", "zbee_zcl_se.met.attr_id", FT_UINT16, BASE_HEX | BASE_EXT_STRING, &zbee_zcl_met_attr_server_names_ext,
0x0, NULL, HFILL } },
{ &hf_zbee_zcl_met_attr_client_id,
{ "Attribute", "zbee_zcl_se.met.attr_client_id", FT_UINT16, BASE_HEX, VALS(zbee_zcl_met_attr_client_names),
0x0, NULL, HFILL } },
{ &hf_zbee_zcl_met_attr_reporting_status, /* common to all SE clusters */
@ -5930,7 +5948,8 @@ proto_reg_handoff_zbee_zcl_met(void)
ett_zbee_zcl_met,
ZBEE_ZCL_CID_SIMPLE_METERING,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_met_attr_id,
hf_zbee_zcl_met_attr_server_id,
hf_zbee_zcl_met_attr_client_id,
hf_zbee_zcl_met_srv_rx_cmd_id,
hf_zbee_zcl_met_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_met_attr_data
@ -5997,7 +6016,7 @@ void proto_register_zbee_zcl_msg(void);
void proto_reg_handoff_zbee_zcl_msg(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_msg_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_msg_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_msg_display (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -6076,9 +6095,10 @@ static const value_string zbee_zcl_msg_ctrl_importance_names[] = {
*@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_msg_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_msg_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* no cluster specific attributes */
@ -6090,7 +6110,7 @@ dissect_zcl_msg_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
break;
default: /* Catch all */
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*/
@ -6547,6 +6567,7 @@ proto_reg_handoff_zbee_zcl_msg(void)
ZBEE_ZCL_CID_MESSAGE,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_msg_attr_id,
hf_zbee_zcl_msg_attr_id,
hf_zbee_zcl_msg_srv_rx_cmd_id,
hf_zbee_zcl_msg_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_msg_attr_data
@ -6599,7 +6620,7 @@ void proto_register_zbee_zcl_tun(void);
void proto_reg_handoff_zbee_zcl_tun(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_tun_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_tun_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Private functions prototype */
@ -6680,9 +6701,10 @@ VALUE_STRING_ARRAY(zbee_zcl_tun_status_names);
*@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_tun_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_tun_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* cluster specific attributes */
@ -6698,7 +6720,7 @@ dissect_zcl_tun_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint1
break;
default: /* Catch all */
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*/
@ -7135,6 +7157,7 @@ proto_reg_handoff_zbee_zcl_tun(void)
ZBEE_ZCL_CID_TUNNELING,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_tun_attr_id,
hf_zbee_zcl_tun_attr_id,
hf_zbee_zcl_tun_srv_rx_cmd_id,
hf_zbee_zcl_tun_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_tun_attr_data
@ -7327,7 +7350,7 @@ void proto_register_zbee_zcl_pp(void);
void proto_reg_handoff_zbee_zcl_pp(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_pp_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_pp_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_pp_select_available_emergency_credit (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -7457,9 +7480,10 @@ static gint ett_zbee_zcl_pp_publish_debt_log_entry[ZBEE_ZCL_SE_PP_NUM_PUBLISH_DE
*@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_pp_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_pp_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -7469,7 +7493,7 @@ dissect_zcl_pp_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_pp_attr_data*/
@ -8533,6 +8557,7 @@ proto_reg_handoff_zbee_zcl_pp(void)
ZBEE_ZCL_CID_PRE_PAYMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_pp_attr_id,
hf_zbee_zcl_pp_attr_id,
hf_zbee_zcl_pp_srv_rx_cmd_id,
hf_zbee_zcl_pp_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_pp_attr_data
@ -8580,7 +8605,7 @@ void proto_register_zbee_zcl_energy_management(void);
void proto_reg_handoff_zbee_zcl_energy_management(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_energy_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_energy_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/*************************/
/* Global Variables */
@ -8609,9 +8634,10 @@ static gint ett_zbee_zcl_energy_management = -1;
*@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_energy_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_energy_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -8621,7 +8647,7 @@ dissect_zcl_energy_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_energy_management_attr_data*/
@ -8758,6 +8784,7 @@ proto_reg_handoff_zbee_zcl_energy_management(void)
ZBEE_ZCL_CID_ENERGY_MANAGEMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_energy_management_attr_id,
hf_zbee_zcl_energy_management_attr_id,
hf_zbee_zcl_energy_management_srv_rx_cmd_id,
hf_zbee_zcl_energy_management_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_energy_management_attr_data
@ -8817,7 +8844,7 @@ void proto_register_zbee_zcl_calendar(void);
void proto_reg_handoff_zbee_zcl_calendar(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_calendar_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_calendar_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_calendar_get_calendar (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -8920,9 +8947,10 @@ VALUE_STRING_ARRAY(zbee_zcl_calendar_time_reference_names);
*@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_calendar_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_calendar_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -8932,7 +8960,7 @@ dissect_zcl_calendar_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, g
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_calendar_attr_data*/
@ -9730,6 +9758,7 @@ proto_reg_handoff_zbee_zcl_calendar(void)
ZBEE_ZCL_CID_CALENDAR,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_calendar_attr_id,
hf_zbee_zcl_calendar_attr_id,
hf_zbee_zcl_calendar_srv_rx_cmd_id,
hf_zbee_zcl_calendar_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_calendar_attr_data
@ -9806,7 +9835,7 @@ void proto_register_zbee_zcl_device_management(void);
void proto_reg_handoff_zbee_zcl_device_management(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_device_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_device_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/*************************/
/* Global Variables */
@ -9835,9 +9864,10 @@ static gint ett_zbee_zcl_device_management = -1;
*@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_device_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_device_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -9847,7 +9877,7 @@ dissect_zcl_device_management_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_device_management_attr_data*/
@ -10026,6 +10056,7 @@ proto_reg_handoff_zbee_zcl_device_management(void)
ZBEE_ZCL_CID_DEVICE_MANAGEMENT,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_device_management_attr_id,
hf_zbee_zcl_device_management_attr_id,
hf_zbee_zcl_device_management_srv_rx_cmd_id,
hf_zbee_zcl_device_management_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_device_management_attr_data
@ -10069,7 +10100,7 @@ void proto_register_zbee_zcl_events(void);
void proto_reg_handoff_zbee_zcl_events(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_events_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_events_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_events_get_event_log (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -10131,9 +10162,10 @@ static gint ett_zbee_zcl_events_publish_event_log_entry[ZBEE_ZCL_SE_EVENTS_NUM_P
*@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_events_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_events_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr)
{
switch (attr_id) {
/* applies to all SE clusters */
@ -10143,7 +10175,7 @@ dissect_zcl_events_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, gui
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_events_attr_data*/
@ -10554,6 +10586,7 @@ proto_reg_handoff_zbee_zcl_events(void)
ZBEE_ZCL_CID_EVENTS,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_events_attr_id,
hf_zbee_zcl_events_attr_id,
hf_zbee_zcl_events_srv_rx_cmd_id,
hf_zbee_zcl_events_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_events_attr_data
@ -10592,7 +10625,7 @@ void proto_register_zbee_zcl_mdu_pairing(void);
void proto_reg_handoff_zbee_zcl_mdu_pairing(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_mdu_pairing_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_mdu_pairing_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_mdu_pairing_request (tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -10632,9 +10665,10 @@ static gint ett_zbee_zcl_mdu_pairing = -1;
*@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_mdu_pairing_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_mdu_pairing_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) {
@ -10645,7 +10679,7 @@ dissect_zcl_mdu_pairing_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset
break;
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_mdu_pairing_attr_data*/
@ -10866,6 +10900,7 @@ proto_reg_handoff_zbee_zcl_mdu_pairing(void)
ZBEE_ZCL_CID_MDU_PAIRING,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_mdu_pairing_attr_id,
hf_zbee_zcl_mdu_pairing_attr_id,
hf_zbee_zcl_mdu_pairing_srv_rx_cmd_id,
hf_zbee_zcl_mdu_pairing_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_mdu_pairing_attr_data
@ -10909,7 +10944,7 @@ void proto_register_zbee_zcl_sub_ghz(void);
void proto_reg_handoff_zbee_zcl_sub_ghz(void);
/* Attribute Dissector Helpers */
static void dissect_zcl_sub_ghz_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
static void dissect_zcl_sub_ghz_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
/* Command Dissector Helpers */
static void dissect_zcl_sub_ghz_suspend_zcl_messages(tvbuff_t *tvb, proto_tree *tree, guint *offset);
@ -10942,9 +10977,10 @@ static gint ett_zbee_zcl_sub_ghz = -1;
*@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_sub_ghz_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type)
dissect_zcl_sub_ghz_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) {
@ -10960,7 +10996,7 @@ dissect_zcl_sub_ghz_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, gu
case ZBEE_ZCL_ATTR_ID_SUB_GHZ_PAGE_30_CHANNEL_MASK:
case ZBEE_ZCL_ATTR_ID_SUB_GHZ_PAGE_31_CHANNEL_MASK:
default: /* Catch all */
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
break;
}
} /*dissect_zcl_sub_ghz_attr_data*/
@ -11119,6 +11155,7 @@ proto_reg_handoff_zbee_zcl_sub_ghz(void)
ZBEE_ZCL_CID_SUB_GHZ,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_sub_ghz_attr_id,
hf_zbee_zcl_sub_ghz_attr_id,
hf_zbee_zcl_sub_ghz_srv_rx_cmd_id,
hf_zbee_zcl_sub_ghz_srv_tx_cmd_id,
(zbee_zcl_fn_attr_data)dissect_zcl_sub_ghz_attr_data
@ -11686,6 +11723,7 @@ proto_reg_handoff_zbee_zcl_ke(void)
ZBEE_ZCL_CID_KE,
ZBEE_MFG_CODE_NONE,
hf_zbee_zcl_ke_attr_id,
hf_zbee_zcl_ke_attr_id,
hf_zbee_zcl_ke_srv_rx_cmd_id,
hf_zbee_zcl_ke_srv_tx_cmd_id,
NULL

View File

@ -31,24 +31,24 @@ void proto_register_zbee_zcl(void);
void proto_reg_handoff_zbee_zcl(void);
/* Command Dissector Helpers */
static void dissect_zcl_write_attr_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_config_report (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_config_report_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_read_report_config (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_read_report_config_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_write_attr_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
static void dissect_zcl_config_report (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
static void dissect_zcl_config_report_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
static void dissect_zcl_read_report_config (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
static void dissect_zcl_read_report_config_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
static void dissect_zcl_default_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset);
static void dissect_zcl_discover_attr (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset);
static void dissect_zcl_discover_attr_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_discover_attr_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
/* Helper routines */
static void dissect_zcl_attr_data_general(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 attr_id, guint data_type, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_attr_data_type_val (tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 cmd_id, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_attr_data_general(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 attr_id, guint data_type, guint16 cluster_id, guint16 mfr_code, gboolean client_attr);
static void dissect_zcl_attr_data_type_val (tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 cmd_id, guint16 cluster_id, guint16 mfr_code, gboolean client_attr);
static guint dissect_zcl_attr_uint8 (tvbuff_t *tvb, proto_tree *tree, guint *offset, int *length);
static void dissect_zcl_attr_id (tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
static void dissect_zcl_attr_id (tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean client_attr);
static void zcl_dump_data(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree);
static void dissect_zcl_array_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num);
static void dissect_zcl_set_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num);
static void dissect_zcl_array_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num, gboolean client_attr);
static void dissect_zcl_set_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num, gboolean client_attr);
/********************
* Global Variables *
@ -896,38 +896,41 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Handle the contents of the command frame. */
switch ( packet.cmd_id ) {
case ZBEE_ZCL_CMD_READ_ATTR:
dissect_zcl_read_attr(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_read_attr(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_READ_ATTR_RESP:
dissect_zcl_read_attr_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_read_attr_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_WRITE_ATTR:
case ZBEE_ZCL_CMD_WRITE_ATTR_UNDIVIDED:
case ZBEE_ZCL_CMD_WRITE_ATTR_NO_RESP:
dissect_zcl_write_attr(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_REPORT_ATTR:
dissect_zcl_write_attr(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_report_attr(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_WRITE_ATTR_RESP:
dissect_zcl_write_attr_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_write_attr_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_CONFIG_REPORT:
dissect_zcl_config_report(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_config_report(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_CONFIG_REPORT_RESP:
dissect_zcl_config_report_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_config_report_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_READ_REPORT_CONFIG:
dissect_zcl_read_report_config(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_read_report_config(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_READ_REPORT_CONFIG_RESP:
dissect_zcl_read_report_config_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_read_report_config_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
case ZBEE_ZCL_CMD_DEFAULT_RESP:
@ -939,7 +942,7 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case ZBEE_ZCL_CMD_DISCOVER_ATTR_RESP:
dissect_zcl_discover_attr_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code);
dissect_zcl_discover_attr_resp(tvb, pinfo, zcl_tree, &offset, cluster_id, packet.mfr_code, packet.direction);
break;
/* BUGBUG: don't dissect these for now */
@ -962,15 +965,17 @@ static int dissect_zbee_zcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*@param offset pointer from caller.
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
void dissect_zcl_read_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code)
void dissect_zcl_read_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
guint tvb_len;
gboolean client_attr = direction == ZBEE_ZCL_FCF_TO_CLIENT;
tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len ) {
/* Dissect the attribute identifier */
dissect_zcl_attr_id(tvb, tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, tree, offset, cluster_id, mfr_code, client_attr);
}
return;
@ -985,14 +990,16 @@ void dissect_zcl_read_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
void dissect_zcl_read_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code)
void dissect_zcl_read_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
guint tvb_len;
guint i = 0;
guint16 attr_id;
gboolean client_attr = direction == ZBEE_ZCL_FCF_TO_SERVER;
tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
@ -1003,14 +1010,14 @@ void dissect_zcl_read_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
/* Dissect the attribute identifier */
attr_id = tvb_get_letohs(tvb, *offset);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, client_attr);
/* Dissect the status and optionally the data type and value */
if ( dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_status)
== ZBEE_ZCL_STAT_SUCCESS ) {
/* Dissect the attribute data type and data */
dissect_zcl_attr_data_type_val(tvb, sub_tree, offset, attr_id, cluster_id, mfr_code);
dissect_zcl_attr_data_type_val(tvb, sub_tree, offset, attr_id, cluster_id, mfr_code, client_attr);
}
/* Set end for subtree */
@ -1027,14 +1034,16 @@ void dissect_zcl_read_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
void dissect_zcl_write_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code)
void dissect_zcl_write_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
guint tvb_len;
guint i = 0;
guint16 attr_id;
gboolean client_attr = direction == ZBEE_ZCL_FCF_TO_CLIENT;
tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
@ -1045,16 +1054,55 @@ void dissect_zcl_write_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
/* Dissect the attribute identifier */
attr_id = tvb_get_letohs(tvb, *offset);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, client_attr);
/* Dissect the attribute data type and data */
dissect_zcl_attr_data_type_val(tvb, sub_tree, offset, attr_id, cluster_id, mfr_code);
dissect_zcl_attr_data_type_val(tvb, sub_tree, offset, attr_id, cluster_id, mfr_code, client_attr);
/* Set end for subtree */
proto_item_set_end(proto_tree_get_parent(sub_tree), tvb, *offset);
}
} /* dissect_zcl_write_attr */
/**
*Helper dissector for ZCL Report Attribute commands.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
*@param tree pointer to data tree wireshark uses to display packet.
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
void dissect_zcl_report_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
guint tvb_len;
guint i = 0;
guint16 attr_id;
gboolean client_attr = direction == ZBEE_ZCL_FCF_TO_SERVER;
tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
/* Create subtree for attribute status field */
sub_tree = proto_tree_add_subtree(tree, tvb, *offset, 0, ett_zbee_zcl_attr[i], NULL, "Attribute Field");
i++;
/* Dissect the attribute identifier */
attr_id = tvb_get_letohs(tvb, *offset);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, client_attr);
/* Dissect the attribute data type and data */
dissect_zcl_attr_data_type_val(tvb, sub_tree, offset, attr_id, cluster_id, mfr_code, client_attr);
/* Set end for subtree */
proto_item_set_end(proto_tree_get_parent(sub_tree), tvb, *offset);
}
} /* dissect_zcl_report_attr */
/**
*Helper dissector for ZCL Write Attribute Response command.
*
@ -1064,13 +1112,15 @@ void dissect_zcl_write_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
static void dissect_zcl_write_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code)
static void dissect_zcl_write_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
guint tvb_len;
guint i = 0;
gboolean client_attr = direction == ZBEE_ZCL_FCF_TO_SERVER;
tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
@ -1084,7 +1134,7 @@ static void dissect_zcl_write_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, p
ZBEE_ZCL_STAT_SUCCESS ) {
/* Dissect the failed attribute identifier */
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, client_attr);
}
/* Set end for subtree */
@ -1102,9 +1152,10 @@ static void dissect_zcl_write_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, p
*@param offset pointer to offset from caller
*@param cluster_id cluster identification
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
static void dissect_zcl_read_report_config_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint *offset, guint16 cluster_id, guint16 mfr_code)
guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
@ -1130,7 +1181,8 @@ static void dissect_zcl_read_report_config_resp(tvbuff_t *tvb, packet_info *pinf
/* Dissect the attribute id */
attr_id = tvb_get_letohs(tvb, *offset);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, (direction == ZBEE_ZCL_FCF_TO_SERVER && attr_dir == ZBEE_ZCL_DIR_REPORTED) ||
(direction == ZBEE_ZCL_FCF_TO_CLIENT && attr_dir == ZBEE_ZCL_DIR_RECEIVED));
if ( attr_status == ZBEE_ZCL_STAT_SUCCESS ) {
if ( attr_dir == ZBEE_ZCL_DIR_REPORTED ) {
@ -1149,7 +1201,7 @@ static void dissect_zcl_read_report_config_resp(tvbuff_t *tvb, packet_info *pinf
if ( IS_ANALOG_SUBTYPE(data_type) ) {
/* Dissect reportable change */
dissect_zcl_attr_data_general(tvb, sub_tree, offset, attr_id, data_type, cluster_id, mfr_code);
dissect_zcl_attr_data_general(tvb, sub_tree, offset, attr_id, data_type, cluster_id, mfr_code, direction == ZBEE_ZCL_FCF_TO_SERVER);
}
} else {
@ -1163,7 +1215,7 @@ static void dissect_zcl_read_report_config_resp(tvbuff_t *tvb, packet_info *pinf
} /* dissect_zcl_read_report_config_resp */
/**
*Helper dissector for ZCL Report Attribute commands.
*Helper dissector for ZCL Config Report Attribute commands.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
@ -1171,8 +1223,9 @@ static void dissect_zcl_read_report_config_resp(tvbuff_t *tvb, packet_info *pinf
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code)
static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
@ -1194,7 +1247,7 @@ static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, pro
/* Dissect the attribute id */
attr_id = tvb_get_letohs(tvb, *offset);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, direction == ZBEE_ZCL_FCF_TO_CLIENT);
/* Dissect the attribute data type */
data_type = dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_data_type);
@ -1209,12 +1262,12 @@ static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, pro
if ( IS_ANALOG_SUBTYPE(data_type) ) {
/* Dissect reportable change */
dissect_zcl_attr_data_general(tvb, sub_tree, offset, attr_id, data_type, cluster_id, mfr_code);
dissect_zcl_attr_data_general(tvb, sub_tree, offset, attr_id, data_type, cluster_id, mfr_code, direction == ZBEE_ZCL_FCF_TO_CLIENT);
}
} else {
/* Dissect the attribute id */
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, direction == ZBEE_ZCL_FCF_TO_SERVER);
/* Dissect timeout period */
proto_tree_add_item(tree, hf_zbee_zcl_attr_timeout, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
@ -1225,7 +1278,7 @@ static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, pro
} /* dissect_zcl_config_report */
/**
*Helper dissector for ZCL Report Attribute commands.
*Helper dissector for ZCL Config Report Attribute Response commands.
*
*@param tvb pointer to buffer containing raw packet.
*@param pinfo pointer to packet information fields
@ -1233,9 +1286,10 @@ static void dissect_zcl_config_report(tvbuff_t *tvb, packet_info *pinfo _U_, pro
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
static void dissect_zcl_config_report_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint *offset, guint16 cluster_id, guint16 mfr_code)
guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
@ -1254,6 +1308,8 @@ static void dissect_zcl_config_report_resp(tvbuff_t *tvb, packet_info *pinfo _U_
}
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
guint8 attr_dir;
/* Create subtree for attribute status field */
sub_tree = proto_tree_add_subtree(tree, tvb, *offset, 3, ett_zbee_zcl_attr[i], NULL, "Attribute Status Record");
i++;
@ -1261,9 +1317,10 @@ static void dissect_zcl_config_report_resp(tvbuff_t *tvb, packet_info *pinfo _U_
/* Dissect the status */
dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_status);
/* Dissect the direction */
dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_dir);
attr_dir = dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_dir);
/* Dissect the attribute identifier */
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, (direction == ZBEE_ZCL_FCF_TO_SERVER && attr_dir == ZBEE_ZCL_DIR_REPORTED) ||
(direction == ZBEE_ZCL_FCF_TO_CLIENT && attr_dir == ZBEE_ZCL_DIR_RECEIVED));
}
} /* dissect_zcl_config_report_resp */
@ -1276,9 +1333,10 @@ static void dissect_zcl_config_report_resp(tvbuff_t *tvb, packet_info *pinfo _U_
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
static void dissect_zcl_read_report_config(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint *offset, guint16 cluster_id, guint16 mfr_code)
guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree;
@ -1287,16 +1345,18 @@ static void dissect_zcl_read_report_config(tvbuff_t *tvb, packet_info *pinfo _U_
tvb_len = tvb_captured_length(tvb);
while ( *offset < tvb_len && i < ZBEE_ZCL_NUM_ATTR_ETT ) {
guint8 attr_dir;
/* Create subtree for attribute status field */
sub_tree = proto_tree_add_subtree(tree, tvb, *offset, 3, ett_zbee_zcl_attr[i], NULL, "Attribute Status Record");
i++;
/* Dissect the direction */
dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_dir);
attr_dir = dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_dir);
/* Dissect the attribute identifier */
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, (direction == ZBEE_ZCL_FCF_TO_SERVER && attr_dir == ZBEE_ZCL_DIR_RECEIVED) ||
(direction == ZBEE_ZCL_FCF_TO_CLIENT && attr_dir == ZBEE_ZCL_DIR_REPORTED));
}
} /* dissect_zcl_read_report_config */
@ -1351,14 +1411,16 @@ static void dissect_zcl_discover_attr(tvbuff_t *tvb, packet_info *pinfo _U_, pro
*@param offset pointer to offset from caller
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param direction ZCL direction
*/
static void dissect_zcl_discover_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint *offset, guint16 cluster_id, guint16 mfr_code)
guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction)
{
proto_tree *sub_tree = NULL;
guint tvb_len;
guint i = 0;
gboolean client_attr = direction == ZBEE_ZCL_FCF_TO_SERVER;
/* XXX - tree is never available!!!*/
dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_dis);
@ -1371,7 +1433,7 @@ static void dissect_zcl_discover_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_
i++;
/* Dissect the attribute identifier */
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code);
dissect_zcl_attr_id(tvb, sub_tree, offset, cluster_id, mfr_code, client_attr);
/* Dissect the number of maximum attribute identifiers */
dissect_zcl_attr_uint8(tvb, sub_tree, offset, &hf_zbee_zcl_attr_data_type);
@ -1388,15 +1450,28 @@ static void dissect_zcl_discover_attr_resp(tvbuff_t *tvb, packet_info *pinfo _U_
*@param offset into the tvb to begin dissection.
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param client_attr ZCL client
*/
static void dissect_zcl_attr_id(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code)
static void dissect_zcl_attr_id(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean client_attr)
{
zbee_zcl_cluster_desc *desc;
int hf_attr_id = hf_zbee_zcl_attr_id;
/* Check if a cluster-specific attribute ID definition exists. */
desc = zbee_zcl_get_cluster_desc(cluster_id, mfr_code);
if (desc && (desc->hf_attr_id >= 0)) hf_attr_id = desc->hf_attr_id;
if (desc) {
if (client_attr) {
if (desc->hf_attr_client_id >= 0) {
hf_attr_id = desc->hf_attr_client_id;
}
}
else {
if (desc->hf_attr_server_id >= 0) {
hf_attr_id = desc->hf_attr_server_id;
}
}
}
/* Add the identifier. */
proto_tree_add_item(tree, hf_attr_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
@ -1412,19 +1487,20 @@ static void dissect_zcl_attr_id(tvbuff_t *tvb, proto_tree *tree, guint *offset,
*@param attr_id attribute id
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param client_attr ZCL client
*/
static void dissect_zcl_attr_data_type_val(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 attr_id, guint16 cluster_id, guint16 mfr_code)
static void dissect_zcl_attr_data_type_val(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 attr_id, guint16 cluster_id, guint16 mfr_code, gboolean client_attr)
{
zbee_zcl_cluster_desc *desc;
desc = zbee_zcl_get_cluster_desc(cluster_id, mfr_code);
if ((desc != NULL) && (desc->fn_attr_data != NULL)) {
desc->fn_attr_data(tree, tvb, offset, attr_id,
dissect_zcl_attr_uint8(tvb, tree, offset, &hf_zbee_zcl_attr_data_type));
dissect_zcl_attr_uint8(tvb, tree, offset, &hf_zbee_zcl_attr_data_type), client_attr);
}
else {
dissect_zcl_attr_data(tvb, tree, offset,
dissect_zcl_attr_uint8(tvb, tree, offset, &hf_zbee_zcl_attr_data_type) );
dissect_zcl_attr_uint8(tvb, tree, offset, &hf_zbee_zcl_attr_data_type), client_attr);
}
} /* dissect_zcl_attr_data_type_val */
@ -1440,17 +1516,18 @@ static void dissect_zcl_attr_data_type_val(tvbuff_t *tvb, proto_tree *tree, guin
*@param data_type type of data
*@param cluster_id cluster id
*@param mfr_code manufacturer code.
*@param client_attr ZCL client
*/
static void dissect_zcl_attr_data_general(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 attr_id, guint data_type, guint16 cluster_id, guint16 mfr_code)
static void dissect_zcl_attr_data_general(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint16 attr_id, guint data_type, guint16 cluster_id, guint16 mfr_code, gboolean client_attr)
{
zbee_zcl_cluster_desc *desc;
desc = zbee_zcl_get_cluster_desc(cluster_id, mfr_code);
if ((desc != NULL) && (desc->fn_attr_data != NULL)) {
desc->fn_attr_data(tree, tvb, offset, attr_id, data_type);
desc->fn_attr_data(tree, tvb, offset, attr_id, data_type, client_attr);
}
else {
dissect_zcl_attr_data(tvb, tree, offset, data_type);
dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr);
}
} /*dissect_zcl_attr_data_general*/
@ -1461,8 +1538,9 @@ static void dissect_zcl_attr_data_general(tvbuff_t *tvb, proto_tree *tree, guint
*@param tvb pointer to buffer containing raw packet.
*@param tree pointer to data tree wireshark uses to display packet.
*@param offset into the tvb to begin dissection.
*@param client_attr ZCL client
*/
void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint data_type)
void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint data_type, gboolean client_attr)
{
guint attr_uint;
gint attr_int;
@ -1758,7 +1836,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
proto_tree_add_uint(tree, hf_zbee_zcl_attr_array_elements_num, tvb, *offset, 2, elements_num);
*offset += 2;
/* BYTE ... - Elements */
dissect_zcl_array_type(tvb, tree, offset, elements_type, elements_num);
dissect_zcl_array_type(tvb, tree, offset, elements_type, elements_num, client_attr);
break;
case ZBEE_ZCL_SET:
@ -1771,7 +1849,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
proto_tree_add_uint(tree, hf_zbee_zcl_attr_set_elements_num, tvb, *offset, 2, elements_num);
*offset += 2;
/* BYTE ... - Elements */
dissect_zcl_set_type(tvb, tree, offset, elements_type, elements_num);
dissect_zcl_set_type(tvb, tree, offset, elements_type, elements_num, client_attr);
break;
case ZBEE_ZCL_BAG: /* Same as ZBEE_ZCL_SET, but using different filter fields */
@ -1784,7 +1862,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
proto_tree_add_uint(tree, hf_zbee_zcl_attr_bag_elements_num, tvb, *offset, 2, elements_num);
*offset += 2;
/* BYTE ... - Elements */
dissect_zcl_set_type(tvb, tree, offset, elements_type, elements_num);
dissect_zcl_set_type(tvb, tree, offset, elements_type, elements_num, client_attr);
break;
case ZBEE_ZCL_STRUCT:
@ -1830,7 +1908,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint
break;
case ZBEE_ZCL_ATTR_ID:
dissect_zcl_attr_id(tvb, tree, offset, zcl_cluster_id, zcl_mfr_code);
dissect_zcl_attr_id(tvb, tree, offset, zcl_cluster_id, zcl_mfr_code, client_attr);
break;
case ZBEE_ZCL_BACNET_OID:
@ -1882,9 +1960,10 @@ static guint dissect_zcl_attr_uint8(tvbuff_t *tvb, proto_tree *tree, guint *offs
*@param offset into the tvb to begin dissection.
*@param elements_type element type
*@param elements_num elements number
*@param client_attr ZCL client
*/
static void
dissect_zcl_array_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num)
dissect_zcl_array_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num, gboolean client_attr)
{
proto_tree *sub_tree;
@ -1903,7 +1982,7 @@ dissect_zcl_array_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 el
sub_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 0,
ett_zbee_zcl_array_elements[ZBEE_ZCL_NUM_ARRAY_ELEM_ETT-1], NULL, "Element #%d", i);
dissect_zcl_attr_data(tvb, sub_tree, offset, elements_type);
dissect_zcl_attr_data(tvb, sub_tree, offset, elements_type, client_attr);
elements_num--;
i++;
}
@ -1917,9 +1996,10 @@ dissect_zcl_array_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 el
*@param offset into the tvb to begin dissection.
*@param elements_type element type
*@param elements_num elements number
*@param client_attr ZCL client
*/
static void
dissect_zcl_set_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num)
dissect_zcl_set_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elements_type, guint16 elements_num, gboolean client_attr)
{
proto_tree *sub_tree;
@ -1938,7 +2018,7 @@ dissect_zcl_set_type(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 elem
sub_tree = proto_tree_add_subtree(tree, tvb, *offset, 0,
ett_zbee_zcl_array_elements[ZBEE_ZCL_NUM_ARRAY_ELEM_ETT-1], NULL, "Element");
dissect_zcl_attr_data(tvb, sub_tree, offset, elements_type);
dissect_zcl_attr_data(tvb, sub_tree, offset, elements_type, client_attr);
elements_num--;
i++;
}
@ -2331,21 +2411,22 @@ void proto_reg_handoff_zbee_zcl(void)
dissector_add_uint("zbee.profile", ZBEE_PROFILE_C4_CL, zbee_zcl_handle);
} /* proto_reg_handoff_zbee_zcl */
/**
*Register the specific cluster.
*
*@param proto_abbrev Protocol abbreviation
*@param proto dissector
*@param ett proto (not used at the moment)
*@param cluster_id cluster identification
*@param mfr_code manufacturer code.
*@param hf_attr_id cluster-specific attribute ID field.
*@param hf_attr_server_id cluster-specific server attribute ID field.
*@param hf_attr_client_id cluster-specific client attribute ID field.
*@param hf_cmd_rx_id cluster-specific client-to-server command ID field, or -1.
*@param hf_cmd_tx_id cluster-specific server-to-client command ID field, or -1.
*@param fn_attr_data specific cluster attribute data decode function
*/
void
zbee_zcl_init_cluster(const char *proto_abbrev, int proto, gint ett, guint16 cluster_id, guint16 mfr_code, int hf_attr_id, int hf_cmd_rx_id, int hf_cmd_tx_id, zbee_zcl_fn_attr_data fn_attr_data)
zbee_zcl_init_cluster(const char *proto_abbrev, int proto, gint ett, guint16 cluster_id, guint16 mfr_code, int hf_attr_server_id, int hf_attr_client_id, int hf_cmd_rx_id, int hf_cmd_tx_id, zbee_zcl_fn_attr_data fn_attr_data)
{
zbee_zcl_cluster_desc *cluster_desc;
dissector_handle_t dissector_handle;
@ -2364,7 +2445,8 @@ zbee_zcl_init_cluster(const char *proto_abbrev, int proto, gint ett, guint16 clu
cluster_desc->ett = ett;
cluster_desc->cluster_id = cluster_id;
cluster_desc->mfr_code = mfr_code;
cluster_desc->hf_attr_id = hf_attr_id;
cluster_desc->hf_attr_server_id = hf_attr_server_id;
cluster_desc->hf_attr_client_id = hf_attr_client_id;
cluster_desc->hf_cmd_rx_id = hf_cmd_rx_id;
cluster_desc->hf_cmd_tx_id = hf_cmd_tx_id;
cluster_desc->fn_attr_data = fn_attr_data;

View File

@ -178,14 +178,15 @@ typedef struct{
/* ZigBee ZCL Cluster Key */
#define ZCL_CLUSTER_MFR_KEY(cluster_id,mfr_code) (((mfr_code)<<16) | (cluster_id))
typedef void (*zbee_zcl_fn_attr_data)(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type);
typedef void (*zbee_zcl_fn_attr_data)(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr);
typedef struct _zbee_zcl_cluster_desc {
int proto_id;
protocol_t *proto;
const char *name;
int ett;
int hf_attr_id;
int hf_attr_server_id;
int hf_attr_client_id;
int hf_cmd_rx_id;
int hf_cmd_tx_id;
guint16 cluster_id;
@ -198,9 +199,10 @@ extern const value_string zbee_mfr_code_names[];
extern const value_string zbee_zcl_status_names[];
/* Dissector functions */
extern void dissect_zcl_read_attr (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
extern void dissect_zcl_write_attr (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
extern void dissect_zcl_read_attr_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code);
extern void dissect_zcl_read_attr (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
extern void dissect_zcl_write_attr (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
extern void dissect_zcl_report_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
extern void dissect_zcl_read_attr_resp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, guint16 cluster_id, guint16 mfr_code, gboolean direction);
/* Helper functions */
zbee_zcl_cluster_desc *zbee_zcl_get_cluster_desc(guint16 cluster_id, guint16 mfr_code);
@ -209,9 +211,9 @@ zbee_zcl_cluster_desc *zbee_zcl_get_cluster_desc(guint16 cluster_id, guint16 mfr
WS_DLL_PUBLIC void decode_zcl_time_in_100ms (gchar *s, guint16 value);
WS_DLL_PUBLIC void decode_zcl_time_in_seconds (gchar *s, guint16 value);
WS_DLL_PUBLIC void decode_zcl_time_in_minutes (gchar *s, guint16 value);
WS_DLL_PUBLIC void dissect_zcl_attr_data (tvbuff_t *tvb, proto_tree *tree, guint *offset, guint data_type);
WS_DLL_PUBLIC void dissect_zcl_attr_data (tvbuff_t *tvb, proto_tree *tree, guint *offset, guint data_type, gboolean client_attr);
WS_DLL_PUBLIC void zbee_zcl_init_cluster(const char *proto_abbrev, int proto, gint ett, guint16 cluster_id, guint16 mfr_code, int hf_attr_id, int hf_cmd_rx_id, int hf_cmd_tx_id, zbee_zcl_fn_attr_data fn_attr_data);
WS_DLL_PUBLIC void zbee_zcl_init_cluster(const char *proto_abbrev, int proto, gint ett, guint16 cluster_id, guint16 mfr_code, int hf_attr_server_id, int hf_attr_client_id, int hf_cmd_rx_id, int hf_cmd_tx_id, zbee_zcl_fn_attr_data fn_attr_data);
/* Cluster-specific commands and parameters */
#define ZBEE_ZCL_CSC_IAS_ZONE_C_ERC_NEP 0x02