diff options
Diffstat (limited to 'epan/dissectors/packet-zbee-tlv.c')
-rw-r--r-- | epan/dissectors/packet-zbee-tlv.c | 849 |
1 files changed, 426 insertions, 423 deletions
diff --git a/epan/dissectors/packet-zbee-tlv.c b/epan/dissectors/packet-zbee-tlv.c index 1ba6e49a..5a12a2e3 100644 --- a/epan/dissectors/packet-zbee-tlv.c +++ b/epan/dissectors/packet-zbee-tlv.c @@ -30,210 +30,210 @@ *------------------------------------- */ static int dissect_zbee_tlv_default(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_); -static guint dissect_zdp_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint cmd_id); -static guint dissect_aps_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, void *data, guint cmd_id); -static guint dissect_zbd_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, void* data _U_, guint cmd_id); -static guint dissect_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); +static unsigned dissect_zdp_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, unsigned cmd_id); +static unsigned dissect_aps_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void *data, unsigned cmd_id); +static unsigned dissect_zbd_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void* data _U_, unsigned cmd_id); +static unsigned dissect_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); //Global TLV Dissector Routines -static guint dissect_zbee_tlv_manufacturer_specific(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 length); -static guint dissect_zbee_tlv_supported_key_negotiation_methods(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_configuration_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_dev_cap_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_panid_conflict_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_next_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_next_channel_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_passphrase(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_router_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_fragmentation_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_potential_parents(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); +static unsigned dissect_zbee_tlv_manufacturer_specific(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t length); +static unsigned dissect_zbee_tlv_supported_key_negotiation_methods(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_configuration_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_dev_cap_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_panid_conflict_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_next_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_next_channel_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_passphrase(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_router_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_fragmentation_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_potential_parents(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); //Local TLV Dissector Routines -static guint dissect_zbee_tlv_selected_key_negotiation_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_public_point(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 length); -static guint dissect_zbee_tlv_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_clear_all_bindigs_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_requested_auth_token_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_target_ieee_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_device_auth_level(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbee_tlv_chanmask(proto_tree *tree, tvbuff_t *tvb, guint offset, int hf_page, int hf_channel); -static guint dissect_zbee_tlv_ext_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_short_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_nwk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_dev_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_nwk_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_join_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_tc_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_nwk_upd_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_adm_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_mj_prov_lnk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_mj_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_mj_cmd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_nwk_channel_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_link_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_nwk_status_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_status_code(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_tunneling_npdu_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, guint8 length); -static guint dissect_zbee_tlv_key_neg_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); -static guint dissect_zbee_tlv_mac_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, guint8 mac_tag_size); -static guint dissect_zbee_tlv_nwk_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_selected_key_negotiation_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_public_point(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t length); +static unsigned dissect_zbee_tlv_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_clear_all_bindigs_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_requested_auth_token_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_target_ieee_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_device_auth_level(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_chanmask(proto_tree *tree, tvbuff_t *tvb, unsigned offset, int hf_page, int hf_channel); +static unsigned dissect_zbee_tlv_ext_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_short_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_nwk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_dev_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_nwk_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_join_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_tc_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_nwk_upd_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_adm_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_mj_prov_lnk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_mj_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_mj_cmd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_nwk_channel_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_link_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_nwk_status_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_status_code(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_tunneling_npdu_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t length); +static unsigned dissect_zbee_tlv_key_neg_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbee_tlv_mac_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t mac_tag_size); +static unsigned dissect_zbee_tlv_nwk_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); //Dissectors for ZB Direct -static guint dissect_zbd_msg_status_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbd_msg_tunneling_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbd_msg_manage_joiners_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbd_msg_join_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbd_msg_formation_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); -static guint dissect_zbd_msg_secur_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset); +static unsigned dissect_zbd_msg_status_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbd_msg_tunneling_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbd_msg_manage_joiners_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbd_msg_join_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbd_msg_formation_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); +static unsigned dissect_zbd_msg_secur_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset); void proto_register_zbee_tlv(void); /* Initialize Protocol and Registered fields */ -static int proto_zbee_tlv = -1; +static int proto_zbee_tlv; static dissector_handle_t zigbee_aps_handle; static dissector_handle_t zbee_nwk_handle; -static int hf_zbee_tlv_global_type = -1; -static int hf_zbee_tlv_local_type_key_update_req_rsp = -1; -static int hf_zbee_tlv_local_type_key_negotiation_req_rsp = -1; -static int hf_zbee_tlv_local_type_get_auth_level_rsp = -1; -static int hf_zbee_tlv_local_type_clear_all_bindings_req = -1; -static int hf_zbee_tlv_local_type_req_security_get_auth_token = -1; -static int hf_zbee_tlv_local_type_req_security_get_auth_level = -1; -static int hf_zbee_tlv_local_type_req_security_decommission = -1; -static int hf_zbee_tlv_local_type_req_beacon_survey = -1; -static int hf_zbee_tlv_local_type_rsp_beacon_survey = -1; -static int hf_zbee_tlv_local_type_req_challenge = -1; -static int hf_zbee_tlv_local_type_rsp_challenge = -1; -static int hf_zbee_tlv_local_type_rsp_set_configuration = -1; - -static int hf_zbee_tlv_length = -1; -static int hf_zbee_tlv_type = -1; -static int hf_zbee_tlv_value = -1; -static int hf_zbee_tlv_count = -1; -static int hf_zbee_tlv_manufacturer_specific = -1; - -static int hf_zbee_tlv_local_status_count = -1; -static int hf_zbee_tlv_local_type_id = -1; -static int hf_zbee_tlv_local_proc_status = -1; - -static int hf_zbee_tlv_local_comm_ext_pan_id = -1; -static int hf_zbee_tlv_local_comm_short_pan_id = -1; -static int hf_zbee_tlv_local_comm_channel_mask = -1; -static int hf_zbee_tlv_local_comm_channel_page = -1; -static int hf_zbee_tlv_local_comm_channel_page_count = -1; -static int hf_zbee_tlv_local_comm_nwk_key = -1; -static int hf_zbee_tlv_local_comm_link_key = -1; -static int hf_zbee_tlv_local_comm_link_key_flags = -1; -static int hf_zbee_tlv_local_comm_link_key_flags_unique = -1; -static int hf_zbee_tlv_local_comm_link_key_flags_provisional = -1; -static int hf_zbee_tlv_local_comm_dev_type = -1; -static int hf_zbee_tlv_local_comm_nwk_addr = -1; -static int hf_zbee_tlv_local_comm_join_method = -1; -static int hf_zbee_tlv_local_comm_tc_addr = -1; -static int hf_zbee_tlv_local_comm_network_status_map = -1; -static int hf_zbee_tlv_local_comm_network_status_map_joined_status = -1; -static int hf_zbee_tlv_local_comm_network_status_map_open_status = -1; -static int hf_zbee_tlv_network_status_map_network_type = -1; -static int hf_zbee_tlv_local_comm_nwk_upd_id = -1; -static int hf_zbee_tlv_local_comm_key_seq_num = -1; -static int hf_zbee_tlv_local_comm_adm_key = -1; -static int hf_zbee_tlv_local_comm_status_code_domain = -1; -static int hf_zbee_tlv_local_comm_status_code_value = -1; -static int hf_zbee_tlv_local_comm_mj_prov_lnk_key = -1; -static int hf_zbee_tlv_local_comm_mj_ieee_addr = -1; -static int hf_zbee_tlv_local_comm_mj_cmd = -1; - -static int hf_zbee_tlv_local_tunneling_npdu = -1; -static int hf_zbee_tlv_local_tunneling_npdu_flags = -1; -static int hf_zbee_tlv_local_tunneling_npdu_flags_security = -1; -static int hf_zbee_tlv_local_tunneling_npdu_flags_reserved = -1; -static int hf_zbee_tlv_local_tunneling_npdu_length = -1; - -static int hf_zbee_tlv_local_selected_key_method = -1; -static int hf_zbee_tlv_local_selected_psk_secret = -1; -static int hf_zbee_tlv_local_nwk_key_seq_num = -1; -static int hf_zbee_tlv_local_mac_tag = -1; - -static int hf_zbee_tlv_zbd_comm_tlv = -1; -static int hf_zbee_tlv_zbd_comm_mj_cmd_tlv = -1; -static int hf_zbee_tlv_zbd_secur_tlv = - 1; -static int hf_zbee_tlv_zbd_tunneling_npdu_msg_tlv = -1; - -static int hf_zbee_tlv_next_pan_id = -1; -static int hf_zbee_tlv_next_channel_change =-1; -static int hf_zbee_tlv_passphrase = -1; -static int hf_zbee_tlv_configuration_param = -1; -static int hf_zbee_tlv_configuration_param_restricted_mode =-1; -static int hf_zbee_tlv_configuration_param_link_key_enc = -1; -static int hf_zbee_tlv_configuration_param_leave_req_allowed = -1; - -static int hf_zbee_tlv_dev_cap_ext_capability_information = -1; -static int hf_zbee_tlv_dev_cap_ext_zbdirect_virt_device = -1; - -static int hf_zbee_tlv_challenge_value = -1; -static int hf_zbee_tlv_aps_frame_counter = -1; -static int hf_zbee_tlv_challenge_counter = -1; -static int hf_zbee_tlv_mic64 = -1; - -static int hf_zbee_tlv_lqa = -1; - -static int hf_zbee_tlv_router_information = -1; -static int hf_zbee_tlv_router_information_hub_connectivity = -1; -static int hf_zbee_tlv_router_information_uptime = -1; -static int hf_zbee_tlv_router_information_pref_parent = -1; -static int hf_zbee_tlv_router_information_battery_backup = -1; -static int hf_zbee_tlv_router_information_enhanced_beacon_request_support = -1; -static int hf_zbee_tlv_router_information_mac_data_poll_keepalive_support = -1; -static int hf_zbee_tlv_router_information_end_device_keepalive_support = -1; -static int hf_zbee_tlv_router_information_power_negotiation_support = -1; - -static int hf_zbee_tlv_node_id = -1; -static int hf_zbee_tlv_frag_opt = -1; -static int hf_zbee_tlv_max_reassembled_buf_size = -1; - -static int hf_zbee_tlv_supported_key_negotiation_methods = -1; -static int hf_zbee_tlv_supported_key_negotiation_methods_key_request = -1; -static int hf_zbee_tlv_supported_key_negotiation_methods_ecdhe_using_curve25519_aes_mmo128 = -1; -static int hf_zbee_tlv_supported_key_negotiation_methods_ecdhe_using_curve25519_sha256 = -1; -static int hf_zbee_tlv_supported_secrets = -1; -static int hf_zbee_tlv_supported_preshared_secrets_auth_token = -1; -static int hf_zbee_tlv_supported_preshared_secrets_ic = -1; -static int hf_zbee_tlv_supported_preshared_secrets_passcode_pake = -1; -static int hf_zbee_tlv_supported_preshared_secrets_basic_access_key = -1; -static int hf_zbee_tlv_supported_preshared_secrets_admin_access_key = -1; - -static int hf_zbee_tlv_panid_conflict_cnt = -1; - -static int hf_zbee_tlv_selected_key_negotiation_method = -1; -static int hf_zbee_tlv_selected_pre_shared_secret = -1; -static int hf_zbee_tlv_device_eui64 = -1; -static int hf_zbee_tlv_public_point = -1; -static int hf_zbee_tlv_global_tlv_id = -1; -static int hf_zbee_tlv_local_ieee_addr = -1; -static int hf_zbee_tlv_local_initial_join_method = -1; -static int hf_zbee_tlv_local_active_lk_type = -1; - -static int hf_zbee_tlv_relay_msg_type = -1; -static int hf_zbee_tlv_relay_msg_length = -1; -static int hf_zbee_tlv_relay_msg_joiner_ieee = -1; - -static gint ett_zbee_aps_tlv = -1; -static gint ett_zbee_aps_relay = -1; -static gint ett_zbee_tlv = -1; -static gint ett_zbee_tlv_supported_key_negotiation_methods = -1; -static gint ett_zbee_tlv_supported_secrets = -1; -static gint ett_zbee_tlv_router_information = -1; -static gint ett_zbee_tlv_configuration_param = -1; -static gint ett_zbee_tlv_capability_information = -1; - -static gint ett_zbee_tlv_zbd_tunneling_npdu = -1; -static gint ett_zbee_tlv_zbd_tunneling_npdu_flags = -1; - -static gint ett_zbee_tlv_link_key_flags = -1; -static gint ett_zbee_tlv_network_status_map = -1; +static int hf_zbee_tlv_global_type; +static int hf_zbee_tlv_local_type_key_update_req_rsp; +static int hf_zbee_tlv_local_type_key_negotiation_req_rsp; +static int hf_zbee_tlv_local_type_get_auth_level_rsp; +static int hf_zbee_tlv_local_type_clear_all_bindings_req; +static int hf_zbee_tlv_local_type_req_security_get_auth_token; +static int hf_zbee_tlv_local_type_req_security_get_auth_level; +static int hf_zbee_tlv_local_type_req_security_decommission; +static int hf_zbee_tlv_local_type_req_beacon_survey; +static int hf_zbee_tlv_local_type_rsp_beacon_survey; +static int hf_zbee_tlv_local_type_req_challenge; +static int hf_zbee_tlv_local_type_rsp_challenge; +static int hf_zbee_tlv_local_type_rsp_set_configuration; + +static int hf_zbee_tlv_length; +static int hf_zbee_tlv_type; +static int hf_zbee_tlv_value; +static int hf_zbee_tlv_count; +static int hf_zbee_tlv_manufacturer_specific; + +static int hf_zbee_tlv_local_status_count; +static int hf_zbee_tlv_local_type_id; +static int hf_zbee_tlv_local_proc_status; + +static int hf_zbee_tlv_local_comm_ext_pan_id; +static int hf_zbee_tlv_local_comm_short_pan_id; +static int hf_zbee_tlv_local_comm_channel_mask; +static int hf_zbee_tlv_local_comm_channel_page; +static int hf_zbee_tlv_local_comm_channel_page_count; +static int hf_zbee_tlv_local_comm_nwk_key; +static int hf_zbee_tlv_local_comm_link_key; +static int hf_zbee_tlv_local_comm_link_key_flags; +static int hf_zbee_tlv_local_comm_link_key_flags_unique; +static int hf_zbee_tlv_local_comm_link_key_flags_provisional; +static int hf_zbee_tlv_local_comm_dev_type; +static int hf_zbee_tlv_local_comm_nwk_addr; +static int hf_zbee_tlv_local_comm_join_method; +static int hf_zbee_tlv_local_comm_tc_addr; +static int hf_zbee_tlv_local_comm_network_status_map; +static int hf_zbee_tlv_local_comm_network_status_map_joined_status; +static int hf_zbee_tlv_local_comm_network_status_map_open_status; +static int hf_zbee_tlv_network_status_map_network_type; +static int hf_zbee_tlv_local_comm_nwk_upd_id; +static int hf_zbee_tlv_local_comm_key_seq_num; +static int hf_zbee_tlv_local_comm_adm_key; +static int hf_zbee_tlv_local_comm_status_code_domain; +static int hf_zbee_tlv_local_comm_status_code_value; +static int hf_zbee_tlv_local_comm_mj_prov_lnk_key; +static int hf_zbee_tlv_local_comm_mj_ieee_addr; +static int hf_zbee_tlv_local_comm_mj_cmd; + +static int hf_zbee_tlv_local_tunneling_npdu; +static int hf_zbee_tlv_local_tunneling_npdu_flags; +static int hf_zbee_tlv_local_tunneling_npdu_flags_security; +static int hf_zbee_tlv_local_tunneling_npdu_flags_reserved; +static int hf_zbee_tlv_local_tunneling_npdu_length; + +static int hf_zbee_tlv_local_selected_key_method; +static int hf_zbee_tlv_local_selected_psk_secret; +static int hf_zbee_tlv_local_nwk_key_seq_num; +static int hf_zbee_tlv_local_mac_tag; + +static int hf_zbee_tlv_zbd_comm_tlv; +static int hf_zbee_tlv_zbd_comm_mj_cmd_tlv; +static int hf_zbee_tlv_zbd_secur_tlv; +static int hf_zbee_tlv_zbd_tunneling_npdu_msg_tlv; + +static int hf_zbee_tlv_next_pan_id; +static int hf_zbee_tlv_next_channel_change; +static int hf_zbee_tlv_passphrase; +static int hf_zbee_tlv_configuration_param; +static int hf_zbee_tlv_configuration_param_restricted_mode; +static int hf_zbee_tlv_configuration_param_link_key_enc; +static int hf_zbee_tlv_configuration_param_leave_req_allowed; + +static int hf_zbee_tlv_dev_cap_ext_capability_information; +static int hf_zbee_tlv_dev_cap_ext_zbdirect_virt_device; + +static int hf_zbee_tlv_challenge_value; +static int hf_zbee_tlv_aps_frame_counter; +static int hf_zbee_tlv_challenge_counter; +static int hf_zbee_tlv_mic64; + +static int hf_zbee_tlv_lqa; + +static int hf_zbee_tlv_router_information; +static int hf_zbee_tlv_router_information_hub_connectivity; +static int hf_zbee_tlv_router_information_uptime; +static int hf_zbee_tlv_router_information_pref_parent; +static int hf_zbee_tlv_router_information_battery_backup; +static int hf_zbee_tlv_router_information_enhanced_beacon_request_support; +static int hf_zbee_tlv_router_information_mac_data_poll_keepalive_support; +static int hf_zbee_tlv_router_information_end_device_keepalive_support; +static int hf_zbee_tlv_router_information_power_negotiation_support; + +static int hf_zbee_tlv_node_id; +static int hf_zbee_tlv_frag_opt; +static int hf_zbee_tlv_max_reassembled_buf_size; + +static int hf_zbee_tlv_supported_key_negotiation_methods; +static int hf_zbee_tlv_supported_key_negotiation_methods_key_request; +static int hf_zbee_tlv_supported_key_negotiation_methods_ecdhe_using_curve25519_aes_mmo128; +static int hf_zbee_tlv_supported_key_negotiation_methods_ecdhe_using_curve25519_sha256; +static int hf_zbee_tlv_supported_secrets; +static int hf_zbee_tlv_supported_preshared_secrets_auth_token; +static int hf_zbee_tlv_supported_preshared_secrets_ic; +static int hf_zbee_tlv_supported_preshared_secrets_passcode_pake; +static int hf_zbee_tlv_supported_preshared_secrets_basic_access_key; +static int hf_zbee_tlv_supported_preshared_secrets_admin_access_key; + +static int hf_zbee_tlv_panid_conflict_cnt; + +static int hf_zbee_tlv_selected_key_negotiation_method; +static int hf_zbee_tlv_selected_pre_shared_secret; +static int hf_zbee_tlv_device_eui64; +static int hf_zbee_tlv_public_point; +static int hf_zbee_tlv_global_tlv_id; +static int hf_zbee_tlv_local_ieee_addr; +static int hf_zbee_tlv_local_initial_join_method; +static int hf_zbee_tlv_local_active_lk_type; + +static int hf_zbee_tlv_relay_msg_type; +static int hf_zbee_tlv_relay_msg_length; +static int hf_zbee_tlv_relay_msg_joiner_ieee; + +static int ett_zbee_aps_tlv; +static int ett_zbee_aps_relay; +static int ett_zbee_tlv; +static int ett_zbee_tlv_supported_key_negotiation_methods; +static int ett_zbee_tlv_supported_secrets; +static int ett_zbee_tlv_router_information; +static int ett_zbee_tlv_configuration_param; +static int ett_zbee_tlv_capability_information; + +static int ett_zbee_tlv_zbd_tunneling_npdu; +static int ett_zbee_tlv_zbd_tunneling_npdu_flags; + +static int ett_zbee_tlv_link_key_flags; +static int ett_zbee_tlv_network_status_map; static expert_field ei_zbee_tlv_max_recursion_depth_reached; @@ -488,13 +488,13 @@ static const value_string zbee_active_lk_types[] = { { 0, NULL } }; -static guint -dissect_aps_relay_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, void *data) +static unsigned +dissect_aps_relay_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void *data) { tvbuff_t *relay_tvb; proto_item *relayed_frame_root; proto_tree *relayed_frame_tree; - guint8 length; + uint8_t length; zbee_nwk_hints_t *nwk_hints; zigbee_aps_handle = find_dissector("zbee_aps"); @@ -502,7 +502,7 @@ dissect_aps_relay_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * proto_tree_add_item(tree, hf_zbee_tlv_relay_msg_type, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset) + 1; + length = tvb_get_uint8(tvb, offset) + 1; proto_tree_add_item(tree, hf_zbee_tlv_relay_msg_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -525,8 +525,8 @@ dissect_aps_relay_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * } -static guint -dissect_aps_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, void *data, guint cmd_id) +static unsigned +dissect_aps_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void *data, unsigned cmd_id) { switch (cmd_id) { case ZBEE_APS_CMD_RELAY_MSG_UPSTREAM: @@ -558,17 +558,17 @@ dissect_aps_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_req_security_decommission_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_req_security_decommission_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_req_security_decommission, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -596,17 +596,17 @@ dissect_zdp_req_security_decommission_local_tlv (tvbuff_t *tvb, packet_info *pin *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_req_security_get_auth_level_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_req_security_get_auth_level_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_req_security_get_auth_level, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -633,17 +633,17 @@ dissect_zdp_req_security_get_auth_level_local_tlv (tvbuff_t *tvb, packet_info *p *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_req_security_get_auth_token_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_req_security_get_auth_token_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_req_security_get_auth_token, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -671,17 +671,17 @@ dissect_zdp_req_security_get_auth_token_local_tlv (tvbuff_t *tvb, packet_info *p *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_req_clear_all_bindings_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_req_clear_all_bindings_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_clear_all_bindings_req, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -709,17 +709,17 @@ dissect_zdp_req_clear_all_bindings_local_tlv (tvbuff_t *tvb, packet_info *pinfo *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_req_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_req_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_req_beacon_survey, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -727,10 +727,10 @@ dissect_zdp_req_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, switch (type) { case ZBEE_TLV_TYPE_BEACON_SURVEY_CONFIGURATION: { - guint8 cnt; - guint8 i; + uint8_t cnt; + uint8_t i; - cnt = tvb_get_guint8(tvb, offset); + cnt = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_zdp_beacon_survey_scan_mask_cnt, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -762,17 +762,17 @@ dissect_zdp_req_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_rsp_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_rsp_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_rsp_beacon_survey, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -780,13 +780,13 @@ dissect_zdp_rsp_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, switch (type) { case ZBEE_TLV_TYPE_BEACON_SURVEY_CONFIGURATION: { - guint8 cnt; - guint8 i; + uint8_t cnt; + uint8_t i; proto_tree_add_item(tree, hf_zbee_zdp_beacon_survey_conf_mask, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; - cnt = tvb_get_guint8(tvb, offset); + cnt = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_zdp_beacon_survey_scan_mask_cnt, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -838,17 +838,17 @@ dissect_zdp_rsp_beacon_survey_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_req_security_challenge_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_req_security_challenge_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_req_challenge, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -881,17 +881,17 @@ dissect_zdp_req_security_challenge_local_tlv (tvbuff_t *tvb, packet_info *pinfo *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_rsp_security_challenge_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_rsp_security_challenge_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_rsp_challenge, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -934,17 +934,17 @@ dissect_zdp_rsp_security_challenge_local_tlv (tvbuff_t *tvb, packet_info *pinfo *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_rsp_security_set_configuration_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_rsp_security_set_configuration_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_rsp_set_configuration, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -952,10 +952,10 @@ dissect_zdp_rsp_security_set_configuration_local_tlv(tvbuff_t *tvb, packet_info switch (type) { case 0: { - guint8 count; - guint8 i; + uint8_t count; + uint8_t i; - count = tvb_get_guint8(tvb, offset); + count = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_status_count, tvb, offset, 1, ENC_NA); offset += 1; @@ -987,17 +987,17 @@ dissect_zdp_rsp_security_set_configuration_local_tlv(tvbuff_t *tvb, packet_info *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_security_start_key_neg_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_security_start_key_neg_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_key_negotiation_req_rsp, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -1027,17 +1027,17 @@ dissect_zdp_security_start_key_neg_local_tlv (tvbuff_t *tvb, packet_info *pinfo *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_security_key_upd_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_security_key_upd_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_key_update_req_rsp, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -1066,17 +1066,17 @@ dissect_zdp_security_key_upd_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, pr *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zdp_rsp_security_get_auth_level_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zdp_rsp_security_get_auth_level_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_local_type_get_auth_level_rsp, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -1106,11 +1106,11 @@ dissect_zdp_rsp_security_get_auth_level_local_tlv (tvbuff_t *tvb, packet_info *p *@param cmd_id - ZDP command id . *@return offset after command dissection. */ -static guint -dissect_zdp_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint cmd_id) +static unsigned +dissect_zdp_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, unsigned cmd_id) { - guint8 total_tlv_length = 2 /*type + len fields*/ + tvb_get_guint8(tvb, offset + 1) + 1; - guint8 tmp_offset = offset; + uint8_t total_tlv_length = 2 /*type + len fields*/ + tvb_get_uint8(tvb, offset + 1) + 1; + uint8_t tmp_offset = offset; switch (cmd_id) { case ZBEE_ZDP_REQ_CLEAR_ALL_BINDINGS: @@ -1190,18 +1190,18 @@ dissect_zdp_local_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, * @param hf_channel channel field index * @return mask */ -static guint -dissect_zbee_tlv_chanmask(proto_tree *tree, tvbuff_t *tvb, guint offset, int hf_page, int hf_channel) +static unsigned +dissect_zbee_tlv_chanmask(proto_tree *tree, tvbuff_t *tvb, unsigned offset, int hf_page, int hf_channel) { - gint i; - guint32 mask; - guint8 page; + int i; + uint32_t mask; + uint8_t page; proto_item *ti; /* Get and display the channel mask. */ mask = tvb_get_letohl(tvb, offset); - page = (guint8)((mask >> 27) & 0x07); + page = (uint8_t)((mask >> 27) & 0x07); mask &= 0x07FFFFFFUL; proto_tree_add_uint(tree, hf_page, tvb, offset, 4, page); @@ -1250,7 +1250,7 @@ dissect_zbee_tlv_chanmask(proto_tree *tree, tvbuff_t *tvb, guint offset, int hf_ } } - offset += sizeof(guint32); + offset += sizeof(uint32_t); return offset; } @@ -1265,7 +1265,7 @@ dissect_zbee_tlv_chanmask(proto_tree *tree, tvbuff_t *tvb, guint offset, int hf_ * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_ext_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_ext_pan_id, tvb, offset, 8, ENC_NA); @@ -1284,7 +1284,7 @@ dissect_zbee_tlv_ext_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_short_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_short_pan_id, tvb, offset, 2, ENC_NA); @@ -1303,7 +1303,7 @@ dissect_zbee_tlv_short_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * @return offset after dissection */ -static guint dissect_zbee_tlv_nwk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_nwk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_nwk_key, tvb, offset, 16, ENC_NA); offset += 16; @@ -1321,7 +1321,7 @@ static guint dissect_zbee_tlv_nwk_key(tvbuff_t *tvb, packet_info *pinfo _U_, pro * @return offset after dissection */ -static guint dissect_zbee_tlv_dev_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_dev_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_dev_type, tvb, offset, 1, ENC_NA); offset += 1; @@ -1339,7 +1339,7 @@ static guint dissect_zbee_tlv_dev_type(tvbuff_t *tvb, packet_info *pinfo _U_, pr * @return offset after dissection */ -static guint dissect_zbee_tlv_nwk_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_nwk_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_nwk_addr, tvb, offset, 2, ENC_NA); offset += 2; @@ -1357,7 +1357,7 @@ static guint dissect_zbee_tlv_nwk_addr(tvbuff_t *tvb, packet_info *pinfo _U_, pr * @return offset after dissection */ -static guint dissect_zbee_tlv_join_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_join_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_join_method, tvb, offset, 1, ENC_NA); offset += 1; @@ -1375,7 +1375,7 @@ static guint dissect_zbee_tlv_join_method(tvbuff_t *tvb, packet_info *pinfo _U_, * @return offset after dissection */ -static guint dissect_zbee_tlv_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_ieee_addr, tvb, offset, 8, ENC_NA); offset += 8; @@ -1393,7 +1393,7 @@ static guint dissect_zbee_tlv_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, p * @return offset after dissection */ -static guint dissect_zbee_tlv_tc_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_tc_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_tc_addr, tvb, offset, 8, ENC_NA); offset += 8; @@ -1411,7 +1411,7 @@ static guint dissect_zbee_tlv_tc_addr(tvbuff_t *tvb, packet_info *pinfo _U_, pro * @return offset after dissection */ -static guint dissect_zbee_tlv_nwk_upd_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_nwk_upd_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_nwk_upd_id, tvb, offset, 1, ENC_NA); offset += 1; @@ -1429,7 +1429,7 @@ static guint dissect_zbee_tlv_nwk_upd_id(tvbuff_t *tvb, packet_info *pinfo _U_, * @return offset after dissection */ -static guint dissect_zbee_tlv_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_key_seq_num, tvb, offset, 1, ENC_NA); offset += 1; @@ -1447,7 +1447,7 @@ static guint dissect_zbee_tlv_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, * @return offset after dissection */ -static guint dissect_zbee_tlv_adm_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_adm_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_adm_key, tvb, offset, 16, ENC_NA); offset += 16; @@ -1465,7 +1465,7 @@ static guint dissect_zbee_tlv_adm_key(tvbuff_t *tvb, packet_info *pinfo _U_, pro * @return offset after dissection */ -static guint dissect_zbee_tlv_mj_prov_lnk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_mj_prov_lnk_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_mj_prov_lnk_key, tvb, offset, 16, ENC_NA); offset += 16; @@ -1483,7 +1483,7 @@ static guint dissect_zbee_tlv_mj_prov_lnk_key(tvbuff_t *tvb, packet_info *pinfo * @return offset after dissection */ -static guint dissect_zbee_tlv_mj_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_mj_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_mj_ieee_addr, tvb, offset, 8, ENC_NA); offset += 8; @@ -1501,7 +1501,7 @@ static guint dissect_zbee_tlv_mj_ieee_addr(tvbuff_t *tvb, packet_info *pinfo _U_ * @return offset after dissection */ -static guint dissect_zbee_tlv_mj_cmd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) +static unsigned dissect_zbee_tlv_mj_cmd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_comm_mj_cmd, tvb, offset, 1, ENC_NA); offset += 1; @@ -1518,15 +1518,15 @@ static guint dissect_zbee_tlv_mj_cmd(tvbuff_t *tvb, packet_info *pinfo _U_, prot * @param offset offset into the tvb to begin dissection * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_nwk_channel_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint32 count = 0; + uint32_t count = 0; proto_tree_add_item_ret_uint(tree, hf_zbee_tlv_local_comm_channel_page_count, tvb, offset, 1, ENC_LITTLE_ENDIAN, &count); offset += 1; - for (guint i = 0; i < count; i++) + for (unsigned i = 0; i < count; i++) { offset = dissect_zbee_tlv_chanmask(tree, tvb, offset, hf_zbee_tlv_local_comm_channel_page, hf_zbee_tlv_local_comm_channel_mask); } @@ -1543,7 +1543,7 @@ dissect_zbee_tlv_nwk_channel_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t * @param offset offset into the tvb to begin dissection * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_link_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { static int * const link_key_flags[] = { @@ -1570,11 +1570,11 @@ dissect_zbee_tlv_link_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre * @param offset offset into the tvb to begin dissection * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_nwk_status_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 mask; - guint joined, opened, centralized; + uint8_t mask; + unsigned joined, opened, centralized; static int * const network_status_map[] = { &hf_zbee_tlv_local_comm_network_status_map_joined_status, @@ -1583,7 +1583,7 @@ dissect_zbee_tlv_nwk_status_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre NULL }; - mask = tvb_get_guint8(tvb, offset); + mask = tvb_get_uint8(tvb, offset); proto_tree_add_bitmask(tree, tvb, offset, hf_zbee_tlv_local_comm_network_status_map, ett_zbee_tlv_network_status_map, network_status_map, ENC_LITTLE_ENDIAN); offset += 1; @@ -1619,10 +1619,10 @@ dissect_zbee_tlv_nwk_status_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre * @param offset offset into the tvb to begin dissection * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_status_code(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint32 code; + uint32_t code; proto_item *code_item; proto_tree_add_item(tree, hf_zbee_tlv_local_comm_status_code_domain, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -1644,17 +1644,17 @@ dissect_zbee_tlv_status_code(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * * @param tree pointer to subtree * @return offset after dissection */ -static guint +static unsigned dissect_zbee_tlv_tunneling_npdu_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, - guint8 length) + uint8_t length) { - guint32 npdu_len = 0; + uint32_t npdu_len = 0; /* Parse NPDU Message TLV */ { proto_item *npdu_flags_item = proto_tree_add_item(tree, hf_zbee_tlv_local_tunneling_npdu_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree *npdu_flags_tree = proto_item_add_subtree(npdu_flags_item, ett_zbee_tlv_zbd_tunneling_npdu_flags); - gboolean secur; + bool secur; proto_tree_add_item_ret_boolean(npdu_flags_tree, hf_zbee_tlv_local_tunneling_npdu_flags_security, tvb, offset, 1, ENC_LITTLE_ENDIAN, &secur); proto_tree_add_item_ret_uint(tree, hf_zbee_tlv_local_tunneling_npdu_length, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN, &npdu_len); @@ -1692,7 +1692,7 @@ dissect_zbee_tlv_tunneling_npdu_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tre * @param offset offset into the tvb to begin dissection * @return offset after command dissection */ -static guint +static unsigned dissect_zbee_tlv_key_neg_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_selected_key_method, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -1713,8 +1713,8 @@ dissect_zbee_tlv_key_neg_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre * @param offset offset into the tvb to begin dissection * @return offset after command dissection */ -static guint -dissect_zbee_tlv_mac_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, guint8 mac_tag_size) +static unsigned +dissect_zbee_tlv_mac_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t mac_tag_size) { proto_tree_add_item(tree, hf_zbee_tlv_local_mac_tag, tvb, offset, mac_tag_size, ENC_NA); offset += mac_tag_size; @@ -1731,7 +1731,7 @@ dissect_zbee_tlv_mac_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree * @param offset offset into the tvb to begin dissection * @return offset after command dissection */ -static guint +static unsigned dissect_zbee_tlv_nwk_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_nwk_key_seq_num, tvb, offset, 1, ENC_LITTLE_ENDIAN); @@ -1749,17 +1749,17 @@ dissect_zbee_tlv_nwk_key_seq_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbd_msg_status_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbd_msg_status_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_zbd_comm_tlv, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -1833,16 +1833,16 @@ dissect_zbd_msg_status_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbd_msg_tunneling_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbd_msg_tunneling_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 opcode = tvb_get_guint8(tvb, offset); - guint8 length; + uint8_t opcode = tvb_get_uint8(tvb, offset); + uint8_t length; proto_tree_add_item(tree, hf_zbee_tlv_zbd_tunneling_npdu_msg_tlv, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -1875,18 +1875,18 @@ dissect_zbd_msg_tunneling_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbd_msg_manage_joiners_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbd_msg_manage_joiners_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_zbd_comm_mj_cmd_tlv, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -1924,17 +1924,17 @@ dissect_zbd_msg_manage_joiners_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbd_msg_join_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbd_msg_join_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_zbd_comm_tlv, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -2004,17 +2004,17 @@ dissect_zbd_msg_join_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbd_msg_formation_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbd_msg_formation_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_zbd_comm_tlv, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -2080,17 +2080,17 @@ dissect_zbd_msg_formation_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbd_msg_secur_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbd_msg_secur_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; + uint8_t type; + uint8_t length; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_zbd_secur_tlv, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -2134,11 +2134,11 @@ dissect_zbd_msg_secur_local_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre *@param cmd_id - ZB Direct local Message ID *@return offset after command dissection */ -static guint -dissect_zbd_local_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, void* data _U_, guint cmd_id) +static unsigned +dissect_zbd_local_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, void* data _U_, unsigned cmd_id) { - guint8 total_tlv_length = 2 /*type + len fields*/ + tvb_get_guint8(tvb, offset + 1) + 1; - guint8 tmp_offset = offset; + uint8_t total_tlv_length = 2 /*type + len fields*/ + tvb_get_uint8(tvb, offset + 1) + 1; + uint8_t tmp_offset = offset; switch (cmd_id) { @@ -2193,8 +2193,8 @@ dissect_zbd_local_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint *@param length of TLV data *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_manufacturer_specific(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 length) +static unsigned +dissect_zbee_tlv_manufacturer_specific(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t length) { proto_tree_add_item(tree, hf_zbee_tlv_manufacturer_specific, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2214,8 +2214,8 @@ dissect_zbee_tlv_manufacturer_specific(tvbuff_t *tvb, packet_info *pinfo _U_, pr *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_supported_key_negotiation_methods(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_supported_key_negotiation_methods(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { static int * const supported_key_negotiation_methods[] = { &hf_zbee_tlv_supported_key_negotiation_methods_key_request, @@ -2254,8 +2254,8 @@ dissect_zbee_tlv_supported_key_negotiation_methods(tvbuff_t *tvb, packet_info *p *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_panid_conflict_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_panid_conflict_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_panid_conflict_cnt, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2273,8 +2273,8 @@ dissect_zbee_tlv_panid_conflict_report(tvbuff_t *tvb, packet_info *pinfo _U_, pr *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_configuration_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_configuration_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { static int * const bitmask[] = { &hf_zbee_tlv_configuration_param_restricted_mode, @@ -2299,8 +2299,8 @@ dissect_zbee_tlv_configuration_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_dev_cap_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_dev_cap_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { static int * const bitmask[] = { &hf_zbee_tlv_dev_cap_ext_zbdirect_virt_device, @@ -2322,10 +2322,10 @@ dissect_zbee_tlv_dev_cap_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_potential_parents(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_potential_parents(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 count, i; + uint8_t count, i; proto_tree_add_item(tree, hf_zbee_zdp_beacon_survey_current_parent, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2333,7 +2333,7 @@ dissect_zbee_tlv_potential_parents(tvbuff_t *tvb, packet_info *pinfo _U_, proto_ proto_tree_add_item(tree, hf_zbee_tlv_lqa, 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_zdp_beacon_survey_cnt_parents, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; @@ -2358,8 +2358,8 @@ dissect_zbee_tlv_potential_parents(tvbuff_t *tvb, packet_info *pinfo _U_, proto_ *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_next_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_next_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_next_pan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2376,8 +2376,8 @@ dissect_zbee_tlv_next_pan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_next_channel_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_next_channel_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { /* todo: fix this (do channel mask) */ proto_tree_add_item(tree, hf_zbee_tlv_next_channel_change, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -2395,8 +2395,8 @@ dissect_zbee_tlv_next_channel_change(tvbuff_t *tvb, packet_info *pinfo _U_, prot *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_passphrase(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_passphrase(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_passphrase, tvb, offset, 16, ENC_NA); offset += 16; @@ -2414,8 +2414,8 @@ dissect_zbee_tlv_passphrase(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_router_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_router_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { static int * const router_information[] = { &hf_zbee_tlv_router_information_hub_connectivity, @@ -2444,8 +2444,8 @@ dissect_zbee_tlv_router_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_fragmentation_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_fragmentation_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_node_id, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -2468,8 +2468,8 @@ dissect_zbee_tlv_fragmentation_parameters(tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_selected_key_negotiation_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_selected_key_negotiation_method(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_selected_key_negotiation_method, tvb, offset, 1, ENC_NA); offset += 1; @@ -2493,10 +2493,10 @@ dissect_zbee_tlv_selected_key_negotiation_method(tvbuff_t *tvb, packet_info *pin *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_public_point(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, guint8 length) +static unsigned +dissect_zbee_tlv_public_point(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t length) { - guint8 public_point_length = length - 8; + uint8_t public_point_length = length - 8; proto_tree_add_item(tree, hf_zbee_tlv_device_eui64, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; @@ -2516,13 +2516,13 @@ dissect_zbee_tlv_public_point(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 eui64_count; - guint8 i; + uint8_t eui64_count; + uint8_t i; - eui64_count = tvb_get_guint8(tvb, offset); + eui64_count = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_count, tvb, offset, 1, ENC_NA); offset += 1; @@ -2544,8 +2544,8 @@ dissect_zbee_tlv_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_clear_all_bindigs_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_clear_all_bindigs_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { return dissect_zbee_tlv_eui64(tvb, pinfo, tree, offset); } @@ -2559,8 +2559,8 @@ dissect_zbee_tlv_clear_all_bindigs_eui64(tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_requested_auth_token_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_requested_auth_token_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_global_tlv_id, tvb, offset, 1, ENC_NA); offset += 1; @@ -2577,8 +2577,8 @@ dissect_zbee_tlv_requested_auth_token_id(tvbuff_t *tvb, packet_info *pinfo _U_, *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_target_ieee_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_target_ieee_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; @@ -2595,8 +2595,8 @@ dissect_zbee_tlv_target_ieee_address(tvbuff_t *tvb, packet_info *pinfo _U_, prot *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv_device_auth_level(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_zbee_tlv_device_auth_level(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { proto_tree_add_item(tree, hf_zbee_tlv_local_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN); @@ -2614,18 +2614,19 @@ dissect_zbee_tlv_device_auth_level(tvbuff_t *tvb, packet_info *pinfo _U_, proto_ /* * ToDo: descr */ -static guint -dissect_global_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +dissect_global_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 type; - guint8 length; - guint tmp_offset; + uint8_t type; + uint8_t length; + unsigned tmp_offset; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_global_type, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -2705,15 +2706,15 @@ dissect_global_tlv (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gui *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset) +static unsigned +dissect_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset) { - guint8 length; + uint8_t length; proto_tree_add_item(tree, hf_zbee_tlv_type, tvb, offset, 1, ENC_NA); offset += 1; - length = tvb_get_guint8(tvb, offset); + length = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_zbee_tlv_length, tvb, offset, 1, ENC_NA); offset += 1; @@ -2733,12 +2734,13 @@ dissect_unknown_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gui *@param offset into the tvb to begin dissection. *@return offset after command dissection. */ -static guint -dissect_zbee_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, void *data, guint8 source_type, guint cmd_id) +static unsigned +// NOLINTNEXTLINE(misc-no-recursion) +dissect_zbee_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void *data, uint8_t source_type, unsigned cmd_id) { - guint8 type; + uint8_t type; - type = tvb_get_guint8(tvb, offset); + type = tvb_get_uint8(tvb, offset); if (type >= ZBEE_TLV_GLOBAL_START_NUMBER) { @@ -2783,11 +2785,12 @@ dissect_zbee_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint #define ZBEE_TLV_MAX_RECURSION_DEPTH 5 // Arbitrarily chosen -guint -dissect_zbee_tlvs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint offset, void *data, guint8 source_type, guint cmd_id) +unsigned +// NOLINTNEXTLINE(misc-no-recursion) +dissect_zbee_tlvs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, void *data, uint8_t source_type, unsigned cmd_id) { proto_tree *subtree; - guint8 length; + uint8_t length; unsigned recursion_depth = p_get_proto_depth(pinfo, proto_zbee_tlv); if (++recursion_depth >= ZBEE_TLV_MAX_RECURSION_DEPTH) { @@ -2798,7 +2801,7 @@ dissect_zbee_tlvs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint p_set_proto_depth(pinfo, proto_zbee_tlv, recursion_depth); while (tvb_bytes_exist(tvb, offset, ZBEE_TLV_HEADER_LENGTH)) { - length = tvb_get_guint8(tvb, offset + 1) + 1; + length = tvb_get_uint8(tvb, offset + 1) + 1; subtree = proto_tree_add_subtree(tree, tvb, offset, ZBEE_TLV_HEADER_LENGTH + length, ett_zbee_tlv, NULL, "TLV"); offset = dissect_zbee_tlv(tvb, pinfo, subtree, offset, data, source_type, cmd_id); } @@ -2819,7 +2822,7 @@ dissect_zbee_tlvs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint static int dissect_zbee_tlv_default(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint offset = 0; + unsigned offset = 0; offset = dissect_zbee_tlvs(tvb, pinfo, tree, offset, data, ZBEE_TLV_SRC_TYPE_DEFAULT, 0); @@ -3273,7 +3276,7 @@ void proto_register_zbee_tlv(void) }; /* Protocol subtrees */ - static gint *ett[] = + static int *ett[] = { &ett_zbee_aps_tlv, &ett_zbee_aps_relay, |