diff options
Diffstat (limited to 'epan/dissectors/packet-zbee-zcl-general.c')
-rw-r--r-- | epan/dissectors/packet-zbee-zcl-general.c | 2950 |
1 files changed, 1495 insertions, 1455 deletions
diff --git a/epan/dissectors/packet-zbee-zcl-general.c b/epan/dissectors/packet-zbee-zcl-general.c index 70ff6359..8d8ec660 100644 --- a/epan/dissectors/packet-zbee-zcl-general.c +++ b/epan/dissectors/packet-zbee-zcl-general.c @@ -17,6 +17,7 @@ #include <epan/packet.h> #include <epan/to_str.h> #include <wsutil/bits_ctz.h> +#include <wsutil/epochs.h> #include <wsutil/utf8_entities.h> #include "packet-zbee.h" @@ -60,7 +61,7 @@ #define ZBEE_ZCL_BASIC_PWR_SRC_BATTERY 0x03 /* Battery */ #define ZBEE_ZCL_BASIC_PWR_SRC_DC_SRC 0x04 /* DC source */ #define ZBEE_ZCL_BASIC_PWR_SRC_EMERGENCY_1 0x05 /* Emergency mains constantly powered */ -#define ZBEE_ZCL_BASIC_PWR_SRC_EMERGENCY_2 0x06 /* Emergency mains and tranfer switch */ +#define ZBEE_ZCL_BASIC_PWR_SRC_EMERGENCY_2 0x06 /* Emergency mains and transfer switch */ /* Device Enable Values */ #define ZBEE_ZCL_BASIC_DISABLED 0x00 /* Disabled */ @@ -84,7 +85,7 @@ void proto_register_zbee_zcl_basic(void); void proto_reg_handoff_zbee_zcl_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -92,25 +93,25 @@ static void dissect_zcl_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint * /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_basic = -1; - -static int hf_zbee_zcl_basic_attr_id = -1; -static int hf_zbee_zcl_basic_pwr_src = -1; -static int hf_zbee_zcl_basic_dev_en = -1; -static int hf_zbee_zcl_basic_alarm_mask = -1; -static int hf_zbee_zcl_basic_alarm_mask_gen_hw_fault = -1; -static int hf_zbee_zcl_basic_alarm_mask_gen_sw_fault = -1; -static int hf_zbee_zcl_basic_alarm_mask_reserved = -1; -static int hf_zbee_zcl_basic_disable_local_cfg = -1; -static int hf_zbee_zcl_basic_disable_local_cfg_reset = -1; -static int hf_zbee_zcl_basic_disable_local_cfg_device_cfg = -1; -static int hf_zbee_zcl_basic_disable_local_cfg_reserved = -1; -static int hf_zbee_zcl_basic_srv_rx_cmd_id = -1; +static int proto_zbee_zcl_basic; + +static int hf_zbee_zcl_basic_attr_id; +static int hf_zbee_zcl_basic_pwr_src; +static int hf_zbee_zcl_basic_dev_en; +static int hf_zbee_zcl_basic_alarm_mask; +static int hf_zbee_zcl_basic_alarm_mask_gen_hw_fault; +static int hf_zbee_zcl_basic_alarm_mask_gen_sw_fault; +static int hf_zbee_zcl_basic_alarm_mask_reserved; +static int hf_zbee_zcl_basic_disable_local_cfg; +static int hf_zbee_zcl_basic_disable_local_cfg_reset; +static int hf_zbee_zcl_basic_disable_local_cfg_device_cfg; +static int hf_zbee_zcl_basic_disable_local_cfg_reserved; +static int hf_zbee_zcl_basic_srv_rx_cmd_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_basic = -1; -static gint ett_zbee_zcl_basic_alarm_mask = -1; -static gint ett_zbee_zcl_basic_dis_local_cfg = -1; +static int ett_zbee_zcl_basic; +static int ett_zbee_zcl_basic_alarm_mask; +static int ett_zbee_zcl_basic_dis_local_cfg; /* Attributes */ static const value_string zbee_zcl_basic_attr_names[] = { @@ -178,8 +179,8 @@ static int dissect_zbee_zcl_basic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; + unsigned offset = 0; + uint8_t cmd_id; /* Reject the packet if data is NULL */ if (data == NULL) @@ -225,16 +226,16 @@ dissect_zbee_zcl_basic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const alarm_mask[] = { @@ -364,7 +365,7 @@ proto_register_zbee_zcl_basic(void) }; /* ZCL Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_basic, &ett_zbee_zcl_basic_alarm_mask, &ett_zbee_zcl_basic_dis_local_cfg @@ -418,7 +419,7 @@ proto_reg_handoff_zbee_zcl_basic(void) /* Attributes */ #define ZBEE_ZCL_ATTR_ID_POWER_CONF_MAINS_VOLTAGE 0x0000 /* Mains voltage */ -#define ZBEE_ZCL_ATTR_ID_POWER_CONF_MAINS_FREQUENCY 0x0001 /* Mains frerquency */ +#define ZBEE_ZCL_ATTR_ID_POWER_CONF_MAINS_FREQUENCY 0x0001 /* Mains frequency */ #define ZBEE_ZCL_ATTR_ID_POWER_CONF_MAINS_ALARM_MASK 0x0010 /* Mains Alarm Mask */ #define ZBEE_ZCL_ATTR_ID_POWER_CONF_MAINS_VOLTAGE_MIN_THR 0x0011 /* Mains Voltage Min Threshold */ #define ZBEE_ZCL_ATTR_ID_POWER_CONF_MAINS_VOLTAGE_MAX_THR 0x0012 /* Mains Voltage Max Threshold */ @@ -464,7 +465,7 @@ void proto_register_zbee_zcl_power_config(void); void proto_reg_handoff_zbee_zcl_power_config(void); /* Command Dissector Helpers */ -static void dissect_zcl_power_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_power_config_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -472,30 +473,30 @@ static void dissect_zcl_power_config_attr_data(proto_tree *tree, tvbuff_t *tvb, /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_power_config = -1; -static int hf_zbee_zcl_power_config_attr_id = -1; -static int hf_zbee_zcl_power_config_batt_type = -1; -static int hf_zbee_zcl_power_config_mains_alarm_mask = -1; -static int hf_zbee_zcl_power_config_mains_alarm_mask_low = -1; -static int hf_zbee_zcl_power_config_mains_alarm_mask_high = -1; -static int hf_zbee_zcl_power_config_mains_alarm_mask_reserved = -1; -static int hf_zbee_zcl_power_config_batt_alarm_mask = -1; -static int hf_zbee_zcl_power_config_batt_alarm_mask_low = -1; -static int hf_zbee_zcl_power_config_batt_alarm_mask_reserved = -1; -static int hf_zbee_zcl_power_config_mains_voltage = -1; -static int hf_zbee_zcl_power_config_mains_frequency = -1; -static int hf_zbee_zcl_power_config_mains_voltage_min_thr = -1; -static int hf_zbee_zcl_power_config_mains_voltage_max_thr = -1; -static int hf_zbee_zcl_power_config_mains_voltage_dwell_tp = -1; -static int hf_zbee_zcl_power_config_batt_voltage = -1; -static int hf_zbee_zcl_power_config_batt_percentage = -1; -static int hf_zbee_zcl_power_config_batt_ah_rating = -1; -static int hf_zbee_zcl_power_config_batt_rated_voltage = -1; -static int hf_zbee_zcl_power_config_batt_voltage_min_thr = -1; +static int proto_zbee_zcl_power_config; +static int hf_zbee_zcl_power_config_attr_id; +static int hf_zbee_zcl_power_config_batt_type; +static int hf_zbee_zcl_power_config_mains_alarm_mask; +static int hf_zbee_zcl_power_config_mains_alarm_mask_low; +static int hf_zbee_zcl_power_config_mains_alarm_mask_high; +static int hf_zbee_zcl_power_config_mains_alarm_mask_reserved; +static int hf_zbee_zcl_power_config_batt_alarm_mask; +static int hf_zbee_zcl_power_config_batt_alarm_mask_low; +static int hf_zbee_zcl_power_config_batt_alarm_mask_reserved; +static int hf_zbee_zcl_power_config_mains_voltage; +static int hf_zbee_zcl_power_config_mains_frequency; +static int hf_zbee_zcl_power_config_mains_voltage_min_thr; +static int hf_zbee_zcl_power_config_mains_voltage_max_thr; +static int hf_zbee_zcl_power_config_mains_voltage_dwell_tp; +static int hf_zbee_zcl_power_config_batt_voltage; +static int hf_zbee_zcl_power_config_batt_percentage; +static int hf_zbee_zcl_power_config_batt_ah_rating; +static int hf_zbee_zcl_power_config_batt_rated_voltage; +static int hf_zbee_zcl_power_config_batt_voltage_min_thr; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_power_config = -1; -static gint ett_zbee_zcl_power_config_mains_alarm_mask = -1; -static gint ett_zbee_zcl_power_config_batt_alarm_mask = -1; +static int ett_zbee_zcl_power_config; +static int ett_zbee_zcl_power_config_mains_alarm_mask; +static int ett_zbee_zcl_power_config_batt_alarm_mask; /* Attributes */ static const value_string zbee_zcl_power_config_attr_names[] = { @@ -561,14 +562,14 @@ dissect_zbee_zcl_power_config(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t * DESCRIPTION * this function decodes voltage values * PARAMETERS - * guint *s - string to display - * guint32 value - value to decode + * unsigned *s - string to display + * uint32_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_power_conf_voltage(gchar *s, guint32 value) +decode_power_conf_voltage(char *s, uint32_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [V]", value/10, value%10); return; @@ -580,14 +581,14 @@ decode_power_conf_voltage(gchar *s, guint32 value) * DESCRIPTION * this function decodes percentage values * PARAMETERS - * guint *s - string to display - * guint32 value - value to decode + * unsigned *s - string to display + * uint32_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_power_conf_percentage(gchar *s, guint32 value) +decode_power_conf_percentage(char *s, uint32_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%.1f [%%]", value/2.0); return; @@ -599,14 +600,14 @@ decode_power_conf_percentage(gchar *s, guint32 value) * DESCRIPTION * this function decodes mains frequency values * PARAMETERS - * guint *s - string to display - * guint32 value - value to decode + * unsigned *s - string to display + * uint32_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_power_conf_frequency(gchar *s, guint32 value) +decode_power_conf_frequency(char *s, uint32_t value) { if(value == 0x00) snprintf(s, ITEM_LABEL_LENGTH, "Frequency too low to be measured (or DC supply)"); @@ -625,14 +626,14 @@ decode_power_conf_frequency(gchar *s, guint32 value) * DESCRIPTION * this function decodes battery capacity values * PARAMETERS - * guint *s - string to display - * guint32 value - value to decode + * unsigned *s - string to display + * uint32_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_power_conf_batt_AHr(gchar *s, guint32 value) +decode_power_conf_batt_AHr(char *s, uint32_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%d [mAHr]", value*10); return; @@ -647,16 +648,16 @@ decode_power_conf_batt_AHr(gchar *s, guint32 value) * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_power_config_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_power_config_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *it; static int * const mains_alarm_mask[] = { @@ -837,7 +838,7 @@ proto_register_zbee_zcl_power_config(void) }; /* ZCL power configuration subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_power_config, &ett_zbee_zcl_power_config_mains_alarm_mask, &ett_zbee_zcl_power_config_batt_alarm_mask @@ -916,7 +917,7 @@ void proto_register_zbee_zcl_device_temperature_configuration(void); void proto_reg_handoff_zbee_zcl_device_temperature_configuration(void); /* Command Dissector Helpers */ -static void dissect_zcl_device_temperature_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_device_temperature_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -924,17 +925,17 @@ static void dissect_zcl_device_temperature_configuration_attr_data (proto_t /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_device_temperature_configuration = -1; +static int proto_zbee_zcl_device_temperature_configuration; -static int hf_zbee_zcl_device_temperature_configuration_attr_id = -1; -static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask = -1; -static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_too_low = -1; -static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_too_high = -1; -static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_reserved = -1; +static int hf_zbee_zcl_device_temperature_configuration_attr_id; +static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask; +static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_too_low; +static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_too_high; +static int hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_reserved; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_device_temperature_configuration = -1; -static gint ett_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask = -1; +static int ett_zbee_zcl_device_temperature_configuration; +static int ett_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask; /* Attributes */ static const value_string zbee_zcl_device_temperature_configuration_attr_names[] = { @@ -971,7 +972,7 @@ static const value_string zbee_zcl_device_temperature_configuration_attr_names[] static int dissect_zbee_zcl_device_temperature_configuration(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void* data _U_) { - return tvb_captured_length(tvb);; + return tvb_captured_length(tvb); } /*dissect_zbee_zcl_device_temperature_configuration*/ @@ -984,16 +985,16 @@ dissect_zbee_zcl_device_temperature_configuration(tvbuff_t *tvb _U_, packet_info * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_device_temperature_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_device_temperature_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const device_temp_alarm_mask[] = { &hf_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask_too_low, @@ -1067,7 +1068,7 @@ proto_register_zbee_zcl_device_temperature_configuration(void) }; /* ZCL Device Temperature Configuration subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_device_temperature_configuration, &ett_zbee_zcl_device_temperature_configuration_device_temp_alarm_mask }; @@ -1136,10 +1137,10 @@ void proto_register_zbee_zcl_identify(void); void proto_reg_handoff_zbee_zcl_identify(void); /* Command Dissector Helpers */ -static void dissect_zcl_identify_identify (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_identify_identifyqueryrsp (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_identify_triggereffect (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_identify_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_identify_identify (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_identify_identifyqueryrsp (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_identify_triggereffect (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_identify_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -1147,18 +1148,18 @@ static void dissect_zcl_identify_attr_data (proto_tree *tree, tvbuf /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_identify = -1; +static int proto_zbee_zcl_identify; -static int hf_zbee_zcl_identify_attr_id = -1; -static int hf_zbee_zcl_identify_identify_time = -1; -static int hf_zbee_zcl_identify_identify_timeout = -1; -static int hf_zbee_zcl_identify_effect_id = -1; -static int hf_zbee_zcl_identify_effect_variant = -1; -static int hf_zbee_zcl_identify_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_identify_srv_tx_cmd_id = -1; +static int hf_zbee_zcl_identify_attr_id; +static int hf_zbee_zcl_identify_identify_time; +static int hf_zbee_zcl_identify_identify_timeout; +static int hf_zbee_zcl_identify_effect_id; +static int hf_zbee_zcl_identify_effect_variant; +static int hf_zbee_zcl_identify_srv_rx_cmd_id; +static int hf_zbee_zcl_identify_srv_tx_cmd_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_identify = -1; +static int ett_zbee_zcl_identify; /* Attributes */ static const value_string zbee_zcl_identify_attr_names[] = { @@ -1214,9 +1215,9 @@ dissect_zbee_zcl_identify(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -1302,7 +1303,7 @@ dissect_zbee_zcl_identify(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v *--------------------------------------------------------------- */ static void -dissect_zcl_identify_identify(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_identify_identify(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Identify Time" field */ proto_tree_add_item(tree, hf_zbee_zcl_identify_identify_time, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -1325,7 +1326,7 @@ dissect_zcl_identify_identify(tvbuff_t *tvb, proto_tree *tree, guint *offset) *--------------------------------------------------------------- */ static void -dissect_zcl_identify_identifyqueryrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_identify_identifyqueryrsp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Identify Timeout" field */ proto_tree_add_item(tree, hf_zbee_zcl_identify_identify_timeout, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -1347,7 +1348,7 @@ dissect_zcl_identify_identifyqueryrsp(tvbuff_t *tvb, proto_tree *tree, guint *of *--------------------------------------------------------------- */ static void -dissect_zcl_identify_triggereffect(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_identify_triggereffect(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Trigger Effect Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_identify_effect_id, tvb, *offset, 1, ENC_NA); @@ -1369,16 +1370,16 @@ dissect_zcl_identify_triggereffect(tvbuff_t *tvb, proto_tree *tree, guint *offse * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_identify_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_identify_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) { @@ -1444,7 +1445,7 @@ proto_register_zbee_zcl_identify(void) }; /* ZCL Identify subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_identify }; @@ -1522,15 +1523,15 @@ void proto_register_zbee_zcl_groups(void); void proto_reg_handoff_zbee_zcl_groups(void); /* Command Dissector Helpers */ -static void dissect_zcl_groups_add_group_or_if_identifying (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_groups_view_group (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_groups_get_group_membership (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_groups_remove_group (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_groups_add_remove_group_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_groups_view_group_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_groups_get_group_membership_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); +static void dissect_zcl_groups_add_group_or_if_identifying (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_groups_view_group (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_groups_get_group_membership (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_groups_remove_group (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_groups_add_remove_group_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_groups_view_group_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_groups_get_group_membership_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); -static void dissect_zcl_groups_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_groups_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -1538,23 +1539,23 @@ static void dissect_zcl_groups_attr_data (proto_tree *tre /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_groups = -1; - -static int hf_zbee_zcl_groups_attr_id = -1; -static int hf_zbee_zcl_groups_group_name_support = -1; -static int hf_zbee_zcl_groups_group_id = -1; -static int hf_zbee_zcl_groups_group_count = -1; -static int hf_zbee_zcl_groups_group_capacity = -1; -static int hf_zbee_zcl_groups_status = -1; -static int hf_zbee_zcl_groups_attr_str_len = -1; -static int hf_zbee_zcl_groups_attr_str = -1; -static int hf_zbee_zcl_groups_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_groups_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_groups_group_list = -1; +static int proto_zbee_zcl_groups; + +static int hf_zbee_zcl_groups_attr_id; +static int hf_zbee_zcl_groups_group_name_support; +static int hf_zbee_zcl_groups_group_id; +static int hf_zbee_zcl_groups_group_count; +static int hf_zbee_zcl_groups_group_capacity; +static int hf_zbee_zcl_groups_status; +static int hf_zbee_zcl_groups_attr_str_len; +static int hf_zbee_zcl_groups_attr_str; +static int hf_zbee_zcl_groups_srv_rx_cmd_id; +static int hf_zbee_zcl_groups_srv_tx_cmd_id; +static int hf_zbee_zcl_groups_group_list; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_groups = -1; -static gint ett_zbee_zcl_groups_grp_ctrl = -1; +static int ett_zbee_zcl_groups; +static int ett_zbee_zcl_groups_grp_ctrl; /* Attributes */ static const value_string zbee_zcl_groups_attr_names[] = { @@ -1605,9 +1606,9 @@ dissect_zbee_zcl_groups(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -1718,17 +1719,17 @@ dissect_zbee_zcl_groups(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi *--------------------------------------------------------------- */ static void -dissect_zcl_groups_add_group_or_if_identifying(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_add_group_or_if_identifying(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint attr_uint; - guint8 *attr_string; + unsigned attr_uint; + uint8_t *attr_string; /* Retrieve "Group ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_groups_group_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); *offset += 2; /* Retrieve "Group Name" field */ - attr_uint = tvb_get_guint8(tvb, *offset); /* string length */ + attr_uint = tvb_get_uint8(tvb, *offset); /* string length */ if (attr_uint == 0xff) attr_uint = 0; proto_tree_add_uint(tree, hf_zbee_zcl_groups_attr_str_len, tvb, *offset, 1, attr_uint); @@ -1759,7 +1760,7 @@ dissect_zcl_groups_add_group_or_if_identifying(tvbuff_t *tvb, proto_tree *tree, *--------------------------------------------------------------- */ static void -dissect_zcl_groups_view_group(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_view_group(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Groups Timeout" field */ proto_tree_add_item(tree, hf_zbee_zcl_groups_group_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -1782,13 +1783,13 @@ dissect_zcl_groups_view_group(tvbuff_t *tvb, proto_tree *tree, guint *offset) *--------------------------------------------------------------- */ static void -dissect_zcl_groups_get_group_membership(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_get_group_membership(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_item *grp_list; proto_tree *grp_list_tree; - guint8 count, i; + uint8_t count, i; /* Retrieve "Group Count" field */ - count = tvb_get_guint8(tvb, *offset); + count = tvb_get_uint8(tvb, *offset); proto_tree_add_uint(tree, hf_zbee_zcl_groups_group_count, tvb, *offset, 1, count); *offset += 1; @@ -1821,7 +1822,7 @@ dissect_zcl_groups_get_group_membership(tvbuff_t *tvb, proto_tree *tree, guint * *--------------------------------------------------------------- */ static void -dissect_zcl_groups_remove_group(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_remove_group(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Groups ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_groups_group_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -1844,7 +1845,7 @@ dissect_zcl_groups_remove_group(tvbuff_t *tvb, proto_tree *tree, guint *offset) *--------------------------------------------------------------- */ static void -dissect_zcl_groups_add_remove_group_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_add_remove_group_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Status" field */ proto_tree_add_item(tree, hf_zbee_zcl_groups_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -1871,10 +1872,10 @@ dissect_zcl_groups_add_remove_group_response(tvbuff_t *tvb, proto_tree *tree, gu *--------------------------------------------------------------- */ static void -dissect_zcl_groups_view_group_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_view_group_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint attr_uint; - guint8 *attr_string; + unsigned attr_uint; + uint8_t *attr_string; /* Retrieve "Status" field */ proto_tree_add_item(tree, hf_zbee_zcl_groups_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -1884,7 +1885,7 @@ dissect_zcl_groups_view_group_response(tvbuff_t *tvb, proto_tree *tree, guint *o *offset += 2; /* Retrieve "Group Name" field */ - attr_uint = tvb_get_guint8(tvb, *offset); /* string length */ + attr_uint = tvb_get_uint8(tvb, *offset); /* string length */ if (attr_uint == 0xff) attr_uint = 0; proto_tree_add_uint(tree, hf_zbee_zcl_groups_attr_str_len, tvb, *offset, 1, attr_uint); @@ -1914,18 +1915,18 @@ dissect_zcl_groups_view_group_response(tvbuff_t *tvb, proto_tree *tree, guint *o *--------------------------------------------------------------- */ static void -dissect_zcl_groups_get_group_membership_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_groups_get_group_membership_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_item *grp_list; proto_tree *grp_list_tree; - guint8 count, i; + uint8_t count, i; /* Retrieve "Capacity" field */ proto_tree_add_item(tree, hf_zbee_zcl_groups_group_capacity, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; /* Retrieve "Group Count" field */ - count = tvb_get_guint8(tvb, *offset); + count = tvb_get_uint8(tvb, *offset); proto_tree_add_uint(tree, hf_zbee_zcl_groups_group_count, tvb, *offset, 1, count); *offset += 1; if(count > 0) @@ -1952,16 +1953,16 @@ dissect_zcl_groups_get_group_membership_response(tvbuff_t *tvb, proto_tree *tree * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_groups_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_groups_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) { @@ -2043,7 +2044,7 @@ proto_register_zbee_zcl_groups(void) }; /* ZCL Groups subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_groups, &ett_zbee_zcl_groups_grp_ctrl }; @@ -2106,8 +2107,8 @@ proto_reg_handoff_zbee_zcl_groups(void) #define ZBEE_ZCL_ATTR_ID_SCENES_LAST_CONFIGURED_BY 0x0005 /* Last Configured By */ /* Scene Name Support */ -#define ZBEE_ZCL_SCENES_NAME_SUPPORTED 0x80 /* Scene Names Supported */ #define ZBEE_ZCL_SCENES_NAME_NOT_SUPPORTED 0x00 /* Scene Names Not Supported */ +#define ZBEE_ZCL_SCENES_NAME_SUPPORTED 0x01 /* Scene Names Supported */ /* Copy Mode */ #define ZBEE_ZCL_SCENES_COPY_SPECIFIED 0x00 /* Copy Specified Scenes */ @@ -2138,8 +2139,8 @@ proto_reg_handoff_zbee_zcl_groups(void) #define ZBEE_ZCL_CMD_ID_SCENES_COPY_SCENE_RESPONSE 0x42 /* Copy Scene Response */ /* Enhanced */ -#define IS_ENHANCED TRUE -#define IS_NOT_ENHANCED FALSE +#define IS_ENHANCED true +#define IS_NOT_ENHANCED false /*************************/ /* Function Declarations */ @@ -2149,18 +2150,18 @@ void proto_register_zbee_zcl_scenes(void); void proto_reg_handoff_zbee_zcl_scenes(void); /* Command Dissector Helpers */ -static void dissect_zcl_scenes_add_scene (tvbuff_t *tvb, proto_tree *tree, guint *offset, gboolean enhanced); -static void dissect_zcl_scenes_view_remove_store_recall_scene (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_remove_all_get_scene_membership (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_copy_scene (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_add_remove_store_scene_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_view_scene_response (tvbuff_t *tvb, proto_tree *tree, guint *offset, gboolean enhanced); -static void dissect_zcl_scenes_remove_all_scenes_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_get_scene_membership_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_copy_scene_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); - -static void dissect_zcl_scenes_extension_fields (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_scenes_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_scenes_add_scene (tvbuff_t *tvb, proto_tree *tree, unsigned *offset, bool enhanced); +static void dissect_zcl_scenes_view_remove_store_recall_scene (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_remove_all_get_scene_membership (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_copy_scene (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_add_remove_store_scene_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_view_scene_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset, bool enhanced); +static void dissect_zcl_scenes_remove_all_scenes_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_get_scene_membership_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_copy_scene_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); + +static void dissect_zcl_scenes_extension_fields (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_scenes_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -2168,50 +2169,50 @@ static void dissect_zcl_scenes_attr_data (pro /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_scenes = -1; - -static int hf_zbee_zcl_scenes_attr_id = -1; -static int hf_zbee_zcl_scenes_attr_id_scene_valid = -1; -static int hf_zbee_zcl_scenes_attr_id_name_support = -1; -static int hf_zbee_zcl_scenes_group_id = -1; -static int hf_zbee_zcl_scenes_group_id_from = -1; -static int hf_zbee_zcl_scenes_group_id_to = -1; -static int hf_zbee_zcl_scenes_scene_id = -1; -static int hf_zbee_zcl_scenes_scene_id_from = -1; -static int hf_zbee_zcl_scenes_scene_id_to = -1; -static int hf_zbee_zcl_scenes_transit_time = -1; -static int hf_zbee_zcl_scenes_enh_transit_time = -1; -static int hf_zbee_zcl_scenes_extension_set_cluster = -1; -static int hf_zbee_zcl_scenes_extension_set_onoff = -1; -static int hf_zbee_zcl_scenes_extension_set_level = -1; -static int hf_zbee_zcl_scenes_extension_set_x = -1; -static int hf_zbee_zcl_scenes_extension_set_y = -1; -static int hf_zbee_zcl_scenes_extension_set_hue = -1; -static int hf_zbee_zcl_scenes_extension_set_saturation = -1; -static int hf_zbee_zcl_scenes_extension_set_color_loop_active = -1; -static int hf_zbee_zcl_scenes_extension_set_color_loop_direction = -1; -static int hf_zbee_zcl_scenes_extension_set_color_loop_time = -1; -static int hf_zbee_zcl_scenes_extension_set_cooling_setpoint = -1; -static int hf_zbee_zcl_scenes_extension_set_heating_setpoint = -1; -static int hf_zbee_zcl_scenes_extension_set_system_mode = -1; -static int hf_zbee_zcl_scenes_extension_set_lock_state = -1; -static int hf_zbee_zcl_scenes_extension_set_lift_percentage = -1; -static int hf_zbee_zcl_scenes_extension_set_tilt_percentage = -1; - -static int hf_zbee_zcl_scenes_status = -1; -static int hf_zbee_zcl_scenes_capacity = -1; -static int hf_zbee_zcl_scenes_scene_count = -1; -static int hf_zbee_zcl_scenes_attr_str_len = -1; -static int hf_zbee_zcl_scenes_attr_str = -1; -static int hf_zbee_zcl_scenes_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_scenes_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_scenes_scene_list = -1; -static int hf_zbee_zcl_scenes_copy_mode = -1; +static int proto_zbee_zcl_scenes; + +static int hf_zbee_zcl_scenes_attr_id; +static int hf_zbee_zcl_scenes_attr_id_scene_valid; +static int hf_zbee_zcl_scenes_attr_id_name_support; +static int hf_zbee_zcl_scenes_group_id; +static int hf_zbee_zcl_scenes_group_id_from; +static int hf_zbee_zcl_scenes_group_id_to; +static int hf_zbee_zcl_scenes_scene_id; +static int hf_zbee_zcl_scenes_scene_id_from; +static int hf_zbee_zcl_scenes_scene_id_to; +static int hf_zbee_zcl_scenes_transit_time; +static int hf_zbee_zcl_scenes_enh_transit_time; +static int hf_zbee_zcl_scenes_extension_set_cluster; +static int hf_zbee_zcl_scenes_extension_set_onoff; +static int hf_zbee_zcl_scenes_extension_set_level; +static int hf_zbee_zcl_scenes_extension_set_x; +static int hf_zbee_zcl_scenes_extension_set_y; +static int hf_zbee_zcl_scenes_extension_set_hue; +static int hf_zbee_zcl_scenes_extension_set_saturation; +static int hf_zbee_zcl_scenes_extension_set_color_loop_active; +static int hf_zbee_zcl_scenes_extension_set_color_loop_direction; +static int hf_zbee_zcl_scenes_extension_set_color_loop_time; +static int hf_zbee_zcl_scenes_extension_set_cooling_setpoint; +static int hf_zbee_zcl_scenes_extension_set_heating_setpoint; +static int hf_zbee_zcl_scenes_extension_set_system_mode; +static int hf_zbee_zcl_scenes_extension_set_lock_state; +static int hf_zbee_zcl_scenes_extension_set_lift_percentage; +static int hf_zbee_zcl_scenes_extension_set_tilt_percentage; + +static int hf_zbee_zcl_scenes_status; +static int hf_zbee_zcl_scenes_capacity; +static int hf_zbee_zcl_scenes_scene_count; +static int hf_zbee_zcl_scenes_attr_str_len; +static int hf_zbee_zcl_scenes_attr_str; +static int hf_zbee_zcl_scenes_srv_rx_cmd_id; +static int hf_zbee_zcl_scenes_srv_tx_cmd_id; +static int hf_zbee_zcl_scenes_scene_list; +static int hf_zbee_zcl_scenes_copy_mode; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_scenes = -1; -static gint ett_zbee_zcl_scenes_scene_ctrl = -1; -static gint ett_zbee_zcl_scenes_extension_field_set = -1; +static int ett_zbee_zcl_scenes; +static int ett_zbee_zcl_scenes_scene_ctrl; +static int ett_zbee_zcl_scenes_extension_field_set; /* Attributes */ static const value_string zbee_zcl_scenes_attr_names[] = { @@ -2285,14 +2286,14 @@ static const value_string zbee_zcl_scenes_color_loop_direction_values[] = { * DESCRIPTION * this function decodes color xy values * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_color_xy(gchar *s, guint16 value) +decode_color_xy(char *s, uint16_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%.4lf", value/65535.0); } @@ -2303,13 +2304,13 @@ decode_color_xy(gchar *s, guint16 value) * DESCRIPTION * this function decodes the setpoint * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ -static void decode_setpoint(gchar *s, gint16 value) +static void decode_setpoint(char *s, int16_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%.2lf [" UTF8_DEGREE_SIGN "C]", value/100.0); } @@ -2332,9 +2333,9 @@ dissect_zbee_zcl_scenes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -2457,10 +2458,10 @@ dissect_zbee_zcl_scenes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi *--------------------------------------------------------------- */ static void -dissect_zcl_scenes_add_scene(tvbuff_t *tvb, proto_tree *tree, guint *offset, gboolean enhanced) +dissect_zcl_scenes_add_scene(tvbuff_t *tvb, proto_tree *tree, unsigned *offset, bool enhanced) { - guint attr_uint; - guint8 *attr_string; + unsigned attr_uint; + uint8_t *attr_string; /* Retrieve "Group ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_group_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -2475,7 +2476,7 @@ dissect_zcl_scenes_add_scene(tvbuff_t *tvb, proto_tree *tree, guint *offset, gbo *offset += 2; /* Retrieve Scene Name */ - attr_uint = tvb_get_guint8(tvb, *offset); /* string length */ + attr_uint = tvb_get_uint8(tvb, *offset); /* string length */ if (attr_uint == 0xff) attr_uint = 0; proto_tree_add_uint(tree, hf_zbee_zcl_scenes_attr_str_len, tvb, *offset, 1, attr_uint); @@ -2509,7 +2510,7 @@ dissect_zcl_scenes_add_scene(tvbuff_t *tvb, proto_tree *tree, guint *offset, gbo *------------------------------------------------------------------------------ */ static void -dissect_zcl_scenes_view_remove_store_recall_scene(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_view_remove_store_recall_scene(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Group ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_group_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -2536,7 +2537,7 @@ dissect_zcl_scenes_view_remove_store_recall_scene(tvbuff_t *tvb, proto_tree *tre *----------------------------------------------------------------------------- */ static void -dissect_zcl_scenes_remove_all_get_scene_membership(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_remove_all_get_scene_membership(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Group ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_group_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -2559,7 +2560,7 @@ dissect_zcl_scenes_remove_all_get_scene_membership(tvbuff_t *tvb, proto_tree *tr *------------------------------------------------------------------------------ */ static void -dissect_zcl_scenes_copy_scene(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_copy_scene(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Mode" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_copy_mode, tvb, *offset, 1, ENC_NA); @@ -2598,7 +2599,7 @@ dissect_zcl_scenes_copy_scene(tvbuff_t *tvb, proto_tree *tree, guint *offset) *--------------------------------------------------------------- */ static void -dissect_zcl_scenes_add_remove_store_scene_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_add_remove_store_scene_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Status" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -2630,13 +2631,13 @@ dissect_zcl_scenes_add_remove_store_scene_response(tvbuff_t *tvb, proto_tree *tr *--------------------------------------------------------------- */ static void -dissect_zcl_scenes_view_scene_response(tvbuff_t *tvb, proto_tree *tree, guint *offset, gboolean enhanced) +dissect_zcl_scenes_view_scene_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset, bool enhanced) { - guint8 status, *attr_string; - guint attr_uint; + uint8_t status, *attr_string; + unsigned attr_uint; /* Retrieve "Status" field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_scenes_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -2655,7 +2656,7 @@ dissect_zcl_scenes_view_scene_response(tvbuff_t *tvb, proto_tree *tree, guint *o *offset += 2; /* Retrieve Scene Name */ - attr_uint = tvb_get_guint8(tvb, *offset); /* string length */ + attr_uint = tvb_get_uint8(tvb, *offset); /* string length */ if (attr_uint == 0xff) attr_uint = 0; proto_tree_add_uint(tree, hf_zbee_zcl_scenes_attr_str_len, tvb, *offset, 1, attr_uint); @@ -2691,7 +2692,7 @@ dissect_zcl_scenes_view_scene_response(tvbuff_t *tvb, proto_tree *tree, guint *o *--------------------------------------------------------------- */ static void -dissect_zcl_scenes_remove_all_scenes_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_remove_all_scenes_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Status" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -2718,14 +2719,14 @@ dissect_zcl_scenes_remove_all_scenes_response(tvbuff_t *tvb, proto_tree *tree, g *--------------------------------------------------------------- */ static void -dissect_zcl_scenes_get_scene_membership_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_get_scene_membership_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_item *scene_list; proto_tree *scene_list_tree; - guint8 status, count, i; + uint8_t status, count, i; /* Retrieve "Status" field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_scenes_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -2740,7 +2741,7 @@ dissect_zcl_scenes_get_scene_membership_response(tvbuff_t *tvb, proto_tree *tree if(status == ZBEE_ZCL_STAT_SUCCESS) { /* Retrieve "Scene Count" field */ - count = tvb_get_guint8(tvb, *offset); + count = tvb_get_uint8(tvb, *offset); proto_tree_add_uint(tree, hf_zbee_zcl_scenes_scene_count, tvb, *offset, 1, count); *offset += 1; @@ -2774,7 +2775,7 @@ dissect_zcl_scenes_get_scene_membership_response(tvbuff_t *tvb, proto_tree *tree *--------------------------------------------------------------- */ static void -dissect_zcl_scenes_copy_scene_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_scenes_copy_scene_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Status" field */ proto_tree_add_item(tree, hf_zbee_zcl_scenes_status, tvb, *offset, 1, ENC_NA); @@ -2799,24 +2800,24 @@ dissect_zcl_scenes_copy_scene_response(tvbuff_t *tvb, proto_tree *tree, guint *o * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ -static void dissect_zcl_scenes_extension_fields(tvbuff_t *tvb, proto_tree *tree, guint *offset) +static void dissect_zcl_scenes_extension_fields(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 set = 1; + uint8_t set = 1; proto_tree *subtree; // Is there an extension field? - gboolean hasExtensionField = tvb_offset_exists(tvb, *offset+2); + bool hasExtensionField = tvb_offset_exists(tvb, *offset+2); while (hasExtensionField) { // Retrieve the cluster and the length - guint32 cluster = tvb_get_guint16(tvb, *offset, ENC_LITTLE_ENDIAN); - guint8 length = tvb_get_guint8 (tvb, *offset+2); + uint32_t cluster = tvb_get_uint16(tvb, *offset, ENC_LITTLE_ENDIAN); + uint8_t length = tvb_get_uint8 (tvb, *offset+2); // Create a subtree subtree = proto_tree_add_subtree_format(tree, tvb, *offset, length, ett_zbee_zcl_scenes_extension_field_set, NULL, "Extension field set %d", set++); @@ -2949,16 +2950,16 @@ static void dissect_zcl_scenes_extension_fields(tvbuff_t *tvb, proto_tree *tree, * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_scenes_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_scenes_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) { @@ -3099,7 +3100,7 @@ proto_register_zbee_zcl_scenes(void) 0x00, NULL, HFILL }}, { &hf_zbee_zcl_scenes_extension_set_color_loop_active, - { "Color Loop Active", "zbee_zcl_general.scenes.extension_set.color_loop_active", FT_BOOLEAN, 8, NULL, + { "Color Loop Active", "zbee_zcl_general.scenes.extension_set.color_loop_active", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }}, { &hf_zbee_zcl_scenes_extension_set_color_loop_direction, @@ -3149,7 +3150,7 @@ proto_register_zbee_zcl_scenes(void) }; /* ZCL Scenes subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_scenes, &ett_zbee_zcl_scenes_scene_ctrl, &ett_zbee_zcl_scenes_extension_field_set @@ -3230,7 +3231,7 @@ void proto_register_zbee_zcl_on_off(void); void proto_reg_handoff_zbee_zcl_on_off(void); /* Command Dissector Helpers */ -static void dissect_zcl_on_off_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_on_off_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -3239,28 +3240,28 @@ static void dissect_zcl_on_off_attr_data(proto_tree *tree, tvbuff_t *tvb, guint /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_on_off = -1; +static int proto_zbee_zcl_on_off; -static int hf_zbee_zcl_on_off_attr_id = -1; -static int hf_zbee_zcl_on_off_attr_onoff = -1; -static int hf_zbee_zcl_on_off_attr_globalscenecontrol = -1; -static int hf_zbee_zcl_on_off_attr_ontime = -1; -static int hf_zbee_zcl_on_off_attr_offwaittime = -1; -static int hf_zbee_zcl_on_off_attr_startuponoff = -1; -static int hf_zbee_zcl_on_off_srv_rx_cmd_id = -1; +static int hf_zbee_zcl_on_off_attr_id; +static int hf_zbee_zcl_on_off_attr_onoff; +static int hf_zbee_zcl_on_off_attr_globalscenecontrol; +static int hf_zbee_zcl_on_off_attr_ontime; +static int hf_zbee_zcl_on_off_attr_offwaittime; +static int hf_zbee_zcl_on_off_attr_startuponoff; +static int hf_zbee_zcl_on_off_srv_rx_cmd_id; -static int hf_zbee_zcl_on_off_effect_identifier = -1; -static int hf_zbee_zcl_on_off_effect_variant_delayed_all_off = -1; -static int hf_zbee_zcl_on_off_effect_variant_dying_light = -1; -static int hf_zbee_zcl_on_off_effect_variant_reserved = -1; +static int hf_zbee_zcl_on_off_effect_identifier; +static int hf_zbee_zcl_on_off_effect_variant_delayed_all_off; +static int hf_zbee_zcl_on_off_effect_variant_dying_light; +static int hf_zbee_zcl_on_off_effect_variant_reserved; -static int hf_zbee_zcl_on_off_timed_off_control_mask = -1; -static int hf_zbee_zcl_on_off_timed_off_control_mask_accept_only_when_on = -1; -static int hf_zbee_zcl_on_off_timed_off_control_mask_reserved = -1; +static int hf_zbee_zcl_on_off_timed_off_control_mask; +static int hf_zbee_zcl_on_off_timed_off_control_mask_accept_only_when_on; +static int hf_zbee_zcl_on_off_timed_off_control_mask_reserved; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_on_off = -1; -static gint ett_zbee_zcl_on_off_timed_off_control_mask = -1; +static int ett_zbee_zcl_on_off; +static int ett_zbee_zcl_on_off_timed_off_control_mask; /* Attributes */ static const value_string zbee_zcl_on_off_attr_names[] = { @@ -3341,10 +3342,10 @@ dissect_zbee_zcl_on_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; - guint8 effect_identifier = 0; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; + uint8_t effect_identifier = 0; static int * const onoff_control_mask[] = { &hf_zbee_zcl_on_off_timed_off_control_mask_accept_only_when_on, @@ -3374,7 +3375,7 @@ dissect_zbee_zcl_on_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi switch (cmd_id) { case ZBEE_ZCL_ON_OFF_CMD_OFF_WITH_EFFECT: proto_tree_add_item(payload_tree, hf_zbee_zcl_on_off_effect_identifier, tvb, offset, 1, ENC_NA); - effect_identifier = tvb_get_guint8(tvb, offset); + effect_identifier = tvb_get_uint8(tvb, offset); offset += 1; switch (effect_identifier) { case 0x00: @@ -3393,8 +3394,8 @@ dissect_zbee_zcl_on_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi proto_tree_add_bitmask(payload_tree, tvb, offset, hf_zbee_zcl_on_off_timed_off_control_mask, ett_zbee_zcl_on_off_timed_off_control_mask, onoff_control_mask, ENC_LITTLE_ENDIAN); offset += 1; - dissect_zcl_on_off_attr_data(payload_tree, tvb, &offset, ZBEE_ZCL_ON_OFF_ATTR_ID_ONTIME, FT_UINT16, FALSE); - dissect_zcl_on_off_attr_data(payload_tree, tvb, &offset, ZBEE_ZCL_ON_OFF_ATTR_ID_OFFWAITTIME, FT_UINT16, FALSE); + dissect_zcl_on_off_attr_data(payload_tree, tvb, &offset, ZBEE_ZCL_ON_OFF_ATTR_ID_ONTIME, FT_UINT16, false); + dissect_zcl_on_off_attr_data(payload_tree, tvb, &offset, ZBEE_ZCL_ON_OFF_ATTR_ID_OFFWAITTIME, FT_UINT16, false); break; default: @@ -3416,16 +3417,16 @@ dissect_zbee_zcl_on_off(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_on_off_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_on_off_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch (attr_id) { @@ -3484,11 +3485,11 @@ proto_register_zbee_zcl_on_off(void) 0x00, NULL, HFILL } }, { &hf_zbee_zcl_on_off_attr_onoff, - { "On/off Control", "zbee_zcl_general.onoff.attr.onoff", FT_BOOLEAN, 8, TFS(&tfs_on_off), + { "On/off Control", "zbee_zcl_general.onoff.attr.onoff", FT_BOOLEAN, BASE_NONE, TFS(&tfs_on_off), 0x00, NULL, HFILL } }, { &hf_zbee_zcl_on_off_attr_globalscenecontrol, - { "Global Scene Control", "zbee_zcl_general.onoff.attr.globalscenecontrol", FT_BOOLEAN, 8, NULL, + { "Global Scene Control", "zbee_zcl_general.onoff.attr.globalscenecontrol", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_zbee_zcl_on_off_attr_ontime, @@ -3538,7 +3539,7 @@ proto_register_zbee_zcl_on_off(void) }; /* ZCL OnOff subtrees */ - static gint *ett[] = { &ett_zbee_zcl_on_off, + static int *ett[] = { &ett_zbee_zcl_on_off, &ett_zbee_zcl_on_off_timed_off_control_mask }; /* Register the ZigBee ZCL OnOff cluster protocol name and description */ @@ -3599,7 +3600,7 @@ void proto_register_zbee_zcl_on_off_switch_configuration(void); void proto_reg_handoff_zbee_zcl_on_off_switch_configuration(void); /* Command Dissector Helpers */ -static void dissect_zcl_on_off_switch_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_on_off_switch_configuration_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -3608,14 +3609,14 @@ static void dissect_zcl_on_off_switch_configuration_attr_data (proto_tree *t /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_on_off_switch_configuration = -1; +static int proto_zbee_zcl_on_off_switch_configuration; -static int hf_zbee_zcl_on_off_switch_configuration_attr_id = -1; -static int hf_zbee_zcl_on_off_switch_configuration_attr_switch_type = -1; -static int hf_zbee_zcl_on_off_switch_configuration_attr_switch_actions = -1; +static int hf_zbee_zcl_on_off_switch_configuration_attr_id; +static int hf_zbee_zcl_on_off_switch_configuration_attr_switch_type; +static int hf_zbee_zcl_on_off_switch_configuration_attr_switch_actions; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_on_off_switch_configuration = -1; +static int ett_zbee_zcl_on_off_switch_configuration; /* Attributes */ static const value_string zbee_zcl_on_off_switch_configuration_attr_names[] = { @@ -3672,16 +3673,16 @@ dissect_zbee_zcl_on_off_switch_configuration(tvbuff_t *tvb _U_, packet_info *pin * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_on_off_switch_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_on_off_switch_configuration_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch (attr_id) { @@ -3736,7 +3737,7 @@ proto_register_zbee_zcl_on_off_switch_configuration(void) }; /* ZCL Identify subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_on_off_switch_configuration }; @@ -3809,18 +3810,18 @@ void proto_reg_handoff_zbee_zcl_alarms(void); /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_alarms = -1; +static int proto_zbee_zcl_alarms; -static int hf_zbee_zcl_alarms_attr_id = -1; -static int hf_zbee_zcl_alarms_alarm_code = -1; -static int hf_zbee_zcl_alarms_cluster_id = -1; -static int hf_zbee_zcl_alarms_status = -1; -static int hf_zbee_zcl_alarms_timestamp = -1; -static int hf_zbee_zcl_alarms_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_alarms_srv_tx_cmd_id = -1; +static int hf_zbee_zcl_alarms_attr_id; +static int hf_zbee_zcl_alarms_alarm_code; +static int hf_zbee_zcl_alarms_cluster_id; +static int hf_zbee_zcl_alarms_status; +static int hf_zbee_zcl_alarms_timestamp; +static int hf_zbee_zcl_alarms_srv_rx_cmd_id; +static int hf_zbee_zcl_alarms_srv_tx_cmd_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_alarms = -1; +static int ett_zbee_zcl_alarms; /* Attributes */ static const value_string zbee_zcl_alarms_attr_names[] = { @@ -3857,15 +3858,15 @@ static const value_string zbee_zcl_alarms_srv_tx_cmd_names[] = { * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_alarms_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_alarms_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) { @@ -3891,7 +3892,7 @@ dissect_zcl_alarms_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, gui *--------------------------------------------------------------- */ static void -dissect_zcl_alarms_alarm_and_reset_alarm(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_alarms_alarm_and_reset_alarm(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Alarm Code" field */ proto_tree_add_item(tree, hf_zbee_zcl_alarms_alarm_code, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -3919,12 +3920,12 @@ dissect_zcl_alarms_alarm_and_reset_alarm(tvbuff_t *tvb, proto_tree *tree, guint */ static void -dissect_zcl_alarms_get_alarm_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_alarms_get_alarm_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 status; + uint8_t status; /* Retrieve "Status" field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_alarms_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -3965,9 +3966,9 @@ dissect_zbee_zcl_alarms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -4090,7 +4091,7 @@ proto_register_zbee_zcl_alarms(void) }; /* ZCL Alarms subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_alarms }; @@ -4175,18 +4176,18 @@ void proto_reg_handoff_zbee_zcl_time(void); /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_time = -1; +static int proto_zbee_zcl_time; -static int hf_zbee_zcl_time_attr_id = -1; -static int hf_zbee_zcl_time_status = -1; -static int hf_zbee_zcl_time_status_master = -1; -static int hf_zbee_zcl_time_status_synchronized = -1; -static int hf_zbee_zcl_time_status_master_zone_dst = -1; -static int hf_zbee_zcl_time_status_superseding = -1; +static int hf_zbee_zcl_time_attr_id; +static int hf_zbee_zcl_time_status; +static int hf_zbee_zcl_time_status_master; +static int hf_zbee_zcl_time_status_synchronized; +static int hf_zbee_zcl_time_status_master_zone_dst; +static int hf_zbee_zcl_time_status_superseding; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_time = -1; -static gint ett_zbee_zcl_time_status_mask = -1; +static int ett_zbee_zcl_time; +static int ett_zbee_zcl_time_status_mask; /* Attributes */ static const value_string zbee_zcl_time_attr_names[] = { @@ -4216,15 +4217,15 @@ static const value_string zbee_zcl_time_attr_names[] = { * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_time_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_time_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const time_status_mask[] = { &hf_zbee_zcl_time_status_master, @@ -4325,7 +4326,7 @@ proto_register_zbee_zcl_time(void) }; /* ZCL Time subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_time, &ett_zbee_zcl_time_status_mask }; @@ -4406,24 +4407,24 @@ void proto_reg_handoff_zbee_zcl_level_control(void); /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_level_control = -1; - -static int hf_zbee_zcl_level_control_attr_id = -1; -static int hf_zbee_zcl_level_control_attr_current_level = -1; -static int hf_zbee_zcl_level_control_attr_remaining_time = -1; -static int hf_zbee_zcl_level_control_attr_onoff_transmit_time = -1; -static int hf_zbee_zcl_level_control_attr_on_level = -1; -static int hf_zbee_zcl_level_control_attr_startup_level = -1; -static int hf_zbee_zcl_level_control_level = -1; -static int hf_zbee_zcl_level_control_move_mode = -1; -static int hf_zbee_zcl_level_control_rate = -1; -static int hf_zbee_zcl_level_control_step_mode = -1; -static int hf_zbee_zcl_level_control_step_size = -1; -static int hf_zbee_zcl_level_control_transit_time = -1; -static int hf_zbee_zcl_level_control_srv_rx_cmd_id = -1; +static int proto_zbee_zcl_level_control; + +static int hf_zbee_zcl_level_control_attr_id; +static int hf_zbee_zcl_level_control_attr_current_level; +static int hf_zbee_zcl_level_control_attr_remaining_time; +static int hf_zbee_zcl_level_control_attr_onoff_transmit_time; +static int hf_zbee_zcl_level_control_attr_on_level; +static int hf_zbee_zcl_level_control_attr_startup_level; +static int hf_zbee_zcl_level_control_level; +static int hf_zbee_zcl_level_control_move_mode; +static int hf_zbee_zcl_level_control_rate; +static int hf_zbee_zcl_level_control_step_mode; +static int hf_zbee_zcl_level_control_step_size; +static int hf_zbee_zcl_level_control_transit_time; +static int hf_zbee_zcl_level_control_srv_rx_cmd_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_level_control = -1; +static int ett_zbee_zcl_level_control; /* Attributes */ static const value_string zbee_zcl_level_control_attr_names[] = { @@ -4479,7 +4480,7 @@ static const range_string zbee_zcl_level_control_startup_level_names[] = { *--------------------------------------------------------------- */ static void -dissect_zcl_level_control_move_to_level(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_level_control_move_to_level(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Level" field */ proto_tree_add_item(tree, hf_zbee_zcl_level_control_level, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -4507,7 +4508,7 @@ dissect_zcl_level_control_move_to_level(tvbuff_t *tvb, proto_tree *tree, guint * */ static void -dissect_zcl_level_control_move(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_level_control_move(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Move Mode" field */ proto_tree_add_item(tree, hf_zbee_zcl_level_control_move_mode, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -4534,7 +4535,7 @@ dissect_zcl_level_control_move(tvbuff_t *tvb, proto_tree *tree, guint *offset) *----------------------------------------------------------------------------- */ static void -dissect_zcl_level_control_step(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_level_control_step(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Step Mode" field */ proto_tree_add_item(tree, hf_zbee_zcl_level_control_step_mode, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -4560,9 +4561,9 @@ dissect_zcl_level_control_step(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type * RETURNS * none *--------------------------------------------------------------- @@ -4586,9 +4587,9 @@ dissect_zbee_zcl_level_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -4643,7 +4644,7 @@ dissect_zbee_zcl_level_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr static void -dissect_zcl_level_control_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_level_control_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) { @@ -4752,7 +4753,7 @@ proto_register_zbee_zcl_level_control(void) }; /* ZCL Identify subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_level_control }; @@ -4860,23 +4861,23 @@ void proto_register_zbee_zcl_rssi_location(void); void proto_reg_handoff_zbee_zcl_rssi_location(void); /* Command Dissector Helpers */ -static void dissect_zcl_rssi_location_set_absolute_location (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_set_device_config (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_get_device_config (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_get_location_data (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_rssi_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_send_pings (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_anchor_node_announce (tvbuff_t *tvb, proto_tree *tree, guint *offset); - -static void dissect_zcl_rssi_location_device_config_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_location_data_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_location_data_notif (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_compact_location_data_notif (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_rssi_ping (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_report_rssi_meas (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_rssi_location_request_own_location (tvbuff_t *tvb, proto_tree *tree, guint *offset); - -static void dissect_zcl_rssi_location_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_rssi_location_set_absolute_location (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_set_device_config (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_get_device_config (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_get_location_data (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_rssi_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_send_pings (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_anchor_node_announce (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); + +static void dissect_zcl_rssi_location_device_config_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_location_data_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_location_data_notif (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_compact_location_data_notif (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_rssi_ping (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_report_rssi_meas (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_rssi_location_request_own_location (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); + +static void dissect_zcl_rssi_location_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -4884,49 +4885,49 @@ static void dissect_zcl_rssi_location_attr_data (proto_tr /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_rssi_location = -1; - -static int hf_zbee_zcl_rssi_location_attr_id = -1; -static int hf_zbee_zcl_rssi_location_location_type = -1; -static int hf_zbee_zcl_rssi_location_location_type_absolute = -1; -static int hf_zbee_zcl_rssi_location_location_type_2D = -1; -static int hf_zbee_zcl_rssi_location_location_type_coordinate_system = -1; -static int hf_zbee_zcl_rssi_location_location_type_reserved = -1; -static int hf_zbee_zcl_rssi_location_attr_id_location_method = -1; -static int hf_zbee_zcl_rssi_location_coordinate1 = -1; -static int hf_zbee_zcl_rssi_location_coordinate2 = -1; -static int hf_zbee_zcl_rssi_location_coordinate3 = -1; -static int hf_zbee_zcl_rssi_location_power = -1; -static int hf_zbee_zcl_rssi_location_path_loss_expo = -1; -static int hf_zbee_zcl_rssi_location_calc_period = -1; -static int hf_zbee_zcl_rssi_location_number_rssi_meas = -1; -static int hf_zbee_zcl_rssi_location_reporting_period = -1; -static int hf_zbee_zcl_rssi_location_target_add = -1; -static int hf_zbee_zcl_rssi_location_header = -1; -static int hf_zbee_zcl_rssi_location_header_abs_only = -1; -static int hf_zbee_zcl_rssi_location_header_recalc = -1; -static int hf_zbee_zcl_rssi_location_header_bcast_ind = -1; -static int hf_zbee_zcl_rssi_location_header_bcast_res = -1; -static int hf_zbee_zcl_rssi_location_header_compact_res = -1; -static int hf_zbee_zcl_rssi_location_header_res = -1; -static int hf_zbee_zcl_rssi_location_number_responses = -1; -static int hf_zbee_zcl_rssi_location_replaying_device = -1; -static int hf_zbee_zcl_rssi_location_rssi = -1; -static int hf_zbee_zcl_rssi_location_anchor_node_add = -1; -static int hf_zbee_zcl_rssi_location_status = -1; -static int hf_zbee_zcl_rssi_location_quality_measure = -1; -static int hf_zbee_zcl_rssi_location_location_age = -1; -static int hf_zbee_zcl_rssi_location_reporting_add = -1; -static int hf_zbee_zcl_rssi_location_no_of_neigh = -1; -static int hf_zbee_zcl_rssi_location_neighbour_add = -1; -static int hf_zbee_zcl_rssi_location_request_add = -1; -static int hf_zbee_zcl_rssi_location_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_rssi_location_srv_tx_cmd_id = -1; +static int proto_zbee_zcl_rssi_location; + +static int hf_zbee_zcl_rssi_location_attr_id; +static int hf_zbee_zcl_rssi_location_location_type; +static int hf_zbee_zcl_rssi_location_location_type_absolute; +static int hf_zbee_zcl_rssi_location_location_type_2D; +static int hf_zbee_zcl_rssi_location_location_type_coordinate_system; +static int hf_zbee_zcl_rssi_location_location_type_reserved; +static int hf_zbee_zcl_rssi_location_attr_id_location_method; +static int hf_zbee_zcl_rssi_location_coordinate1; +static int hf_zbee_zcl_rssi_location_coordinate2; +static int hf_zbee_zcl_rssi_location_coordinate3; +static int hf_zbee_zcl_rssi_location_power; +static int hf_zbee_zcl_rssi_location_path_loss_expo; +static int hf_zbee_zcl_rssi_location_calc_period; +static int hf_zbee_zcl_rssi_location_number_rssi_meas; +static int hf_zbee_zcl_rssi_location_reporting_period; +static int hf_zbee_zcl_rssi_location_target_add; +static int hf_zbee_zcl_rssi_location_header; +static int hf_zbee_zcl_rssi_location_header_abs_only; +static int hf_zbee_zcl_rssi_location_header_recalc; +static int hf_zbee_zcl_rssi_location_header_bcast_ind; +static int hf_zbee_zcl_rssi_location_header_bcast_res; +static int hf_zbee_zcl_rssi_location_header_compact_res; +static int hf_zbee_zcl_rssi_location_header_res; +static int hf_zbee_zcl_rssi_location_number_responses; +static int hf_zbee_zcl_rssi_location_replaying_device; +static int hf_zbee_zcl_rssi_location_rssi; +static int hf_zbee_zcl_rssi_location_anchor_node_add; +static int hf_zbee_zcl_rssi_location_status; +static int hf_zbee_zcl_rssi_location_quality_measure; +static int hf_zbee_zcl_rssi_location_location_age; +static int hf_zbee_zcl_rssi_location_reporting_add; +static int hf_zbee_zcl_rssi_location_no_of_neigh; +static int hf_zbee_zcl_rssi_location_neighbour_add; +static int hf_zbee_zcl_rssi_location_request_add; +static int hf_zbee_zcl_rssi_location_srv_rx_cmd_id; +static int hf_zbee_zcl_rssi_location_srv_tx_cmd_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_rssi_location = -1; -static gint ett_zbee_zcl_rssi_location_location_type = -1; -static gint ett_zbee_zcl_rssi_location_header = -1; +static int ett_zbee_zcl_rssi_location; +static int ett_zbee_zcl_rssi_location_location_type; +static int ett_zbee_zcl_rssi_location_header; /* Attributes */ static const value_string zbee_zcl_rssi_location_attr_names[] = { @@ -5026,9 +5027,9 @@ dissect_zbee_zcl_rssi_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -5157,7 +5158,7 @@ dissect_zbee_zcl_rssi_location(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_set_absolute_location(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_set_absolute_location(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Coordinate 1" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_coordinate1, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -5196,7 +5197,7 @@ dissect_zcl_rssi_location_set_absolute_location(tvbuff_t *tvb, proto_tree *tree, *------------------------------------------------------------------------------ */ static void -dissect_zcl_rssi_location_set_device_config(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_set_device_config(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Power" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_power, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -5235,7 +5236,7 @@ dissect_zcl_rssi_location_set_device_config(tvbuff_t *tvb, proto_tree *tree, gui *----------------------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_get_device_config(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_get_device_config(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Target Address" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_target_add, tvb, *offset, 8, ENC_LITTLE_ENDIAN); @@ -5258,9 +5259,9 @@ dissect_zcl_rssi_location_get_device_config(tvbuff_t *tvb, proto_tree *tree, gui *----------------------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_get_location_data(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_get_location_data(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 header; + uint8_t header; static int * const location_header_fields[] = { &hf_zbee_zcl_rssi_location_header_abs_only, @@ -5273,7 +5274,7 @@ dissect_zcl_rssi_location_get_location_data(tvbuff_t *tvb, proto_tree *tree, gui }; /* Retrieve "8-bit header" field */ - header = tvb_get_guint8(tvb, *offset); + header = tvb_get_uint8(tvb, *offset); proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_rssi_location_header, ett_zbee_zcl_rssi_location_header, location_header_fields, ENC_LITTLE_ENDIAN); *offset += 1; @@ -5305,7 +5306,7 @@ dissect_zcl_rssi_location_get_location_data(tvbuff_t *tvb, proto_tree *tree, gui *------------------------------------------------------------------------------ */ static void -dissect_zcl_rssi_location_rssi_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_rssi_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Replaying Device" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_replaying_device, tvb, *offset, 8, ENC_LITTLE_ENDIAN); @@ -5348,7 +5349,7 @@ dissect_zcl_rssi_location_rssi_response(tvbuff_t *tvb, proto_tree *tree, guint * *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_send_pings(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_send_pings(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Target Address" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_target_add, tvb, *offset, 8, ENC_LITTLE_ENDIAN); @@ -5379,7 +5380,7 @@ dissect_zcl_rssi_location_send_pings(tvbuff_t *tvb, proto_tree *tree, guint *off *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_anchor_node_announce(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_anchor_node_announce(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Anchor Node Address" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_anchor_node_add, tvb, *offset, 8, ENC_LITTLE_ENDIAN); @@ -5414,12 +5415,12 @@ dissect_zcl_rssi_location_anchor_node_announce(tvbuff_t *tvb, proto_tree *tree, *------------------------------------------------------------------------------ */ static void -dissect_zcl_rssi_location_device_config_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_device_config_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 status; + uint8_t status; /* Retrieve "Status" field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -5463,19 +5464,19 @@ dissect_zcl_rssi_location_device_config_response(tvbuff_t *tvb, proto_tree *tree *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_location_data_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_location_data_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 status; + uint8_t status; /* Retrieve "Status" field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; if(status == ZBEE_ZCL_STAT_SUCCESS) { /* Retrieve "Location Type" field */ - dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, FALSE); + dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, false); /* Retrieve "Coordinate 1" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_coordinate1, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -5527,13 +5528,13 @@ dissect_zcl_rssi_location_location_data_response(tvbuff_t *tvb, proto_tree *tree *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_location_data_notif(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_location_data_notif(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 temp; + uint8_t temp; /* Retrieve "Location Type" field */ - temp = tvb_get_guint8(tvb, *offset); - dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, FALSE); + temp = tvb_get_uint8(tvb, *offset); + dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, false); /* Retrieve "Coordinate 1" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_coordinate1, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -5591,13 +5592,13 @@ dissect_zcl_rssi_location_location_data_notif(tvbuff_t *tvb, proto_tree *tree, g *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_compact_location_data_notif(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_compact_location_data_notif(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 temp; + uint8_t temp; /* Retrieve "Location Type" field */ - temp = tvb_get_guint8(tvb, *offset); - dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, FALSE); + temp = tvb_get_uint8(tvb, *offset); + dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, false); /* Retrieve "Coordinate 1" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_coordinate1, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -5642,10 +5643,10 @@ dissect_zcl_rssi_location_compact_location_data_notif(tvbuff_t *tvb, proto_tree *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_rssi_ping(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_rssi_ping(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Location Type" field */ - dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, FALSE); + dissect_zcl_rssi_location_attr_data(tree, tvb, offset, ZBEE_ZCL_ATTR_ID_RSSI_LOCATION_LOCATION_TYPE, ZBEE_ZCL_8_BIT_DATA, false); } /*dissect_zcl_rssi_location_rssi_ping*/ @@ -5665,15 +5666,15 @@ dissect_zcl_rssi_location_rssi_ping(tvbuff_t *tvb, proto_tree *tree, guint *offs *--------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_report_rssi_meas(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_report_rssi_meas(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 count, i; + uint8_t count, i; /* Retrieve "Reporting Address" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_reporting_add, tvb, *offset, 8, ENC_LITTLE_ENDIAN); *offset += 8; /* Retrieve "Number of Neighbours" field */ - count = tvb_get_guint8(tvb, *offset); + count = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_no_of_neigh, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -5721,7 +5722,7 @@ dissect_zcl_rssi_location_report_rssi_meas(tvbuff_t *tvb, proto_tree *tree, guin *----------------------------------------------------------------------------- */ static void -dissect_zcl_rssi_location_request_own_location(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_rssi_location_request_own_location(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Requesting Address Address" field */ proto_tree_add_item(tree, hf_zbee_zcl_rssi_location_request_add, tvb, *offset, 8, ENC_LITTLE_ENDIAN); @@ -5739,16 +5740,16 @@ dissect_zcl_rssi_location_request_own_location(tvbuff_t *tvb, proto_tree *tree, * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_rssi_location_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_rssi_location_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const location_type[] = { &hf_zbee_zcl_rssi_location_location_type_absolute, @@ -5956,7 +5957,7 @@ proto_register_zbee_zcl_rssi_location(void) }; /* ZCL RSSI Location subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_rssi_location, &ett_zbee_zcl_rssi_location_location_type, &ett_zbee_zcl_rssi_location_header @@ -6072,7 +6073,7 @@ void proto_register_zbee_zcl_analog_input_basic(void); void proto_reg_handoff_zbee_zcl_analog_input_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_analog_input_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_analog_input_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -6080,19 +6081,19 @@ static void dissect_zcl_analog_input_basic_attr_data (proto_tree *tree, tvb /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_analog_input_basic = -1; +static int proto_zbee_zcl_analog_input_basic; -static int hf_zbee_zcl_analog_input_basic_attr_id = -1; -static int hf_zbee_zcl_analog_input_basic_reliability = -1; -static int hf_zbee_zcl_analog_input_basic_status_flags = -1; -static int hf_zbee_zcl_analog_input_basic_status_in_alarm = -1; -static int hf_zbee_zcl_analog_input_basic_status_fault = -1; -static int hf_zbee_zcl_analog_input_basic_status_overridden = -1; -static int hf_zbee_zcl_analog_input_basic_status_out_of_service = -1; +static int hf_zbee_zcl_analog_input_basic_attr_id; +static int hf_zbee_zcl_analog_input_basic_reliability; +static int hf_zbee_zcl_analog_input_basic_status_flags; +static int hf_zbee_zcl_analog_input_basic_status_in_alarm; +static int hf_zbee_zcl_analog_input_basic_status_fault; +static int hf_zbee_zcl_analog_input_basic_status_overridden; +static int hf_zbee_zcl_analog_input_basic_status_out_of_service; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_analog_input_basic = -1; -static gint ett_zbee_zcl_analog_input_basic_status_flags = -1; +static int ett_zbee_zcl_analog_input_basic; +static int ett_zbee_zcl_analog_input_basic_status_flags; /* Attributes */ static const value_string zbee_zcl_analog_input_basic_attr_names[] = { @@ -6143,16 +6144,16 @@ dissect_zbee_zcl_analog_input_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U_, p * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_analog_input_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_analog_input_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const status_flags[] = { &hf_zbee_zcl_analog_input_basic_status_in_alarm, @@ -6240,7 +6241,7 @@ proto_register_zbee_zcl_analog_input_basic(void) }; /* ZCL Analog Input Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_analog_input_basic, &ett_zbee_zcl_analog_input_basic_status_flags }; @@ -6317,7 +6318,7 @@ void proto_register_zbee_zcl_analog_output_basic(void); void proto_reg_handoff_zbee_zcl_analog_output_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_analog_output_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_analog_output_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -6325,25 +6326,25 @@ static void dissect_zcl_analog_output_basic_attr_data (proto_tree *tree, tv /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_analog_output_basic = -1; - -static int hf_zbee_zcl_analog_output_basic_attr_id = -1; -static int hf_zbee_zcl_analog_output_basic_reliability = -1; -static int hf_zbee_zcl_analog_output_basic_status_flags = -1; -static int hf_zbee_zcl_analog_output_basic_status_in_alarm = -1; -static int hf_zbee_zcl_analog_output_basic_status_fault = -1; -static int hf_zbee_zcl_analog_output_basic_status_overridden = -1; -static int hf_zbee_zcl_analog_output_basic_status_out_of_service = -1; -static int hf_zbee_zcl_analog_output_basic_priority_array_bool = -1; -static int hf_zbee_zcl_analog_output_basic_priority_array_sing_prec = -1; -static int hf_zbee_zcl_analog_output_basic_priority_array = -1; -static int hf_zbee_zcl_analog_output_basic_structure = -1; +static int proto_zbee_zcl_analog_output_basic; + +static int hf_zbee_zcl_analog_output_basic_attr_id; +static int hf_zbee_zcl_analog_output_basic_reliability; +static int hf_zbee_zcl_analog_output_basic_status_flags; +static int hf_zbee_zcl_analog_output_basic_status_in_alarm; +static int hf_zbee_zcl_analog_output_basic_status_fault; +static int hf_zbee_zcl_analog_output_basic_status_overridden; +static int hf_zbee_zcl_analog_output_basic_status_out_of_service; +static int hf_zbee_zcl_analog_output_basic_priority_array_bool; +static int hf_zbee_zcl_analog_output_basic_priority_array_sing_prec; +static int hf_zbee_zcl_analog_output_basic_priority_array; +static int hf_zbee_zcl_analog_output_basic_structure; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_analog_output_basic = -1; -static gint ett_zbee_zcl_analog_output_basic_status_flags = -1; -static gint ett_zbee_zcl_analog_output_basic_priority_array = -1; -static gint ett_zbee_zcl_analog_output_basic_priority_array_structure = -1; +static int ett_zbee_zcl_analog_output_basic; +static int ett_zbee_zcl_analog_output_basic_status_flags; +static int ett_zbee_zcl_analog_output_basic_priority_array; +static int ett_zbee_zcl_analog_output_basic_priority_array_structure; /* Attributes */ static const value_string zbee_zcl_analog_output_basic_attr_names[] = { @@ -6396,16 +6397,16 @@ dissect_zbee_zcl_analog_output_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U_, * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_analog_output_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_analog_output_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *ti = NULL, *tj = NULL; proto_tree *sub_tree = NULL, *sub = NULL; @@ -6513,7 +6514,7 @@ proto_register_zbee_zcl_analog_output_basic(void) /* end Status Flags fields */ { &hf_zbee_zcl_analog_output_basic_priority_array_bool, - { "Valid/Invalid", "zbee_zcl_general.analog_output_basic.attr.priority_array.bool", FT_BOOLEAN, 8, TFS(&tfs_invalid_valid), + { "Valid/Invalid", "zbee_zcl_general.analog_output_basic.attr.priority_array.bool", FT_BOOLEAN, BASE_NONE, TFS(&tfs_invalid_valid), 0x0, NULL, HFILL } }, { &hf_zbee_zcl_analog_output_basic_priority_array_sing_prec, @@ -6530,7 +6531,7 @@ proto_register_zbee_zcl_analog_output_basic(void) }; /* ZCL Analog Output Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_analog_output_basic, &ett_zbee_zcl_analog_output_basic_status_flags, &ett_zbee_zcl_analog_output_basic_priority_array, @@ -6606,7 +6607,7 @@ void proto_register_zbee_zcl_analog_value_basic(void); void proto_reg_handoff_zbee_zcl_analog_value_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_analog_value_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_analog_value_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -6614,25 +6615,25 @@ static void dissect_zcl_analog_value_basic_attr_data (proto_tree *tree, tvb /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_analog_value_basic = -1; - -static int hf_zbee_zcl_analog_value_basic_attr_id = -1; -static int hf_zbee_zcl_analog_value_basic_reliability = -1; -static int hf_zbee_zcl_analog_value_basic_status_flags = -1; -static int hf_zbee_zcl_analog_value_basic_status_in_alarm = -1; -static int hf_zbee_zcl_analog_value_basic_status_fault = -1; -static int hf_zbee_zcl_analog_value_basic_status_overridden = -1; -static int hf_zbee_zcl_analog_value_basic_status_out_of_service = -1; -static int hf_zbee_zcl_analog_value_basic_priority_array_bool = -1; -static int hf_zbee_zcl_analog_value_basic_priority_array_sing_prec = -1; -static int hf_zbee_zcl_analog_value_basic_priority_array = -1; -static int hf_zbee_zcl_analog_value_basic_structure = -1; +static int proto_zbee_zcl_analog_value_basic; + +static int hf_zbee_zcl_analog_value_basic_attr_id; +static int hf_zbee_zcl_analog_value_basic_reliability; +static int hf_zbee_zcl_analog_value_basic_status_flags; +static int hf_zbee_zcl_analog_value_basic_status_in_alarm; +static int hf_zbee_zcl_analog_value_basic_status_fault; +static int hf_zbee_zcl_analog_value_basic_status_overridden; +static int hf_zbee_zcl_analog_value_basic_status_out_of_service; +static int hf_zbee_zcl_analog_value_basic_priority_array_bool; +static int hf_zbee_zcl_analog_value_basic_priority_array_sing_prec; +static int hf_zbee_zcl_analog_value_basic_priority_array; +static int hf_zbee_zcl_analog_value_basic_structure; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_analog_value_basic = -1; -static gint ett_zbee_zcl_analog_value_basic_status_flags = -1; -static gint ett_zbee_zcl_analog_value_basic_priority_array = -1; -static gint ett_zbee_zcl_analog_value_basic_priority_array_structure = -1; +static int ett_zbee_zcl_analog_value_basic; +static int ett_zbee_zcl_analog_value_basic_status_flags; +static int ett_zbee_zcl_analog_value_basic_priority_array; +static int ett_zbee_zcl_analog_value_basic_priority_array_structure; /* Attributes */ static const value_string zbee_zcl_analog_value_basic_attr_names[] = { @@ -6682,16 +6683,16 @@ dissect_zbee_zcl_analog_value_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U_, p * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_analog_value_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_analog_value_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *ti = NULL, *tj = NULL; proto_tree *sub_tree = NULL, *sub = NULL; @@ -6796,7 +6797,7 @@ proto_register_zbee_zcl_analog_value_basic(void) /* end Status Flags fields */ { &hf_zbee_zcl_analog_value_basic_priority_array_bool, - { "Valid/Invalid", "zbee_zcl_general.analog_value_basic.attr.priority_array.bool", FT_BOOLEAN, 8, TFS(&tfs_invalid_valid), + { "Valid/Invalid", "zbee_zcl_general.analog_value_basic.attr.priority_array.bool", FT_BOOLEAN, BASE_NONE, TFS(&tfs_invalid_valid), 0x00, NULL, HFILL } }, { &hf_zbee_zcl_analog_value_basic_priority_array_sing_prec, @@ -6813,7 +6814,7 @@ proto_register_zbee_zcl_analog_value_basic(void) }; /* ZCL Analog Value Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_analog_value_basic, &ett_zbee_zcl_analog_value_basic_status_flags, &ett_zbee_zcl_analog_value_basic_priority_array, @@ -6893,7 +6894,7 @@ void proto_register_zbee_zcl_binary_input_basic(void); void proto_reg_handoff_zbee_zcl_binary_input_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_binary_input_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_binary_input_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -6901,20 +6902,20 @@ static void dissect_zcl_binary_input_basic_attr_data (proto_tree *tree, tvb /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_binary_input_basic = -1; +static int proto_zbee_zcl_binary_input_basic; -static int hf_zbee_zcl_binary_input_basic_attr_id = -1; -static int hf_zbee_zcl_binary_input_basic_status_flags = -1; -static int hf_zbee_zcl_binary_input_basic_status_in_alarm = -1; -static int hf_zbee_zcl_binary_input_basic_status_fault = -1; -static int hf_zbee_zcl_binary_input_basic_status_overridden = -1; -static int hf_zbee_zcl_binary_input_basic_status_out_of_service = -1; -static int hf_zbee_zcl_binary_input_basic_polarity = -1; -static int hf_zbee_zcl_binary_input_basic_reliability= -1; +static int hf_zbee_zcl_binary_input_basic_attr_id; +static int hf_zbee_zcl_binary_input_basic_status_flags; +static int hf_zbee_zcl_binary_input_basic_status_in_alarm; +static int hf_zbee_zcl_binary_input_basic_status_fault; +static int hf_zbee_zcl_binary_input_basic_status_overridden; +static int hf_zbee_zcl_binary_input_basic_status_out_of_service; +static int hf_zbee_zcl_binary_input_basic_polarity; +static int hf_zbee_zcl_binary_input_basic_reliability; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_binary_input_basic = -1; -static gint ett_zbee_zcl_binary_input_basic_status_flags = -1; +static int ett_zbee_zcl_binary_input_basic; +static int ett_zbee_zcl_binary_input_basic_status_flags; /* Attributes */ static const value_string zbee_zcl_binary_input_basic_attr_names[] = { @@ -6964,16 +6965,16 @@ dissect_zbee_zcl_binary_input_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U_, p * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_binary_input_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_binary_input_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const status_flags[] = { &hf_zbee_zcl_binary_input_basic_status_in_alarm, @@ -7069,7 +7070,7 @@ proto_register_zbee_zcl_binary_input_basic(void) }; /* ZCL Binary Input Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_binary_input_basic, &ett_zbee_zcl_binary_input_basic_status_flags }; @@ -7150,7 +7151,7 @@ void proto_register_zbee_zcl_binary_output_basic(void); void proto_reg_handoff_zbee_zcl_binary_output_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_binary_output_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_binary_output_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -7158,26 +7159,26 @@ static void dissect_zcl_binary_output_basic_attr_data (proto_tree *tree, tv /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_binary_output_basic = -1; - -static int hf_zbee_zcl_binary_output_basic_attr_id = -1; -static int hf_zbee_zcl_binary_output_basic_status_flags = -1; -static int hf_zbee_zcl_binary_output_basic_status_in_alarm = -1; -static int hf_zbee_zcl_binary_output_basic_status_fault = -1; -static int hf_zbee_zcl_binary_output_basic_status_overridden = -1; -static int hf_zbee_zcl_binary_output_basic_status_out_of_service = -1; -static int hf_zbee_zcl_binary_output_basic_priority_array_bool = -1; -static int hf_zbee_zcl_binary_output_basic_priority_array_sing_prec = -1; -static int hf_zbee_zcl_binary_output_basic_polarity = -1; -static int hf_zbee_zcl_binary_output_basic_reliability = -1; -static int hf_zbee_zcl_binary_output_basic_priority_array = -1; -static int hf_zbee_zcl_binary_output_basic_structure = -1; +static int proto_zbee_zcl_binary_output_basic; + +static int hf_zbee_zcl_binary_output_basic_attr_id; +static int hf_zbee_zcl_binary_output_basic_status_flags; +static int hf_zbee_zcl_binary_output_basic_status_in_alarm; +static int hf_zbee_zcl_binary_output_basic_status_fault; +static int hf_zbee_zcl_binary_output_basic_status_overridden; +static int hf_zbee_zcl_binary_output_basic_status_out_of_service; +static int hf_zbee_zcl_binary_output_basic_priority_array_bool; +static int hf_zbee_zcl_binary_output_basic_priority_array_sing_prec; +static int hf_zbee_zcl_binary_output_basic_polarity; +static int hf_zbee_zcl_binary_output_basic_reliability; +static int hf_zbee_zcl_binary_output_basic_priority_array; +static int hf_zbee_zcl_binary_output_basic_structure; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_binary_output_basic = -1; -static gint ett_zbee_zcl_binary_output_basic_status_flags = -1; -static gint ett_zbee_zcl_binary_output_basic_priority_array = -1; -static gint ett_zbee_zcl_binary_output_basic_priority_array_structure = -1; +static int ett_zbee_zcl_binary_output_basic; +static int ett_zbee_zcl_binary_output_basic_status_flags; +static int ett_zbee_zcl_binary_output_basic_priority_array; +static int ett_zbee_zcl_binary_output_basic_priority_array_structure; /* Attributes */ static const value_string zbee_zcl_binary_output_basic_attr_names[] = { @@ -7231,16 +7232,16 @@ dissect_zbee_zcl_binary_output_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U_, * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_binary_output_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_binary_output_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *ti = NULL, *tj = NULL; proto_tree *sub_tree = NULL, *sub = NULL; @@ -7357,7 +7358,7 @@ proto_register_zbee_zcl_binary_output_basic(void) 0x00, NULL, HFILL } }, { &hf_zbee_zcl_binary_output_basic_priority_array_bool, - { "Valid/Invalid", "zbee_zcl_general.binary_output_basic.attr.priority_array.bool", FT_BOOLEAN, 8, TFS(&tfs_invalid_valid), + { "Valid/Invalid", "zbee_zcl_general.binary_output_basic.attr.priority_array.bool", FT_BOOLEAN, BASE_NONE, TFS(&tfs_invalid_valid), 0x00, NULL, HFILL } }, { &hf_zbee_zcl_binary_output_basic_priority_array_sing_prec, @@ -7374,7 +7375,7 @@ proto_register_zbee_zcl_binary_output_basic(void) }; /* ZCL Binary Output Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_binary_output_basic, &ett_zbee_zcl_binary_output_basic_status_flags, &ett_zbee_zcl_binary_output_basic_priority_array, @@ -7450,7 +7451,7 @@ void proto_register_zbee_zcl_binary_value_basic(void); void proto_reg_handoff_zbee_zcl_binary_value_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_binary_value_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_binary_value_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -7458,25 +7459,25 @@ static void dissect_zcl_binary_value_basic_attr_data (proto_tree *tree, tvb /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_binary_value_basic = -1; - -static int hf_zbee_zcl_binary_value_basic_attr_id = -1; -static int hf_zbee_zcl_binary_value_basic_status_flags = -1; -static int hf_zbee_zcl_binary_value_basic_status_in_alarm = -1; -static int hf_zbee_zcl_binary_value_basic_status_fault = -1; -static int hf_zbee_zcl_binary_value_basic_status_overridden = -1; -static int hf_zbee_zcl_binary_value_basic_status_out_of_service = -1; -static int hf_zbee_zcl_binary_value_basic_priority_array_bool = -1; -static int hf_zbee_zcl_binary_value_basic_priority_array_sing_prec = -1; -static int hf_zbee_zcl_binary_value_basic_reliability = -1; -static int hf_zbee_zcl_binary_value_basic_priority_array = -1; -static int hf_zbee_zcl_binary_value_basic_structure = -1; +static int proto_zbee_zcl_binary_value_basic; + +static int hf_zbee_zcl_binary_value_basic_attr_id; +static int hf_zbee_zcl_binary_value_basic_status_flags; +static int hf_zbee_zcl_binary_value_basic_status_in_alarm; +static int hf_zbee_zcl_binary_value_basic_status_fault; +static int hf_zbee_zcl_binary_value_basic_status_overridden; +static int hf_zbee_zcl_binary_value_basic_status_out_of_service; +static int hf_zbee_zcl_binary_value_basic_priority_array_bool; +static int hf_zbee_zcl_binary_value_basic_priority_array_sing_prec; +static int hf_zbee_zcl_binary_value_basic_reliability; +static int hf_zbee_zcl_binary_value_basic_priority_array; +static int hf_zbee_zcl_binary_value_basic_structure; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_binary_value_basic = -1; -static gint ett_zbee_zcl_binary_value_basic_status_flags = -1; -static gint ett_zbee_zcl_binary_value_basic_priority_array = -1; -static gint ett_zbee_zcl_binary_value_basic_priority_array_structure = -1; +static int ett_zbee_zcl_binary_value_basic; +static int ett_zbee_zcl_binary_value_basic_status_flags; +static int ett_zbee_zcl_binary_value_basic_priority_array; +static int ett_zbee_zcl_binary_value_basic_priority_array_structure; /* Attributes */ static const value_string zbee_zcl_binary_value_basic_attr_names[] = { @@ -7529,16 +7530,16 @@ dissect_zbee_zcl_binary_value_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U_, p * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_binary_value_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_binary_value_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *ti = NULL, *tj = NULL; proto_tree *sub_tree = NULL, *sub = NULL; @@ -7646,7 +7647,7 @@ proto_register_zbee_zcl_binary_value_basic(void) /* end Status Flags fields */ { &hf_zbee_zcl_binary_value_basic_priority_array_bool, - { "Valid/Invalid", "zbee_zcl_general.binary_value_basic.attr.priority_array.bool", FT_BOOLEAN, 8,TFS(&tfs_invalid_valid), + { "Valid/Invalid", "zbee_zcl_general.binary_value_basic.attr.priority_array.bool", FT_BOOLEAN, BASE_NONE, TFS(&tfs_invalid_valid), 0x00, NULL, HFILL } }, { &hf_zbee_zcl_binary_value_basic_priority_array_sing_prec, @@ -7663,7 +7664,7 @@ proto_register_zbee_zcl_binary_value_basic(void) }; /* ZCL Binary Value Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_binary_value_basic, &ett_zbee_zcl_binary_value_basic_status_flags, &ett_zbee_zcl_binary_value_basic_priority_array, @@ -7736,7 +7737,7 @@ void proto_register_zbee_zcl_multistate_input_basic(void); void proto_reg_handoff_zbee_zcl_multistate_input_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_multistate_input_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_multistate_input_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -7744,19 +7745,19 @@ static void dissect_zcl_multistate_input_basic_attr_data (proto_tree *tree, /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_multistate_input_basic = -1; +static int proto_zbee_zcl_multistate_input_basic; -static int hf_zbee_zcl_multistate_input_basic_attr_id = -1; -static int hf_zbee_zcl_multistate_input_basic_status_flags = -1; -static int hf_zbee_zcl_multistate_input_basic_status_in_alarm = -1; -static int hf_zbee_zcl_multistate_input_basic_status_fault = -1; -static int hf_zbee_zcl_multistate_input_basic_status_overridden = -1; -static int hf_zbee_zcl_multistate_input_basic_status_out_of_service = -1; -static int hf_zbee_zcl_multistate_input_basic_reliability = -1; +static int hf_zbee_zcl_multistate_input_basic_attr_id; +static int hf_zbee_zcl_multistate_input_basic_status_flags; +static int hf_zbee_zcl_multistate_input_basic_status_in_alarm; +static int hf_zbee_zcl_multistate_input_basic_status_fault; +static int hf_zbee_zcl_multistate_input_basic_status_overridden; +static int hf_zbee_zcl_multistate_input_basic_status_out_of_service; +static int hf_zbee_zcl_multistate_input_basic_reliability; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_multistate_input_basic = -1; -static gint ett_zbee_zcl_multistate_input_basic_status_flags = -1; +static int ett_zbee_zcl_multistate_input_basic; +static int ett_zbee_zcl_multistate_input_basic_status_flags; /* Attributes */ static const value_string zbee_zcl_multistate_input_basic_attr_names[] = { @@ -7805,16 +7806,16 @@ dissect_zbee_zcl_multistate_input_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_multistate_input_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_multistate_input_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const status_flags[] = { &hf_zbee_zcl_multistate_input_basic_status_in_alarm, @@ -7899,7 +7900,7 @@ proto_register_zbee_zcl_multistate_input_basic(void) }; /* ZCL Multistate Input Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_multistate_input_basic, &ett_zbee_zcl_multistate_input_basic_status_flags }; @@ -7972,7 +7973,7 @@ void proto_register_zbee_zcl_multistate_output_basic(void); void proto_reg_handoff_zbee_zcl_multistate_output_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_multistate_output_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_multistate_output_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -7980,25 +7981,25 @@ static void dissect_zcl_multistate_output_basic_attr_data (proto_tree *tree /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_multistate_output_basic = -1; - -static int hf_zbee_zcl_multistate_output_basic_attr_id = -1; -static int hf_zbee_zcl_multistate_output_basic_status_flags = -1; -static int hf_zbee_zcl_multistate_output_basic_status_in_alarm = -1; -static int hf_zbee_zcl_multistate_output_basic_status_fault = -1; -static int hf_zbee_zcl_multistate_output_basic_status_overridden = -1; -static int hf_zbee_zcl_multistate_output_basic_status_out_of_service = -1; -static int hf_zbee_zcl_multistate_output_basic_reliability = -1; -static int hf_zbee_zcl_multistate_output_basic_priority_array_bool = -1; -static int hf_zbee_zcl_multistate_output_basic_priority_array_sing_prec = -1; -static int hf_zbee_zcl_multistate_output_basic_priority_array = -1; -static int hf_zbee_zcl_multistate_output_basic_structure = -1; +static int proto_zbee_zcl_multistate_output_basic; + +static int hf_zbee_zcl_multistate_output_basic_attr_id; +static int hf_zbee_zcl_multistate_output_basic_status_flags; +static int hf_zbee_zcl_multistate_output_basic_status_in_alarm; +static int hf_zbee_zcl_multistate_output_basic_status_fault; +static int hf_zbee_zcl_multistate_output_basic_status_overridden; +static int hf_zbee_zcl_multistate_output_basic_status_out_of_service; +static int hf_zbee_zcl_multistate_output_basic_reliability; +static int hf_zbee_zcl_multistate_output_basic_priority_array_bool; +static int hf_zbee_zcl_multistate_output_basic_priority_array_sing_prec; +static int hf_zbee_zcl_multistate_output_basic_priority_array; +static int hf_zbee_zcl_multistate_output_basic_structure; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_multistate_output_basic = -1; -static gint ett_zbee_zcl_multistate_output_basic_status_flags = -1; -static gint ett_zbee_zcl_multistate_output_basic_priority_array = -1; -static gint ett_zbee_zcl_multistate_output_basic_priority_array_structure = -1; +static int ett_zbee_zcl_multistate_output_basic; +static int ett_zbee_zcl_multistate_output_basic_status_flags; +static int ett_zbee_zcl_multistate_output_basic_priority_array; +static int ett_zbee_zcl_multistate_output_basic_priority_array_structure; /* Attributes */ static const value_string zbee_zcl_multistate_output_basic_attr_names[] = { @@ -8055,16 +8056,16 @@ dissect_zbee_zcl_multistate_output_basic(tvbuff_t *tvb _U_, packet_info *pinfo _ * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_multistate_output_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_multistate_output_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *ti = NULL, *tj = NULL; proto_tree *sub_tree = NULL, *sub = NULL; @@ -8186,7 +8187,7 @@ proto_register_zbee_zcl_multistate_output_basic(void) }; /* ZCL Multistate Output Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_multistate_output_basic, &ett_zbee_zcl_multistate_output_basic_status_flags, &ett_zbee_zcl_multistate_output_basic_priority_array, @@ -8261,7 +8262,7 @@ void proto_register_zbee_zcl_multistate_value_basic(void); void proto_reg_handoff_zbee_zcl_multistate_value_basic(void); /* Command Dissector Helpers */ -static void dissect_zcl_multistate_value_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_multistate_value_basic_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -8269,26 +8270,26 @@ static void dissect_zcl_multistate_value_basic_attr_data (proto_tree *tree, /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_multistate_value_basic = -1; +static int proto_zbee_zcl_multistate_value_basic; -static int hf_zbee_zcl_multistate_value_basic_attr_id = -1; -static int hf_zbee_zcl_multistate_value_basic_status_flags = -1; -static int hf_zbee_zcl_multistate_value_basic_status_in_alarm = -1; -static int hf_zbee_zcl_multistate_value_basic_status_fault = -1; -static int hf_zbee_zcl_multistate_value_basic_status_overridden = -1; -static int hf_zbee_zcl_multistate_value_basic_status_out_of_service = -1; -static int hf_zbee_zcl_multistate_value_basic_reliability = -1; -static int hf_zbee_zcl_multistate_value_basic_priority_array_bool = -1; -static int hf_zbee_zcl_multistate_value_basic_priority_array_sing_prec = -1; -static int hf_zbee_zcl_multistate_value_basic_priority_array = -1; -static int hf_zbee_zcl_multistate_value_basic_structure = -1; +static int hf_zbee_zcl_multistate_value_basic_attr_id; +static int hf_zbee_zcl_multistate_value_basic_status_flags; +static int hf_zbee_zcl_multistate_value_basic_status_in_alarm; +static int hf_zbee_zcl_multistate_value_basic_status_fault; +static int hf_zbee_zcl_multistate_value_basic_status_overridden; +static int hf_zbee_zcl_multistate_value_basic_status_out_of_service; +static int hf_zbee_zcl_multistate_value_basic_reliability; +static int hf_zbee_zcl_multistate_value_basic_priority_array_bool; +static int hf_zbee_zcl_multistate_value_basic_priority_array_sing_prec; +static int hf_zbee_zcl_multistate_value_basic_priority_array; +static int hf_zbee_zcl_multistate_value_basic_structure; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_multistate_value_basic = -1; -static gint ett_zbee_zcl_multistate_value_basic_status_flags = -1; -static gint ett_zbee_zcl_multistate_value_basic_priority_array = -1; -static gint ett_zbee_zcl_multistate_value_basic_priority_array_structure = -1; +static int ett_zbee_zcl_multistate_value_basic; +static int ett_zbee_zcl_multistate_value_basic_status_flags; +static int ett_zbee_zcl_multistate_value_basic_priority_array; +static int ett_zbee_zcl_multistate_value_basic_priority_array_structure; /* Attributes */ static const value_string zbee_zcl_multistate_value_basic_attr_names[] = { @@ -8345,16 +8346,16 @@ dissect_zbee_zcl_multistate_value_basic(tvbuff_t *tvb _U_, packet_info *pinfo _U * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_multistate_value_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_multistate_value_basic_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { proto_item *ti = NULL, *tj = NULL; proto_tree *sub_tree = NULL, *sub = NULL; @@ -8476,7 +8477,7 @@ proto_register_zbee_zcl_multistate_value_basic(void) }; /* ZCL Multistate Value Basic subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_multistate_value_basic, &ett_zbee_zcl_multistate_value_basic_status_flags, &ett_zbee_zcl_multistate_value_basic_priority_array, @@ -8584,12 +8585,12 @@ void proto_register_zbee_zcl_commissioning(void); void proto_reg_handoff_zbee_zcl_commissioning(void); /* Command Dissector Helpers */ -static void dissect_zcl_commissioning_restart_device (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_commissioning_save_restore_startup_parameters (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_commissioning_reset_startup_parameters (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_commissioning_response (tvbuff_t *tvb, proto_tree *tree, guint *offset); +static void dissect_zcl_commissioning_restart_device (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_commissioning_save_restore_startup_parameters (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_commissioning_reset_startup_parameters (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_commissioning_response (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); -static void dissect_zcl_commissioning_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_commissioning_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -8597,32 +8598,32 @@ static void dissect_zcl_commissioning_attr_data (pro /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_commissioning = -1; - -static int hf_zbee_zcl_commissioning_attr_id = -1; -static int hf_zbee_zcl_commissioning_attr_stack_profile = -1; -static int hf_zbee_zcl_commissioning_attr_startup_control = -1; -static int hf_zbee_zcl_commissioning_restart_device_options = -1; -static int hf_zbee_zcl_commissioning_restart_device_options_startup_mode = -1; -static int hf_zbee_zcl_commissioning_restart_device_options_immediate = -1; -static int hf_zbee_zcl_commissioning_restart_device_options_reserved = -1; -static int hf_zbee_zcl_commissioning_delay = -1; -static int hf_zbee_zcl_commissioning_jitter = -1; -static int hf_zbee_zcl_commissioning_options = -1; -static int hf_zbee_zcl_commissioning_index = -1; -static int hf_zbee_zcl_commissioning_reset_startup_options = -1; -static int hf_zbee_zcl_commissioning_reset_startup_options_reset_current = -1; -static int hf_zbee_zcl_commissioning_reset_startup_options_reset_all = -1; -static int hf_zbee_zcl_commissioning_reset_startup_options_erase_index = -1; -static int hf_zbee_zcl_commissioning_reset_startup_options_reserved = -1; -static int hf_zbee_zcl_commissioning_status = -1; -static int hf_zbee_zcl_commissioning_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_commissioning_srv_tx_cmd_id = -1; +static int proto_zbee_zcl_commissioning; + +static int hf_zbee_zcl_commissioning_attr_id; +static int hf_zbee_zcl_commissioning_attr_stack_profile; +static int hf_zbee_zcl_commissioning_attr_startup_control; +static int hf_zbee_zcl_commissioning_restart_device_options; +static int hf_zbee_zcl_commissioning_restart_device_options_startup_mode; +static int hf_zbee_zcl_commissioning_restart_device_options_immediate; +static int hf_zbee_zcl_commissioning_restart_device_options_reserved; +static int hf_zbee_zcl_commissioning_delay; +static int hf_zbee_zcl_commissioning_jitter; +static int hf_zbee_zcl_commissioning_options; +static int hf_zbee_zcl_commissioning_index; +static int hf_zbee_zcl_commissioning_reset_startup_options; +static int hf_zbee_zcl_commissioning_reset_startup_options_reset_current; +static int hf_zbee_zcl_commissioning_reset_startup_options_reset_all; +static int hf_zbee_zcl_commissioning_reset_startup_options_erase_index; +static int hf_zbee_zcl_commissioning_reset_startup_options_reserved; +static int hf_zbee_zcl_commissioning_status; +static int hf_zbee_zcl_commissioning_srv_rx_cmd_id; +static int hf_zbee_zcl_commissioning_srv_tx_cmd_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_commissioning = -1; -static gint ett_zbee_zcl_commissioning_restart_device_options = -1; -static gint ett_zbee_zcl_commissioning_reset_startup_options = -1; +static int ett_zbee_zcl_commissioning; +static int ett_zbee_zcl_commissioning_restart_device_options; +static int ett_zbee_zcl_commissioning_reset_startup_options; /* Attributes */ static const value_string zbee_zcl_commissioning_attr_names[] = { @@ -8655,19 +8656,19 @@ static const value_string zbee_zcl_commissioning_attr_names[] = { /* Server Commands Received */ static const value_string zbee_zcl_commissioning_srv_rx_cmd_names[] = { - { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTART_DEVICE, "Commissioning" }, - { ZBEE_ZCL_CMD_ID_COMMISSIONING_SAVE_STARTUP_PARAMETERS, "Commissioning" }, - { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTORE_STARTUP_PARAMETERS, "Commissioning" }, - { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESET_STARTUP_PARAMETERS, "Commissioning" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTART_DEVICE, "Commissioning - Restart Device" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_SAVE_STARTUP_PARAMETERS, "Commissioning - Save Startup Parameters" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTORE_STARTUP_PARAMETERS, "Commissioning - Restore Startup Parameters" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESET_STARTUP_PARAMETERS, "Commissioning - Reset Startup Parameters" }, { 0, NULL } }; /* Server Commands Generated */ static const value_string zbee_zcl_commissioning_srv_tx_cmd_names[] = { - { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTART_DEVICE_RESPONSE, "Commissioning" }, - { ZBEE_ZCL_CMD_ID_COMMISSIONING_SAVE_STARTUP_PARAMETERS_RESPONSE, "Commissioning" }, - { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTORE_STARTUP_PARAMETERS_RESPONSE, "Commissioning" }, - { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESET_STARTUP_PARAMETERS_RESPONSE, "Commissioning" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTART_DEVICE_RESPONSE, "Commissioning - Restart Device Response" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_SAVE_STARTUP_PARAMETERS_RESPONSE, "Commissioning - Save Startup Parameters Response" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESTORE_STARTUP_PARAMETERS_RESPONSE, "Commissioning - Startup Parameters Response" }, + { ZBEE_ZCL_CMD_ID_COMMISSIONING_RESET_STARTUP_PARAMETERS_RESPONSE, "Commissioning - Reset Startup Parameters Response" }, { 0, NULL } }; @@ -8713,9 +8714,9 @@ dissect_zbee_zcl_commissioning(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -8805,7 +8806,7 @@ dissect_zbee_zcl_commissioning(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr *--------------------------------------------------------------- */ static void -dissect_zcl_commissioning_restart_device(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_commissioning_restart_device(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const restart_device_mask[] = { &hf_zbee_zcl_commissioning_restart_device_options_startup_mode, @@ -8843,7 +8844,7 @@ dissect_zcl_commissioning_restart_device(tvbuff_t *tvb, proto_tree *tree, guint *--------------------------------------------------------------- */ static void -dissect_zcl_commissioning_save_restore_startup_parameters(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_commissioning_save_restore_startup_parameters(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Options" field */ proto_tree_add_item(tree, hf_zbee_zcl_commissioning_options, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -8869,7 +8870,7 @@ dissect_zcl_commissioning_save_restore_startup_parameters(tvbuff_t *tvb, proto_t *--------------------------------------------------------------- */ static void -dissect_zcl_commissioning_reset_startup_parameters(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_commissioning_reset_startup_parameters(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const reset_startup_mask[] = { &hf_zbee_zcl_commissioning_reset_startup_options_reset_current, @@ -8903,7 +8904,7 @@ dissect_zcl_commissioning_reset_startup_parameters(tvbuff_t *tvb, proto_tree *tr *--------------------------------------------------------------- */ static void -dissect_zcl_commissioning_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_commissioning_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Status" field */ proto_tree_add_item(tree, hf_zbee_zcl_commissioning_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -8921,16 +8922,16 @@ dissect_zcl_commissioning_response(tvbuff_t *tvb, proto_tree *tree, guint *offse * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ void -dissect_zcl_commissioning_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_commissioning_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) { @@ -9075,7 +9076,7 @@ proto_register_zbee_zcl_commissioning(void) }; /* ZCL Commissioning subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_commissioning, &ett_zbee_zcl_commissioning_restart_device_options, &ett_zbee_zcl_commissioning_reset_startup_options @@ -9172,11 +9173,11 @@ void proto_register_zbee_zcl_part(void); void proto_reg_handoff_zbee_zcl_part(void); /* Command Dissector Helpers */ -static void dissect_zcl_part_trasfpartframe (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_part_rdhandshakeparam (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, gboolean direction); -static void dissect_zcl_part_wrhandshakeparam (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, gboolean direction); -static void dissect_zcl_part_multiack (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_part_rdhandshakeparamrsp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, gboolean direction); +static void dissect_zcl_part_trasfpartframe (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_part_rdhandshakeparam (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned *offset, bool direction); +static void dissect_zcl_part_wrhandshakeparam (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned *offset, bool direction); +static void dissect_zcl_part_multiack (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_part_rdhandshakeparamrsp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned *offset, bool direction); /* Private functions prototype */ @@ -9185,30 +9186,30 @@ static void dissect_zcl_part_rdhandshakeparamrsp (tvbuff_t *tvb, packet_info /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_part = -1; - -static int hf_zbee_zcl_part_attr_id = -1; -static int hf_zbee_zcl_part_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_part_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_part_opt = -1; -static int hf_zbee_zcl_part_opt_first_block = -1; -static int hf_zbee_zcl_part_opt_indic_len = -1; -static int hf_zbee_zcl_part_opt_res = -1; -static int hf_zbee_zcl_part_first_frame_id = -1; -static int hf_zbee_zcl_part_part_indicator = -1; -static int hf_zbee_zcl_part_part_frame = -1; -static int hf_zbee_zcl_part_partitioned_cluster_id = -1; -static int hf_zbee_zcl_part_ack_opt = -1; -static int hf_zbee_zcl_part_ack_opt_nack_id_len = -1; -static int hf_zbee_zcl_part_ack_opt_res = -1; -static int hf_zbee_zcl_part_nack_id = -1; +static int proto_zbee_zcl_part; + +static int hf_zbee_zcl_part_attr_id; +static int hf_zbee_zcl_part_srv_tx_cmd_id; +static int hf_zbee_zcl_part_srv_rx_cmd_id; +static int hf_zbee_zcl_part_opt; +static int hf_zbee_zcl_part_opt_first_block; +static int hf_zbee_zcl_part_opt_indic_len; +static int hf_zbee_zcl_part_opt_res; +static int hf_zbee_zcl_part_first_frame_id; +static int hf_zbee_zcl_part_part_indicator; +static int hf_zbee_zcl_part_part_frame; +static int hf_zbee_zcl_part_partitioned_cluster_id; +static int hf_zbee_zcl_part_ack_opt; +static int hf_zbee_zcl_part_ack_opt_nack_id_len; +static int hf_zbee_zcl_part_ack_opt_res; +static int hf_zbee_zcl_part_nack_id; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_part = -1; -static gint ett_zbee_zcl_part_fragm_options = -1; -static gint ett_zbee_zcl_part_ack_opts = -1; -static gint ett_zbee_zcl_part_nack_id_list[ZBEE_ZCL_PART_NUM_NACK_ID_ETT]; -static gint ett_zbee_zcl_part_attrs_id_list[ZBEE_ZCL_PART_NUM_ATTRS_ID_ETT]; +static int ett_zbee_zcl_part; +static int ett_zbee_zcl_part_fragm_options; +static int ett_zbee_zcl_part_ack_opts; +static int ett_zbee_zcl_part_nack_id_list[ZBEE_ZCL_PART_NUM_NACK_ID_ETT]; +static int ett_zbee_zcl_part_attrs_id_list[ZBEE_ZCL_PART_NUM_ATTRS_ID_ETT]; /* Attributes */ static const value_string zbee_zcl_part_attr_names[] = { @@ -9270,9 +9271,9 @@ dissect_zbee_zcl_part(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -9360,11 +9361,11 @@ dissect_zbee_zcl_part(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* * none *--------------------------------------------------------------- */ -static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, guint *offset) +static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 options; - gint frame_len; + uint8_t options; + int frame_len; static int * const part_opt[] = { &hf_zbee_zcl_part_opt_first_block, @@ -9374,7 +9375,7 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui }; /* Retrieve "Fragmentation Options" field */ - options = tvb_get_guint8(tvb, *offset); + options = tvb_get_uint8(tvb, *offset); proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_part_opt, ett_zbee_zcl_part_fragm_options, part_opt, ENC_NA); *offset += 1; @@ -9413,7 +9414,7 @@ static void dissect_zcl_part_trasfpartframe(tvbuff_t *tvb, proto_tree *tree, gui *--------------------------------------------------------------- */ static void -dissect_zcl_part_rdhandshakeparam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, gboolean direction) +dissect_zcl_part_rdhandshakeparam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned *offset, bool direction) { /* Retrieve "Partitioned Cluster ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_part_partitioned_cluster_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -9439,7 +9440,7 @@ dissect_zcl_part_rdhandshakeparam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *--------------------------------------------------------------- */ static void -dissect_zcl_part_wrhandshakeparam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, gboolean direction) +dissect_zcl_part_wrhandshakeparam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned *offset, bool direction) { /* Retrieve "Partitioned Cluster ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_part_partitioned_cluster_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -9468,11 +9469,11 @@ dissect_zcl_part_wrhandshakeparam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *--------------------------------------------------------------- */ static void -dissect_zcl_part_multiack(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_part_multiack(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint tvb_len = tvb_reported_length(tvb); - guint i = 0; - guint8 options; + unsigned tvb_len = tvb_reported_length(tvb); + unsigned i = 0; + uint8_t options; static int * const ack_opts[] = { &hf_zbee_zcl_part_ack_opt_nack_id_len, @@ -9481,7 +9482,7 @@ dissect_zcl_part_multiack(tvbuff_t *tvb, proto_tree *tree, guint *offset) }; /* Retrieve "Ack Options" field */ - options = tvb_get_guint8(tvb, *offset); + options = tvb_get_uint8(tvb, *offset); proto_tree_add_bitmask(tree, tvb, *offset, hf_zbee_zcl_part_ack_opt, ett_zbee_zcl_part_ack_opts, ack_opts, ENC_NA); *offset += 1; @@ -9533,7 +9534,7 @@ dissect_zcl_part_multiack(tvbuff_t *tvb, proto_tree *tree, guint *offset) *--------------------------------------------------------------- */ static void -dissect_zcl_part_rdhandshakeparamrsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *offset, gboolean direction) +dissect_zcl_part_rdhandshakeparamrsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned *offset, bool direction) { /* Retrieve "Partitioned Cluster ID" field */ proto_tree_add_item(tree, hf_zbee_zcl_part_partitioned_cluster_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -9553,16 +9554,16 @@ dissect_zcl_part_rdhandshakeparamrsp(tvbuff_t *tvb, packet_info *pinfo, proto_tr * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type * RETURNS * none *--------------------------------------------------------------- */ void proto_register_zbee_zcl_part(void) { - guint8 i, j; + uint8_t i, j; static hf_register_info hf[] = { @@ -9629,7 +9630,7 @@ void proto_register_zbee_zcl_part(void) }; /* ZCL Partition subtrees */ - gint *ett[ZBEE_ZCL_PART_NUM_ETT] = { + int *ett[ZBEE_ZCL_PART_NUM_ETT] = { &ett_zbee_zcl_part, &ett_zbee_zcl_part_fragm_options, &ett_zbee_zcl_part_ack_opts @@ -9637,12 +9638,10 @@ void proto_register_zbee_zcl_part(void) /* initialize attribute subtree types */ for ( i = 0, j = ZBEE_ZCL_PART_NUM_GENERIC_ETT; i < ZBEE_ZCL_PART_NUM_NACK_ID_ETT; i++, j++) { - ett_zbee_zcl_part_nack_id_list[i] = -1; ett[j] = &ett_zbee_zcl_part_nack_id_list[i]; } for ( i = 0; i < ZBEE_ZCL_PART_NUM_ATTRS_ID_ETT; i++, j++) { - ett_zbee_zcl_part_attrs_id_list[i] = -1; ett[j] = &ett_zbee_zcl_part_attrs_id_list[i]; } @@ -9772,7 +9771,7 @@ void proto_reg_handoff_zbee_zcl_part(void) #define ZBEE_ZCL_OTA_TIME_NOW 0x00000000 /* Now */ #define ZBEE_ZCL_OTA_TIME_UTC_LO 0x00000001 /* UTC Low Boundary */ #define ZBEE_ZCL_OTA_TIME_UTC_HI 0xfffffffe /* UTC High Boundary */ -#define ZBEE_ZCL_OTA_TIME_WAIT 0xffffffff /* Wait for a Upgrade command (not used for RequesTime) */ +#define ZBEE_ZCL_OTA_TIME_WAIT 0xffffffff /* Wait for a Upgrade command (not used for RequestTime) */ /*************************/ /* Function Declarations */ @@ -9785,53 +9784,54 @@ void proto_reg_handoff_zbee_zcl_ota(void); /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_ota = -1; - -static int hf_zbee_zcl_ota_attr_id = -1; -static int hf_zbee_zcl_ota_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_ota_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_ota_image_upgrade_status = -1; -static int hf_zbee_zcl_ota_zb_stack_ver = -1; -static int hf_zbee_zcl_ota_file_offset = -1; -static int hf_zbee_zcl_ota_payload_type = -1; -static int hf_zbee_zcl_ota_query_jitter = -1; -static int hf_zbee_zcl_ota_manufacturer_code = -1; -static int hf_zbee_zcl_ota_image_type = -1; -static int hf_zbee_zcl_ota_file_version = -1; -static int hf_zbee_zcl_ota_file_version_appl_release = -1; -static int hf_zbee_zcl_ota_file_version_appl_build = -1; -static int hf_zbee_zcl_ota_file_version_stack_release = -1; -static int hf_zbee_zcl_ota_file_version_stack_build = -1; -static int hf_zbee_zcl_ota_query_next_image_req_field_ctrl = -1; -static int hf_zbee_zcl_ota_query_next_image_req_field_ctrl_hw_ver_present = -1; -static int hf_zbee_zcl_ota_query_next_image_req_field_ctrl_reserved = -1; -static int hf_zbee_zcl_ota_image_block_req_field_ctrl = -1; -static int hf_zbee_zcl_ota_image_block_req_field_ctrl_ieee_addr_present = -1; -static int hf_zbee_zcl_ota_image_block_req_field_ctrl_min_block_period_present = -1; -static int hf_zbee_zcl_ota_image_block_req_field_ctrl_reserved = -1; -static int hf_zbee_zcl_ota_image_page_req_field_ctrl = -1; -static int hf_zbee_zcl_ota_image_page_req_field_ctrl_ieee_addr_present = -1; -static int hf_zbee_zcl_ota_image_page_req_field_ctrl_reserved = -1; -static int hf_zbee_zcl_ota_hw_version = -1; -static int hf_zbee_zcl_ota_status = -1; -static int hf_zbee_zcl_ota_image_size = -1; -static int hf_zbee_zcl_ota_max_data_size = -1; -static int hf_zbee_zcl_ota_min_block_period = -1; -static int hf_zbee_zcl_ota_req_node_addr = -1; -static int hf_zbee_zcl_ota_current_time = -1; -static int hf_zbee_zcl_ota_request_time = -1; -static int hf_zbee_zcl_ota_upgrade_time = -1; -static int hf_zbee_zcl_ota_data_size = -1; -static int hf_zbee_zcl_ota_image_data = -1; -static int hf_zbee_zcl_ota_page_size = -1; -static int hf_zbee_zcl_ota_rsp_spacing = -1; +static int proto_zbee_zcl_ota; + +static int hf_zbee_zcl_ota_attr_id; +static int hf_zbee_zcl_ota_srv_tx_cmd_id; +static int hf_zbee_zcl_ota_srv_rx_cmd_id; +static int hf_zbee_zcl_ota_image_upgrade_status; +static int hf_zbee_zcl_ota_zb_stack_ver; +static int hf_zbee_zcl_ota_file_offset; +static int hf_zbee_zcl_ota_payload_type; +static int hf_zbee_zcl_ota_query_jitter; +static int hf_zbee_zcl_ota_manufacturer_code; +static int hf_zbee_zcl_ota_image_type; +static int hf_zbee_zcl_ota_file_version; +static int hf_zbee_zcl_ota_file_version_appl_release; +static int hf_zbee_zcl_ota_file_version_appl_build; +static int hf_zbee_zcl_ota_file_version_stack_release; +static int hf_zbee_zcl_ota_file_version_stack_build; +static int hf_zbee_zcl_ota_query_next_image_req_field_ctrl; +static int hf_zbee_zcl_ota_query_next_image_req_field_ctrl_hw_ver_present; +static int hf_zbee_zcl_ota_query_next_image_req_field_ctrl_reserved; +static int hf_zbee_zcl_ota_image_block_req_field_ctrl; +static int hf_zbee_zcl_ota_image_block_req_field_ctrl_ieee_addr_present; +static int hf_zbee_zcl_ota_image_block_req_field_ctrl_min_block_period_present; +static int hf_zbee_zcl_ota_image_block_req_field_ctrl_reserved; +static int hf_zbee_zcl_ota_image_page_req_field_ctrl; +static int hf_zbee_zcl_ota_image_page_req_field_ctrl_ieee_addr_present; +static int hf_zbee_zcl_ota_image_page_req_field_ctrl_reserved; +static int hf_zbee_zcl_ota_hw_version; +static int hf_zbee_zcl_ota_status; +static int hf_zbee_zcl_ota_image_size; +static int hf_zbee_zcl_ota_max_data_size; +static int hf_zbee_zcl_ota_min_block_period; +static int hf_zbee_zcl_ota_req_node_addr; +static int hf_zbee_zcl_ota_current_time; +static int hf_zbee_zcl_ota_request_time; +static int hf_zbee_zcl_ota_upgrade_time; +static int hf_zbee_zcl_ota_upgrade_time_utc; +static int hf_zbee_zcl_ota_data_size; +static int hf_zbee_zcl_ota_image_data; +static int hf_zbee_zcl_ota_page_size; +static int hf_zbee_zcl_ota_rsp_spacing; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_ota = -1; -static gint ett_zbee_zcl_ota_query_next_image_req_field_ctrl = -1; -static gint ett_zbee_zcl_ota_image_block_req_field_ctrl = -1; -static gint ett_zbee_zcl_ota_image_page_req_field_ctrl = -1; -static gint ett_zbee_zcl_ota_file_version = -1; +static int ett_zbee_zcl_ota; +static int ett_zbee_zcl_ota_query_next_image_req_field_ctrl; +static int ett_zbee_zcl_ota_image_block_req_field_ctrl; +static int ett_zbee_zcl_ota_image_page_req_field_ctrl; +static int ett_zbee_zcl_ota_file_version; /* Attributes */ static const value_string zbee_zcl_ota_attr_names[] = { @@ -9924,14 +9924,14 @@ static const range_string zbee_zcl_ota_image_type_names[] = { *--------------------------------------------------------------- */ static void -decode_zcl_ota_curr_time(gchar *s, guint32 value) +decode_zcl_ota_curr_time(char *s, uint32_t value) { if (value == ZBEE_ZCL_OTA_TIME_NOW) { snprintf(s, ITEM_LABEL_LENGTH, "Now"); } else { - gchar *tmp; - value += ZBEE_ZCL_NSTIME_UTC_OFFSET; + char *tmp; + value += EPOCH_DELTA_2000_01_01_00_00_00_UTC; tmp = abs_time_secs_to_str(NULL, value, ABSOLUTE_TIME_LOCAL, 1); snprintf(s, ITEM_LABEL_LENGTH, "%s", tmp); wmem_free(NULL, tmp); @@ -9951,14 +9951,14 @@ decode_zcl_ota_curr_time(gchar *s, guint32 value) *--------------------------------------------------------------- */ static void -decode_zcl_ota_req_time(gchar *s, guint32 value) +decode_zcl_ota_req_time(char *s, uint32_t value) { if (value == ZBEE_ZCL_OTA_TIME_WAIT) { snprintf(s, ITEM_LABEL_LENGTH, "Wrong Value"); } else { /* offset from now */ - gchar *tmp = signed_time_secs_to_str(NULL, value); + char *tmp = signed_time_secs_to_str(NULL, value); snprintf(s, ITEM_LABEL_LENGTH, "%s from now", tmp); wmem_free(NULL, tmp); } @@ -9977,14 +9977,14 @@ decode_zcl_ota_req_time(gchar *s, guint32 value) *--------------------------------------------------------------- */ static void -decode_zcl_ota_upgr_time(gchar *s, guint32 value) +decode_zcl_ota_upgr_time(char *s, uint32_t value) { if (value == ZBEE_ZCL_OTA_TIME_WAIT) { snprintf(s, ITEM_LABEL_LENGTH, "Wait for upgrade command"); } else { /* offset from now */ - gchar *tmp = signed_time_secs_to_str(NULL, value); + char *tmp = signed_time_secs_to_str(NULL, value); snprintf(s, ITEM_LABEL_LENGTH, "%s from now", tmp); wmem_free(NULL, tmp); } @@ -9994,6 +9994,33 @@ decode_zcl_ota_upgr_time(gchar *s, guint32 value) /*FUNCTION:------------------------------------------------------ * NAME + * decode_zcl_ota_upgr_time_utc + * DESCRIPTION + * this function decode the upgrade time field when it is UTC time + * PARAMETERS + * RETURNS + * none + *--------------------------------------------------------------- + */ +static void +decode_zcl_ota_upgr_time_utc(char *s, uint32_t value) +{ + if (value == ZBEE_ZCL_OTA_TIME_WAIT) { + snprintf(s, ITEM_LABEL_LENGTH, "Wait for upgrade command"); + } + else { + char *tmp; + value += EPOCH_DELTA_2000_01_01_00_00_00_UTC; + tmp = abs_time_secs_to_str(NULL, value, ABSOLUTE_TIME_LOCAL, 1); + snprintf(s, ITEM_LABEL_LENGTH, "%s", tmp); + wmem_free(NULL, tmp); + } + + return; +} /*decode_zcl_ota_upgr_time_utc*/ + +/*FUNCTION:------------------------------------------------------ + * NAME * decode_zcl_ota_size_in_bytes * DESCRIPTION * this function decodes size in bytes @@ -10003,7 +10030,7 @@ decode_zcl_ota_upgr_time(gchar *s, guint32 value) *--------------------------------------------------------------- */ static void -decode_zcl_ota_size_in_bytes(gchar *s, guint32 value) +decode_zcl_ota_size_in_bytes(char *s, uint32_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%d [Bytes]", value); } /*decode_zcl_ota_size_in_bytes*/ @@ -10016,13 +10043,13 @@ decode_zcl_ota_size_in_bytes(gchar *s, guint32 value) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_file_version_field(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_file_version_field(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const file_version[] = { &hf_zbee_zcl_ota_file_version_appl_release, @@ -10050,21 +10077,21 @@ dissect_zcl_ota_file_version_field(tvbuff_t *tvb, proto_tree *tree, guint *offse * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * int hf_hdr - hf_hdr - * gint ett - ett subtree index + * int ett - ett subtree index * int* const *fields - fields an array of pointers to int that lists all the fields of the bitmask * RETURNS - * guint8 - field ctrl value + * uint8_t - field ctrl value *--------------------------------------------------------------- */ -static guint8 -dissect_zcl_ota_field_ctrl_field(tvbuff_t *tvb, proto_tree *tree, guint *offset, int hf_hdr, gint ett, int * const *fields) +static uint8_t +dissect_zcl_ota_field_ctrl_field(tvbuff_t *tvb, proto_tree *tree, unsigned *offset, int hf_hdr, int ett, int * const *fields) { - guint8 field; + uint8_t field; /* Retrieve 'Field Control' field */ - field = tvb_get_guint8(tvb, *offset); + field = tvb_get_uint8(tvb, *offset); proto_tree_add_bitmask(tree, tvb, *offset, hf_hdr, ett, fields, ENC_NA); *offset += 1; @@ -10079,18 +10106,18 @@ dissect_zcl_ota_field_ctrl_field(tvbuff_t *tvb, proto_tree *tree, guint *offset, * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_imagenotify(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_imagenotify(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 payload_type; + uint8_t payload_type; /* Retrieve 'Payload type' field */ - payload_type = tvb_get_guint8(tvb, *offset); + payload_type = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_ota_payload_type, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -10127,13 +10154,13 @@ dissect_zcl_ota_imagenotify(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_querynextimagereq(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_querynextimagereq(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const fields[] = { &hf_zbee_zcl_ota_query_next_image_req_field_ctrl_hw_ver_present, @@ -10141,7 +10168,7 @@ dissect_zcl_ota_querynextimagereq(tvbuff_t *tvb, proto_tree *tree, guint *offset NULL }; - guint8 field_ctrl; + uint8_t field_ctrl; /* Retrieve 'Field Control' field */ field_ctrl = dissect_zcl_ota_field_ctrl_field(tvb, tree, offset, hf_zbee_zcl_ota_query_next_image_req_field_ctrl, ett_zbee_zcl_ota_query_next_image_req_field_ctrl, fields); @@ -10173,18 +10200,18 @@ dissect_zcl_ota_querynextimagereq(tvbuff_t *tvb, proto_tree *tree, guint *offset * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_querynextimagersp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_querynextimagersp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 status; + uint8_t status; /* Retrieve 'Status' field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_ota_status, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -10216,13 +10243,13 @@ dissect_zcl_ota_querynextimagersp(tvbuff_t *tvb, proto_tree *tree, guint *offset * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_imageblockreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_imageblockreq(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const fields[] = { &hf_zbee_zcl_ota_image_block_req_field_ctrl_ieee_addr_present, @@ -10231,7 +10258,7 @@ dissect_zcl_ota_imageblockreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) NULL }; - guint8 field_ctrl; + uint8_t field_ctrl; /* Retrieve 'Field Control' field */ field_ctrl = dissect_zcl_ota_field_ctrl_field(tvb, tree, offset, hf_zbee_zcl_ota_image_block_req_field_ctrl, ett_zbee_zcl_ota_image_block_req_field_ctrl, fields); @@ -10276,13 +10303,13 @@ dissect_zcl_ota_imageblockreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_imagepagereq(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_imagepagereq(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const fields[] = { &hf_zbee_zcl_ota_image_page_req_field_ctrl_ieee_addr_present, @@ -10290,7 +10317,7 @@ dissect_zcl_ota_imagepagereq(tvbuff_t *tvb, proto_tree *tree, guint *offset) NULL }; - guint8 field_ctrl; + uint8_t field_ctrl; /* Retrieve 'Field Control' field */ field_ctrl = dissect_zcl_ota_field_ctrl_field(tvb, tree, offset, hf_zbee_zcl_ota_image_page_req_field_ctrl, ett_zbee_zcl_ota_image_page_req_field_ctrl, fields); @@ -10338,19 +10365,19 @@ dissect_zcl_ota_imagepagereq(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 status; - guint8 data_size; + uint8_t status; + uint8_t data_size; /* Retrieve 'Status' field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_ota_status, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -10371,7 +10398,7 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) *offset += 4; /* Retrieve 'Data Size' field */ - data_size = tvb_get_guint8(tvb, *offset); + data_size = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_ota_data_size, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -10402,13 +10429,13 @@ dissect_zcl_ota_imageblockrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_upgradeendreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_upgradeendreq(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve 'Status' field */ proto_tree_add_item(tree, hf_zbee_zcl_ota_status, tvb, *offset, 1, ENC_NA); @@ -10435,14 +10462,16 @@ dissect_zcl_ota_upgradeendreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_upgradeendrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_upgradeendrsp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { + uint32_t current_time = 0; + /* Retrieve 'Manufacturer Code' field */ proto_tree_add_item(tree, hf_zbee_zcl_ota_manufacturer_code, tvb, *offset, 2, ENC_LITTLE_ENDIAN); *offset += 2; @@ -10455,12 +10484,22 @@ dissect_zcl_ota_upgradeendrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) dissect_zcl_ota_file_version_field(tvb, tree, offset); /* Retrieve 'Current Time' field */ - proto_tree_add_item(tree, hf_zbee_zcl_ota_current_time, tvb, *offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item_ret_uint(tree, hf_zbee_zcl_ota_current_time, tvb, *offset, 4, ENC_LITTLE_ENDIAN, ¤t_time); *offset += 4; /* Retrieve 'Upgrade Time' field */ - proto_tree_add_item(tree, hf_zbee_zcl_ota_upgrade_time, tvb, *offset, 4, ENC_LITTLE_ENDIAN); - *offset += 4; + if (current_time == 0) + { + /* Upgrade Time is offset time from now */ + proto_tree_add_item(tree, hf_zbee_zcl_ota_upgrade_time, tvb, *offset, 4, ENC_LITTLE_ENDIAN); + *offset += 4; + } + else + { + /* Upgrade Time is UTC time */ + proto_tree_add_item(tree, hf_zbee_zcl_ota_upgrade_time_utc, tvb, *offset, 4, ENC_LITTLE_ENDIAN); + *offset += 4; + } } /*dissect_zcl_ota_upgradeendrsp*/ @@ -10472,13 +10511,13 @@ dissect_zcl_ota_upgradeendrsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_queryspecfilereq(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_queryspecfilereq(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* 'Request Node Address' field present, retrieves it */ proto_tree_add_item(tree, hf_zbee_zcl_ota_req_node_addr, tvb, *offset, 8, ENC_LITTLE_ENDIAN); @@ -10509,18 +10548,18 @@ dissect_zcl_ota_queryspecfilereq(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_queryspecfilersp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_ota_queryspecfilersp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 status; + uint8_t status; /* Retrieve 'Status' field */ - status = tvb_get_guint8(tvb, *offset); + status = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_ota_status, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -10553,16 +10592,16 @@ dissect_zcl_ota_queryspecfilersp(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_ota_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_ota_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch ( attr_id ) @@ -10620,9 +10659,9 @@ dissect_zbee_zcl_ota(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -10726,9 +10765,9 @@ dissect_zbee_zcl_ota(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type * RETURNS * none *--------------------------------------------------------------- @@ -10889,6 +10928,10 @@ void proto_register_zbee_zcl_ota(void) { "Upgrade Time", "zbee_zcl_general.ota.upgrade_time", FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_zcl_ota_upgr_time), 0x0, NULL, HFILL }}, + { &hf_zbee_zcl_ota_upgrade_time_utc, + { "Upgrade Time", "zbee_zcl_general.ota.upgrade_time_utc", FT_UINT32, BASE_CUSTOM, CF_FUNC(decode_zcl_ota_upgr_time_utc), + 0x0, NULL, HFILL }}, + { &hf_zbee_zcl_ota_data_size, { "Data Size", "zbee_zcl_general.ota.data_size", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, @@ -10899,7 +10942,7 @@ void proto_register_zbee_zcl_ota(void) }; /* ZCL OTA subtrees */ - gint *ett[] = { + int *ett[] = { &ett_zbee_zcl_ota, &ett_zbee_zcl_ota_query_next_image_req_field_ctrl, &ett_zbee_zcl_ota_image_block_req_field_ctrl, @@ -11023,76 +11066,76 @@ void proto_register_zbee_zcl_pwr_prof(void); void proto_reg_handoff_zbee_zcl_pwr_prof(void); /* Command Dissector Helpers */ -static void dissect_zcl_pwr_prof_pwrprofreq (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_getpwrprofpricersp (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_getoverallschedpricersp (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_enphsschednotif (tvbuff_t *tvb, proto_tree *tree, guint *offset); +static void dissect_zcl_pwr_prof_pwrprofreq (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_getpwrprofpricersp (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_getoverallschedpricersp (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_enphsschednotif (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); -static void dissect_zcl_energy_phase (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_pwrprofnotif (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_power_profile (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_pwrprofstatersp (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_pwrprofschedcontrsnotif (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_pwr_prof_pwrprofpriceext (tvbuff_t *tvb, proto_tree *tree, guint *offset); +static void dissect_zcl_energy_phase (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_pwrprofnotif (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_power_profile (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_pwrprofstatersp (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_pwrprofschedcontrsnotif (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_pwr_prof_pwrprofpriceext (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); -static void dissect_zcl_pwr_prof_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_pwr_prof_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ -static void decode_power_profile_id (gchar *s, guint8 id); -static void decode_price_in_cents (gchar *s, guint32 value); -static void decode_power_in_watt (gchar *s, guint16 value); -static void decode_energy (gchar *s, guint16 value); +static void decode_power_profile_id (char *s, uint8_t id); +static void decode_price_in_cents (char *s, uint32_t value); +static void decode_power_in_watt (char *s, uint16_t value); +static void decode_energy (char *s, uint16_t value); /*************************/ /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_pwr_prof = -1; - -static int hf_zbee_zcl_pwr_prof_attr_id = -1; -static int hf_zbee_zcl_pwr_prof_tot_prof_num = -1; -static int hf_zbee_zcl_pwr_prof_multiple_sched = -1; -static int hf_zbee_zcl_pwr_prof_energy_format = -1; -static int hf_zbee_zcl_pwr_prof_energy_format_rdigit = -1; -static int hf_zbee_zcl_pwr_prof_energy_format_ldigit = -1; -static int hf_zbee_zcl_pwr_prof_energy_format_noleadingzero = -1; -static int hf_zbee_zcl_pwr_prof_energy_remote = -1; -static int hf_zbee_zcl_pwr_prof_sched_mode = -1; -static int hf_zbee_zcl_pwr_prof_sched_mode_cheapest = -1; -static int hf_zbee_zcl_pwr_prof_sched_mode_greenest = -1; -static int hf_zbee_zcl_pwr_prof_sched_mode_reserved = -1; -static int hf_zbee_zcl_pwr_prof_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_pwr_prof_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_pwr_prof_pwr_prof_id = -1; -static int hf_zbee_zcl_pwr_prof_currency = -1; -static int hf_zbee_zcl_pwr_prof_price = -1; -static int hf_zbee_zcl_pwr_prof_price_trailing_digit = -1; -static int hf_zbee_zcl_pwr_prof_num_of_sched_phases = -1; -static int hf_zbee_zcl_pwr_prof_scheduled_time = -1; -static int hf_zbee_zcl_pwr_prof_pwr_prof_count = -1; -static int hf_zbee_zcl_pwr_prof_num_of_trans_phases = -1; -static int hf_zbee_zcl_pwr_prof_energy_phase_id = -1; -static int hf_zbee_zcl_pwr_prof_macro_phase_id = -1; -static int hf_zbee_zcl_pwr_prof_expect_duration = -1; -static int hf_zbee_zcl_pwr_prof_peak_power = -1; -static int hf_zbee_zcl_pwr_prof_energy = -1; -static int hf_zbee_zcl_pwr_prof_max_active_delay = -1; -static int hf_zbee_zcl_pwr_prof_pwr_prof_rem_ctrl = -1; -static int hf_zbee_zcl_pwr_prof_pwr_prof_state = -1; -static int hf_zbee_zcl_pwr_prof_start_after = -1; -static int hf_zbee_zcl_pwr_prof_stop_before = -1; -static int hf_zbee_zcl_pwr_prof_options = -1; -static int hf_zbee_zcl_pwr_prof_options_01 = -1; -static int hf_zbee_zcl_pwr_prof_options_res = -1; -static int hf_zbee_zcl_pwr_prof_pwr_prof_stime = -1; +static int proto_zbee_zcl_pwr_prof; + +static int hf_zbee_zcl_pwr_prof_attr_id; +static int hf_zbee_zcl_pwr_prof_tot_prof_num; +static int hf_zbee_zcl_pwr_prof_multiple_sched; +static int hf_zbee_zcl_pwr_prof_energy_format; +static int hf_zbee_zcl_pwr_prof_energy_format_rdigit; +static int hf_zbee_zcl_pwr_prof_energy_format_ldigit; +static int hf_zbee_zcl_pwr_prof_energy_format_noleadingzero; +static int hf_zbee_zcl_pwr_prof_energy_remote; +static int hf_zbee_zcl_pwr_prof_sched_mode; +static int hf_zbee_zcl_pwr_prof_sched_mode_cheapest; +static int hf_zbee_zcl_pwr_prof_sched_mode_greenest; +static int hf_zbee_zcl_pwr_prof_sched_mode_reserved; +static int hf_zbee_zcl_pwr_prof_srv_tx_cmd_id; +static int hf_zbee_zcl_pwr_prof_srv_rx_cmd_id; +static int hf_zbee_zcl_pwr_prof_pwr_prof_id; +static int hf_zbee_zcl_pwr_prof_currency; +static int hf_zbee_zcl_pwr_prof_price; +static int hf_zbee_zcl_pwr_prof_price_trailing_digit; +static int hf_zbee_zcl_pwr_prof_num_of_sched_phases; +static int hf_zbee_zcl_pwr_prof_scheduled_time; +static int hf_zbee_zcl_pwr_prof_pwr_prof_count; +static int hf_zbee_zcl_pwr_prof_num_of_trans_phases; +static int hf_zbee_zcl_pwr_prof_energy_phase_id; +static int hf_zbee_zcl_pwr_prof_macro_phase_id; +static int hf_zbee_zcl_pwr_prof_expect_duration; +static int hf_zbee_zcl_pwr_prof_peak_power; +static int hf_zbee_zcl_pwr_prof_energy; +static int hf_zbee_zcl_pwr_prof_max_active_delay; +static int hf_zbee_zcl_pwr_prof_pwr_prof_rem_ctrl; +static int hf_zbee_zcl_pwr_prof_pwr_prof_state; +static int hf_zbee_zcl_pwr_prof_start_after; +static int hf_zbee_zcl_pwr_prof_stop_before; +static int hf_zbee_zcl_pwr_prof_options; +static int hf_zbee_zcl_pwr_prof_options_01; +static int hf_zbee_zcl_pwr_prof_options_res; +static int hf_zbee_zcl_pwr_prof_pwr_prof_stime; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_pwr_prof = -1; -static gint ett_zbee_zcl_pwr_prof_options = -1; -static gint ett_zbee_zcl_pwr_prof_en_format = -1; -static gint ett_zbee_zcl_pwr_prof_sched_mode = -1; -static gint ett_zbee_zcl_pwr_prof_pwrprofiles[ZBEE_ZCL_PWR_PROF_NUM_PWR_PROF_ETT]; -static gint ett_zbee_zcl_pwr_prof_enphases[ZBEE_ZCL_PWR_PROF_NUM_EN_PHS_ETT]; +static int ett_zbee_zcl_pwr_prof; +static int ett_zbee_zcl_pwr_prof_options; +static int ett_zbee_zcl_pwr_prof_en_format; +static int ett_zbee_zcl_pwr_prof_sched_mode; +static int ett_zbee_zcl_pwr_prof_pwrprofiles[ZBEE_ZCL_PWR_PROF_NUM_PWR_PROF_ETT]; +static int ett_zbee_zcl_pwr_prof_enphases[ZBEE_ZCL_PWR_PROF_NUM_EN_PHS_ETT]; /* Attributes */ static const value_string zbee_zcl_pwr_prof_attr_names[] = { @@ -11178,9 +11221,9 @@ dissect_zbee_zcl_pwr_prof (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -11302,13 +11345,13 @@ dissect_zbee_zcl_pwr_prof (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_pwrprofreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_pwrprofreq(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Power Profile Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_pwr_prof_id, tvb, *offset, 1, ENC_NA); @@ -11326,13 +11369,13 @@ dissect_zcl_pwr_prof_pwrprofreq(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_getpwrprofpricersp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_getpwrprofpricersp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Power Profile Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_pwr_prof_id, tvb, *offset, 1, ENC_NA); @@ -11362,13 +11405,13 @@ dissect_zcl_pwr_prof_getpwrprofpricersp(tvbuff_t *tvb, proto_tree *tree, guint * * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_getoverallschedpricersp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_getoverallschedpricersp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Currency" field */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_currency, tvb, *offset, 2, ENC_LITTLE_ENDIAN); @@ -11394,13 +11437,13 @@ dissect_zcl_pwr_prof_getoverallschedpricersp(tvbuff_t *tvb, proto_tree *tree, gu * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_sched_energy_phase(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_sched_energy_phase(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Energy Phase ID */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_energy_phase_id, tvb, *offset, 1, ENC_NA); @@ -11422,25 +11465,25 @@ dissect_zcl_sched_energy_phase(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_enphsschednotif(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_enphsschednotif(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree *sub_tree = NULL; - guint i; - guint8 num_of_sched_phases; + unsigned i; + uint8_t num_of_sched_phases; /* Retrieve "Power Profile Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_pwr_prof_id, tvb, *offset, 1, ENC_NA); *offset += 1; /* Retrieve "Number of Scheduled Phases" field */ - num_of_sched_phases = tvb_get_guint8(tvb, *offset); + num_of_sched_phases = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_num_of_sched_phases, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -11464,13 +11507,13 @@ dissect_zcl_pwr_prof_enphsschednotif(tvbuff_t *tvb, proto_tree *tree, guint *off * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_energy_phase(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_energy_phase(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_energy_phase_id, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -11502,22 +11545,22 @@ dissect_zcl_energy_phase(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_pwrprofnotif(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_pwrprofnotif(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree *sub_tree = NULL; - guint i; - guint8 total_profile_number; - guint8 num_of_transferred_phases; + unsigned i; + uint8_t total_profile_number; + uint8_t num_of_transferred_phases; /* Retrieve "Total Profile Number" field */ - total_profile_number = tvb_get_guint8(tvb, *offset); + total_profile_number = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_tot_prof_num, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -11527,7 +11570,7 @@ dissect_zcl_pwr_prof_pwrprofnotif(tvbuff_t *tvb, proto_tree *tree, guint *offset *offset += 1; /* Retrieve "Number of Transferred Phases" field */ - num_of_transferred_phases = tvb_get_guint8(tvb, *offset); + num_of_transferred_phases = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_num_of_trans_phases, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -11552,13 +11595,13 @@ dissect_zcl_pwr_prof_pwrprofnotif(tvbuff_t *tvb, proto_tree *tree, guint *offset * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_power_profile(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_power_profile(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Power Profile Id */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_pwr_prof_id, tvb, *offset, 1, ENC_NA); @@ -11588,21 +11631,21 @@ dissect_zcl_power_profile(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_pwrprofstatersp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_pwrprofstatersp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree *sub_tree = NULL; - guint i; - guint8 power_profile_count; + unsigned i; + uint8_t power_profile_count; /* Retrieve "Total Profile Number" field */ - power_profile_count = MIN(tvb_get_guint8(tvb, *offset), ZBEE_ZCL_PWR_PROF_NUM_PWR_PROF_ETT); + power_profile_count = MIN(tvb_get_uint8(tvb, *offset), ZBEE_ZCL_PWR_PROF_NUM_PWR_PROF_ETT); proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_pwr_prof_count, tvb, *offset, 1, ENC_NA); *offset += 1; @@ -11626,13 +11669,13 @@ dissect_zcl_pwr_prof_pwrprofstatersp(tvbuff_t *tvb, proto_tree *tree, guint *off * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_pwrprofschedcontrsnotif(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_pwrprofschedcontrsnotif(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Power Profile Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_pwr_prof_pwr_prof_id, tvb, *offset, 1, ENC_NA); @@ -11658,13 +11701,13 @@ dissect_zcl_pwr_prof_pwrprofschedcontrsnotif(tvbuff_t *tvb, proto_tree *tree, gu * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_pwrprofpriceext(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_pwr_prof_pwrprofpriceext(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const options[] = { &hf_zbee_zcl_pwr_prof_options_01, @@ -11696,16 +11739,16 @@ dissect_zcl_pwr_prof_pwrprofpriceext(tvbuff_t *tvb, proto_tree *tree, guint *off * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_pwr_prof_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_pwr_prof_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const format_fields[] = { &hf_zbee_zcl_pwr_prof_energy_format_rdigit, @@ -11761,14 +11804,14 @@ dissect_zcl_pwr_prof_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, g * DESCRIPTION * this function decodes the power profile custom type * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_power_profile_id(gchar *s, guint8 id) +decode_power_profile_id(char *s, uint8_t id) { if (id == 0) { snprintf(s, ITEM_LABEL_LENGTH, "%d (All)", id); @@ -11785,14 +11828,14 @@ decode_power_profile_id(gchar *s, guint8 id) * DESCRIPTION * this function decodes price type variable * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_price_in_cents(gchar *s, guint32 value) +decode_price_in_cents(char *s, uint32_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%d cents", value); } /* decode_price_in_cents */ @@ -11804,14 +11847,14 @@ decode_price_in_cents(gchar *s, guint32 value) * DESCRIPTION * this function decodes watt power type variable * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_power_in_watt(gchar *s, guint16 value) +decode_power_in_watt(char *s, uint16_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%d Watt", value); } /* decode_power_in_watt */ @@ -11822,14 +11865,14 @@ decode_power_in_watt(gchar *s, guint16 value) * DESCRIPTION * this function decodes energy type variable * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -decode_energy(gchar *s, guint16 value) +decode_energy(char *s, uint16_t value) { snprintf(s, ITEM_LABEL_LENGTH, "%d Watt per hours", value); } /* decode_energy */ @@ -11840,14 +11883,14 @@ decode_energy(gchar *s, guint16 value) * DESCRIPTION * this function decodes minute delay type variable * PARAMETERS - * guint *s - string to display - * guint16 value - value to decode + * unsigned *s - string to display + * uint16_t value - value to decode * RETURNS * none *--------------------------------------------------------------- */ static void -func_decode_delayinminute(gchar *s, guint16 value) +func_decode_delayinminute(char *s, uint16_t value) { if (value == 0) { snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (Not permitted)", value); @@ -11873,7 +11916,7 @@ func_decode_delayinminute(gchar *s, guint16 value) void proto_register_zbee_zcl_pwr_prof(void) { - guint i, j; + unsigned i, j; static hf_register_info hf[] = { @@ -12030,7 +12073,7 @@ proto_register_zbee_zcl_pwr_prof(void) }; /* ZCL PowerProfile subtrees */ - static gint *ett[ZBEE_ZCL_PWR_PROF_NUM_ETT] = { + static int *ett[ZBEE_ZCL_PWR_PROF_NUM_ETT] = { &ett_zbee_zcl_pwr_prof, &ett_zbee_zcl_pwr_prof_options, &ett_zbee_zcl_pwr_prof_en_format, @@ -12039,12 +12082,10 @@ proto_register_zbee_zcl_pwr_prof(void) /* initialize attribute subtree types */ for ( i = 0, j = ZBEE_ZCL_PWR_PROF_NUM_GENERIC_ETT; i < ZBEE_ZCL_PWR_PROF_NUM_PWR_PROF_ETT; i++, j++ ) { - ett_zbee_zcl_pwr_prof_pwrprofiles[i] = -1; ett[j] = &ett_zbee_zcl_pwr_prof_pwrprofiles[i]; } for ( i = 0; i < ZBEE_ZCL_PWR_PROF_NUM_EN_PHS_ETT; i++, j++ ) { - ett_zbee_zcl_pwr_prof_enphases[i] = -1; ett[j] = &ett_zbee_zcl_pwr_prof_enphases[i]; } @@ -12184,13 +12225,13 @@ void proto_register_zbee_zcl_appl_ctrl(void); void proto_reg_handoff_zbee_zcl_appl_ctrl(void); /* Command Dissector Helpers */ -static void dissect_zcl_appl_ctrl_exec_cmd (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_appl_ctrl_attr_func (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_appl_ctrl_wr_funcs (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_appl_ctrl_ovrl_warning (tvbuff_t *tvb, proto_tree *tree, guint *offset); -static void dissect_zcl_appl_ctrl_signal_state_rsp (tvbuff_t *tvb, proto_tree *tree, guint *offset); +static void dissect_zcl_appl_ctrl_exec_cmd (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_appl_ctrl_attr_func (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_appl_ctrl_wr_funcs (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_appl_ctrl_ovrl_warning (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); +static void dissect_zcl_appl_ctrl_signal_state_rsp (tvbuff_t *tvb, proto_tree *tree, unsigned *offset); -static void dissect_zcl_appl_ctrl_attr_data (proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr); +static void dissect_zcl_appl_ctrl_attr_data (proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr); /* Private functions prototype */ @@ -12198,30 +12239,30 @@ static void dissect_zcl_appl_ctrl_attr_data (proto_tree *tree, tvbuf /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_appl_ctrl = -1; - -static int hf_zbee_zcl_appl_ctrl_attr_id = -1; -static int hf_zbee_zcl_appl_ctrl_time = -1; -static int hf_zbee_zcl_appl_ctrl_time_mm = -1; -static int hf_zbee_zcl_appl_ctrl_time_encoding_type = -1; -static int hf_zbee_zcl_appl_ctrl_time_hh = -1; -static int hf_zbee_zcl_appl_ctrl_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_appl_ctrl_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_appl_ctrl_exec_cmd_id = -1; -static int hf_zbee_zcl_appl_ctrl_attr_func_id = -1; -static int hf_zbee_zcl_appl_ctrl_attr_func_data_type = -1; -static int hf_zbee_zcl_appl_ctrl_warning_id = -1; -static int hf_zbee_zcl_appl_ctrl_appl_status = -1; -static int hf_zbee_zcl_appl_ctrl_rem_en_flags_raw = -1; -static int hf_zbee_zcl_appl_ctrl_rem_en_flags = -1; -static int hf_zbee_zcl_appl_ctrl_status2 = -1; -static int hf_zbee_zcl_appl_ctrl_status2_array = -1; +static int proto_zbee_zcl_appl_ctrl; + +static int hf_zbee_zcl_appl_ctrl_attr_id; +static int hf_zbee_zcl_appl_ctrl_time; +static int hf_zbee_zcl_appl_ctrl_time_mm; +static int hf_zbee_zcl_appl_ctrl_time_encoding_type; +static int hf_zbee_zcl_appl_ctrl_time_hh; +static int hf_zbee_zcl_appl_ctrl_srv_tx_cmd_id; +static int hf_zbee_zcl_appl_ctrl_srv_rx_cmd_id; +static int hf_zbee_zcl_appl_ctrl_exec_cmd_id; +static int hf_zbee_zcl_appl_ctrl_attr_func_id; +static int hf_zbee_zcl_appl_ctrl_attr_func_data_type; +static int hf_zbee_zcl_appl_ctrl_warning_id; +static int hf_zbee_zcl_appl_ctrl_appl_status; +static int hf_zbee_zcl_appl_ctrl_rem_en_flags_raw; +static int hf_zbee_zcl_appl_ctrl_rem_en_flags; +static int hf_zbee_zcl_appl_ctrl_status2; +static int hf_zbee_zcl_appl_ctrl_status2_array; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_appl_ctrl = -1; -static gint ett_zbee_zcl_appl_ctrl_flags = -1; -static gint ett_zbee_zcl_appl_ctrl_time = -1; -static gint ett_zbee_zcl_appl_ctrl_func[ZBEE_ZCL_APPL_CTRL_NUM_FUNC_ETT]; +static int ett_zbee_zcl_appl_ctrl; +static int ett_zbee_zcl_appl_ctrl_flags; +static int ett_zbee_zcl_appl_ctrl_time; +static int ett_zbee_zcl_appl_ctrl_func[ZBEE_ZCL_APPL_CTRL_NUM_FUNC_ETT]; /* Attributes */ static const value_string zbee_zcl_appl_ctrl_attr_names[] = { @@ -12276,7 +12317,7 @@ static const value_string zbee_zcl_appl_ctrl_appl_status_names[] = { { ZBEE_ZCL_APPL_CTRL_ID_STATUS_PAUSE, "Pause" }, { ZBEE_ZCL_APPL_CTRL_ID_STATUS_END_PRG, "End Programmed" }, { ZBEE_ZCL_APPL_CTRL_ID_STATUS_FAILURE, "Failure" }, - { ZBEE_ZCL_APPL_CTRL_ID_STATUS_PRG_INTERRUPTED, "Programme Interrupted" }, + { ZBEE_ZCL_APPL_CTRL_ID_STATUS_PRG_INTERRUPTED, "Programming Interrupted" }, { ZBEE_ZCL_APPL_CTRL_ID_STATUS_IDLE, "Idle" }, { ZBEE_ZCL_APPL_CTRL_ID_STATUS_RINSE_HOLD, "Raise Hold" }, { ZBEE_ZCL_APPL_CTRL_ID_STATUS_SERVICE, "Service" }, @@ -12343,9 +12384,9 @@ dissect_zbee_zcl_appl_ctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, { proto_tree *payload_tree; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; - gint rem_len; + unsigned offset = 0; + uint8_t cmd_id; + int rem_len; /* Reject the packet if data is NULL */ if (data == NULL) @@ -12433,13 +12474,13 @@ dissect_zbee_zcl_appl_ctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_appl_ctrl_exec_cmd(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_appl_ctrl_exec_cmd(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Command Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_appl_ctrl_exec_cmd_id, tvb, *offset, 1, ENC_NA); @@ -12455,16 +12496,16 @@ dissect_zcl_appl_ctrl_exec_cmd(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_appl_ctrl_attr_func(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_appl_ctrl_attr_func(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { - guint8 func_data_type; - guint16 func_id; + uint8_t func_data_type; + uint16_t func_id; /* ID */ func_id = tvb_get_letohs(tvb, *offset); @@ -12475,12 +12516,12 @@ dissect_zcl_appl_ctrl_attr_func(tvbuff_t *tvb, proto_tree *tree, guint *offset) val_to_str_ext_const(func_id, &zbee_zcl_appl_ctrl_attr_names_ext, "Reserved")); /* Data Type */ - func_data_type = tvb_get_guint8(tvb, *offset); + func_data_type = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_appl_ctrl_attr_func_data_type, tvb, *offset, 1, ENC_NA); *offset += 1; /* Function Data Dissector */ - dissect_zcl_appl_ctrl_attr_data(tree, tvb, offset, func_id, func_data_type, FALSE); + dissect_zcl_appl_ctrl_attr_data(tree, tvb, offset, func_id, func_data_type, false); } /*dissect_zcl_appl_ctrl_attr_func*/ @@ -12494,17 +12535,17 @@ dissect_zcl_appl_ctrl_attr_func(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_appl_ctrl_wr_funcs(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_appl_ctrl_wr_funcs(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree *sub_tree = NULL; - guint tvb_len; - guint i = 0; + unsigned tvb_len; + unsigned i = 0; tvb_len = tvb_reported_length(tvb); while ( *offset < tvb_len && i < ZBEE_ZCL_APPL_CTRL_NUM_FUNC_ETT ) { @@ -12529,13 +12570,13 @@ dissect_zcl_appl_ctrl_wr_funcs(tvbuff_t *tvb, proto_tree *tree, guint *offset) * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_appl_ctrl_ovrl_warning(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_appl_ctrl_ovrl_warning(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { /* Retrieve "Warning Id" field */ proto_tree_add_item(tree, hf_zbee_zcl_appl_ctrl_warning_id, tvb, *offset, 1, ENC_NA); @@ -12553,13 +12594,13 @@ dissect_zcl_appl_ctrl_ovrl_warning(tvbuff_t *tvb, proto_tree *tree, guint *offse * PARAMETERS * tvbuff_t *tvb - pointer to buffer containing raw packet. * proto_tree *tree - pointer to data tree Wireshark uses to display packet. - * guint *offset - pointer to buffer offset + * unsigned *offset - pointer to buffer offset * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_appl_ctrl_signal_state_rsp(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_appl_ctrl_signal_state_rsp(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const flags[] = { &hf_zbee_zcl_appl_ctrl_rem_en_flags, @@ -12588,16 +12629,16 @@ dissect_zcl_appl_ctrl_signal_state_rsp(tvbuff_t *tvb, proto_tree *tree, guint *o * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_appl_ctrl_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id, guint data_type, gboolean client_attr) +dissect_zcl_appl_ctrl_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id, unsigned data_type, bool client_attr) { static int * const flags[] = { &hf_zbee_zcl_appl_ctrl_time_mm, @@ -12638,7 +12679,7 @@ dissect_zcl_appl_ctrl_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, void proto_register_zbee_zcl_appl_ctrl(void) { - guint i, j; + unsigned i, j; static hf_register_info hf[] = { @@ -12709,7 +12750,7 @@ proto_register_zbee_zcl_appl_ctrl(void) }; /* ZCL ApplianceControl subtrees */ - gint *ett[ZBEE_ZCL_APPL_CTRL_NUM_ETT] = { + int *ett[ZBEE_ZCL_APPL_CTRL_NUM_ETT] = { &ett_zbee_zcl_appl_ctrl, &ett_zbee_zcl_appl_ctrl_flags, &ett_zbee_zcl_appl_ctrl_time @@ -12717,7 +12758,6 @@ proto_register_zbee_zcl_appl_ctrl(void) /* initialize attribute subtree types */ for ( i = 0, j = ZBEE_ZCL_APPL_CTRL_NUM_GENERIC_ETT; i < ZBEE_ZCL_APPL_CTRL_NUM_FUNC_ETT; i++, j++) { - ett_zbee_zcl_appl_ctrl_func[i] = -1; ett[j] = &ett_zbee_zcl_appl_ctrl_func[i]; } @@ -12810,17 +12850,17 @@ static const value_string zbee_zcl_poll_ctrl_srv_rx_cmd_names[] = { /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_poll_ctrl = -1; +static int proto_zbee_zcl_poll_ctrl; -static int hf_zbee_zcl_poll_ctrl_attr_id = -1; -static int hf_zbee_zcl_poll_ctrl_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_poll_ctrl_srv_tx_cmd_id = -1; -static int hf_zbee_zcl_poll_ctrl_start_fast_polling = -1; -static int hf_zbee_zcl_poll_ctrl_fast_poll_timeout = -1; -static int hf_zbee_zcl_poll_ctrl_new_long_poll_interval = -1; -static int hf_zbee_zcl_poll_ctrl_new_short_poll_interval = -1; +static int hf_zbee_zcl_poll_ctrl_attr_id; +static int hf_zbee_zcl_poll_ctrl_srv_rx_cmd_id; +static int hf_zbee_zcl_poll_ctrl_srv_tx_cmd_id; +static int hf_zbee_zcl_poll_ctrl_start_fast_polling; +static int hf_zbee_zcl_poll_ctrl_fast_poll_timeout; +static int hf_zbee_zcl_poll_ctrl_new_long_poll_interval; +static int hf_zbee_zcl_poll_ctrl_new_short_poll_interval; -static gint ett_zbee_zcl_poll_ctrl = -1; +static int ett_zbee_zcl_poll_ctrl; /*************************/ /* Function Declarations */ @@ -12846,8 +12886,8 @@ static int dissect_zbee_zcl_poll_ctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; + unsigned offset = 0; + uint8_t cmd_id; /* Reject the packet if data is NULL */ if (data == NULL) @@ -12920,16 +12960,16 @@ dissect_zbee_zcl_poll_ctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * PARAMETERS * proto_tree *tree - pointer to data tree Wireshark uses to display packet. * tvbuff_t *tvb - pointer to buffer containing raw packet. - * guint *offset - pointer to buffer offset - * guint16 attr_id - attribute identifier - * guint data_type - attribute data type - * gboolean client_attr- ZCL client + * unsigned *offset - pointer to buffer offset + * uint16_t attr_id - attribute identifier + * unsigned data_type - attribute data type + * bool client_attr- ZCL client * RETURNS * none *--------------------------------------------------------------- */ static void -dissect_zcl_poll_ctrl_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id _U_, guint data_type, gboolean client_attr) +dissect_zcl_poll_ctrl_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id _U_, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ dissect_zcl_attr_data(tvb, tree, offset, data_type, client_attr); @@ -12966,7 +13006,7 @@ proto_register_zbee_zcl_poll_ctrl(void) VALS(zbee_zcl_poll_ctrl_srv_tx_cmd_names), 0x0, NULL, HFILL }}, { &hf_zbee_zcl_poll_ctrl_start_fast_polling, - { "Start Fast Polling", "zbee_zcl_general.poll.start", FT_BOOLEAN, 8, NULL, 0x0, + { "Start Fast Polling", "zbee_zcl_general.poll.start", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_zbee_zcl_poll_ctrl_fast_poll_timeout, @@ -12983,7 +13023,7 @@ proto_register_zbee_zcl_poll_ctrl(void) }; /* ZCL Poll Control subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_poll_ctrl }; @@ -13386,298 +13426,298 @@ static const value_string zbee_zcl_gp_proxy_sink_tbl_req_type[] = { /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_gp = -1; +static int proto_zbee_zcl_gp; -static int hf_zbee_zcl_gp_attr_id = -1; -static int hf_zbee_zcl_gp_srv_rx_cmd_id = -1; -static int hf_zbee_zcl_gp_srv_tx_cmd_id = -1; +static int hf_zbee_zcl_gp_attr_id; +static int hf_zbee_zcl_gp_srv_rx_cmd_id; +static int hf_zbee_zcl_gp_srv_tx_cmd_id; -static gint ett_zbee_zcl_gp = -1; +static int ett_zbee_zcl_gp; /* GP_PROXY_COMMISSIONING_MODE */ -static gint ett_zbee_gp_cmd_proxy_commissioning_mode_options = -1; -static gint ett_zbee_gp_cmd_proxy_commissioning_mode_exit_mode = -1; -static gint hf_zbee_gp_cmd_proxy_commissioning_mode_options = -1; -static gint hf_zbee_gp_cmd_pcm_opt_action = -1; -static gint hf_zbee_gp_cmd_pcm_opt_exit_mode = -1; -static gint hf_zbee_gp_cmd_pcm_opt_channel_present = -1; -static gint hf_zbee_gp_cmd_pcm_opt_unicast_comm = -1; -static gint hf_zbee_gp_cmd_proxy_commissioning_mode_exit_mode = -1; -static gint hf_zbee_gp_cmd_pcm_exit_mode_on_comm_window_expire = -1; -static gint hf_zbee_gp_cmd_pcm_exit_mode_on_pairing_success = -1; -static gint hf_zbee_gp_cmd_pcm_exit_mode_on_gp_proxy_comm_mode = -1; -static gint hf_zbee_zcl_gp_commissioning_window = -1; -static gint hf_zbee_zcl_gp_channel = -1; +static int ett_zbee_gp_cmd_proxy_commissioning_mode_options; +static int ett_zbee_gp_cmd_proxy_commissioning_mode_exit_mode; +static int hf_zbee_gp_cmd_proxy_commissioning_mode_options; +static int hf_zbee_gp_cmd_pcm_opt_action; +static int hf_zbee_gp_cmd_pcm_opt_exit_mode; +static int hf_zbee_gp_cmd_pcm_opt_channel_present; +static int hf_zbee_gp_cmd_pcm_opt_unicast_comm; +static int hf_zbee_gp_cmd_proxy_commissioning_mode_exit_mode; +static int hf_zbee_gp_cmd_pcm_exit_mode_on_comm_window_expire; +static int hf_zbee_gp_cmd_pcm_exit_mode_on_pairing_success; +static int hf_zbee_gp_cmd_pcm_exit_mode_on_gp_proxy_comm_mode; +static int hf_zbee_zcl_gp_commissioning_window; +static int hf_zbee_zcl_gp_channel; /* GP_COMMISSIONING_NOTIFICATION */ -static gint hf_zbee_gp_cmd_comm_notif_opt_app_id = -1; -static gint hf_zbee_gp_cmd_comm_notif_opt_rx_after_tx = -1; -static gint hf_zbee_gp_cmd_comm_notif_opt_secur_level = -1; -static gint hf_zbee_gp_cmd_comm_notif_opt_secur_key_type = -1; -static gint hf_zbee_gp_cmd_comm_notif_opt_secur_fail = -1; -static gint hf_zbee_gp_cmd_comm_notif_opt_bidir_cap = -1; -static gint hf_zbee_gp_cmd_comm_notif_opt_proxy_info_present = -1; -static gint hf_zbee_gp_cmd_commissioning_notification_options = -1; -static gint ett_zbee_gp_cmd_commissioning_notification_options = -1; -static gint hf_zbee_gp_src_id = -1; -static gint hf_zbee_gp_ieee = -1; -static gint hf_zbee_gp_endpoint = -1; -static gint hf_zbee_gp_secur_frame_counter = -1; -static gint hf_zbee_gp_gpd_command_id = -1; -static gint hf_zbee_gp_short_addr = -1; -static gint hf_zbee_gp_gpp_gpd_link = -1; -static gint hf_zbee_gp_mic = -1; -static gint ett_zbee_gp_gpp_gpd_link = -1; -static gint hf_zbee_gpp_gpd_link_rssi = -1; -static gint hf_zbee_gpp_gpd_link_lqi = -1; -static gint hf_zbee_gp_gpd_payload_size = -1; +static int hf_zbee_gp_cmd_comm_notif_opt_app_id; +static int hf_zbee_gp_cmd_comm_notif_opt_rx_after_tx; +static int hf_zbee_gp_cmd_comm_notif_opt_secur_level; +static int hf_zbee_gp_cmd_comm_notif_opt_secur_key_type; +static int hf_zbee_gp_cmd_comm_notif_opt_secur_fail; +static int hf_zbee_gp_cmd_comm_notif_opt_bidir_cap; +static int hf_zbee_gp_cmd_comm_notif_opt_proxy_info_present; +static int hf_zbee_gp_cmd_commissioning_notification_options; +static int ett_zbee_gp_cmd_commissioning_notification_options; +static int hf_zbee_gp_src_id; +static int hf_zbee_gp_ieee; +static int hf_zbee_gp_endpoint; +static int hf_zbee_gp_secur_frame_counter; +static int hf_zbee_gp_gpd_command_id; +static int hf_zbee_gp_short_addr; +static int hf_zbee_gp_gpp_gpd_link; +static int hf_zbee_gp_mic; +static int ett_zbee_gp_gpp_gpd_link; +static int hf_zbee_gpp_gpd_link_rssi; +static int hf_zbee_gpp_gpd_link_lqi; +static int hf_zbee_gp_gpd_payload_size; /* GP_NOTIFICATION */ -static gint hf_zbee_gp_cmd_notification_options = -1; -static gint ett_zbee_gp_cmd_notification_options = -1; -static gint hf_zbee_gp_cmd_notif_opt_app_id = -1; -static gint hf_zbee_gp_cmd_notif_opt_also_unicast = -1; -static gint hf_zbee_gp_cmd_notif_opt_also_derived_group = -1; -static gint hf_zbee_gp_cmd_notif_opt_also_comm_group = -1; -static gint hf_zbee_gp_cmd_notif_opt_secur_level = -1; -static gint hf_zbee_gp_cmd_notif_opt_secur_key_type = -1; -static gint hf_zbee_gp_cmd_notif_opt_rx_after_tx = -1; -static gint hf_zbee_gp_cmd_notif_opt_tx_q_full = -1; -static gint hf_zbee_gp_cmd_notif_opt_bidir_cap = -1; -static gint hf_zbee_gp_cmd_notif_opt_proxy_info_present = -1; +static int hf_zbee_gp_cmd_notification_options; +static int ett_zbee_gp_cmd_notification_options; +static int hf_zbee_gp_cmd_notif_opt_app_id; +static int hf_zbee_gp_cmd_notif_opt_also_unicast; +static int hf_zbee_gp_cmd_notif_opt_also_derived_group; +static int hf_zbee_gp_cmd_notif_opt_also_comm_group; +static int hf_zbee_gp_cmd_notif_opt_secur_level; +static int hf_zbee_gp_cmd_notif_opt_secur_key_type; +static int hf_zbee_gp_cmd_notif_opt_rx_after_tx; +static int hf_zbee_gp_cmd_notif_opt_tx_q_full; +static int hf_zbee_gp_cmd_notif_opt_bidir_cap; +static int hf_zbee_gp_cmd_notif_opt_proxy_info_present; /* GP_PAIRING */ -static gint hf_zbee_gp_cmd_pairing_opt_app_id = -1; -static gint hf_zbee_gp_cmd_pairing_opt_add_sink = -1; -static gint hf_zbee_gp_cmd_pairing_opt_remove_gpd = -1; -static gint hf_zbee_gp_cmd_pairing_opt_communication_mode = -1; -static gint hf_zbee_gp_cmd_pairing_opt_gpd_fixed = -1; -static gint hf_zbee_gp_cmd_pairing_opt_gpd_mac_seq_num_cap = -1; -static gint hf_zbee_gp_cmd_pairing_opt_secur_level = -1; -static gint hf_zbee_gp_cmd_pairing_opt_secur_key_type = -1; -static gint hf_zbee_gp_cmd_pairing_opt_gpd_frame_cnt_present = -1; -static gint hf_zbee_gp_cmd_pairing_opt_gpd_secur_key_present = -1; -static gint hf_zbee_gp_cmd_pairing_opt_assigned_alias_present = -1; -static gint hf_zbee_gp_cmd_pairing_opt_fwd_radius_present = -1; -static gint hf_zbee_gp_cmd_pairing_options = -1; -static gint ett_zbee_gp_cmd_pairing_options = -1; -static gint hf_zbee_gp_sink_ieee = -1; -static gint hf_zbee_gp_sink_nwk = -1; -static gint hf_zbee_gp_sink_group_id = -1; -static gint hf_zbee_gp_device_id = -1; -static gint hf_zbee_gp_assigned_alias = -1; -static gint hf_zbee_gp_forwarding_radius = -1; -static gint hf_zbee_gp_gpd_key = -1; -static gint hf_zbee_gp_groupcast_radius = -1; +static int hf_zbee_gp_cmd_pairing_opt_app_id; +static int hf_zbee_gp_cmd_pairing_opt_add_sink; +static int hf_zbee_gp_cmd_pairing_opt_remove_gpd; +static int hf_zbee_gp_cmd_pairing_opt_communication_mode; +static int hf_zbee_gp_cmd_pairing_opt_gpd_fixed; +static int hf_zbee_gp_cmd_pairing_opt_gpd_mac_seq_num_cap; +static int hf_zbee_gp_cmd_pairing_opt_secur_level; +static int hf_zbee_gp_cmd_pairing_opt_secur_key_type; +static int hf_zbee_gp_cmd_pairing_opt_gpd_frame_cnt_present; +static int hf_zbee_gp_cmd_pairing_opt_gpd_secur_key_present; +static int hf_zbee_gp_cmd_pairing_opt_assigned_alias_present; +static int hf_zbee_gp_cmd_pairing_opt_fwd_radius_present; +static int hf_zbee_gp_cmd_pairing_options; +static int ett_zbee_gp_cmd_pairing_options; +static int hf_zbee_gp_sink_ieee; +static int hf_zbee_gp_sink_nwk; +static int hf_zbee_gp_sink_group_id; +static int hf_zbee_gp_device_id; +static int hf_zbee_gp_assigned_alias; +static int hf_zbee_gp_forwarding_radius; +static int hf_zbee_gp_gpd_key; +static int hf_zbee_gp_groupcast_radius; /* GP Response */ -static gint hf_zbee_gp_cmd_response_options = -1; -static gint ett_zbee_gp_cmd_response_options = -1; -static gint hf_zbee_gp_cmd_response_tx_channel = -1; -static gint ett_zbee_gp_cmd_response_tx_channel = -1; -static gint hf_zbee_gp_cmd_resp_opt_app_id = -1; -static gint hf_zbee_gp_cmd_resp_opt_tx_on_ep_match = -1; -static gint hf_zbee_gp_tmp_master_short_addr = -1; -static gint hf_zbee_gp_cmd_resp_tx_channel = -1; +static int hf_zbee_gp_cmd_response_options; +static int ett_zbee_gp_cmd_response_options; +static int hf_zbee_gp_cmd_response_tx_channel; +static int ett_zbee_gp_cmd_response_tx_channel; +static int hf_zbee_gp_cmd_resp_opt_app_id; +static int hf_zbee_gp_cmd_resp_opt_tx_on_ep_match; +static int hf_zbee_gp_tmp_master_short_addr; +static int hf_zbee_gp_cmd_resp_tx_channel; /* GP_PAIRING_CONFIGURATION */ -static int hf_zbee_gp_cmd_pc_actions_action = -1; -static int hf_zbee_gp_cmd_pc_actions_send_gp_pairing = -1; -static int hf_zbee_gp_cmd_pc_opt_app_id = -1; -static int hf_zbee_gp_cmd_pc_opt_communication_mode = -1; -static int hf_zbee_gp_cmd_pc_opt_seq_number_cap = -1; -static int hf_zbee_gp_cmd_px_opt_rx_on_cap = -1; -static int hf_zbee_gp_cmd_pc_opt_fixed_location = -1; -static int hf_zbee_gp_cmd_pc_opt_assigned_alias = -1; -static int hf_zbee_gp_cmd_pc_opt_security_use = -1; -static int hf_zbee_gp_cmd_pc_opt_app_info_present = -1; -static int hf_zbee_gp_cmd_pc_secur_level = -1; -static int hf_zbee_gp_cmd_pc_secur_key_type = -1; -static int hf_zbee_gp_cmd_pc_app_info_manuf_id_present = -1; -static int hf_zbee_gp_cmd_pc_app_info_model_id_present = -1; -static int hf_zbee_gp_cmd_pc_app_info_gpd_commands_present = -1; -static int hf_zbee_gp_cmd_pc_app_info_cluster_list_present = -1; -static int hf_zbee_gp_cmd_pc_actions = -1; -static guint ett_zbee_gp_cmd_pc_actions = -1; -static int hf_zbee_gp_cmd_pc_options = -1; -static guint ett_zbee_gp_cmd_pc_options = -1; -static guint ett_zbee_zcl_gp_group_list = -1; -static int hf_zbee_gp_group_list_len = -1; -static int hf_zbee_gp_group_list_group_id = -1; -static int hf_zbee_gp_group_list_alias = -1; -static int hf_zbee_gp_cmd_pc_secur_options = -1; -static guint ett_zbee_gp_cmd_pc_secur_options = -1; -static int hf_zbee_gp_n_paired_endpoints = -1; -static int hf_zbee_gp_paired_endpoint = -1; -static int hf_zbee_gp_cmd_pc_app_info = -1; -static guint ett_zbee_gp_cmd_pc_app_info = -1; -static int hf_zbee_zcl_gp_manufacturer_id = -1; -static int hf_zbee_zcl_gp_model_id = -1; -static int hf_zbee_gp_n_gpd_commands = -1; -static int hf_zbee_gp_gpd_command = -1; -static int hf_zbee_gp_n_srv_clusters = -1; -static int hf_zbee_gp_n_cli_clusters = -1; -static int hf_zbee_gp_gpd_cluster_id = -1; -static guint ett_zbee_zcl_gp_ep = -1; -static guint ett_zbee_zcl_gp_cmds = -1; -static guint ett_zbee_zcl_gp_clusters = -1; -static guint ett_zbee_zcl_gp_srv_clusters = -1; -static guint ett_zbee_zcl_gp_cli_clusters = -1; +static int hf_zbee_gp_cmd_pc_actions_action; +static int hf_zbee_gp_cmd_pc_actions_send_gp_pairing; +static int hf_zbee_gp_cmd_pc_opt_app_id; +static int hf_zbee_gp_cmd_pc_opt_communication_mode; +static int hf_zbee_gp_cmd_pc_opt_seq_number_cap; +static int hf_zbee_gp_cmd_px_opt_rx_on_cap; +static int hf_zbee_gp_cmd_pc_opt_fixed_location; +static int hf_zbee_gp_cmd_pc_opt_assigned_alias; +static int hf_zbee_gp_cmd_pc_opt_security_use; +static int hf_zbee_gp_cmd_pc_opt_app_info_present; +static int hf_zbee_gp_cmd_pc_secur_level; +static int hf_zbee_gp_cmd_pc_secur_key_type; +static int hf_zbee_gp_cmd_pc_app_info_manuf_id_present; +static int hf_zbee_gp_cmd_pc_app_info_model_id_present; +static int hf_zbee_gp_cmd_pc_app_info_gpd_commands_present; +static int hf_zbee_gp_cmd_pc_app_info_cluster_list_present; +static int hf_zbee_gp_cmd_pc_actions; +static int ett_zbee_gp_cmd_pc_actions; +static int hf_zbee_gp_cmd_pc_options; +static int ett_zbee_gp_cmd_pc_options; +static int ett_zbee_zcl_gp_group_list; +static int hf_zbee_gp_group_list_len; +static int hf_zbee_gp_group_list_group_id; +static int hf_zbee_gp_group_list_alias; +static int hf_zbee_gp_cmd_pc_secur_options; +static int ett_zbee_gp_cmd_pc_secur_options; +static int hf_zbee_gp_n_paired_endpoints; +static int hf_zbee_gp_paired_endpoint; +static int hf_zbee_gp_cmd_pc_app_info; +static int ett_zbee_gp_cmd_pc_app_info; +static int hf_zbee_zcl_gp_manufacturer_id; +static int hf_zbee_zcl_gp_model_id; +static int hf_zbee_gp_n_gpd_commands; +static int hf_zbee_gp_gpd_command; +static int hf_zbee_gp_n_srv_clusters; +static int hf_zbee_gp_n_cli_clusters; +static int hf_zbee_gp_gpd_cluster_id; +static int ett_zbee_zcl_gp_ep; +static int ett_zbee_zcl_gp_cmds; +static int ett_zbee_zcl_gp_clusters; +static int ett_zbee_zcl_gp_srv_clusters; +static int ett_zbee_zcl_gp_cli_clusters; /* GP_SINK_TABLE_REQUEST and GP_PROXY_TABLE_REQUEST */ -static guint ett_zbee_zcl_proxy_sink_tbl_req_options = -1; -static int hf_zbee_zcl_proxy_sink_tbl_req_options = -1; -static int hf_zbee_zcl_proxy_sink_tbl_req_fld_app_id = -1; -static int hf_zbee_zcl_proxy_sink_tbl_req_fld_req_type = -1; -static int hf_zbee_zcl_proxy_sink_tbl_req_index = -1; +static int ett_zbee_zcl_proxy_sink_tbl_req_options; +static int hf_zbee_zcl_proxy_sink_tbl_req_options; +static int hf_zbee_zcl_proxy_sink_tbl_req_fld_app_id; +static int hf_zbee_zcl_proxy_sink_tbl_req_fld_req_type; +static int hf_zbee_zcl_proxy_sink_tbl_req_index; /* GP_SINK_TABLE_RESPONSE and GP_PROXY_TABLE_RESPONSE */ -static int hf_zbee_zcl_proxy_sink_tbl_resp_status = -1; -static int hf_zbee_zcl_proxy_sink_tbl_resp_entries_total = -1; -static int hf_zbee_zcl_proxy_sink_tbl_resp_start_index = -1; -static int hf_zbee_zcl_proxy_sink_tbl_resp_entries_count = -1; +static int hf_zbee_zcl_proxy_sink_tbl_resp_status; +static int hf_zbee_zcl_proxy_sink_tbl_resp_entries_total; +static int hf_zbee_zcl_proxy_sink_tbl_resp_start_index; +static int hf_zbee_zcl_proxy_sink_tbl_resp_entries_count; /* GP SINK_COMMISSIONING_MODE */ -static gint ett_zbee_zcl_gp_cmd_sink_comm_mode_options = -1; -static gint hf_zbee_zcl_gp_cmd_sink_comm_mode_options = -1; +static int ett_zbee_zcl_gp_cmd_sink_comm_mode_options; +static int hf_zbee_zcl_gp_cmd_sink_comm_mode_options; -static gint hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_action = -1; -static gint hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_inv_gpm_in_secur = -1; -static gint hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_inv_gpm_in_pairing = -1; -static gint hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_inv_proxies = -1; +static int hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_action; +static int hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_inv_gpm_in_secur; +static int hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_inv_gpm_in_pairing; +static int hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_inv_proxies; -static gint hf_zbee_gp_zcl_cmd_sink_comm_mode_gpm_addr_for_secur = -1; -static gint hf_zbee_gp_zcl_cmd_sink_comm_mode_gpm_addr_for_pairing = -1; -static gint hf_zbee_gp_zcl_cmd_sink_comm_mode_sink_ep = -1; +static int hf_zbee_gp_zcl_cmd_sink_comm_mode_gpm_addr_for_secur; +static int hf_zbee_gp_zcl_cmd_sink_comm_mode_gpm_addr_for_pairing; +static int hf_zbee_gp_zcl_cmd_sink_comm_mode_sink_ep; /* GP Sink Table Attribute */ -static gint ett_zbee_gp_sink_tbl = -1; -static gint ett_zbee_gp_sink_tbl_entry = -1; -static gint ett_zbee_gp_sink_tbl_entry_options = -1; - -static gint hf_zbee_gp_sink_tbl_length = -1; -static gint hf_zbee_gp_sink_tbl_entry_options = -1; - -static gint hf_zbee_gp_sink_tbl_entry_options_app_id = -1; -static gint hf_zbee_gp_sink_tbl_entry_options_comm_mode = -1; -static gint hf_zbee_gp_sink_tbl_entry_options_seq_num_cap = -1; -static gint hf_zbee_gp_sink_tbl_entry_options_rx_on_cap = -1; -static gint hf_zbee_gp_sink_tbl_entry_options_fixed_loc = -1; -static gint hf_zbee_gp_sink_tbl_entry_options_assigned_alias = -1; -static gint hf_zbee_gp_sink_tbl_entry_options_sec_use = -1; - -static gint ett_zbee_gp_sec_options = -1; -static gint hf_zbee_gp_sec_options = -1; -static gint hf_zbee_gp_sec_options_sec_level = -1; -static gint hf_zbee_gp_sec_options_sec_key_type = -1; +static int ett_zbee_gp_sink_tbl; +static int ett_zbee_gp_sink_tbl_entry; +static int ett_zbee_gp_sink_tbl_entry_options; + +static int hf_zbee_gp_sink_tbl_length; +static int hf_zbee_gp_sink_tbl_entry_options; + +static int hf_zbee_gp_sink_tbl_entry_options_app_id; +static int hf_zbee_gp_sink_tbl_entry_options_comm_mode; +static int hf_zbee_gp_sink_tbl_entry_options_seq_num_cap; +static int hf_zbee_gp_sink_tbl_entry_options_rx_on_cap; +static int hf_zbee_gp_sink_tbl_entry_options_fixed_loc; +static int hf_zbee_gp_sink_tbl_entry_options_assigned_alias; +static int hf_zbee_gp_sink_tbl_entry_options_sec_use; + +static int ett_zbee_gp_sec_options; +static int hf_zbee_gp_sec_options; +static int hf_zbee_gp_sec_options_sec_level; +static int hf_zbee_gp_sec_options_sec_key_type; /* GP Proxy Table Attribute */ -static gint ett_zbee_gp_proxy_tbl = -1; -static gint ett_zbee_gp_proxy_tbl_entry = -1; -static gint ett_zbee_gp_proxy_tbl_entry_options = -1; -static gint ett_zbee_gp_proxy_tbl_entry_ext_options = -1; - -static gint hf_zbee_gp_proxy_tbl_length = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options = -1; -static gint hf_zbee_gp_proxy_tbl_entry_ext_options = -1; - -static gint hf_zbee_gp_proxy_tbl_entry_options_app_id = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_entry_active = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_entry_valid = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_seq_num_cap = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_lw_ucast_gps = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_derived_group_gps = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_comm_group_gps = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_first_to_forward = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_in_range = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_gpd_fixed = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_has_all_ucast_routes = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_assigned_alias = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_sec_use = -1; -static gint hf_zbee_gp_proxy_tbl_entry_options_opt_ext = -1; - -static gint hf_zbee_gp_proxy_tbl_entry_search_counter = -1; - -static gint hf_zbee_gp_proxy_tbl_entry_ext_options_full_ucast_gps = -1; - -static gint ett_zbee_gp_sink_address_list = -1; -static gint hf_zbee_gp_sink_address_list_length = -1; +static int ett_zbee_gp_proxy_tbl; +static int ett_zbee_gp_proxy_tbl_entry; +static int ett_zbee_gp_proxy_tbl_entry_options; +static int ett_zbee_gp_proxy_tbl_entry_ext_options; + +static int hf_zbee_gp_proxy_tbl_length; +static int hf_zbee_gp_proxy_tbl_entry_options; +static int hf_zbee_gp_proxy_tbl_entry_ext_options; + +static int hf_zbee_gp_proxy_tbl_entry_options_app_id; +static int hf_zbee_gp_proxy_tbl_entry_options_entry_active; +static int hf_zbee_gp_proxy_tbl_entry_options_entry_valid; +static int hf_zbee_gp_proxy_tbl_entry_options_seq_num_cap; +static int hf_zbee_gp_proxy_tbl_entry_options_lw_ucast_gps; +static int hf_zbee_gp_proxy_tbl_entry_options_derived_group_gps; +static int hf_zbee_gp_proxy_tbl_entry_options_comm_group_gps; +static int hf_zbee_gp_proxy_tbl_entry_options_first_to_forward; +static int hf_zbee_gp_proxy_tbl_entry_options_in_range; +static int hf_zbee_gp_proxy_tbl_entry_options_gpd_fixed; +static int hf_zbee_gp_proxy_tbl_entry_options_has_all_ucast_routes; +static int hf_zbee_gp_proxy_tbl_entry_options_assigned_alias; +static int hf_zbee_gp_proxy_tbl_entry_options_sec_use; +static int hf_zbee_gp_proxy_tbl_entry_options_opt_ext; + +static int hf_zbee_gp_proxy_tbl_entry_search_counter; + +static int hf_zbee_gp_proxy_tbl_entry_ext_options_full_ucast_gps; + +static int ett_zbee_gp_sink_address_list; +static int hf_zbee_gp_sink_address_list_length; /* GP gppFunctionality Attribute */ -static gint ett_zbee_zcl_gp_attr_gpp_func = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func = -1; - -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gp_feature = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_direct_comm = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_derived_gcast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_pre_commissioned_gcast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_full_ucast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_lw_ucast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_bidir_op = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_proxy_tbl_maintenance = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gp_commissioning = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_ct_based_commissioning = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_maintenance_of_gpd = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_00 = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_01 = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_10 = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_11 = -1; -static gint hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_ieee_address = -1; +static int ett_zbee_zcl_gp_attr_gpp_func; +static int hf_zbee_zcl_gp_attr_gpp_func; + +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gp_feature; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_direct_comm; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_derived_gcast_comm; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_pre_commissioned_gcast_comm; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_full_ucast_comm; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_lw_ucast_comm; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_bidir_op; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_proxy_tbl_maintenance; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gp_commissioning; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_ct_based_commissioning; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_maintenance_of_gpd; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_00; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_01; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_10; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_secur_lvl_11; +static int hf_zbee_zcl_gp_attr_gpp_func_fld_gpd_ieee_address; /* GP gppActiveFunctionality Attribute */ -static gint ett_zbee_zcl_gp_attr_gpp_active_func = -1; -static gint hf_zbee_zcl_gp_attr_gpp_active_func = -1; -static gint hf_zbee_zcl_gp_attr_gpp_active_func_fld_gp_functionality = -1; +static int ett_zbee_zcl_gp_attr_gpp_active_func; +static int hf_zbee_zcl_gp_attr_gpp_active_func; +static int hf_zbee_zcl_gp_attr_gpp_active_func_fld_gp_functionality; /* GP gpsFunctionality Attribute */ -static gint ett_zbee_zcl_gp_attr_gps_func = -1; -static gint hf_zbee_zcl_gp_attr_gps_func = -1; - -static gint hf_zbee_zcl_gp_attr_gps_func_fld_gp_feature = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_direct_comm = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_derived_gcast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_pre_commissioned_gcast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_full_ucast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_lw_ucast_comm = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_proximity_bidir_op = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_multi_hop_bidir_op = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_proxy_tbl_maintenance = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_proximity_commissioning = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_multi_hop_commissioning = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_ct_based_commissioning = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_maintenance_of_gpd = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_00 = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_01 = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_10 = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_11 = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_sink_tbl_based_gcast_forwarding = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_translation_table = -1; -static gint hf_zbee_zcl_gp_attr_gps_func_fld_gpd_ieee_address = -1; +static int ett_zbee_zcl_gp_attr_gps_func; +static int hf_zbee_zcl_gp_attr_gps_func; + +static int hf_zbee_zcl_gp_attr_gps_func_fld_gp_feature; +static int hf_zbee_zcl_gp_attr_gps_func_fld_direct_comm; +static int hf_zbee_zcl_gp_attr_gps_func_fld_derived_gcast_comm; +static int hf_zbee_zcl_gp_attr_gps_func_fld_pre_commissioned_gcast_comm; +static int hf_zbee_zcl_gp_attr_gps_func_fld_full_ucast_comm; +static int hf_zbee_zcl_gp_attr_gps_func_fld_lw_ucast_comm; +static int hf_zbee_zcl_gp_attr_gps_func_fld_proximity_bidir_op; +static int hf_zbee_zcl_gp_attr_gps_func_fld_multi_hop_bidir_op; +static int hf_zbee_zcl_gp_attr_gps_func_fld_proxy_tbl_maintenance; +static int hf_zbee_zcl_gp_attr_gps_func_fld_proximity_commissioning; +static int hf_zbee_zcl_gp_attr_gps_func_fld_multi_hop_commissioning; +static int hf_zbee_zcl_gp_attr_gps_func_fld_ct_based_commissioning; +static int hf_zbee_zcl_gp_attr_gps_func_fld_maintenance_of_gpd; +static int hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_00; +static int hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_01; +static int hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_10; +static int hf_zbee_zcl_gp_attr_gps_func_fld_gpd_secur_lvl_11; +static int hf_zbee_zcl_gp_attr_gps_func_fld_sink_tbl_based_gcast_forwarding; +static int hf_zbee_zcl_gp_attr_gps_func_fld_translation_table; +static int hf_zbee_zcl_gp_attr_gps_func_fld_gpd_ieee_address; /* GP gppActiveFunctionality Attribute */ -static gint ett_zbee_zcl_gp_attr_gps_active_func = -1; -static gint hf_zbee_zcl_gp_attr_gps_active_func = -1; -static gint hf_zbee_zcl_gp_attr_gps_active_func_fld_gp_functionality = -1; +static int ett_zbee_zcl_gp_attr_gps_active_func; +static int hf_zbee_zcl_gp_attr_gps_active_func; +static int hf_zbee_zcl_gp_attr_gps_active_func_fld_gp_functionality; /* GP gpsCommissioningExitMode Attribute */ -static gint ett_zbee_zcl_gp_attr_gps_comm_exit_mode = -1; -static gint hf_zbee_zcl_gp_attr_gps_comm_exit_mode = -1; -static gint hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_comm_window_expire = -1; -static gint hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_pairing_success = -1; -static gint hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_gp_proxy_comm_mode = -1; +static int ett_zbee_zcl_gp_attr_gps_comm_exit_mode; +static int hf_zbee_zcl_gp_attr_gps_comm_exit_mode; +static int hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_comm_window_expire; +static int hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_pairing_success; +static int hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_gp_proxy_comm_mode; /* GP gpsCommunicationMode Attribute */ -static gint ett_zbee_zcl_gp_attr_gps_communication_mode = -1; -static gint hf_zbee_zcl_gp_attr_gps_communication_mode = -1; -static gint hf_zbee_zcl_gp_attr_gps_communication_mode_fld_mode = -1; +static int ett_zbee_zcl_gp_attr_gps_communication_mode; +static int hf_zbee_zcl_gp_attr_gps_communication_mode; +static int hf_zbee_zcl_gp_attr_gps_communication_mode_fld_mode; /* GP gpsSecurityLevel Attribute */ -static gint ett_zbee_zcl_gp_attr_gps_secur_lvl = -1; -static gint hf_zbee_zcl_gp_attr_gps_secur_lvl = -1; -static gint hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_min_gpd_secur_lvl = -1; -static gint hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_protection_with_gp_link_key = -1; -static gint hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_involve_tc = -1; +static int ett_zbee_zcl_gp_attr_gps_secur_lvl; +static int hf_zbee_zcl_gp_attr_gps_secur_lvl; +static int hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_min_gpd_secur_lvl; +static int hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_protection_with_gp_link_key; +static int hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_involve_tc; /* reuse ZGPD command names */ extern value_string_ext zbee_nwk_gp_cmd_names_ext; @@ -13706,27 +13746,27 @@ static dissector_handle_t zgp_handle; * @return new offset. */ static int -dissect_zbee_zcl_gp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) { - guint payload_size; + unsigned payload_size; proto_tree_add_item(tree, hf_zbee_gp_gpd_command_id, tvb, offset, 1, ENC_NA); offset += 1; - payload_size = tvb_get_guint8(tvb, offset); + payload_size = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_gp_gpd_payload_size, tvb, offset, 1, ENC_NA); offset += 1; if (payload_size != 0 && payload_size != 0xff) { tvbuff_t *gtvb = tvb_new_composite(); - gboolean writable = col_get_writable(pinfo->cinfo, COL_INFO); + bool writable = col_get_writable(pinfo->cinfo, COL_INFO); /* remove payload length and put command id instead */ tvb_composite_append(gtvb, tvb_new_subset_length(tvb, offset-2, 1)); tvb_composite_append(gtvb, tvb_new_subset_length(tvb, offset, payload_size)); tvb_composite_finalize(gtvb); /* prevent overwriting COL_INFO */ - col_set_writable(pinfo->cinfo, COL_INFO, FALSE); + col_set_writable(pinfo->cinfo, COL_INFO, false); call_dissector_only(zgp_handle, gtvb, pinfo, tree, NULL); col_set_writable(pinfo->cinfo, COL_INFO, writable); offset += payload_size; @@ -13746,9 +13786,9 @@ dissect_zbee_zcl_gp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * @return new offset. */ static int -dissect_zbee_zcl_gp_group_list(tvbuff_t *tvb, proto_tree *tree, guint offset, const char* text) +dissect_zbee_zcl_gp_group_list(tvbuff_t *tvb, proto_tree *tree, unsigned offset, const char* text) { - guint8 len = tvb_get_guint8(tvb, offset); + uint8_t len = tvb_get_uint8(tvb, offset); proto_tree *gl_tree = proto_tree_add_subtree_format(tree, tvb, offset, len*4+1, ett_zbee_zcl_gp_group_list, NULL, "%s #%d", text, len); @@ -13777,9 +13817,9 @@ dissect_zbee_zcl_gp_group_list(tvbuff_t *tvb, proto_tree *tree, guint offset, co * @return new offset. */ static int -dissect_zbee_zcl_gp_sink_address_list(tvbuff_t *tvb, proto_tree *tree, guint offset, const char* text) +dissect_zbee_zcl_gp_sink_address_list(tvbuff_t *tvb, proto_tree *tree, unsigned offset, const char* text) { - guint8 len = tvb_get_guint8(tvb, offset); + uint8_t len = tvb_get_uint8(tvb, offset); proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, offset, len*10+1, ett_zbee_gp_sink_address_list, NULL, "%s #%d", text, len); @@ -13809,10 +13849,10 @@ dissect_zbee_zcl_gp_sink_address_list(tvbuff_t *tvb, proto_tree *tree, guint off * @return 1 if entry parsed, 0 - otherwise. */ static int -dissect_zbee_zcl_gp_sink_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint idx) +dissect_zbee_zcl_gp_sink_table_entry(tvbuff_t *tvb, proto_tree *tree, unsigned *offset, unsigned idx) { - guint16 options = 0; - guint16 app_id, comm_mode; + uint16_t options = 0; + uint16_t app_id, comm_mode; proto_tree *subtree; static int * const n_options[] = { &hf_zbee_gp_sink_tbl_entry_options_app_id, @@ -13834,7 +13874,7 @@ dissect_zbee_zcl_gp_sink_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *off NULL, "Sink Table Entry #%d", idx); /* Options - 2 bytes */ - options = tvb_get_guint16(tvb, *offset, ENC_LITTLE_ENDIAN); + options = tvb_get_uint16(tvb, *offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(subtree, tvb, *offset, hf_zbee_gp_sink_tbl_entry_options, ett_zbee_gp_sink_tbl_entry_options, n_options, ENC_LITTLE_ENDIAN); *offset += 2; @@ -13913,15 +13953,15 @@ dissect_zbee_zcl_gp_sink_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *off * @return new offset. */ static int -dissect_zbee_zcl_gp_sink_table(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_sink_table(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { - guint16 sink_tbl_len, n_parsed_octets; - guint8 n_tbl_entries; + uint16_t sink_tbl_len, n_parsed_octets; + uint8_t n_tbl_entries; proto_tree *sink_tbl_tree; n_parsed_octets = 0; n_tbl_entries = 0; - sink_tbl_len = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); + sink_tbl_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN); sink_tbl_tree = proto_tree_add_subtree_format(tree, tvb, offset, sink_tbl_len, ett_zbee_gp_sink_tbl, NULL, "Sink Table: length = %d", sink_tbl_len); @@ -13932,7 +13972,7 @@ dissect_zbee_zcl_gp_sink_table(tvbuff_t *tvb, proto_tree *tree, guint offset) } while (n_parsed_octets < sink_tbl_len) { - guint old_offset = offset; + unsigned old_offset = offset; if (dissect_zbee_zcl_gp_sink_table_entry(tvb, sink_tbl_tree, &offset, n_tbl_entries + 1)) { n_parsed_octets += offset - old_offset; } @@ -13960,11 +14000,11 @@ dissect_zbee_zcl_gp_sink_table(tvbuff_t *tvb, proto_tree *tree, guint offset) * @return 1 if entry parsed, 0 - otherwise. */ static int -dissect_zbee_zcl_gp_proxy_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint idx) +dissect_zbee_zcl_gp_proxy_table_entry(tvbuff_t *tvb, proto_tree *tree, unsigned *offset, unsigned idx) { - guint16 options = 0; - guint16 ext_options = 0; - guint16 app_id; + uint16_t options = 0; + uint16_t ext_options = 0; + uint16_t app_id; proto_tree *subtree; static int * const n_options[] = { &hf_zbee_gp_proxy_tbl_entry_options_app_id, @@ -13997,7 +14037,7 @@ dissect_zbee_zcl_gp_proxy_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *of ett_zbee_gp_proxy_tbl_entry, NULL, "Proxy Table Entry #%d", idx); /* Options - 2 bytes */ - options = tvb_get_guint16(tvb, *offset, ENC_LITTLE_ENDIAN); + options = tvb_get_uint16(tvb, *offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(subtree, tvb, *offset, hf_zbee_gp_proxy_tbl_entry_options, ett_zbee_gp_proxy_tbl_entry_options, n_options, ENC_LITTLE_ENDIAN); *offset += 2; @@ -14068,7 +14108,7 @@ dissect_zbee_zcl_gp_proxy_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *of /* Extended Options: 2 bytes */ if (options & ZBEE_ZCL_GP_PROXY_TBL_OPT_OPTIONS_EXTENTIONS) { - ext_options = tvb_get_guint16(tvb, *offset, ENC_LITTLE_ENDIAN); + ext_options = tvb_get_uint16(tvb, *offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(subtree, tvb, *offset, hf_zbee_gp_proxy_tbl_entry_ext_options, ett_zbee_gp_proxy_tbl_entry_ext_options, n_ext_options, ENC_LITTLE_ENDIAN); *offset += 1; @@ -14094,15 +14134,15 @@ dissect_zbee_zcl_gp_proxy_table_entry(tvbuff_t *tvb, proto_tree *tree, guint *of * @return new offset. */ static int -dissect_zbee_zcl_gp_proxy_table(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_proxy_table(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { - guint16 proxy_tbl_len, n_parsed_octets; - guint8 n_tbl_entries; + uint16_t proxy_tbl_len, n_parsed_octets; + uint8_t n_tbl_entries; proto_tree *proxy_tbl_tree; n_parsed_octets = 0; n_tbl_entries = 0; - proxy_tbl_len = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); + proxy_tbl_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN); proxy_tbl_tree = proto_tree_add_subtree_format(tree, tvb, offset, proxy_tbl_len, ett_zbee_gp_proxy_tbl, NULL, "Proxy Table: length = %d", proxy_tbl_len); @@ -14113,7 +14153,7 @@ dissect_zbee_zcl_gp_proxy_table(tvbuff_t *tvb, proto_tree *tree, guint offset) } while (n_parsed_octets < proxy_tbl_len) { - guint old_offset = offset; + unsigned old_offset = offset; if (dissect_zbee_zcl_gp_proxy_table_entry(tvb, proxy_tbl_tree, &offset, n_tbl_entries + 1)) { n_parsed_octets += offset - old_offset; } @@ -14140,7 +14180,7 @@ dissect_zbee_zcl_gp_proxy_table(tvbuff_t *tvb, proto_tree *tree, guint offset) * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gpp_functionality(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gpp_functionality(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gpp_func_fld_gp_feature, @@ -14181,7 +14221,7 @@ dissect_zbee_zcl_gp_attr_gpp_functionality(tvbuff_t *tvb, proto_tree *tree, guin * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gpp_active_functionality(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gpp_active_functionality(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gpp_active_func_fld_gp_functionality, @@ -14207,7 +14247,7 @@ dissect_zbee_zcl_gp_attr_gpp_active_functionality(tvbuff_t *tvb, proto_tree *tre * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gps_functionality(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gps_functionality(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gps_func_fld_gp_feature, @@ -14252,7 +14292,7 @@ dissect_zbee_zcl_gp_attr_gps_functionality(tvbuff_t *tvb, proto_tree *tree, guin * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gps_active_functionality(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gps_active_functionality(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gps_active_func_fld_gp_functionality, @@ -14278,7 +14318,7 @@ dissect_zbee_zcl_gp_attr_gps_active_functionality(tvbuff_t *tvb, proto_tree *tre * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gps_communication_mode(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gps_communication_mode(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gps_communication_mode_fld_mode, @@ -14304,7 +14344,7 @@ dissect_zbee_zcl_gp_attr_gps_communication_mode(tvbuff_t *tvb, proto_tree *tree, * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gps_comm_exit_mode(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gps_comm_exit_mode(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gps_comm_exit_mode_fld_on_comm_window_expire, @@ -14332,7 +14372,7 @@ dissect_zbee_zcl_gp_attr_gps_comm_exit_mode(tvbuff_t *tvb, proto_tree *tree, gui * @return new offset. */ static int -dissect_zbee_zcl_gp_attr_gps_secur_lvl(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_zbee_zcl_gp_attr_gps_secur_lvl(tvbuff_t *tvb, proto_tree *tree, unsigned offset) { static int * const n_fields[] = { &hf_zbee_zcl_gp_attr_gps_secur_lvl_fld_min_gpd_secur_lvl, @@ -14359,11 +14399,11 @@ dissect_zbee_zcl_gp_attr_gps_secur_lvl(tvbuff_t *tvb, proto_tree *tree, guint of * @param offset - pointer to buffer offset */ static void -dissect_zcl_gp_proxy_sink_table_request(proto_tree *tree, tvbuff_t *tvb, guint *offset) +dissect_zcl_gp_proxy_sink_table_request(proto_tree *tree, tvbuff_t *tvb, unsigned *offset) { /* get Options field */ - guint8 options = tvb_get_guint8(tvb, *offset); - guint8 app_id, req_type; + uint8_t options = tvb_get_uint8(tvb, *offset); + uint8_t app_id, req_type; static int * const n_options[] = { &hf_zbee_zcl_proxy_sink_tbl_req_fld_app_id, &hf_zbee_zcl_proxy_sink_tbl_req_fld_req_type, @@ -14384,7 +14424,7 @@ dissect_zcl_gp_proxy_sink_table_request(proto_tree *tree, tvbuff_t *tvb, guint * *offset += 4; } else if (app_id == ZBEE_ZCL_GP_APP_ID_ZGP) { - /* App_id = 010: MAC address + Endoint */ + /* App_id = 010: MAC address + Endpoint */ proto_tree_add_item(tree, hf_zbee_gp_ieee, tvb, *offset, 8, ENC_LITTLE_ENDIAN); *offset += 8; proto_tree_add_item(tree, hf_zbee_gp_endpoint, tvb, *offset, 1, ENC_NA); @@ -14411,10 +14451,10 @@ dissect_zcl_gp_proxy_sink_table_request(proto_tree *tree, tvbuff_t *tvb, guint * * ZBEE_ZCL_ATTR_GPP_PROXY_TABLE) that will be reported */ static void -dissect_zcl_gp_proxy_sink_table_response(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id) +dissect_zcl_gp_proxy_sink_table_response(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id) { - guint8 entries_count, start_index; - guint i, stop; + uint8_t entries_count, start_index; + unsigned i, stop; if ( !((attr_id == ZBEE_ZCL_ATTR_GPS_SINK_TABLE) || (attr_id == ZBEE_ZCL_ATTR_GPP_PROXY_TABLE)) ) { return; @@ -14424,20 +14464,20 @@ dissect_zcl_gp_proxy_sink_table_response(proto_tree *tree, tvbuff_t *tvb, guint *offset += 1; proto_tree_add_item(tree, hf_zbee_zcl_proxy_sink_tbl_resp_entries_total, tvb, *offset, 1, ENC_NA); *offset += 1; - start_index = tvb_get_guint8(tvb, *offset); + start_index = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_proxy_sink_tbl_resp_start_index, tvb, *offset, 1, ENC_NA); *offset += 1; - entries_count = tvb_get_guint8(tvb, *offset); + entries_count = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_proxy_sink_tbl_resp_entries_count, tvb, *offset, 1, ENC_NA); *offset += 1; for (i = 0, stop = 0; i < entries_count && !stop; i++) { switch (attr_id) { case ZBEE_ZCL_ATTR_GPS_SINK_TABLE: - stop = !dissect_zbee_zcl_gp_sink_table_entry(tvb, tree, (guint*) offset, start_index + i); + stop = !dissect_zbee_zcl_gp_sink_table_entry(tvb, tree, (unsigned*) offset, start_index + i); break; case ZBEE_ZCL_ATTR_GPP_PROXY_TABLE: - stop = !dissect_zbee_zcl_gp_proxy_table_entry(tvb, tree, (guint*) offset, start_index + i); + stop = !dissect_zbee_zcl_gp_proxy_table_entry(tvb, tree, (unsigned*) offset, start_index + i); break; } } @@ -14454,7 +14494,7 @@ dissect_zcl_gp_proxy_sink_table_response(proto_tree *tree, tvbuff_t *tvb, guint * @param offset - pointer to buffer offset */ static void -dissect_zcl_gp_sink_comm_mode(proto_tree *tree, tvbuff_t *tvb, guint *offset) +dissect_zcl_gp_sink_comm_mode(proto_tree *tree, tvbuff_t *tvb, unsigned *offset) { static int * const n_options[] = { &hf_zbee_zcl_gp_cmd_sink_comm_mode_options_fld_action, @@ -14497,8 +14537,8 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d }; zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; + unsigned offset = 0; + uint8_t cmd_id; /* Reject the packet if data is NULL */ if (data == NULL) @@ -14533,7 +14573,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_notif_opt_proxy_info_present, NULL }; - guint16 options = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); + uint16_t options = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_notification_options, ett_zbee_gp_cmd_notification_options, n_options, ENC_LITTLE_ENDIAN); @@ -14581,7 +14621,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_comm_notif_opt_proxy_info_present, NULL }; - guint16 options = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); + uint16_t options = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_commissioning_notification_options, ett_zbee_gp_cmd_commissioning_notification_options, commn_options, ENC_LITTLE_ENDIAN); @@ -14634,13 +14674,13 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_pc_opt_app_info_present, NULL }; - guint16 options; + uint16_t options; proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_pc_actions, ett_zbee_gp_cmd_pc_actions, pc_actions, ENC_NA); offset += 1; - options = tvb_get_guint16(tvb, offset, ENC_LITTLE_ENDIAN); + options = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_pc_options, ett_zbee_gp_cmd_pc_options, pc_options, ENC_LITTLE_ENDIAN); @@ -14662,7 +14702,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d if (((options & ZBEE_ZCL_GP_CMD_PC_OPT_COMMUNICATION_MODE) >> ZBEE_ZCL_GP_PAIRING_CONFIGURATION_OPTION_COMMUNICATION_MODE_SHIFT) == ZBEE_ZCL_GP_COMMUNICATION_MODE_GROUPCAST_PRECOMMISSIONED) { - guint8 len = tvb_get_guint8(tvb, offset); + uint8_t len = tvb_get_uint8(tvb, offset); proto_tree *gl_tree = proto_tree_add_subtree_format(tree, tvb, offset, len*4+1, ett_zbee_zcl_gp_group_list, NULL, "GroupList #%d", len); proto_tree_add_item(gl_tree, hf_zbee_gp_group_list_len, tvb, offset, 1, ENC_NA); @@ -14700,7 +14740,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d offset += 16; } { - guint8 n_paired_endpoints = tvb_get_guint8(tvb, offset); + uint8_t n_paired_endpoints = tvb_get_uint8(tvb, offset); proto_tree *ep_tree = proto_tree_add_subtree_format(tree, tvb, offset, n_paired_endpoints+1, ett_zbee_zcl_gp_ep, NULL, "Paired Endpoints #%d", n_paired_endpoints); proto_tree_add_item(ep_tree, hf_zbee_gp_n_paired_endpoints, tvb, offset, 1, ENC_NA); offset += 1; @@ -14723,7 +14763,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_pc_app_info_cluster_list_present, NULL }; - guint8 appi = tvb_get_guint8(tvb, offset); + uint8_t appi = tvb_get_uint8(tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_pc_app_info, ett_zbee_gp_cmd_pc_app_info, app_info, ENC_NA); @@ -14737,7 +14777,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d offset += 2; } if (appi & ZBEE_ZCL_GP_CMD_PC_APP_INFO_GPD_COMMANDS_PRESENT) { - guint8 n_commands = tvb_get_guint8(tvb, offset); + uint8_t n_commands = tvb_get_uint8(tvb, offset); proto_tree *c_tree = proto_tree_add_subtree_format(tree, tvb, offset, n_commands+1, ett_zbee_zcl_gp_cmds, NULL, "GPD CommandID list #%d", n_commands); proto_tree_add_item(c_tree, hf_zbee_gp_n_gpd_commands, tvb, offset, 1, ENC_NA); offset += 1; @@ -14749,9 +14789,9 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d } } if (appi & ZBEE_ZCL_GP_CMD_PC_APP_INFO_CLUSTER_LIST_PRESENT) { - guint8 n = tvb_get_guint8(tvb, offset); - guint8 n_srv_clusters = n & ZBEE_ZCL_GP_CLUSTER_LIST_LEN_SRV; - guint8 n_cli_clusters = (n & ZBEE_ZCL_GP_CLUSTER_LIST_LEN_CLI) >> ZBEE_ZCL_GP_CLUSTER_LIST_LEN_CLI_SHIFT; + uint8_t n = tvb_get_uint8(tvb, offset); + uint8_t n_srv_clusters = n & ZBEE_ZCL_GP_CLUSTER_LIST_LEN_SRV; + uint8_t n_cli_clusters = (n & ZBEE_ZCL_GP_CLUSTER_LIST_LEN_CLI) >> ZBEE_ZCL_GP_CLUSTER_LIST_LEN_CLI_SHIFT; proto_tree *cl_tree = proto_tree_add_subtree_format(tree, tvb, offset, n*2+1, ett_zbee_zcl_gp_clusters, NULL, "Cluster List #%d/%d", n_srv_clusters, n_cli_clusters); proto_tree_add_item(cl_tree, hf_zbee_gp_n_srv_clusters, tvb, offset, 1, ENC_NA); proto_tree_add_item(cl_tree, hf_zbee_gp_n_cli_clusters, tvb, offset, 1, ENC_NA); @@ -14831,7 +14871,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_pairing_opt_fwd_radius_present, NULL }; - guint32 options = tvb_get_guint24(tvb, offset, ENC_LITTLE_ENDIAN); + uint32_t options = tvb_get_uint24(tvb, offset, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_pairing_options, ett_zbee_gp_cmd_pairing_options, p_options, ENC_LITTLE_ENDIAN); @@ -14892,7 +14932,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_pcm_opt_unicast_comm, NULL }; - guint8 options = tvb_get_guint8(tvb, offset); + uint8_t options = tvb_get_uint8(tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_proxy_commissioning_mode_options, ett_zbee_gp_cmd_proxy_commissioning_mode_options, pcm_options, ENC_NA); if (options & ZBEE_ZCL_GP_PROXY_COMMISSIONING_MODE_OPTION_ACTION) { @@ -14928,7 +14968,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d &hf_zbee_gp_cmd_resp_tx_channel, NULL }; - guint8 options = tvb_get_guint8(tvb, offset); + uint8_t options = tvb_get_uint8(tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_gp_cmd_response_options, ett_zbee_gp_cmd_response_options, rsp_options, ENC_LITTLE_ENDIAN); @@ -14990,7 +15030,7 @@ dissect_zbee_zcl_gp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d * @param client_attr - ZCL client */ static void -dissect_zcl_gp_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id _U_, guint data_type, gboolean client_attr) +dissect_zcl_gp_attr_data(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, uint16_t attr_id _U_, unsigned data_type, bool client_attr) { /* Dissect attribute data type and data */ switch (attr_id) { @@ -15705,7 +15745,7 @@ proto_register_zbee_zcl_gp(void) }; /* ZCL Green Power subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_gp, &ett_zbee_gp_cmd_proxy_commissioning_mode_options, &ett_zbee_gp_cmd_proxy_commissioning_mode_exit_mode, @@ -15818,7 +15858,7 @@ proto_reg_handoff_zbee_zcl_gp(void) #define ZBEE_ZCL_TOUCHLINK_INFO_UNDEFINED 0x20 #define ZBEE_ZCL_TOUCHLINK_INFO_PROFILE_INTEROP 0x80 -/*Touchlink Key Indicies*/ +/*Touchlink Key Indices*/ #define ZBEE_ZCL_TOUCHLINK_KEYID_DEVELOPMENT 0 #define ZBEE_ZCL_TOUCHLINK_KEYID_MASTER 4 #define ZBEE_ZCL_TOUCHLINK_KEYID_CERTIFICATION 15 @@ -15833,62 +15873,62 @@ void proto_reg_handoff_zbee_zcl_touchlink(void); /* Global Variables */ /*************************/ /* Initialize the protocol and registered fields */ -static int proto_zbee_zcl_touchlink = -1; - -static int hf_zbee_zcl_touchlink_rx_cmd_id = -1; -static int hf_zbee_zcl_touchlink_tx_cmd_id = -1; -static int hf_zbee_zcl_touchlink_transaction_id = -1; -static int hf_zbee_zcl_touchlink_zbee = -1; -static int hf_zbee_zcl_touchlink_zbee_type = -1; -static int hf_zbee_zcl_touchlink_zbee_rxidle = -1; -static int hf_zbee_zcl_touchlink_info = -1; -static int hf_zbee_zcl_touchlink_info_factory = -1; -static int hf_zbee_zcl_touchlink_info_assignment = -1; -static int hf_zbee_zcl_touchlink_info_initiator = -1; -static int hf_zbee_zcl_touchlink_info_undefined = -1; -static int hf_zbee_zcl_touchlink_info_profile_introp = -1; -static int hf_zbee_zcl_touchlink_start_index = -1; -static int hf_zbee_zcl_touchlink_ident_duration = -1; - -static int hf_zbee_zcl_touchlink_rssi_correction = -1; -static int hf_zbee_zcl_touchlink_response_id = -1; -static int hf_zbee_zcl_touchlink_ext_panid = -1; -static int hf_zbee_zcl_touchlink_nwk_update_id = -1; -static int hf_zbee_zcl_touchlink_channel = -1; -static int hf_zbee_zcl_touchlink_nwk_addr = -1; -static int hf_zbee_zcl_touchlink_ext_addr = -1; -static int hf_zbee_zcl_touchlink_panid = -1; -static int hf_zbee_zcl_touchlink_sub_devices = -1; -static int hf_zbee_zcl_touchlink_total_groups = -1; -static int hf_zbee_zcl_touchlink_endpoint = -1; -static int hf_zbee_zcl_touchlink_profile_id = -1; -static int hf_zbee_zcl_touchlink_device_id = -1; -static int hf_zbee_zcl_touchlink_version = -1; -static int hf_zbee_zcl_touchlink_group_count = -1; -static int hf_zbee_zcl_touchlink_group_begin = -1; -static int hf_zbee_zcl_touchlink_group_end = -1; -static int hf_zbee_zcl_touchlink_group_type = -1; -static int hf_zbee_zcl_touchlink_group_id = -1; -static int hf_zbee_zcl_touchlink_addr_range_begin = -1; -static int hf_zbee_zcl_touchlink_addr_range_end = -1; -static int hf_zbee_zcl_touchlink_group_range_begin = -1; -static int hf_zbee_zcl_touchlink_group_range_end = -1; -static int hf_zbee_zcl_touchlink_key_bitmask = -1; -static int hf_zbee_zcl_touchlink_key_bit_dev = -1; -static int hf_zbee_zcl_touchlink_key_bit_master = -1; -static int hf_zbee_zcl_touchlink_key_bit_cert = -1; -static int hf_zbee_zcl_touchlink_key_index = -1; -static int hf_zbee_zcl_touchlink_key = -1; -static int hf_zbee_zcl_touchlink_init_addr = -1; -static int hf_zbee_zcl_touchlink_init_eui64 = -1; -static int hf_zbee_zcl_touchlink_status = -1; +static int proto_zbee_zcl_touchlink; + +static int hf_zbee_zcl_touchlink_rx_cmd_id; +static int hf_zbee_zcl_touchlink_tx_cmd_id; +static int hf_zbee_zcl_touchlink_transaction_id; +static int hf_zbee_zcl_touchlink_zbee; +static int hf_zbee_zcl_touchlink_zbee_type; +static int hf_zbee_zcl_touchlink_zbee_rxidle; +static int hf_zbee_zcl_touchlink_info; +static int hf_zbee_zcl_touchlink_info_factory; +static int hf_zbee_zcl_touchlink_info_assignment; +static int hf_zbee_zcl_touchlink_info_initiator; +static int hf_zbee_zcl_touchlink_info_undefined; +static int hf_zbee_zcl_touchlink_info_profile_introp; +static int hf_zbee_zcl_touchlink_start_index; +static int hf_zbee_zcl_touchlink_ident_duration; + +static int hf_zbee_zcl_touchlink_rssi_correction; +static int hf_zbee_zcl_touchlink_response_id; +static int hf_zbee_zcl_touchlink_ext_panid; +static int hf_zbee_zcl_touchlink_nwk_update_id; +static int hf_zbee_zcl_touchlink_channel; +static int hf_zbee_zcl_touchlink_nwk_addr; +static int hf_zbee_zcl_touchlink_ext_addr; +static int hf_zbee_zcl_touchlink_panid; +static int hf_zbee_zcl_touchlink_sub_devices; +static int hf_zbee_zcl_touchlink_total_groups; +static int hf_zbee_zcl_touchlink_endpoint; +static int hf_zbee_zcl_touchlink_profile_id; +static int hf_zbee_zcl_touchlink_device_id; +static int hf_zbee_zcl_touchlink_version; +static int hf_zbee_zcl_touchlink_group_count; +static int hf_zbee_zcl_touchlink_group_begin; +static int hf_zbee_zcl_touchlink_group_end; +static int hf_zbee_zcl_touchlink_group_type; +static int hf_zbee_zcl_touchlink_group_id; +static int hf_zbee_zcl_touchlink_addr_range_begin; +static int hf_zbee_zcl_touchlink_addr_range_end; +static int hf_zbee_zcl_touchlink_group_range_begin; +static int hf_zbee_zcl_touchlink_group_range_end; +static int hf_zbee_zcl_touchlink_key_bitmask; +static int hf_zbee_zcl_touchlink_key_bit_dev; +static int hf_zbee_zcl_touchlink_key_bit_master; +static int hf_zbee_zcl_touchlink_key_bit_cert; +static int hf_zbee_zcl_touchlink_key_index; +static int hf_zbee_zcl_touchlink_key; +static int hf_zbee_zcl_touchlink_init_addr; +static int hf_zbee_zcl_touchlink_init_eui64; +static int hf_zbee_zcl_touchlink_status; /* Initialize the subtree pointers */ -static gint ett_zbee_zcl_touchlink = -1; -static gint ett_zbee_zcl_touchlink_zbee = -1; -static gint ett_zbee_zcl_touchlink_info = -1; -static gint ett_zbee_zcl_touchlink_keybits = -1; -static gint ett_zbee_zcl_touchlink_groups = -1; +static int ett_zbee_zcl_touchlink; +static int ett_zbee_zcl_touchlink_zbee; +static int ett_zbee_zcl_touchlink_info; +static int ett_zbee_zcl_touchlink_keybits; +static int ett_zbee_zcl_touchlink_groups; /* Command names */ static const value_string zbee_zcl_touchlink_rx_cmd_names[] = { @@ -15957,7 +15997,7 @@ static const value_string zbee_zcl_touchlink_keyid_names[] = { *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_scan_request(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_scan_request(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const zbee_info_flags[] = { &hf_zbee_zcl_touchlink_zbee_type, @@ -15986,7 +16026,7 @@ dissect_zcl_touchlink_scan_request(tvbuff_t *tvb, proto_tree *tree, guint *offse *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_identify_request(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_identify_request(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_touchlink_ident_duration, tvb, *offset, 2, ENC_LITTLE_ENDIAN); *offset += 2; @@ -16000,7 +16040,7 @@ dissect_zcl_touchlink_identify_request(tvbuff_t *tvb, proto_tree *tree, guint *o *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_network_start_request(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_network_start_request(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_touchlink_ext_panid, tvb, *offset, 8, ENC_LITTLE_ENDIAN); *offset += 8; @@ -16040,7 +16080,7 @@ dissect_zcl_touchlink_network_start_request(tvbuff_t *tvb, proto_tree *tree, gui *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_network_join_request(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_network_join_request(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_touchlink_ext_panid, tvb, *offset, 8, ENC_LITTLE_ENDIAN); *offset += 8; @@ -16078,7 +16118,7 @@ dissect_zcl_touchlink_network_join_request(tvbuff_t *tvb, proto_tree *tree, guin *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_network_update_request(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_network_update_request(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_touchlink_ext_panid, tvb, *offset, 8, ENC_LITTLE_ENDIAN); *offset += 8; @@ -16100,7 +16140,7 @@ dissect_zcl_touchlink_network_update_request(tvbuff_t *tvb, proto_tree *tree, gu *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_scan_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_scan_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { static int * const zbee_info_flags[] = { &hf_zbee_zcl_touchlink_zbee_type, @@ -16121,7 +16161,7 @@ dissect_zcl_touchlink_scan_response(tvbuff_t *tvb, proto_tree *tree, guint *offs &hf_zbee_zcl_touchlink_key_bit_cert, NULL }; - guint8 subdev; + uint8_t subdev; /* Parse out the fixed-format stuff */ proto_tree_add_item(tree, hf_zbee_zcl_touchlink_rssi_correction, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -16144,7 +16184,7 @@ dissect_zcl_touchlink_scan_response(tvbuff_t *tvb, proto_tree *tree, guint *offs *offset += 2; proto_tree_add_item(tree, hf_zbee_zcl_touchlink_nwk_addr, tvb, *offset, 2, ENC_LITTLE_ENDIAN); *offset += 2; - subdev = tvb_get_guint8(tvb, *offset); + subdev = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_touchlink_sub_devices, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_zbee_zcl_touchlink_total_groups, tvb, *offset, 1, ENC_LITTLE_ENDIAN); @@ -16173,7 +16213,7 @@ dissect_zcl_touchlink_scan_response(tvbuff_t *tvb, proto_tree *tree, guint *offs *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_network_start_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_network_start_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_touchlink_status, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -16195,7 +16235,7 @@ dissect_zcl_touchlink_network_start_response(tvbuff_t *tvb, proto_tree *tree, gu *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_endpoint_info(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_endpoint_info(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree_add_item(tree, hf_zbee_zcl_touchlink_ext_addr, tvb, *offset, 8, ENC_LITTLE_ENDIAN); *offset += 8; @@ -16219,15 +16259,15 @@ dissect_zcl_touchlink_endpoint_info(tvbuff_t *tvb, proto_tree *tree, guint *offs *@param offset offset of data in tvb */ static void -dissect_zcl_touchlink_group_id_response(tvbuff_t *tvb, proto_tree *tree, guint *offset) +dissect_zcl_touchlink_group_id_response(tvbuff_t *tvb, proto_tree *tree, unsigned *offset) { proto_tree *list_tree; - guint8 count; + uint8_t count; proto_tree_add_item(tree, hf_zbee_zcl_touchlink_total_groups, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; proto_tree_add_item(tree, hf_zbee_zcl_touchlink_start_index, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; - count = tvb_get_guint8(tvb, *offset); + count = tvb_get_uint8(tvb, *offset); proto_tree_add_item(tree, hf_zbee_zcl_touchlink_group_count, tvb, *offset, 1, ENC_LITTLE_ENDIAN); *offset += 1; @@ -16251,8 +16291,8 @@ static int dissect_zbee_zcl_touchlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { zbee_zcl_packet *zcl; - guint offset = 0; - guint8 cmd_id; + unsigned offset = 0; + uint8_t cmd_id; int hf_cmd_id; const value_string *vals_cmd_id; @@ -16565,7 +16605,7 @@ proto_register_zbee_zcl_touchlink(void) }; /* ZCL Touchlink subtrees */ - static gint *ett[] = { + static int *ett[] = { &ett_zbee_zcl_touchlink, &ett_zbee_zcl_touchlink_zbee, &ett_zbee_zcl_touchlink_info, |