diff options
author | Michael Mann <mmann78@netscape.net> | 2013-08-05 11:57:21 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-08-05 11:57:21 +0000 |
commit | ad1d32485cf6a7c810bed94bfcdec0000bb4fbd4 (patch) | |
tree | aa603dafa924e385f0050f3496b1c2f84975a8d8 /epan/dissectors/packet-ua3g.c | |
parent | 7861e5e42676c8a94c3fb1db9f973cb3b61b79e5 (diff) |
Massive conversion to filterable items. It started with convert_proto_tree_add_text.pl, but continued as with many other cases that couldn't be handled by it (like using emem_strbuf_t to create groups of field strings).
Should now pacify bug 6844 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6844)
svn path=/trunk/; revision=51148
Diffstat (limited to 'epan/dissectors/packet-ua3g.c')
-rw-r--r-- | epan/dissectors/packet-ua3g.c | 3723 |
1 files changed, 1524 insertions, 2199 deletions
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index c42d9b8927..471cd89ae8 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -47,6 +47,7 @@ static int proto_ua3g = -1; static gint ett_ua3g = -1; static gint ett_ua3g_body = -1; static gint ett_ua3g_param = -1; +static gint ett_ua3g_param_sub = -1; static gint ett_ua3g_option = -1; static int hf_ua3g_length = -1; @@ -77,6 +78,292 @@ static int hf_ua3g_command_announce = -1; static int hf_ua3g_command_ring = -1; static int hf_ua3g_command_ua_dwl_protocol = -1; static int hf_ua3g_command_unsolicited_msg = -1; +static int hf_ua3g_ip_device_routing_stop_rtp_parameter = -1; +static int hf_ua3g_ip_device_routing_stop_rtp_parameter_length = -1; +static int hf_ua3g_ip_device_routing_stop_rtp_parameter_value_num = -1; +static int hf_ua3g_ip_device_routing_stop_rtp_parameter_value_bytes = -1; +/* Generated from convert_proto_tree_add_text.pl */ +static int hf_ua3g_ip_device_routing_start_tone_direction = -1; +static int hf_ua3g_ip_device_routing_start_tone_num_entries = -1; +static int hf_ua3g_ip_device_routing_def_tones_num_entries = -1; +static int hf_ua3g_cs_ip_device_routing_cmd00_characteristic_number = -1; +static int hf_ua3g_subdevice_msg_subdev_type = -1; +static int hf_ua3g_unsolicited_msg_next_byte_of_bad_segment = -1; +static int hf_ua3g_ip_device_routing_start_tone_identification = -1; +static int hf_ua3g_ip_device_routing_def_tones_level_2 = -1; +static int hf_ua3g_r_w_peripheral_content = -1; +static int hf_ua3g_subdevice_metastate_subchannel_address = -1; +static int hf_ua3g_subdevice_parameter_bytes = -1; +static int hf_ua3g_subdevice_msg_parameter_bytes = -1; +static int hf_ua3g_set_clck_timer_pos_call_timer_column_number = -1; +static int hf_ua3g_unsolicited_msg_segment_failure_s = -1; +static int hf_ua3g_ip_device_routing_reset_parameter = -1; +static int hf_ua3g_ip_device_routing_get_param_req_parameter = -1; +static int hf_ua3g_set_lcd_contrast_driver_number = -1; +static int hf_ua3g_dwl_special_char_character_number = -1; +static int hf_ua3g_cs_ip_device_routing_cmd00_vta_type = -1; +static int hf_ua3g_ua_dwl_protocol_cause = -1; +static int hf_ua3g_audio_padded_path_emission_padded_level = -1; +static int hf_ua3g_set_clck_timer_pos_clock_column_number = -1; +static int hf_ua3g_segment_msg_num_remaining = -1; +static int hf_ua3g_ip_device_routing_digit_value = -1; +static int hf_ua3g_super_msg_data = -1; +static int hf_ua3g_unsolicited_msg_hardware_version = -1; +static int hf_ua3g_voice_channel_announce = -1; +static int hf_ua3g_ring_silent = -1; +static int hf_ua3g_audio_config_handsfree_return = -1; +static int hf_ua3g_dwl_dtmf_clck_format_inter_digit_pause_time = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_length = -1; +static int hf_ua3g_unsolicited_msg_opcode_bad_segment = -1; +static int hf_ua3g_unsolicited_msg_firmware_version_loader = -1; +static int hf_ua3g_debug_in_line = -1; +static int hf_ua3g_voice_channel_b_microphones = -1; +static int hf_ua3g_beep_beep_number = -1; +static int hf_ua3g_main_voice_mode_tune = -1; +static int hf_ua3g_super_msg_length = -1; +static int hf_ua3g_ip_device_routing_redirect_parameter = -1; +static int hf_ua3g_unsolicited_msg_next_byte_of_bad_command = -1; +static int hf_ua3g_unsolicited_msg_self_test_result = -1; +static int hf_ua3g_beep_on_off = -1; +static int hf_ua3g_ua_dwl_protocol_binary_length = -1; +static int hf_ua3g_ring_speaker_level = -1; +static int hf_ua3g_voice_channel_channel_mode = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_length = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter = -1; +static int hf_ua3g_subdevice_metastate_new_metastate = -1; +static int hf_ua3g_unsolicited_msg_other_information_2 = -1; +static int hf_ua3g_set_lcd_contrast_contrast_value = -1; +static int hf_ua3g_unsolicited_msg_vta_type = -1; +static int hf_ua3g_ua_dwl_protocol_packet_number = -1; +static int hf_ua3g_unsolicited_msg_segment_failure_l = -1; +static int hf_ua3g_voice_channel_b_ear_piece = -1; +static int hf_ua3g_subdevice_msg_subdev_address = -1; +static int hf_ua3g_ring_progressive = -1; +static int hf_ua3g_ua_dwl_protocol_item_version = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_length = -1; +static int hf_ua3g_dwl_dtmf_clck_format_minimum_on_time = -1; +static int hf_ua3g_ring_melody = -1; +static int hf_ua3g_ua_dwl_protocol_item_identifier = -1; +static int hf_ua3g_main_voice_mode_speaker_volume = -1; +static int hf_ua3g_ip_device_routing_listen_rtp_parameter_length = -1; +static int hf_ua3g_ringing_cadence_length = -1; +static int hf_ua3g_software_reset = -1; +static int hf_ua3g_feedback_level = -1; +static int hf_ua3g_ip_phone_warmstart = -1; +static int hf_ua3g_subdevice_opcode = -1; +static int hf_ua3g_unsolicited_msg_device_event = -1; +static int hf_ua3g_segment_message_data = -1; +static int hf_ua3g_main_voice_mode_sending_level = -1; +static int hf_ua3g_subdevice_msg_subdevice_opcode = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter = -1; +static int hf_ua3g_audio_padded_path_reception_padded_level = -1; +static int hf_ua3g_ua_dwl_protocol_force_mode = -1; +static int hf_ua3g_lcd_line_cmd_starting_column = -1; +static int hf_ua3g_subdevice_address = -1; +static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter = -1; +static int hf_ua3g_audio_config_ignored = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options = -1; +static int hf_ua3g_main_voice_mode_cadence = -1; +static int hf_ua3g_segment_msg_length = -1; +static int hf_ua3g_ua_dwl_protocol_acknowledge = -1; +static int hf_ua3g_command_led_number = -1; +static int hf_ua3g_set_clck_timer_pos_call_timer_line_number = -1; +static int hf_ua3g_unsolicited_msg_segment_failure_t = -1; +static int hf_ua3g_ip_device_routing_start_tone_duration = -1; +static int hf_ua3g_unsolicited_msg_other_information_1 = -1; +static int hf_ua3g_unsolicited_msg_firmware_datas_patch_version = -1; +static int hf_ua3g_ring_beep_number = -1; +static int hf_ua3g_feedback_duration = -1; +static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_length = -1; +static int hf_ua3g_audio_config_law = -1; +static int hf_ua3g_ua_dwl_protocol_checksum = -1; +static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_value = -1; +static int hf_ua3g_audio_config_handsfree_handsfree = -1; +static int hf_ua3g_ringing_cadence_cadence = -1; +static int hf_ua3g_lcd_cursor_line_number = -1; +static int hf_ua3g_ip_device_routing_def_tones_level_1 = -1; +static int hf_ua3g_unsolicited_msg_opcode_of_bad_command = -1; +static int hf_ua3g_ua_dwl_protocol_download_ack_status = -1; +static int hf_ua3g_voice_channel_main_voice = -1; +static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_length = -1; +static int hf_ua3g_icon_cmd_segment = -1; +static int hf_ua3g_cs_ip_device_routing_cmd01_incident_0 = -1; +static int hf_ua3g_beep_destination = -1; +static int hf_ua3g_ip_device_routing_def_tones_frequency_1 = -1; +static int hf_ua3g_unsolicited_msg_datas_version = -1; +static int hf_ua3g_dwl_dtmf_clck_format_dtmf_country_adaptation = -1; +static int hf_ua3g_ringing_cadence_on_off = -1; +static int hf_ua3g_audio_config_volume_level = -1; +static int hf_ua3g_voice_channel_b_general = -1; +static int hf_ua3g_beep_terminator = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter = -1; +static int hf_ua3g_unsolicited_msg_firmware_version_bootloader = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter = -1; +static int hf_ua3g_ip_device_routing_start_rtp_direction = -1; +static int hf_ua3g_set_clck_timer_pos_clock_line_number = -1; +static int hf_ua3g_voice_channel_b_loud_speaker = -1; +static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter = -1; +static int hf_ua3g_on_off_level_level_on_loudspeaker = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_length = -1; +static int hf_ua3g_main_voice_mode_microphone_volume = -1; +static int hf_ua3g_sidetone_level = -1; +static int hf_ua3g_beep_number_of_notes = -1; +static int hf_ua3g_unsolicited_msg_segment_failure_num = -1; +static int hf_ua3g_dwl_special_char_byte = -1; +static int hf_ua3g_ring_cadence = -1; +static int hf_ua3g_unsolicited_msg_device_type = -1; +static int hf_ua3g_voice_channel_codec = -1; +static int hf_ua3g_ip_device_routing_redirect_parameter_length = -1; +static int hf_ua3g_ip_device_routing_listen_rtp_parameter = -1; +static int hf_ua3g_beep_cadence = -1; +static int hf_ua3g_voice_channel_voice_channel = -1; +static int hf_ua3g_unsolicited_msg_other_information = -1; +static int hf_ua3g_ip_device_routing_def_tones_frequency_2 = -1; +static int hf_ua3g_digit_dialed_digit_value = -1; +static int hf_ua3g_unsolicited_msg_subdevice_address = -1; +static int hf_ua3g_ua_dwl_protocol_packet_download_end_ack_ok_status = -1; +static int hf_ua3g_r_w_peripheral_address = -1; +static int hf_ua3g_icon_cmd_icon_number = -1; +static int hf_ua3g_dwl_dtmf_clck_format_clock_time_format = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_length = -1; +static int hf_ua3g_i_m_here_id_code = -1; +static int hf_ua3g_ua_dwl_protocol_item_version_nc = -1; +static int hf_ua3g_unsolicited_msg_firmware_version = -1; +static int hf_ua3g_segment_msg_segment = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_bootloader = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_data = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_customization = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_localization = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_code = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_noe_update_sip = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_value = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_bad_sec_mode = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_cust_name = -1; +static int hf_ua3g_ip_device_routing_reset_parameter_l10n_name = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_ip = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_compressor = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_value = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_enabler = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_dtmf_sending = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_rfc2198 = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_srtp_encryption = -1; +static int hf_ua3g_ip_device_routing_start_rtp_parameter_uint = -1; +static int hf_ua3g_ip_device_routing_redirect_parameter_ip = -1; +static int hf_ua3g_ip_device_routing_redirect_parameter_uint = -1; +static int hf_ua3g_ip_device_routing_redirect_parameter_value = -1; +static int hf_ua3g_ip_device_routing_listen_rtp_parameter_ip = -1; +static int hf_ua3g_ip_device_routing_listen_rtp_parameter_port = -1; +static int hf_ua3g_ip_device_routing_listen_rtp_parameter_value = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_compressor = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_err_string = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_tftp_backup_ip = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_set_pc_port_status = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_record_rtp_auth = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_security_flag_filter = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_uint = -1; +static int hf_ua3g_ip_device_routing_set_param_req_parameter_value = -1; +static int hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_uint = -1; +static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_remote_ip = -1; +static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_uint = -1; +static int hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_value = -1; +static int hf_ua3g_main_voice_mode_handset_level = -1; +static int hf_ua3g_main_voice_mode_headset_level = -1; +static int hf_ua3g_main_voice_mode_handsfree_level = -1; +static int hf_ua3g_audio_config_dpi_chan_ua_tx1 = -1; +static int hf_ua3g_audio_config_dpi_chan_ua_tx2 = -1; +static int hf_ua3g_audio_config_dpi_chan_gci_tx1 = -1; +static int hf_ua3g_audio_config_dpi_chan_gci_tx2 = -1; +static int hf_ua3g_audio_config_dpi_chan_cod_tx = -1; +static int hf_ua3g_audio_config_audio_circuit_dth = -1; +static int hf_ua3g_audio_config_audio_circuit_dtr = -1; +static int hf_ua3g_audio_config_audio_circuit_dtf = -1; +static int hf_ua3g_audio_config_audio_circuit_str = -1; +static int hf_ua3g_audio_config_audio_circuit_ahp1 = -1; +static int hf_ua3g_audio_config_audio_circuit_ahp2 = -1; +static int hf_ua3g_audio_config_audio_circuit_ath = -1; +static int hf_ua3g_audio_config_audio_circuit_atr = -1; +static int hf_ua3g_audio_config_audio_circuit_atf = -1; +static int hf_ua3g_audio_config_audio_circuit_alm = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_group_listen = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_attenuation = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_stay_in_send = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mtx = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mrc = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_trans_threshold = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_trans_threshold = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_recv_threshold = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_recv_threshold = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_med_recv_threshold = -1; +static int hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_high_recv_threshold = -1; +static int hf_ua3g_ua_dwl_protocol_files_inc_boot_binary = -1; +static int hf_ua3g_ua_dwl_protocol_files_inc_loader_binary = -1; +static int hf_ua3g_ua_dwl_protocol_files_inc_appli_binary = -1; +static int hf_ua3g_ua_dwl_protocol_files_inc_data_binary = -1; +static int hf_ua3g_ua_dwl_protocol_model_selection_a = -1; +static int hf_ua3g_ua_dwl_protocol_model_selection_b = -1; +static int hf_ua3g_ua_dwl_protocol_model_selection_c = -1; +static int hf_ua3g_ua_dwl_protocol_model_selection_country_ver = -1; +static int hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe1 = -1; +static int hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe2 = -1; +static int hf_ua3g_ua_dwl_protocol_memory_sizes_flash = -1; +static int hf_ua3g_ua_dwl_protocol_memory_sizes_ext_ram = -1; +static int hf_ua3g_unsolicited_msg_char_num_vta_subtype = -1; +static int hf_ua3g_unsolicited_msg_char_num_generation = -1; +static int hf_ua3g_unsolicited_msg_char_num_design = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_vta_type = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_design = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_subtype = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_hard_config_chip = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_hard_config_flash = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_config_ram = -1; +static int hf_ua3g_unsolicited_msg_hardware_config_hard_config_ip = -1; +static int hf_ua3g_unsolicited_msg_hook_status = -1; +static int hf_ua3g_special_key_shift = -1; +static int hf_ua3g_special_key_ctrl = -1; +static int hf_ua3g_special_key_alt = -1; +static int hf_ua3g_special_key_cmd = -1; +static int hf_ua3g_special_key_shift_prime = -1; +static int hf_ua3g_special_key_ctrl_prime = -1; +static int hf_ua3g_special_key_alt_prime = -1; +static int hf_ua3g_special_key_cmd_prime = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options_call_timer = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options_blink = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options_call_timer_control = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options_call_timer_display = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options_time_of_day_display = -1; +static int hf_ua3g_lcd_line_cmd_lcd_options_suspend_display_refresh = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_firmware_version = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_ip = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_uint = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_bytes = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_mac_address = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_uint = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_value = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_speed = -1; +static int hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_duplex = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip1 = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip2 = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_ip = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_string = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021Q_used = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021P_priority = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_vlan_id = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_diffserv = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution_200ms = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_rtp_lost = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_uint = -1; +static int hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution = -1; extern e_ua_direction message_direction; @@ -342,15 +629,15 @@ static const value_string str_device_type[] = { /*----------------------------------------------------------------------------- VERSION NUMBER COMPUTER - This function computes a version number (S.SZ.AB) from a 16 bits number ---------------------------------------------------------------------------*/ -static char * -version_number_computer(int hexa_version) +static void +version_number_computer( gchar *result, guint32 hexa_version ) { int release, vers, fix; release = (int)(hexa_version / 10000); vers = (int)((hexa_version % 10000) / 100); fix = (hexa_version % 10000) % 100; - return ep_strdup_printf("%d.%02d.%02d", release, vers, fix); + g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix); } @@ -364,17 +651,14 @@ version_number_computer(int hexa_version) TRACE ON - 42h (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_with_one_parameter(proto_tree *tree _U_, tvbuff_t *tvb, +decode_with_one_parameter(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, guint offset, guint length, - int hf_opcode, proto_item *ua3g_body_item) + int hf_opcode) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item || (length == 0)) + if (length == 0) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_item(ua3g_body_tree, hf_opcode, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_opcode, tvb, offset, 1, ENC_NA); } @@ -382,34 +666,13 @@ decode_with_one_parameter(proto_tree *tree _U_, tvbuff_t *tvb, SUBDEVICE ESCAPE TO SUBDEVICE - 02h (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_subdevice_escape(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_subdevice_escape(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; - int j; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subdevice Address: %d", (tvb_get_guint8(tvb, offset) & 0x0F)); - offset++; - length--; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subdevice Opcode: 0x%02x", (tvb_get_guint8(tvb, offset) & 0x7F)); - offset++; - length--; - - j = 0; - while (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Parameter Byte %2d: %d", j++, - tvb_get_guint8(tvb, offset)); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_subdevice_address, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_subdevice_opcode, tvb, offset+1, 1, ENC_NA); + if (length > 2) { + proto_tree_add_item(tree, hf_ua3g_subdevice_parameter_bytes, tvb, offset+2, length-2, ENC_NA); } } @@ -424,20 +687,13 @@ static const value_string software_reset_verswitch_vals[] = { }; static void -decode_software_reset(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_software_reset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item || (length == 0)) + if (length == 0) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - val_to_str_const(tvb_get_guint8(tvb, offset), software_reset_verswitch_vals, "Unknown")); - /* offset++; */ - /* length--; */ + proto_tree_add_item(tree, hf_ua3g_software_reset, tvb, offset, 1, ENC_NA); } @@ -451,24 +707,13 @@ static const value_string str_command_ip_phone_warmstart[] = { }; static void -decode_ip_phone_warmstart(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_ip_phone_warmstart(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item || (length == 0)) + if (length == 0) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, - tvb, - offset, - 1, - "Command: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_command_ip_phone_warmstart, "Unknown")); - /* offset++; */ - /* length--; */ + proto_tree_add_item(tree, hf_ua3g_ip_phone_warmstart, tvb, offset, 1, ENC_NA); } @@ -477,41 +722,34 @@ decode_ip_phone_warmstart(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinf SUPER MESSAGE 2 - 17h (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_super_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode, - proto_item *ua3g_body_item) +decode_super_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length, guint8 opcode) { - proto_tree *ua3g_body_tree; - int i, parameter_length; - int j; + proto_tree *ua3g_body_tree = tree; + int j = 0, parameter_length; - if (!ua3g_body_item || (length == 0)) + if (!ua3g_body_tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - j = 0; while (length > 0) { if (opcode == 0x17) { parameter_length = tvb_get_ntohs(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Length %d: %d", j++, parameter_length); + proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_super_msg_length, tvb, offset, 2, + parameter_length, "Length %d: %d", j++, parameter_length); offset += 2; length -= 2; } else { parameter_length = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Length %d: %d", j++, parameter_length); + proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_super_msg_length, tvb, offset, 1, + parameter_length, "Length %d: %d", j++, parameter_length); offset++; length--; } - for (i = 1; i <= parameter_length; i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "L%d Byte %2d: %d", - j, i, tvb_get_guint8(tvb, offset)); - offset++; - length--; + if (parameter_length > 0) { + proto_tree_add_item(ua3g_body_tree, hf_ua3g_super_msg_data, tvb, offset, parameter_length, ENC_NA); + offset += parameter_length; + length -= parameter_length; } } } @@ -520,44 +758,31 @@ decode_super_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, /*----------------------------------------------------------------------------- SEGMENT MESSAGE - 0Ch (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM) ---------------------------------------------------------------------------*/ +const true_false_string tfs_segment_msg_segment = { "First Segment", "Subsequent Segment" }; + static void -decode_segment_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_segment_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; guint8 val; - int j; - if (!ua3g_body_item) + if (!tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "F/S: %s (%d)", - (val & 0x80) ? "First Segment" : "Subsequent Segment", - val & 0x80); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Number Of Remaining Segments: %d", - (val & 0x7F)); + proto_tree_add_item(tree, hf_ua3g_segment_msg_segment, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_segment_msg_num_remaining, tvb, offset, 1, ENC_NA); offset++; length--; if (val & 0x80) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, "Length: %d", - tvb_get_ntohs(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_segment_msg_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; } - j = 0; - while (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Segment Message byte %d: %d", - j++, tvb_get_guint8(tvb, offset)); - offset++; - length--; + if (length > 0) { + proto_tree_add_item(tree, hf_ua3g_segment_message_data, tvb, offset, length, ENC_NA); } } @@ -644,7 +869,7 @@ static const value_string ip_device_routing_cmd_start_rtp_vals[] = { }; static value_string_ext ip_device_routing_cmd_start_rtp_vals_ext = VALUE_STRING_EXT_INIT(ip_device_routing_cmd_start_rtp_vals); -static const value_string str_start_rtp_compressor[] = { +static const val64_string str_start_rtp_compressor[] = { {0x00, "G.711 A-law"}, {0x01, "G.711 mu-law"}, {0x0F, "G.723.1 5.3kbps"}, @@ -768,29 +993,22 @@ static const value_string str_enable_feature[] = { }; static void -decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_ip_device_routing(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree, *ua3g_param_tree; + proto_tree *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_param_subtree; proto_item *ua3g_param_item; + int parameter_length, parameter_id; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_ip_device_routing, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_ip_device_routing, "Unknown")); - if (!ua3g_body_item) + if (!ua3g_body_tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip, tvb, offset, 1, ENC_NA); offset++; length--; @@ -798,257 +1016,143 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo switch (command) { case 0x00: /* RESET */ { - int i, parameter_id, parameter_length; - if (length > 0) { - emem_strbuf_t *strbuf; - strbuf = ep_strbuf_new_label(NULL); - parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_const(parameter_id, ip_device_routing_cmd_reset_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; + if (parameter_length > 0) { guint8 param; switch (parameter_id) { case 0x00: /* Update Mode */ - { - static const char *str_update_mode[] = { - "Bootloader", - "Data", - "Customization", - "Localization", - "Code", - "SIP" - }; - param = tvb_get_guint8(tvb, offset + 2); - if ((param & 0x80) == 0x00) { - ep_strbuf_append(strbuf, "NOE Update Mode: "); - - for (i = 0; i < 6; i++) { - ep_strbuf_append_printf(strbuf, "%s: %s, ", - str_update_mode[i], - ((param >> i) & 0x01) ? "Enable" : "Disable"); - } - } else { - ep_strbuf_append(strbuf, "Unknown"); - } - break; + param = tvb_get_guint8(tvb, offset); + if ((param & 0x80) == 0x00) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_noe_update, tvb, offset, 1, ENC_NA); + ua3g_param_subtree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param_sub); + + proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_bootloader, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_data, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_customization, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_localization, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_code, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_subtree, hf_ua3g_ip_device_routing_reset_parameter_noe_update_sip, tvb, offset, 1, ENC_NA); + + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_value, tvb, offset, parameter_length, ENC_NA); } + + break; case 0x01: /* Bad_Sec_Mode */ - { - ep_strbuf_append(strbuf, - val_to_str_const(tvb_get_guint8(tvb, offset + 2), reset_param_bad_sec_mode, "Unknown")); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_bad_sec_mode, tvb, offset, 1, ENC_NA); + break; case 0x02: /* Cust_Name */ - { - ep_strbuf_append(strbuf, "\""); - /* XXX: Advancing thru param byte by byte, yet using stringz ?? */ - /* XXX: ! isprint() action same as for isprint() ?? */ - for (i = 1; i <= parameter_length; i++) { - if (isprint(tvb_get_guint8(tvb, offset + 1 + i))) - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - else - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - } - - ep_strbuf_append(strbuf, "\""); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_cust_name, tvb, offset, parameter_length, ENC_NA|ENC_ASCII); + break; case 0x03: /* L10N_Name */ - { - ep_strbuf_append(strbuf, "\""); - /* XXX: Advancing thru param byte by byte, yet using stringz ?? */ - /* XXX: ! isprint() action same as for isprint() ?? */ - for (i = 1; i <= parameter_length; i++) { - if (isprint(tvb_get_guint8(tvb, offset + 1 + i))) - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - else - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - } - - ep_strbuf_append(strbuf, "\""); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_l10n_name, tvb, offset, parameter_length, ENC_NA|ENC_ASCII); + break; + default: + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_reset_parameter_value, tvb, offset, parameter_length, ENC_NA); + break; } - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_const(parameter_id, ip_device_routing_cmd_reset_vals, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_const(parameter_id, ip_device_routing_cmd_reset_vals, "Unknown")); - } - - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s", val_to_str_const(parameter_id, ip_device_routing_cmd_reset_vals, "Unknown")); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - /*offset += parameter_length;*/ - /*length -= parameter_length;*/ + offset += parameter_length; + length -= parameter_length; } } break; } case 0x01: /* START RTP */ { - emem_strbuf_t *strbuf; - int i, parameter_length, parameter_id; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Direction: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), start_rtp_str_direction, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_rtp_direction, tvb, offset, 1, ENC_NA); offset++; length--; - strbuf = ep_strbuf_new_label(NULL); while (length > 0) { - ep_strbuf_truncate(strbuf, 0); - parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_start_rtp_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_start_rtp_vals_ext, "Unknown")); + + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; + if (parameter_length > 0) { switch (parameter_id) { case 0x01: /* Remote IP Address */ case 0x11: /* Destination For RTCP Sender Reports - IP Address */ case 0x13: /* Destination For RTCP Receiver Reports - IP Address */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 2)); - - for (i = 1; i < parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+2+i)); - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN); break; - } case 0x04: /* Compressor */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, val_to_str_const((guint8)(param_value), str_start_rtp_compressor, "Default Codec")); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; case 0x06: /* Echo Cancelation Enabler */ case 0x07: /* Silence Suppression Enabler */ case 0x0A: /* Post Filtering Enabler */ case 0x0B: /* High Pass Filtering Enabler */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, STR_ON_OFF((guint8)(param_value))); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_enabler, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; case 0x0D: /* Must Send QOS Tickets */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - /* XXX: Only 0x01 ==> "Yes" ?? */ - ep_strbuf_append(strbuf, ((guint8)param_value == 0x01) ? "Yes": "No"); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; case 0x0E: /* Local Identifier */ case 0x0F: /* Distant Identifier */ - { - break; - } + break; case 0x15: /* DTMF Sending */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, ((guint8)param_value) ? "Send DTMF" : "Don't Send DTMF"); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_dtmf_sending, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; case 0x18: /* Enable / Disable RFC 2198 */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, (((guint8)param_value) == 0x00) ? "Enable" : "Disable"); /* XXX: OK ? */ - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_rfc2198, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; case 0x31: /* SRTP Encryption Enable For This Communication */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, (((guint8)param_value) == 0x10) ? "Enable" : "Disable"); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_srtp_encryption, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; case 0x00: /* Local UDP Port */ case 0x02: /* Remote UDP Port */ case 0x03: /* Type Of Service */ @@ -1070,47 +1174,14 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo case 0x38: /* MKI value for SRTP packets in output stream */ case 0x50: /* MD5 Authentication */ default: - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; } - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_start_rtp_vals_ext, "Unknown"), strbuf->str); - } else { - /* (parameter_length == 0) */ - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_start_rtp_vals_ext, "Unknown")); - } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Parameter: %s (0x%02x)", - val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_start_rtp_vals_ext, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); offset += parameter_length; length -= parameter_length; } @@ -1118,146 +1189,74 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo break; } case 0x02: /* STOP_RTP */ - { - emem_strbuf_t *strbuf; - int i, parameter_id, parameter_length; + while (length > 0) { + parameter_id = tvb_get_guint8(tvb, offset); + parameter_length = tvb_get_guint8(tvb, offset + 1); - strbuf = ep_strbuf_new_label(NULL); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_const(parameter_id, ip_device_routing_cmd_stop_rtp_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - while (length > 0) { - ep_strbuf_truncate(strbuf, 0); - - parameter_id = tvb_get_guint8(tvb, offset); - parameter_length = tvb_get_guint8(tvb, offset + 1); - - if (parameter_length > 0) { - switch (parameter_id) { - case 0x0E: /* Local Identifier */ - case 0x0F: /* Distant Identifier */ - { - break; - } - case 0x14: /* Canal Identifier */ - default: - { - if (parameter_length <= 8) { - guint64 param_value = 0; + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; - } - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_const(parameter_id, ip_device_routing_cmd_stop_rtp_vals, "Unknown"), strbuf->str); + if (parameter_length > 0) { + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter_value_num, tvb, offset, parameter_length, ENC_BIG_ENDIAN); } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_const(parameter_id, ip_device_routing_cmd_stop_rtp_vals, "Unknown")); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_stop_rtp_parameter_value_bytes, tvb, offset, parameter_length, ENC_NA); } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s (0x%02x)", - val_to_str_const(parameter_id, ip_device_routing_cmd_stop_rtp_vals, "Unknown"), parameter_id); - offset++; - length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } + offset += parameter_length; + length -= parameter_length; } - break; } + break; case 0x03: /* REDIRECT */ - { - emem_strbuf_t *strbuf; - int i, parameter_length, parameter_id; + while (length > 0) { + parameter_id = tvb_get_guint8(tvb, offset); + parameter_length = tvb_get_guint8(tvb, offset + 1); - strbuf = ep_strbuf_new_label(NULL); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_redirect_parameter, + tvb, offset, parameter_length + 2, parameter_id, + "%s", val_to_str_const(parameter_id, ip_device_routing_cmd_redirect_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - while (length > 0) { - ep_strbuf_truncate(strbuf, 0); - parameter_id = tvb_get_guint8(tvb, offset); - parameter_length = tvb_get_guint8(tvb, offset + 1); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; - if (parameter_length > 0) { - switch (parameter_id) { - case 0x00: /* Remote MainCPU Server IP Address */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 2)); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+1+i)); - } - break; - } - case 0x01: /* Remote MainCPU Server Port */ - default: - { - if (parameter_length <= 8) { - guint64 param_value = 0; - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - } - break; + if (parameter_length > 0) { + switch (parameter_id) { + case 0x00: /* Remote MainCPU Server IP Address */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN); + break; + case 0x01: /* Remote MainCPU Server Port */ + default: + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_redirect_parameter_value, tvb, offset, parameter_length, ENC_BIG_ENDIAN); } - - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, parameter_length + 2, - "%s: %s", val_to_str_const(parameter_id, ip_device_routing_cmd_redirect_vals, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, parameter_length + 2, - "%s", val_to_str_const(parameter_id, ip_device_routing_cmd_redirect_vals, "Unknown")); + break; } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s (0x%02x)", - val_to_str_const(parameter_id, ip_device_routing_cmd_redirect_vals, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } + offset += parameter_length; + length -= parameter_length; } - break; } + break; case 0x04: /* DEF_TONES */ { int i, tone_nb_entries; @@ -1266,7 +1265,7 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo tone_nb_entries = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Number Of Entries: %d", tone_nb_entries); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_def_tones_num_entries, tvb, offset, 1, ENC_NA); offset++; length--; @@ -1282,20 +1281,19 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo i, frequency_1, level_1, frequency_2, level_2); ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 2, - "Frequency 1: %d Hz", frequency_1); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_frequency_1, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Level: %d dB", level_1); + proto_tree_add_int(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_level_1, tvb, offset, 1, level_1); offset++; length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 2, "Frequency 2: %d Hz", frequency_2); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_frequency_2, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Level: %d dB", level_2); + proto_tree_add_int(ua3g_param_tree, hf_ua3g_ip_device_routing_def_tones_level_2, tvb, offset, 1, level_2); offset++; length--; } @@ -1304,19 +1302,16 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo } case 0x05: /* START TONE */ { - guint8 ii, tone_nb_entries; - guint8 tone_direction, tone_id; + guint8 ii, tone_nb_entries, tone_id; #if 0 - guint8 tone_direction, tone_id, tone_duration tone_silence; */ + guint8 tone_direction, tone_id, tone_duration tone_silence; #endif int tone_duration; - tone_direction = tvb_get_guint8(tvb, offset) & 0xC0; tone_nb_entries = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Direction: %s - Number Of Entries: %d", - val_to_str_const(tone_direction, ip_device_routing_tone_direction_vals, "Unknown"), tone_nb_entries); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_tone_direction, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_start_tone_num_entries, tvb, offset, 1, ENC_NA); offset++; length--; @@ -1338,13 +1333,11 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo ii+1, tone_id, tone_duration); ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Identification: %d", tone_id); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_identification, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 2, - "Duration: %d ms", tone_duration); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_tone_duration, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; @@ -1365,167 +1358,100 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo } case 0x07: /* START LISTEN RTP */ case 0x08: /* STOP LISTEN RTP */ - { - emem_strbuf_t *strbuf; - int i, parameter_length, parameter_id; - - strbuf = ep_strbuf_new_label(NULL); - - while (length > 0) { - ep_strbuf_truncate(strbuf, 0); + while (length > 0) { + parameter_id = tvb_get_guint8(tvb, offset); + parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_id = tvb_get_guint8(tvb, offset); - parameter_length = tvb_get_guint8(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_const(parameter_id, ip_device_routing_cmd_listen_rtp_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - if (parameter_length > 0) { - switch (parameter_id) { - case 0x00: /* Remote IP Address - Not for start listening rtp */ - case 0x03: /* Remote IP Address Out - Not for start listening rtp */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 2)); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+1+i)); - } - break; - } - case 0x01: /* Remote UDP Port In - Not for start listening rtp */ - case 0x02: /* Remote UDP Port Out - Not for start listening rtp */ - case 0x04: /* Canal Number */ - default: - { - if (parameter_length <= 8) { - guint64 param_value = 0; + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - } - break; + if (parameter_length > 0) { + switch (parameter_id) { + case 0x00: /* Remote IP Address - Not for start listening rtp */ + case 0x03: /* Remote IP Address Out - Not for start listening rtp */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_ip, tvb, offset, 1, ENC_NA); + break; + case 0x01: /* Remote UDP Port In - Not for start listening rtp */ + case 0x02: /* Remote UDP Port Out - Not for start listening rtp */ + case 0x04: /* Canal Number */ + default: + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_port, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_listen_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } - - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_const(parameter_id, ip_device_routing_cmd_listen_rtp_vals, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_const(parameter_id, ip_device_routing_cmd_listen_rtp_vals, "Unknown")); + break; } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s (0x%02x)", - val_to_str_const(parameter_id, ip_device_routing_cmd_listen_rtp_vals, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } + offset += parameter_length; + length -= parameter_length; } - break; } + break; case 0x09: /* GET_PARAM_REQ */ - { - guint8 parameter; - - while (length > 0) { - parameter = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - val_to_str_const(parameter, ip_device_routing_cmd_get_param_req_vals, "Unknown")); - offset++; - length--; - } - break; + while (length > 0) { + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_get_param_req_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; } + break; + case 0x0A: /* SET_PARAM_REQ */ { - emem_strbuf_t *strbuf; - int i, parameter_id, parameter_length; - - strbuf = ep_strbuf_new_label(NULL); - while (length > 0) { guint64 param_value = 0; - ep_strbuf_truncate(strbuf, 0); - parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_guint8(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_set_param_req_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_set_param_req_vals_ext, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; + if (parameter_length > 0) { switch (parameter_id) { case 0x06: /* Compressor */ - { - ep_strbuf_append(strbuf, val_to_str_const(tvb_get_guint8(tvb, offset + 2), - str_set_param_req_compressor, "Default Codec")); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_compressor, tvb, offset, 1, ENC_NA); + break; case 0x07: /* ERR STRING NET DOWN */ case 0x08: /* ERR STRING CABLE PB */ case 0x09: /* ERR STRING TRY CONNECT */ case 0x0A: /* ERR STRING CONNECTED */ case 0x0B: /* ERR STRING RESET */ case 0x0C: /* ERR STRING DUPLICATE IP ADDRESS */ - { - ep_strbuf_append(strbuf, "\""); - for (i = 1; i <= parameter_length; i++) { - /* XXX: Advancing thru param byte by byte, yet using stringz ?? */ - /* XXX: ! isprint() action same as for isprint() ?? */ - if (isprint(tvb_get_guint8(tvb, offset + 1 + i))) - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - else - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - } - ep_strbuf_append(strbuf, "\""); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_err_string, tvb, offset, parameter_length, ENC_NA|ENC_ASCII); + break; case 0x0F: /* TFTP BACKUP IP ADDR */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 2)); - - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+1+i)); - } - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_tftp_backup_ip, tvb, offset, 4, ENC_BIG_ENDIAN); + break; case 0x11: /* Set PC Port status */ - { - ep_strbuf_append(strbuf, val_to_str_const(tvb_get_guint8(tvb, offset + 2), - str_set_pc_port_status, "Unknown")); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_set_pc_port_status, tvb, offset, 1, ENC_NA); + break; case 0x12: /* Record RTP Authorization */ - { - ep_strbuf_append(strbuf, val_to_str_const(tvb_get_guint8(tvb, offset + 2), - str_enable_feature, "Unknown")); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_record_rtp_auth, tvb, offset, 1, ENC_NA); + break; case 0x13: /* Security Flags */ - { - ep_strbuf_append(strbuf, - (tvb_get_guint8(tvb, offset + 2) & 0x01) ? - "Filtering Activated" : "Filtering Not Active"); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_security_flag_filter, tvb, offset, 1, ENC_NA); + break; case 0x00: /* QOS IP TOS */ case 0x01: /* QOS 8021 VLID */ case 0x02: /* QOS 8021 PRI */ @@ -1539,45 +1465,14 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo case 0x15: /* Session Param */ case 0x30: /* MD5 Authentication */ default: - { - if ((parameter_length > 0) && (parameter_length <= 8)) { - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else if (parameter_length > 8) { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; + if ((parameter_length > 0) && (parameter_length <= 8)) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else if (parameter_length > 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_set_param_req_parameter_value, tvb, offset, parameter_length, ENC_NA); } + break; } - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_set_param_req_vals_ext, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_set_param_req_vals_ext, "Unknown")); - } - - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Parameter: %s (0x%02x)", - val_to_str_ext_const(parameter_id, &ip_device_routing_cmd_set_param_req_vals_ext, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); offset += parameter_length; length -= parameter_length; } @@ -1585,157 +1480,89 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo break; } case 0x0B: /* SEND_DIGIT */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Digit Value: %s", - val_to_str_ext_const(tvb_get_guint8(tvb, offset), &str_digit_ext, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_device_routing_digit_value, tvb, offset, 1, ENC_NA); break; - } + case 0x0C: /* PAUSE_RTP */ case 0x0D: /* RESTART_RTP */ - { - emem_strbuf_t *strbuf; - int i, parameter_length, parameter_id; - - strbuf = ep_strbuf_new_label(NULL); - - while (length > 0) { - ep_strbuf_truncate(strbuf, 0); + while (length > 0) { + parameter_id = tvb_get_guint8(tvb, offset); + parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_id = tvb_get_guint8(tvb, offset); - parameter_length = tvb_get_guint8(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_const(parameter_id, ip_device_routing_cmd_pause_restart_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - if (parameter_length > 0) { - if (parameter_length <= 8) { - guint64 param_value = 0; + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_const(parameter_id, ip_device_routing_cmd_pause_restart_vals, "Unknown"), strbuf->str); + if (parameter_length > 0) { + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_const(parameter_id, ip_device_routing_cmd_pause_restart_vals, "Unknown")); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_value, tvb, offset, parameter_length, ENC_NA); } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s (0x%02x)", - val_to_str_const(parameter_id, ip_device_routing_cmd_pause_restart_vals, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } + offset += parameter_length; + length -= parameter_length; } - break; } + break; case 0x0E: /* START_RECORD_RTP */ case 0x0F: /* STOP RECORD RTP */ - { - emem_strbuf_t *strbuf; - int i, parameter_length, parameter_id; + while (length > 0) { - strbuf = ep_strbuf_new_label(NULL); - - while (length > 0) { - ep_strbuf_truncate(strbuf, 0); + parameter_id = tvb_get_guint8(tvb, offset); + parameter_length = tvb_get_guint8(tvb, offset + 1); - parameter_id = tvb_get_guint8(tvb, offset); - parameter_length = tvb_get_guint8(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter, tvb, offset, + parameter_length + 2, parameter_id, "%s", + val_to_str_const(parameter_id, ip_device_routing_cmd_record_rtp_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - if (parameter_length > 0) { - switch (parameter_id) { - case 0x01: /* Remote IP Address */ - case 0x04: /* Remote IP Address Out */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 2)); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+1+i)); - } - break; - } - case 0x00: /* Recorder Index */ - case 0x02: /* Remote UDP Port In */ - case 0x03: /* Remote UDP Port Out */ - case 0x05: /* Local UDP Port In */ - case 0x06: /* Local UDP Port Out */ - case 0x07: /* Type Of Service */ - case 0x08: /* Master Key For SRTP Session */ - case 0x09: /* Master Salt Key For SRTP Session */ - case 0x30: /* MD5 Authentication */ - default: - { - if (parameter_length <= 8) { - guint64 param_value = 0; + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - } - break; + if (parameter_length > 0) { + switch (parameter_id) { + case 0x01: /* Remote IP Address */ + case 0x04: /* Remote IP Address Out */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_remote_ip, tvb, offset, 4, ENC_BIG_ENDIAN); + break; + case 0x00: /* Recorder Index */ + case 0x02: /* Remote UDP Port In */ + case 0x03: /* Remote UDP Port Out */ + case 0x05: /* Local UDP Port In */ + case 0x06: /* Local UDP Port Out */ + case 0x07: /* Type Of Service */ + case 0x08: /* Master Key For SRTP Session */ + case 0x09: /* Master Salt Key For SRTP Session */ + case 0x30: /* MD5 Authentication */ + default: + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_value, tvb, offset, parameter_length, ENC_BIG_ENDIAN); } - - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_const(parameter_id, ip_device_routing_cmd_record_rtp_vals, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_const(parameter_id, ip_device_routing_cmd_record_rtp_vals, "Unknown")); + break; } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s (0x%02x)", - val_to_str_const(parameter_id, ip_device_routing_cmd_record_rtp_vals, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } + offset += parameter_length; + length -= parameter_length; } - break; } + break; case 0x06: /* STOP TONE */ default: { @@ -1749,35 +1576,10 @@ decode_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo DEBUG IN LINE - 18h (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_debug_in_line(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_debug_in_line(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; - int i, parameter_length; - emem_strbuf_t *strbuf; - - if (!ua3g_body_item) - return; - - parameter_length = length; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - strbuf = ep_strbuf_new_label(NULL); - - ep_strbuf_append(strbuf, "\""); - for (i = 0; i < parameter_length; i++) { - /* XXX: Advancing thru param byte by byte, yet using stringz ?? */ - /* XXX: ! isprint() action same as for isprint() ?? */ - if (isprint(tvb_get_guint8(tvb, offset + i))) - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+i, NULL)); - else - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+i, NULL)); - } - ep_strbuf_append(strbuf, "\""); - - proto_tree_add_text(ua3g_body_tree, tvb, offset, length, - "Text String With Debug: %s", strbuf->str); + proto_tree_add_item(tree, hf_ua3g_debug_in_line, tvb, offset, length, ENC_NA|ENC_ASCII); } @@ -1797,35 +1599,23 @@ static const value_string str_command_led[] = { }; static void -decode_led_command(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_led_command(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { - proto_tree *ua3g_body_tree; int command; - const gchar* command_str; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_led, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_led, "Unknown")); - if (!ua3g_body_item) + if (!tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, "s - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_led, tvb, offset, 1, ENC_NA); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_command_led, tvb, offset, 1, ENC_NA); if ((command >= 0) && (command < 7)) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Led Number: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_command_led_number, tvb, offset+1, 1, ENC_NA); } } @@ -1841,15 +1631,6 @@ static const value_string str_command_lcd_line[] = { {0, NULL} }; -static const value_string str_lcd_option[] = { - {7, "Suspend Display Refresh"}, - {6, "Time Of Day Display "}, - {5, "Call Timer Display "}, - {4, "Call Timer Control "}, - {2, "Blink "}, - {0, NULL} -}; - static const value_string str_call_timer_ctrl[] = { {0x00, "Call Timer Status Not Changed"}, {0x01, "Stop Call Timer"}, @@ -1859,18 +1640,14 @@ static const value_string str_call_timer_ctrl[] = { }; static void -decode_lcd_line_cmd(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 lcd_options, command, column_n; - guint i; const gchar* command_str; - proto_tree *ua3g_body_tree, *ua3g_param_tree, *ua3g_option_tree; + proto_tree *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_option_tree; proto_item *ua3g_param_item, *ua3g_option_item; emem_strbuf_t *strbuf; -/* static char str_ascii[40]; */ /* XXX: value never created ? */ -/* static char lcd_options_tab[6];*/ lcd_options = tvb_get_guint8(tvb, offset) & 0xFC; command = tvb_get_guint8(tvb, offset) & 0x03; @@ -1878,60 +1655,42 @@ decode_lcd_line_cmd(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, command_str = val_to_str_const(command, str_command_lcd_line, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s %d", - command_str, column_n); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s %d", command_str, column_n); - if (!ua3g_body_item) + if (!ua3g_body_tree) return; strbuf = ep_strbuf_new_label("\""); - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s %d", command_str, column_n); - proto_item_append_text(ua3g_body_item, " %s %d", command_str, column_n); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - for (i = 0; i < length - 2; i++) { - if (isprint(tvb_get_guint8(tvb, offset + 2 + i))) - ep_strbuf_append_printf(strbuf, "%c", tvb_get_guint8(tvb, offset + 2 + i)); - else - ep_strbuf_append_printf(strbuf, "'0x%02x'", tvb_get_guint8(tvb, offset + 2 + i)); - } - ep_strbuf_append(strbuf, "\""); + ep_strbuf_append_printf(strbuf, "%s\"", tvb_format_text(tvb, offset + 2, length - 2)); ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, length, "%s %d: %s", - command_str, column_n, /*str_ascii*/ strbuf->str); + command_str, column_n, strbuf->str); ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_lcd_line, tvb, offset, 1, ENC_NA); - ua3g_option_item = proto_tree_add_text(ua3g_param_tree, tvb, offset, - 1, "LCD Options: 0x%x", lcd_options); + ua3g_option_item = proto_tree_add_item(ua3g_param_tree, hf_ua3g_lcd_line_cmd_lcd_options, tvb, offset, 1, ENC_NA); ua3g_option_tree = proto_item_add_subtree(ua3g_option_item, ett_ua3g_option); - for (i = 2; i <= 7; i++) { - if (i != 3) { - proto_tree_add_text(ua3g_option_tree, tvb, offset, 1, "%s: %s", - val_to_str_const(i, str_lcd_option, "Unknown"), - (lcd_options & (1 << i)) ? "Enable" : "Disable"); - } else { - i++; - proto_tree_add_text(ua3g_option_tree, tvb, offset, 1, "%s: %s", - val_to_str_const(i, str_lcd_option, "Unknown"), - val_to_str_const((lcd_options >> 3) & 0x03, str_call_timer_ctrl, "Unknown")); - } - } + proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_call_timer, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_blink, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_call_timer_control, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_call_timer_display, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_time_of_day_display, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_option_tree, hf_ua3g_lcd_line_cmd_lcd_options_suspend_display_refresh, tvb, offset, 1, ENC_NA); + offset++; length--; if (command != 3) - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Starting Column: %d", column_n); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_lcd_line_cmd_starting_column, tvb, offset, 1, ENC_NA); else proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Unused"); offset++; length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, length, "ASCII Char: %s", /*str_ascii*/ strbuf->str); + proto_tree_add_text(ua3g_param_tree, tvb, offset, length, "ASCII Char: %s", strbuf->str); } @@ -1965,36 +1724,21 @@ static const value_string str_cadence[] = { {0, NULL} }; -static const value_string str_receiving_level[] = { - {0x11, "Receiving Level "}, - {0x12, "Receiving Level "}, - {0x13, "Speaker Level "}, - {0, NULL} -}; - static void -decode_main_voice_mode(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_main_voice_mode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 mode; - const gchar* mode_str; - proto_tree *ua3g_body_tree; + proto_tree *ua3g_body_tree = tree; mode = tvb_get_guint8(tvb, offset); - mode_str = val_to_str_const(mode, str_main_voice_mode, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", mode_str); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(mode, str_main_voice_mode, "Unknown")); - if (!ua3g_body_item) + if (!ua3g_body_tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", mode_str); - proto_item_append_text(ua3g_body_item, " - %s", mode_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode, tvb, offset, 1, ENC_NA); offset++; length--; @@ -2002,15 +1746,11 @@ decode_main_voice_mode(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, switch (mode) { case 0x06: /* Ringing */ { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Tune: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_tune, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Cadence: %s (%d)", - val_to_str_const(tvb_get_guint8(tvb, offset), str_cadence, "Unknown"), - tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_cadence, tvb, offset, 1, ENC_NA); offset++; length--; } @@ -2020,35 +1760,46 @@ decode_main_voice_mode(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, case 0x04: /* Handsfree */ case 0x05: /* Announce Loudspeaker */ { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Speaker Volume: %d", - tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_speaker_volume, tvb, offset, 1, ENC_NA); offset++; length--; if (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "Microphone Volume: %d", - tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_main_voice_mode_microphone_volume, tvb, offset, 1, ENC_NA); } break; } case 0x11: /* Handset */ + { + signed char level; + + level = (signed char)(tvb_get_guint8(tvb, offset)) / 2; + proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_handset_level, tvb, offset, 1, level); + + level = (signed char)(tvb_get_guint8(tvb, offset+1)) / 2; + proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_sending_level, tvb, offset+1, 1, level); + break; + } case 0x12: /* Headset */ - case 0x13: /* Handsfree */ { signed char level; level = (signed char)(tvb_get_guint8(tvb, offset)) / 2; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "%s: %d dB", - val_to_str_const(mode, str_receiving_level, "Unknown"), level); - offset++; - length--; + proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_headset_level, tvb, offset, 1, level); + + level = (signed char)(tvb_get_guint8(tvb, offset+1)) / 2; + proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_sending_level, tvb, offset+1, 1, level); + break; + } + case 0x13: /* Handsfree */ + { + signed char level; level = (signed char)(tvb_get_guint8(tvb, offset)) / 2; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Sending Level: %d dB", level); + proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_handsfree_level, tvb, offset, 1, level); + + level = (signed char)(tvb_get_guint8(tvb, offset+1)) / 2; + proto_tree_add_int(ua3g_body_tree, hf_ua3g_main_voice_mode_sending_level, tvb, offset+1, 1, level); break; } case 0x00: /* Idle */ @@ -2073,22 +1824,11 @@ static const value_string str_new_metastate[] = { }; static void -decode_subdevice_metastate(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_subdevice_metastate(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subchannel Address: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "New Metastate: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_new_metastate, "Unknown")); + proto_tree_add_item(tree, hf_ua3g_subdevice_metastate_subchannel_address, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_subdevice_metastate_new_metastate, tvb, offset+1, 1, ENC_NA); } @@ -2102,34 +1842,15 @@ static const value_string str_clock_format[] = { }; static void -decode_dwl_dtmf_clck_format(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_dwl_dtmf_clck_format(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset, guint length) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Minimum 'ON' Time: %d ms", (tvb_get_guint8(tvb, offset) * 10)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Inter-Digit Pause Time: %d ms", - (tvb_get_guint8(tvb, offset) * 10)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Clock Time Format: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_clock_format, "Unknown")); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_minimum_on_time, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_inter_digit_pause_time, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_clock_time_format, tvb, offset+2, 1, ENC_NA); - if (length > 0) - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "DTMF Country Adaptation: %d", tvb_get_guint8(tvb, offset)); + if (length > 2) + proto_tree_add_item(tree, hf_ua3g_dwl_dtmf_clck_format_dtmf_country_adaptation, tvb, offset+3, 1, ENC_NA); } @@ -2149,31 +1870,18 @@ static const value_string str_call_timer[] = { }; static void -decode_set_clck(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_set_clck(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree, *ua3g_param_tree; - proto_item *ua3g_param_item; int hour, minute, second, call_timer; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_set_clck, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_set_clck, "Unknown")); - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_set_clck, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_command_set_clck, tvb, offset, 1, ENC_NA); offset++; length--; call_timer = 0; @@ -2192,22 +1900,11 @@ decode_set_clck(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, minute = tvb_get_guint8(tvb, offset + 1); second = tvb_get_guint8(tvb, offset + 2); - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 3, + proto_tree_add_text(tree, tvb, offset, 3, "%s: %d:%d:%d", val_to_str_const(call_timer, str_call_timer, "Current Time"), hour, minute, second); - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "%sHour: %d", - val_to_str_const(call_timer, str_call_timer, ""), hour); - offset++; - length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "%sMinute: %d", - val_to_str_const(call_timer, str_call_timer, ""), minute); - offset++; - length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "%sSecond: %d", - val_to_str_const(call_timer, str_call_timer, ""), second); - offset++; - length--; + offset += 3; + length -= 3; call_timer = 1; } @@ -2232,54 +1929,26 @@ static const value_string str_voice_channel[] = { {0, NULL} }; +static const true_false_string tfs_voice_channel_channel_mode = { "Write 00 to Voice Channel", "Normal Voice Channel Mode" }; +static const true_false_string tfs_voice_channel_codec = { "Write Quiet To Codec", "Normal Codec Operation" }; +static const true_false_string tfs_voice_channel_voice_channel = { "Use B3 As Voice Channel", "Use B1 As Voice Channel" }; + static void -decode_voice_channel(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_voice_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - if (length == 1) { - guint8 val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - (val & 0x01) ? "Write 00 to Voice Channel" : "Normal Voice Channel Mode"); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - (val & 0x02) ? "Write Quiet To Codec" : "Normal Codec Operation"); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - (val & 0x04) ? "Use B3 As Voice Channel" : "Use B1 As Voice Channel"); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_voice_channel_channel_mode, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_voice_channel_codec, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_voice_channel_voice_channel, tvb, offset, 1, ENC_NA); } else if (length == 2) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Main Voice: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_voice_channel, "Unknown")); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Announce: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_voice_channel, "Unknown")); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_voice_channel_main_voice, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_voice_channel_announce, tvb, offset+1, 1, ENC_NA); } else if (length == 4) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "B General: %d", - tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "B Loud Speaker: %d", - tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "B Ear Piece: %d", - tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "B Microphones: %d", - tvb_get_guint8(tvb, offset)); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_voice_channel_b_general, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_voice_channel_b_loud_speaker, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_voice_channel_b_ear_piece, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_voice_channel_b_microphones, tvb, offset+3, 1, ENC_NA); } } @@ -2295,29 +1964,17 @@ static const value_string str_ext_ring_cmd[] = { }; static void -decode_external_ringing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length _U_, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_external_ringing(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset) { - proto_tree *ua3g_body_tree; guint8 command; - const gchar* command_str; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_ext_ring_cmd, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - - if (!ua3g_body_item) - return; + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_ext_ring_cmd, "Unknown")); - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_external_ringing_command, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_external_ringing_command, tvb, offset, 1, ENC_NA); } @@ -2325,30 +1982,15 @@ decode_external_ringing(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, LCD CURSOR - 35h - (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_lcd_cursor(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_lcd_cursor(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, guint offset) { - proto_tree *ua3g_body_tree; const gchar* str_on_off_val = STR_ON_OFF(tvb_get_guint8(tvb, offset + 1) & 0x02); /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", str_on_off_val); - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", str_on_off_val); - proto_item_append_text(ua3g_body_item, " - %s", str_on_off_val); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Line Number: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_lcd_cursor, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_lcd_cursor_line_number, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_lcd_cursor, tvb, offset+1, 1, ENC_NA); } @@ -2356,40 +1998,17 @@ decode_lcd_cursor(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, DOWNLOAD SPECIAL CHARACTER - 36h - (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_dwl_special_char(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_dwl_special_char(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset, guint length) { - proto_tree *ua3g_body_tree; - int i, j; - emem_strbuf_t *strbuf; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - strbuf = ep_strbuf_new_label(NULL); + int i; while (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Character Number: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_dwl_special_char_character_number, tvb, offset, 1, ENC_NA); offset++; length--; for (i = 1; i <= 8; i++) { - int byte = tvb_get_guint8(tvb, offset); - - /* The following loop will draw a picture of the character with "spaces" and "o" */ - ep_strbuf_truncate(strbuf, 0); - for (j = 7; j >= 0; j--) { - if (((byte >> j) & 0x01) == 0) - ep_strbuf_append_printf(strbuf, " "); - else - ep_strbuf_append_printf(strbuf, "o "); - } - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Byte %d: 0x%02x %s", i, byte, strbuf->str); + proto_tree_add_item(tree, hf_ua3g_dwl_special_char_byte, tvb, offset, 1, ENC_NA); offset++; length--; } @@ -2401,30 +2020,16 @@ decode_dwl_special_char(proto_tree *tree _U_, tvbuff_t *tvb, SET CLOCK/TIMER POSITION - 38h - (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_set_clck_timer_pos(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_set_clck_timer_pos(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) + if (!tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Clock Line Number: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Clock Column Number: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Call Timer Line Number: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Call Timer Column Number: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_clock_line_number, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_clock_column_number, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_call_timer_line_number, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_set_clck_timer_pos_call_timer_column_number, tvb, offset+3, 1, ENC_NA); } @@ -2438,23 +2043,11 @@ static const value_string str_driver_number[] = { }; static void -decode_set_lcd_contrast(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_set_lcd_contrast(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Driver Number: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_driver_number, "Unknown")); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Contrast Value: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_set_lcd_contrast_driver_number, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_set_lcd_contrast_contrast_value, tvb, offset+1, 1, ENC_NA); } @@ -2504,28 +2097,17 @@ static const value_string str_beep_terminator[] = { }; static void -decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_beep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { if (length > 0) { /* All cases except classical beep */ guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree; + proto_tree *ua3g_body_tree = tree; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_beep, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_beep, "Unknown")); proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_beep, tvb, offset, 1, ENC_NA); offset++; @@ -2537,9 +2119,7 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, { int i = 0; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Destination: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_beep_start_destination, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_destination, tvb, offset, 1, ENC_NA); offset++; length--; @@ -2547,11 +2127,10 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, guint8 val; i++; - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "On / Off: %s", - STR_ON_OFF(val & 0x80)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Cadence T%d: %d ms", - i, ((val & 0x7F) * 10)); + val = (tvb_get_guint8(tvb, offset) & 0x7F) * 10; + proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_on_off, tvb, offset, 1, ENC_NA); + proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_beep_cadence, tvb, offset, 1, val, + "Cadence T%d: %d ms", i, val); offset++; length--; } @@ -2576,16 +2155,15 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, "Destination: %s", strbuf->str); offset++; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Beep Number: %x", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_NA); break; } case 0x05: { int i, nb_of_notes, beep_number; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Beep Number: %x", beep_number = tvb_get_guint8(tvb, offset)); + beep_number = tvb_get_guint8(tvb, offset); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_NA); offset++; length--; @@ -2594,8 +2172,8 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, else beep_number = 0xFF; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Number Of Notes: %x", nb_of_notes = tvb_get_guint8(tvb, offset)); + nb_of_notes = tvb_get_guint8(tvb, offset); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_number_of_notes, tvb, offset, 1, ENC_NA); offset++; length--; @@ -2616,9 +2194,7 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, offset++; length--; } - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Terminator: %d (%s)", - tvb_get_guint8(tvb, offset), - val_to_str_const(tvb_get_guint8(tvb, offset), str_beep_terminator, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_terminator, tvb, offset, 1, ENC_NA); offset++; length--; } @@ -2633,14 +2209,6 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, } else { /* Classical Beep */ /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": Classical Beep"); - - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", Classical Beep"); - proto_item_append_text(ua3g_body_item, " - Classical Beep"); - } } @@ -2649,13 +2217,10 @@ decode_beep(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, SIDETONE ON / OFF - 3Dh (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_sidetone(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length _U_, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_sidetone(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint offset) { guint8 command; const gchar* command_str; - proto_tree *ua3g_body_tree; command = tvb_get_guint8(tvb, offset); command_str = STR_ON_OFF(command); @@ -2663,21 +2228,11 @@ decode_sidetone(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_sidetone, tvb, offset, 1, ENC_NA); - offset++; + proto_tree_add_item(tree, hf_ua3g_command_sidetone, tvb, offset, 1, ENC_NA); if (command == 0x01) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Level: %d dB", - (signed char)(tvb_get_guint8(tvb, offset) / 2)); + proto_tree_add_int(tree, hf_ua3g_sidetone_level, tvb, offset+1, 1, + (signed char)(tvb_get_guint8(tvb, offset+1) / 2)); } } @@ -2686,28 +2241,25 @@ decode_sidetone(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, SET PROGRAMMABLE RINGING CADENCE - 3Eh (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_ringing_cadence(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_ringing_cadence(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset, guint length) { - proto_tree *ua3g_body_tree; int i = 0; + guint16 cadence_length; - if (!ua3g_body_item) + if (!tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Cadence: %d", - tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_ringing_cadence_cadence, tvb, offset, 1, ENC_NA); offset++; length--; while (length > 0) { i++; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "On / Off : %s", - STR_ON_OFF(tvb_get_guint8(tvb, offset) & 0x80)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Length %d : %d ms", - i, ((tvb_get_guint8(tvb, offset) & 0x7F) * 10)); + proto_tree_add_item(tree, hf_ua3g_ringing_cadence_on_off, tvb, offset, 1, ENC_NA); + cadence_length = ((tvb_get_guint8(tvb, offset) & 0x7F) * 10); + proto_tree_add_uint_format(tree, hf_ua3g_ringing_cadence_length, tvb, offset, 1, cadence_length, + "Length %d : %d ms", i, cadence_length); offset++; length--; } @@ -2724,29 +2276,16 @@ static const value_string str_mute[] = { }; static void -decode_mute(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length _U_, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_mute(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint offset) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_mute, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_mute, "Unknown")); - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_mute, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_command_mute, tvb, offset, 1, ENC_NA); } @@ -2754,13 +2293,11 @@ decode_mute(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, FEEDBACK ON / OFF - 40h (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_feedback(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_feedback(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 command; const gchar* command_str; - proto_tree *ua3g_body_tree; command = tvb_get_guint8(tvb, offset); command_str = STR_ON_OFF(command); @@ -2768,29 +2305,22 @@ decode_feedback(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - if (!ua3g_body_item) + if (!tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_feedback, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_command_feedback, tvb, offset, 1, ENC_NA); offset++; length--; if (command == 0x01) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Level: %d dB", + proto_tree_add_int(tree, hf_ua3g_feedback_level, tvb, offset, 1, (signed char)(tvb_get_guint8(tvb, offset) / 2)); offset++; length--; if (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Duration: %d ms", - (tvb_get_guint8(tvb, offset) * 10)); + proto_tree_add_uint_format_value(tree, hf_ua3g_feedback_duration, tvb, offset, 1, + tvb_get_guint8(tvb, offset) * 10, "%d ms", tvb_get_guint8(tvb, offset) * 10); } } } @@ -2802,24 +2332,13 @@ decode_feedback(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, PERIPHERAL CONTENT - 2Bh (MESSAGE FROM THE TERMINAL) ---------------------------------------------------------------------------*/ static void -decode_r_w_peripheral(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_r_w_peripheral(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset, guint length) { - proto_tree *ua3g_body_tree; + proto_tree_add_item(tree, hf_ua3g_r_w_peripheral_address, tvb, offset, 2, ENC_BIG_ENDIAN); - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, "Address: %d", - tvb_get_ntohs(tvb, offset)); - offset += 2; - length -= 2; - - if (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Content: %d", tvb_get_guint8(tvb, offset)); + if (length > 2) { + proto_tree_add_item(tree, hf_ua3g_r_w_peripheral_content, tvb, offset+2, 1, ENC_NA); } } @@ -2836,35 +2355,25 @@ static const value_string str_icon_cmd_state[] = { }; static void -decode_icon_cmd(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_icon_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; guint8 byte0, byte1, bytex; int i; - if (!ua3g_body_item) + if (!tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Icon Number: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_icon_cmd_icon_number, tvb, offset, 1, ENC_NA); - byte0 = tvb_get_guint8(tvb, offset); - byte1 = tvb_get_guint8(tvb, offset+1); + byte0 = tvb_get_guint8(tvb, offset+1); + byte1 = tvb_get_guint8(tvb, offset+2); for (i = 0; i < 8; i++) { bytex = ((byte0 >> i) & 0x01) * 2 + ((byte1 >> i) & 0x01); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Segment %d: %s (%d)", i, - val_to_str_const(bytex, str_icon_cmd_state, "Unknown"), - bytex - ); + proto_tree_add_uint_format(tree, hf_ua3g_icon_cmd_segment, tvb, offset+1, 2, bytex, + "Segment %d: %s (%d)", i, val_to_str_const(bytex, str_icon_cmd_state, "Unknown"), bytex); } } @@ -2898,72 +2407,47 @@ static const value_string str_device_configuration[] = { { 0, NULL } }; +const true_false_string tfs_audio_config_handsfree_return = { "Return Loss Active", "Return Loss Normal" }; +const true_false_string tfs_audio_config_handsfree_handsfree = { "More Full Duplex", "Handsfree Normal" }; + static void -decode_audio_config(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_audio_config(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree; + proto_tree *ua3g_body_tree = tree; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_audio_config, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_audio_config, "Unknown")); - if (!ua3g_body_item) + if (!ua3g_body_tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_audio_config, tvb, offset, 1, ENC_NA); offset++; length--; switch (command) { case 0x00: /* Audio Coding */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "Ignored: %d", - tvb_get_guint8(tvb, offset)); - offset++; - length--; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "Law: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_audio_coding_law, "Unknown")); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_ignored, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_law, tvb, offset+1, 1, ENC_NA); + break; case 0x01: /* DPI Channel Allocations */ - { - int i; - static const gchar *str_body[] = { - "UA Channel UA-TX1 ", - "UA Channel UA-TX2 ", - "GCI Channel GCI-TX1 ", - "GCI Channel GCI-TX2 ", - "Codec Channel COD-TX" - }; - for (i = 0; i < 5; i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "%s: %d", - str_body[i], tvb_get_guint8(tvb, offset)); - offset++; - length--; - } - break; - } + + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_ua_tx1, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_ua_tx2, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_gci_tx1, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_gci_tx2, tvb, offset+3, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_dpi_chan_cod_tx, tvb, offset+4, 1, ENC_NA); + break; case 0x02: /* Loudspeaker Volume Adjust */ { int i; for (i = 1; i < 8; i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "Volume Level %d: %d", + proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_audio_config_volume_level, tvb, offset, + 1, tvb_get_guint8(tvb, offset), "Volume Level %d: %d", i, tvb_get_guint8(tvb, offset)); offset++; length--; @@ -2971,66 +2455,35 @@ decode_audio_config(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, break; } case 0x03: /* Audio Circuit Configuration */ - { - int i; - static const gchar *str_body[] = { - "Anti-Distortion Coeff 1(DTH)", - "Anti-Distortion Coeff 2(DTR)", - "Anti-Distortion Coeff 3(DTF)", - "Sidetone Attenuation (STR) ", - "Anti-Larsen Coeff 1 (AHP1) ", - "Anti-Larsen Coeff 2 (AHP2) ", - "Anti-Larsen Coeff 3 (ATH) ", - "Anti-Larsen Coeff 4 (ATR) ", - "Anti-Larsen Coeff 5 (ATF) ", - "Anti-Larsen Coeff 6 (ALM) " - }; - for (i = 0; i < 10; i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "%s: %d", - str_body[i], tvb_get_guint8(tvb, offset)); - offset++; - length--; - } - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_dth, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_dtr, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_dtf, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_str, tvb, offset+3, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_ahp1, tvb, offset+4, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_ahp2, tvb, offset+5, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_ath, tvb, offset+6, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_atr, tvb, offset+7, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_atf, tvb, offset+8, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_audio_circuit_alm, tvb, offset+9, 1, ENC_NA); + break; case 0x04: /* Handsfree Parameters */ - { - guint8 val; - - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - (val & 0x01) ? "Return Loss Active" : "Return Loss Normal"); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s", - (val & 0x02) ? "More Full Duplex" : "Handsfree Normal"); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_handsfree_return, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_handsfree_handsfree, tvb, offset, 1, ENC_NA); + break; case 0x05: /* Loudspeaker Acoustic Parameters */ - { - int i; - static const gchar *str_body[] = { - "Group Listening Attenuation Constant ", - "Handsfree Attenuation Constant ", - "Handsfree Number Of ms To Stay In Send State Before Going To Another State", - "Handsfree Number Of Positions To Shift Right MTx ", - "Handsfree Number Of Positions To Shift Right MRc ", - "Handsfree Idle Transmission Threshold ", - "Handsfree Low Transmission Threshold ", - "Handsfree Idle Reception Threshold ", - "Handsfree Low Reception Threshold ", - "Handsfree Medium Reception Threshold ", - "Handsfree High Reception Threshold " - }; - - for (i = 0; i < 11; i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s: %d", - str_body[i], tvb_get_guint8(tvb, offset)); - offset++; - length--; - } - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_group_listen, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_attenuation, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_stay_in_send, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mtx, tvb, offset+3, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mrc, tvb, offset+4, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_trans_threshold, tvb, offset+5, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_trans_threshold, tvb, offset+6, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_recv_threshold, tvb, offset+7, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_recv_threshold, tvb, offset+8, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_med_recv_threshold, tvb, offset+9, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_high_recv_threshold, tvb, offset+10, 1, ENC_NA); + break; case 0x06: /* Device Configuration */ { static const gchar *str_device_values[] = { @@ -3085,22 +2538,11 @@ decode_audio_config(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, AUDIO PADDED PATH - 4Ah (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_audio_padded_path(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_audio_padded_path(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Emission Padded Level: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Reception Padded Level: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf_ua3g_audio_padded_path_emission_padded_level, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_audio_padded_path_reception_padded_level, tvb, offset+1, 1, ENC_NA); } @@ -3111,13 +2553,11 @@ decode_audio_padded_path(proto_tree *tree _U_, tvbuff_t *tvb, ANNOUNCE ON / OFF - 4Eh (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_on_off_level(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, int hf_opcode, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_on_off_level(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length, int hf_opcode) { guint8 command; const gchar* command_str; - proto_tree *ua3g_body_tree; command = tvb_get_guint8(tvb, offset); command_str = STR_ON_OFF(command); @@ -3125,23 +2565,11 @@ decode_on_off_level(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_opcode, tvb, offset, 1, ENC_NA); - offset++; - length--; + proto_tree_add_item(tree, hf_opcode, tvb, offset, 1, ENC_NA); - if (length > 0) { + if (length > 1) { if (command == 0x01) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Level on Loudspeaker: %d dB", - (signed char)(tvb_get_guint8(tvb, offset))); + proto_tree_add_item(tree, hf_ua3g_on_off_level_level_on_loudspeaker, tvb, offset+1, 1, ENC_NA); } } } @@ -3151,13 +2579,11 @@ decode_on_off_level(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, RING ON / OFF - 4Fh (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_ring(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_ring(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 command; const gchar* command_str; - proto_tree *ua3g_body_tree; command = tvb_get_guint8(tvb, offset); command_str = STR_ON_OFF(command); @@ -3165,40 +2591,18 @@ decode_ring(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - if (!ua3g_body_item) + if (!tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - - proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_ring, tvb, offset, 1, ENC_NA); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_command_ring, tvb, offset, 1, ENC_NA); if (command == 0x01) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Melody: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Cadence: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_cadence, "Unknown")); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Speaker level: %d dB", - (signed char)(tvb_get_guint8(tvb, offset))); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Beep number: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Silent: %s", - STR_ON_OFF(tvb_get_guint8(tvb, offset) & 0x80)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Progressive: %d", - (tvb_get_guint8(tvb, offset) & 0x03)); + proto_tree_add_item(tree, hf_ua3g_ring_melody, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_ring_cadence, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_ring_speaker_level, tvb, offset+3, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_ring_beep_number, tvb, offset+4, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_ring_silent, tvb, offset+5, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_ring_progressive, tvb, offset+5, 1, ENC_NA); } } @@ -3276,28 +2680,31 @@ static const value_string str_iso_checksum_ack_status[] = { {0, NULL} }; +static const value_string str_mem_size[] = { + {0x00, "No Check"}, + {0x01, "128 Kbytes"}, + {0x02, "256 Kbytes"}, + {0x03, "512 Kbytes"}, + {0x04, "1 Mbytes"}, + {0x05, "2 Mbytes"}, + {0x06, "4 Mbytes"}, + {0x07, "8 Mbytes"}, + {0, NULL} +}; + + static void -decode_ua_dwl_protocol(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_ua_dwl_protocol(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree; + proto_tree *ua3g_body_tree = tree, *ua3g_param_tree; + proto_item *ua3g_param_item; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_ua_dwl_protocol, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_ua_dwl_protocol, "Unknown")); proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_ua_dwl_protocol, tvb, offset, 1, ENC_NA); offset++; @@ -3305,89 +2712,72 @@ decode_ua_dwl_protocol(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, switch (command) { case 0x00: /* Downloading Suggest (MESSAGE FROM THE TERMINAL) */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Item Identifier: %d", tvb_get_guint8(tvb, offset)); - offset++; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Item Version: %s", - version_number_computer(tvb_get_letohs(tvb, offset))); - offset += 2; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Cause: %d", tvb_get_guint8(tvb, offset)); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_identifier, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_version_nc, tvb, offset+1, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_cause, tvb, offset+3, 1, ENC_NA); + break; case 0x01: /* Downloading Request (MESSAGE FROM THE SYSTEM) */ { - static const gchar *str_mem_size[] = { - "No Check", - "128 Kbytes", - "256 Kbytes", - "512 Kbytes", - "1 Mbytes", - "2 Mbytes", - "4 Mbytes", - "8 Mbytes" - }; - static const gchar *str_bin_info[] = { "Uncompressed Binary", "LZO Compressed Binary" }; if (length > 7) { /* Not R1 */ - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Force Mode: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_download_req_force_mode, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_force_mode, tvb, offset, 1, ENC_NA); offset++; length--; } - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Item Identifier: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_download_req_item_id, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_identifier, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Item Version: %d", tvb_get_ntohs(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_item_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; if (length > 2) { /* Not R1 */ - guint8 val; - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Files Included: %sBoot Binary Included, %sLoader Binary Included," - " %sAppli Binary Included, %sDatas Binary Included", - (val & 0x01) ? "" : "No ", - (val & 0x02) ? "" : "No ", - (val & 0x04) ? "" : "No ", - (val & 0x08) ? "" : "No "); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Files Included"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_boot_binary, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_loader_binary, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_appli_binary, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_files_inc_data_binary, + tvb, offset, 1, ENC_NA); offset++; length--; - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Model Selection: For A Model: %s, For B Model: %s, For C Model %s, Country Version: %s", - STR_YES_NO(val & 0x01), - STR_YES_NO(val & 0x02), - STR_YES_NO(val & 0x04), - val_to_str_const(((tvb_get_guint8(tvb, offset) & 0xE0) >> 5), str_download_req_mode_selection_country, "Unknown")); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Model Selection"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_a, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_b, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_c, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_model_selection_country_ver, + tvb, offset, 1, ENC_NA); offset++; length--; - - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Hardware Selection: For Ivanoe 1: %s, For Ivanoe 2: %s", - STR_YES_NO(val & 0x01), - STR_YES_NO(val & 0x02)); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Hardware Selection"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe1, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe2, + tvb, offset, 1, ENC_NA); offset++; length--; - val = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Memory Sizes Required: Flash Min Size: %s, External Ram Min Size: %s", - str_mem_size[(val & 0x07)], - str_mem_size[(val & 0x38) >> 3]); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Memory Sizes Required"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_memory_sizes_flash, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_ua_dwl_protocol_memory_sizes_ext_ram, + tvb, offset, 1, ENC_NA); offset++; length--; } else { /* R1 */ @@ -3398,26 +2788,18 @@ decode_ua_dwl_protocol(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, length--; } - proto_tree_add_text(ua3g_body_tree, tvb, offset, 3, - "Binary Length: %d", tvb_get_ntoh24(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_binary_length, tvb, offset, 3, ENC_BIG_ENDIAN); break; } case 0x02: /* Downloading Acknowledge (MESSAGE FROM THE TERMINAL) */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Packet Number: %d", tvb_get_ntohs(tvb, offset)); - offset += 2; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Status: %s", - val_to_str_ext_const(tvb_get_guint8(tvb, offset), &str_download_ack_status_ext, "Unknown")); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_number, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_download_ack_status, tvb, offset+2, 1, ENC_NA); + break; case 0x03: /* Downloading Data (MESSAGE FROM THE SYSTEM) */ { int i = 1; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Packet Number: %d", tvb_get_ntohs(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_number, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; @@ -3431,30 +2813,17 @@ decode_ua_dwl_protocol(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, break; } case 0x05: /* Downloading End Acknowledge (MESSAGE FROM THE TERMINAL) */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Status: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_download_end_ack_ok, "Not Ok")); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_packet_download_end_ack_ok_status, tvb, offset, 1, ENC_NA); + break; case 0x06: /* Downloading Iso Checksum (MESSAGE FROM THE SYSTEM) */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 4, - "Checksum: %d", tvb_get_ntohl(tvb, offset)); - /*offset += 4;*/ - /*length -= 4;*/ - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_checksum, tvb, offset, 4, ENC_BIG_ENDIAN); + break; case 0x07: /* Downloading ISO Checksum Acknowledge (MESSAGE FROM THE TERMINAL) */ - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Acknowledge: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_iso_checksum_ack_status, "Unknown")); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_ua_dwl_protocol_acknowledge, tvb, offset, 1, ENC_NA); + break; case 0x04: /* Downloading End (MESSAGE FROM THE SYSTEM) */ default: - { - break; - } + break; } } @@ -3463,18 +2832,9 @@ decode_ua_dwl_protocol(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, DIGIT DIALED - 03h (MESSAGE FROM THE SYSTEM) ---------------------------------------------------------------------------*/ static void -decode_digit_dialed(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length _U_, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_digit_dialed(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Digit Value: %s", - val_to_str_ext_const(tvb_get_guint8(tvb, offset), &str_digit_ext, "Unknown")); + proto_tree_add_item(tree, hf_ua3g_digit_dialed_digit_value, tvb, offset, 1, ENC_NA); } @@ -3482,35 +2842,19 @@ decode_digit_dialed(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, SUBDEVICE_MSG - 04h (MESSAGE FROM THE TERMINAL) ---------------------------------------------------------------------------*/ static void -decode_subdevice_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_subdevice_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint length) { - proto_tree *ua3g_body_tree; - int i = 0; - - if (!ua3g_body_item) + if (!tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subdev Type: %d", (tvb_get_guint8(tvb, offset) & 0xF0)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subdev Address: %d", (tvb_get_guint8(tvb, offset) & 0x0F)); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_subdevice_msg_subdev_type, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_subdevice_msg_subdev_address, tvb, offset, 1, ENC_NA); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subdevice Opcode: %d", (tvb_get_guint8(tvb, offset) & 0x7F)); - offset++; - length--; + proto_tree_add_item(tree, hf_ua3g_subdevice_msg_subdevice_opcode, tvb, offset+1, 1, ENC_NA); - while (length > 0) { - i++; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Parameter Byte %2d: %d", i, tvb_get_guint8(tvb, offset)); - offset++; - length--; + if (length > 2) { + proto_tree_add_item(tree, hf_ua3g_subdevice_msg_parameter_bytes, tvb, offset+2, length-2, ENC_NA); } } @@ -3543,7 +2887,7 @@ static const value_string str_cs_ip_device_routing_08_compressor[] = { {0, NULL} }; -static const value_string str_cs_ip_device_routing_0F_compressor[] = { +static const val64_string str_cs_ip_device_routing_0F_compressor[] = { {0x00, "G.711 A-law"}, {0x01, "G.711 mu-law"}, {0x02, "G.723.1 6.3kbps"}, @@ -3625,7 +2969,7 @@ static const value_string cs_ip_device_routing_cmd03_second_byte_vals[] = { {0, NULL} }; -static const value_string cs_ip_device_routing_cmd03_voice_mode_vals[] = { +static const val64_string cs_ip_device_routing_cmd03_voice_mode_vals[] = { {0x50, "Idle"}, {0x51, "Handset"}, {0x52, "Group Listening"}, @@ -3687,51 +3031,35 @@ static const value_string cs_ip_device_routing_consecutive_rtp_lost_range_vals[] static void decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo, guint offset, guint length, - guint8 opcode _U_, proto_item *ua3g_item, - proto_item *ua3g_body_item) + packet_info *pinfo, guint offset, guint length) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree, *ua3g_param_tree; + proto_tree *ua3g_body_tree = tree, *ua3g_param_tree; proto_item *ua3g_param_item; + int i, parameter_id, parameter_length; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_cs_ip_device_routing, "Unknown"); /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_cs_ip_device_routing, "Unknown")); - if (!ua3g_body_item) + if (!ua3g_body_tree) return; - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_item(ua3g_body_tree, hf_ua3g_ip_cs, tvb, offset, 1, ENC_NA); offset++; length--; switch (command) { case 0x00: - { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "VTA Type: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_cs_ip_device_routing_vta_type, "Unknown")); - offset++; - length--; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, - 1, "Characteristic Number: %d", tvb_get_guint8(tvb, offset)); - break; - } + proto_tree_add_item(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd00_vta_type, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd00_characteristic_number, tvb, offset+1, 1, ENC_NA); + break; case 0x01: { int i = 0; if (length == 1) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Incident 0: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd01_incident_0, tvb, offset, 1, ENC_NA); } else { while (length >0) { i++; @@ -3745,319 +3073,180 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, break; } case 0x02: - { - emem_strbuf_t *strbuf; - int i, parameter_id, parameter_length; - - strbuf = ep_strbuf_new_label(NULL); - - while (length > 0) { - ep_strbuf_truncate(strbuf, 0); - - parameter_id = tvb_get_guint8(tvb, offset); - parameter_length = tvb_get_guint8(tvb, offset + 1); + while (length > 0) { + parameter_id = tvb_get_guint8(tvb, offset); + parameter_length = tvb_get_guint8(tvb, offset + 1); - if (parameter_length > 0) { - switch (parameter_id) { - case 0x00: /* Firmware Version */ - { - ep_strbuf_append_printf(strbuf, "%s", - version_number_computer(tvb_get_ntohs(tvb, offset + 2))); - break; - } - case 0x01: /* Firmware Version */ - case 0x02: /* DHCP IP Address */ - case 0x03: /* Local IP Address */ - case 0x04: /* Subnetwork Mask */ - case 0x05: /* Router IP Address */ - case 0x06: /* TFTP IP Address */ - case 0x07: /* Main CPU Address */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 2)); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter, tvb, offset, + parameter_id, parameter_length + 2, + "%s", val_to_str_const(parameter_id, ip_device_routing_cmd_get_param_req_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+1+i)); - } - break; - } - case 0x08: /* Default Codec */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, - val_to_str_const((guint8)(param_value), str_cs_ip_device_routing_08_compressor, "Default Codec")); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; - } - case 0x09: /* Ethernet Drivers Config */ - { - if (parameter_length == 2) { - ep_strbuf_append_printf(strbuf, - "Port Lan Speed: %d - Port Lan Duplex: %d", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3)); - } else if (parameter_length == 4) { - ep_strbuf_append_printf(strbuf, - "Port Lan Speed: %d - Port Lan Duplex: %d - Port PC Speed: %d - Port PC Duplex: %d", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + 4), - tvb_get_guint8(tvb, offset + 5)); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } - break; - } - case 0x0A: /* MAC Address */ - { - ep_strbuf_append_printf(strbuf, "%02x", tvb_get_guint8(tvb, offset + 2)); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_length, tvb, offset, 1, ENC_NA); + offset++; + length--; - /* XXX: Advancing thru param byte by byte, yet using stringz ?? */ - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, ":"); - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+1+i, NULL)); - } - break; + if (parameter_length > 0) { + switch (parameter_id) { + case 0x00: /* Firmware Version */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_firmware_version, tvb, offset, 2, ENC_BIG_ENDIAN); + break; + case 0x01: /* Firmware Version */ + case 0x02: /* DHCP IP Address */ + case 0x03: /* Local IP Address */ + case 0x04: /* Subnetwork Mask */ + case 0x05: /* Router IP Address */ + case 0x06: /* TFTP IP Address */ + case 0x07: /* Main CPU Address */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN); + break; + case 0x08: /* Default Codec */ + { + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_bytes, tvb, offset, parameter_length, ENC_NA); } - default: - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - } else { - ep_strbuf_append_printf(strbuf, "0x%02x 0x%02x ... 0x%02x 0x%02x", - tvb_get_guint8(tvb, offset + 2), - tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + parameter_length), - tvb_get_guint8(tvb, offset + 1 + parameter_length)); - } + break; + } + case 0x09: /* Ethernet Drivers Config */ + { + if (parameter_length == 2) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex, tvb, offset+1, 1, ENC_NA); + } else if (parameter_length == 4) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_speed, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_duplex, tvb, offset+3, 1, ENC_NA); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_value, tvb, offset, parameter_length, ENC_NA); } break; } - - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s: %s", - val_to_str_const(parameter_id, ip_device_routing_cmd_get_param_req_vals, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 2, "%s", - val_to_str_const(parameter_id, ip_device_routing_cmd_get_param_req_vals, "Unknown")); + case 0x0A: /* MAC Address */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_mac_address, tvb, offset, 6, ENC_NA); + break; + default: + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd02_parameter_value, tvb, offset, parameter_length, ENC_NA); + } + break; } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Parameter: %s (0x%02x)", - val_to_str_const(parameter_id, ip_device_routing_cmd_get_param_req_vals, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Length: %d", parameter_length); - offset++; - length--; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } + offset += parameter_length; + length -= parameter_length; } - break; } + break; case 0x03: { - emem_strbuf_t *strbuf; - int i, parameter_id, parameter_length; - int element_length = 1; int framing_rtp = 0; -#define PVT_ROWS 15 -#define PVT_COLS 50 - char parameter_value_tab[PVT_ROWS][PVT_COLS]; /* XXX: Use ep_alloc'd memory */ - - strbuf = ep_strbuf_new_label(NULL); while (length > 0) { - ep_strbuf_truncate(strbuf, 0); - parameter_id = tvb_get_guint8(tvb, offset); parameter_length = tvb_get_ntohs(tvb, offset + 1); + ua3g_param_item = proto_tree_add_uint_format(ua3g_body_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter, tvb, offset, + parameter_length+3, parameter_id, "%s", + val_to_str_const(parameter_id, cs_ip_device_routing_03_parameter_id_tab_vals, "Unknown")); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter, tvb, offset, 1, ENC_NA); + offset++; + length--; + + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_length, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + length -= 2; + if (parameter_length > 0) { switch (parameter_id) { case 0x06: /* Type Of Equipment */ - { - ep_strbuf_append_printf(strbuf, "%s, %s", - val_to_str_const(tvb_get_guint8(tvb, offset + 3), cs_ip_device_routing_cmd03_first_byte_vals, "Unknown"), - val_to_str_const(tvb_get_ntohs(tvb, offset + 3), cs_ip_device_routing_cmd03_second_byte_vals, "Unknown")); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip1, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip2, tvb, offset, 2, ENC_BIG_ENDIAN); + break; case 0x08: /* Local IP Address */ case 0x09: /* Distant IP Address */ case 0x26: /* Firmware Version */ - { - ep_strbuf_append_printf(strbuf, "%d", tvb_get_guint8(tvb, offset + 3)); - for (i = 2; i <= parameter_length; i++) { - ep_strbuf_append(strbuf, "."); - ep_strbuf_append_printf(strbuf, "%u", tvb_get_guint8(tvb, offset+2+i)); - } - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_ip, tvb, offset, 4, ENC_BIG_ENDIAN); + break; case 0x0A: case 0x0B: - { - ep_strbuf_append(strbuf, "\""); - for (i = 1; i <= parameter_length; i++) { - /* XXX: Advancing thru param byte by byte, yet using stringz ?? */ - /* XXX: ! isprint() action same as for isprint() ?? */ - if (isprint(tvb_get_guint8(tvb, offset + 2 + i))) - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+2+i, NULL)); - else - ep_strbuf_append(strbuf, tvb_get_const_stringz(tvb, offset+2+i, NULL)); - } - ep_strbuf_append(strbuf, "\""); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_string, tvb, offset, parameter_length, ENC_NA|ENC_ASCII); + break; case 0x0F: /* Default Codec */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 2 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, - val_to_str_const((guint8)(param_value), str_cs_ip_device_routing_0F_compressor, "Default Codec")); - } else { - ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); - } - - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, 8, ENC_BIG_ENDIAN); + /* XXX - add as expert info ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ } + break; case 0x10: /* VAD */ + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad, tvb, offset, 1, ENC_NA); + break; case 0x11: /* ECE */ - { - ep_strbuf_append_printf(strbuf, "%s", - STR_ON_OFF(tvb_get_guint8(tvb, offset + 3))); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece, tvb, offset, 1, ENC_NA); + break; case 0x12: /* Voice Mode */ - { - if (parameter_length <= 8) { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { /* XXX: Not needed since only LO byte used ? */ - param_value += ((guint64)tvb_get_guint8(tvb, offset + 2 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append(strbuf, - val_to_str_const((guint8)(param_value), cs_ip_device_routing_cmd03_voice_mode_vals, "Unknown")); - } else { - ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); - } - - break; + if (parameter_length <= 8) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, parameter_length, ENC_BIG_ENDIAN); + } else { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, 8, ENC_BIG_ENDIAN); + /* XXX - add as expert info ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ } + break; case 0x1B: /* Delay Distribution */ - { - element_length = 2; - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - g_snprintf(parameter_value_tab[i], PVT_COLS, "%s: %d", - val_to_str_const(i, cs_ip_device_routing_delay_distribution_range_vals, "Unknown"), - tvb_get_ntohs(tvb, offset + 3 + element_length * i)); - } - break; + for (i = 0; i < parameter_length; i += 2) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution, tvb, offset+i, 2, ENC_BIG_ENDIAN); } + break; case 0x1E: /* Consecutive BFI */ - { - element_length = 2; - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - g_snprintf(parameter_value_tab[i], PVT_COLS, "%s: %d", - val_to_str_const(i, cs_ip_device_routing_consecutive_bfi_range_vals, "Unknown"), - tvb_get_ntohs(tvb, offset + 3 + element_length * i)); - } - break; + for (i = 0; i < parameter_length; i += 2) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi, tvb, offset+i, 2, ENC_BIG_ENDIAN); } + break; case 0x1F: /* BFI Distribution */ - { - element_length = 2; - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - g_snprintf(parameter_value_tab[i], PVT_COLS, "%s: %d", - val_to_str_const(i, cs_ip_device_routing_bfi_distribution_range_vals, "Unknown"), - tvb_get_ntohs(tvb, offset + 3 + element_length * i)); - } - break; + for (i = 0; i < parameter_length; i += 2) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution, tvb, offset+i, 2, ENC_BIG_ENDIAN); } + break; case 0x20: /* Jitter Depth Distribution */ - { - element_length = 4; - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - g_snprintf(parameter_value_tab[i], PVT_COLS, "+/- %3d ms: %d", - ((2 * i) + 1) * framing_rtp / 2, - tvb_get_ntohl(tvb, offset + 3 + 4 * i)); - } - break; + for (i = 0; i < parameter_length / 4; i+=4) { + proto_tree_add_uint_format(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution, + tvb, offset+i, 4, tvb_get_ntohl(tvb, offset+i), "Jitter Depth Distribution: +/- %3d ms: %d", + ((2 * i/4) + 1) * framing_rtp / 2, tvb_get_ntohl(tvb, offset+i)); } + break; case 0x2E: /* 802.1 Q Used */ - { - ep_strbuf_append(strbuf, - tvb_get_guint8(tvb, offset + 3) ? "True" : "False"); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021Q_used, tvb, offset, 1, ENC_NA); + break; case 0x2F: /* 802.1p Priority */ - { - ep_strbuf_append_printf(strbuf, "%d", (tvb_get_guint8(tvb, offset + 3) & 0x07)); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021P_priority, tvb, offset, 1, ENC_NA); + break; case 0x30: /* VLAN Id */ - { - ep_strbuf_append_printf(strbuf, "%d", (tvb_get_ntohs(tvb, offset + 3) & 0x0FFF)); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN); + break; case 0x31: /* DiffServ */ - { - ep_strbuf_append_printf(strbuf, "%d (%d)", tvb_get_guint8(tvb, offset + 3), - tvb_get_guint8(tvb, offset + 3)>>2); - break; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_diffserv, tvb, offset, 1, ENC_NA); + break; case 0x3D: /* 200 ms BFI Distribution */ - { - element_length = 2; - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - g_snprintf(parameter_value_tab[i], PVT_COLS, "%s: %d", - val_to_str_const(i, cs_ip_device_routing_200ms_bfi_distribution_range_vals, "Unknown"), - tvb_get_ntohs(tvb, offset + 3 + element_length * i)); - } - break; + for (i = 0; i < parameter_length; i += 2) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution_200ms, tvb, offset+i, 2, ENC_BIG_ENDIAN); } + break; case 0x3E: /* Consecutive RTP Lost */ - { - element_length = 2; - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - g_snprintf(parameter_value_tab[i], PVT_COLS, "%s: %d", - val_to_str_const(i, cs_ip_device_routing_consecutive_rtp_lost_range_vals, "Unknown"), - tvb_get_ntohs(tvb, offset + 3 + element_length * i)); - } - break; + for (i = 0; i < parameter_length; i += 2) { + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_rtp_lost, tvb, offset+i, 2, ENC_BIG_ENDIAN); } + break; case 0x14: /* Received Framing (ms) */ { /* XXX: What is the point of this assignment? */ @@ -4084,103 +3273,18 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, case 0x2A: /* Transmitter SID */ case 0x2D: /* Minimum Delay (ms) */ default: - { - guint64 param_value = 0; - - for (i = parameter_length; i > 0; i--) { - param_value += ((guint64)tvb_get_guint8(tvb, offset + 2 + i) << (8 * (parameter_length - i))); - } - ep_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", param_value); - break; - } - } - } - - switch (parameter_id) - { - /* Case of values in table */ - case 0x1B: - case 0x1E: - case 0x1F: - case 0x20: - case 0x3D: - case 0x3E: - { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 3, "%s:", - val_to_str_ext_const(parameter_id, &cs_ip_device_routing_03_parameter_id_vals_ext, "Unknown")); - proto_tree_add_text(ua3g_body_tree, tvb, offset + 3, - parameter_length, " %s", - val_to_str_const(parameter_id, cs_ip_device_routing_03_parameter_id_tab_vals, "Unknown")); - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, - "Parameter: %s (0x%02x)", - val_to_str_ext_const(parameter_id, &cs_ip_device_routing_03_parameter_id_vals_ext, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 2, - "Length: %d", parameter_length); - offset += 2; - length -= 2; - - for (i = 0; (i < (parameter_length / element_length)) && (i < PVT_ROWS); i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, - element_length, " %s", parameter_value_tab[i]); - offset += element_length; - length -= element_length; - } - if (i >= PVT_ROWS) { - gint length_remaining = parameter_length - PVT_ROWS*element_length; - proto_tree_add_text(ua3g_body_tree, - tvb, offset, length_remaining, - "Unknown Parameter Data"); - offset += length_remaining; - length -= length_remaining; - } + proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_uint, tvb, offset, parameter_length, ENC_BIG_ENDIAN); break; } - default: - { - if (parameter_length > 0) { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 3, "%s: %s", - val_to_str_ext_const(parameter_id, &cs_ip_device_routing_03_parameter_id_vals_ext, "Unknown"), strbuf->str); - } else { - ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, - parameter_length + 3, "%s", - val_to_str_ext_const(parameter_id, &cs_ip_device_routing_03_parameter_id_vals_ext, "Unknown")); - } - ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 1, "Parameter: %s (0x%02x)", - val_to_str_ext_const(parameter_id, &cs_ip_device_routing_03_parameter_id_vals_ext, "Unknown"), parameter_id); - offset++; - length--; - - proto_tree_add_text(ua3g_param_tree, tvb, offset, 2, "Length: %d", parameter_length); - offset += 2; - length -= 2; - - if (parameter_length > 0) { - proto_tree_add_text(ua3g_param_tree, tvb, offset, parameter_length, - "Value: %s", strbuf->str); - offset += parameter_length; - length -= parameter_length; - } - break; - } + offset += parameter_length; + length -= parameter_length; } - } break; } default: - { break; - } } } @@ -4225,32 +3329,31 @@ static const value_string str_unsolicited_msg_hard_config_ip[] = { {0, NULL} }; static const value_string str_unsolicited_msg_hard_config_chip[] = { - {0x00, "Chip Id: Unknown"}, - {0x01, "Chip Id: Ivanoe 1"}, - {0x02, "Chip Id: Ivanoe 2"}, - {0x03, "Chip Id: Reserved"}, + {0x01, "Ivanoe 1"}, + {0x02, "Ivanoe 2"}, + {0x03, "Reserved"}, {0, NULL} }; static const value_string str_unsolicited_msg_hard_config_flash[] = { - {0x00, "Flash Size: No Flash"}, - {0x01, "Flash Size: 128 Kbytes"}, - {0x02, "Flash Size: 256 Kbytes"}, - {0x03, "Flash Size: 512 Kbytes"}, - {0x04, "Flash Size: 1 Mbytes"}, - {0x05, "Flash Size: 2 Mbytes"}, - {0x06, "Flash Size: 4 Mbytes"}, - {0x07, "Flash Size: 8 Mbytes"}, + {0x00, "No Flash"}, + {0x01, "128 Kbytes"}, + {0x02, "256 Kbytes"}, + {0x03, "512 Kbytes"}, + {0x04, "1 Mbytes"}, + {0x05, "2 Mbytes"}, + {0x06, "4 Mbytes"}, + {0x07, "8 Mbytes"}, {0, NULL} }; static const value_string str_unsolicited_msg_hard_config_ram[] = { - {0x00, "External RAM Size: No External RAM"}, - {0x01, "External RAM Size: 128 Kbytes"}, - {0x02, "External RAM Size: 256 Kbytes"}, - {0x03, "External RAM Size: 512 Kbytes"}, - {0x04, "External RAM Size: 1 Mbytes"}, - {0x05, "External RAM Size: 2 Mbytes"}, - {0x06, "External RAM Size: 4 Mbytes"}, - {0x07, "External RAM Size: 8 Mbytes"}, + {0x00, "No External RAM"}, + {0x01, "128 Kbytes"}, + {0x02, "256 Kbytes"}, + {0x03, "512 Kbytes"}, + {0x04, "1 Mbytes"}, + {0x05, "2 Mbytes"}, + {0x06, "4 Mbytes"}, + {0x07, "8 Mbytes"}, {0, NULL} }; @@ -4286,37 +3389,23 @@ static const value_string str_unsolicited_msg_hard_subtype[] = { }; static void -decode_unsolicited_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, - guint offset, guint length, guint8 opcode, - proto_item *ua3g_item, proto_item *ua3g_body_item) +decode_unsolicited_msg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, + guint offset, guint length, guint8 opcode) { guint8 command; - const gchar* command_str; - proto_tree *ua3g_body_tree; + proto_tree *ua3g_body_tree = tree, *ua3g_param_tree; + proto_item *ua3g_param_item; command = tvb_get_guint8(tvb, offset); - command_str = val_to_str_const(command, str_command_unsolicited_msg, "Unknown"); if (opcode != 0x21) { /* add text to the frame "INFO" column */ - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", command_str); - - if (!ua3g_body_item) - return; - - /* add text to the frame tree */ - proto_item_append_text(ua3g_item, ", %s", command_str); - proto_item_append_text(ua3g_body_item, " - %s", command_str); - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", val_to_str_const(command, str_command_unsolicited_msg, "Unknown")); proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_unsolicited_msg, tvb, offset, 1, ENC_NA); offset++; length--; } else { - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); command = 0xFF; /* Opcode = 0x21 */ } @@ -4328,27 +3417,23 @@ decode_unsolicited_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, { int link, vta_type; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Device Type: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_device_type, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_device_type, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, "Firmware Version: %s", - version_number_computer(tvb_get_ntohs(tvb, offset))); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_version, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; length -= 2; if (opcode != 0x21) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Self-Test Result: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_self_test_result, tvb, offset, 1, ENC_NA); offset++; length--; } vta_type = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "VTA Type: %s", - val_to_str_const(vta_type, str_unsolicited_msg_vta_type, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_vta_type, tvb, offset, 1, ENC_NA); offset++; length--; @@ -4358,24 +3443,28 @@ decode_unsolicited_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, case 0x04: case 0x05: { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Characteristic Number: VTA SubType: %s, Generation: %s, Design: %s", - val_to_str_const((((tvb_get_guint8(tvb, offset) & 0xC0) >> 6) + vta_type), str_unsolicited_msg_subtype, "Unknown"), - val_to_str_const(((tvb_get_guint8(tvb, offset) & 0x38) >> 3), str_unsolicited_msg_generation, "Unknown"), - val_to_str_const((tvb_get_guint8(tvb, offset) & 0x07), str_unsolicited_msg_design, "Unknown")); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Characteristic Number"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_char_num_vta_subtype, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_char_num_generation, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_char_num_design, + tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Other Information: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_unsolicited_msg_other_info_2, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_other_information, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Hardware Configuration: VTA Type: %s, Design: %s, VTA SubType: %s", - val_to_str_const((((tvb_get_guint8(tvb, offset) & 0xE0) >> 5) + vta_type), str_unsolicited_msg_hard_vta_type, "Unknown"), - val_to_str_const(((tvb_get_guint8(tvb, offset) & 0x1C) >> 2), str_unsolicited_msg_hard_design, "Unknown"), - val_to_str_const((tvb_get_guint8(tvb, offset) & 0x03), str_unsolicited_msg_hard_subtype, "Unknown")); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Hardware Configuration"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_vta_type, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_design, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_subtype, + tvb, offset, 1, ENC_NA); offset++; length--; @@ -4396,67 +3485,56 @@ decode_unsolicited_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, default: { link = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Other Information 1: %s", - val_to_str_const(link, str_unsolicited_msg_other_info_1, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_other_information_1, tvb, offset, 1, ENC_NA); offset++; length--; if (link == 0x00) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Hardware Version: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_hardware_version, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Hardware Configuration: %s, %s, %s", - val_to_str_const((tvb_get_guint8(tvb, offset) & 0x03), str_unsolicited_msg_hard_config_chip, "Unknown"), - val_to_str_const(((tvb_get_guint8(tvb, offset) & 0x1C) >> 2), str_unsolicited_msg_hard_config_flash, "Unknown"), - val_to_str_const(((tvb_get_guint8(tvb, offset) & 0xE0) >> 5), str_unsolicited_msg_hard_config_ram, "Unknown")); + ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Hardware Configuration"); + ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_hard_config_chip, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_hard_config_flash, + tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_param_tree, hf_ua3g_unsolicited_msg_hardware_config_config_ram, + tvb, offset, 1, ENC_NA); offset++; length--; } else { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Other Information 2: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_unsolicited_msg_other_info_2, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_other_information_2, tvb, offset, 1, ENC_NA); offset++; length--; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Hardware Configuration: %s", - val_to_str_const((tvb_get_guint8(tvb, offset) & 0x01), str_unsolicited_msg_hard_config_ip, "Unknown")); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_hardware_config_hard_config_ip, + tvb, offset, 1, ENC_NA); offset++; length--; } if (opcode != 0x21) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Hook Status: %s Hook", - STR_ON_OFF(tvb_get_guint8(tvb, offset))); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_hook_status, + tvb, offset, 1, ENC_NA); offset++; length--; if (length > 0) { if (link == 0x00) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Firmware Datas Patch Version: %s", - version_number_computer(tvb_get_ntohs(tvb, offset))); - offset += 2; - length -= 2; - - if (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Firmware Version (Loader): %s", - version_number_computer(tvb_get_ntohs(tvb, offset))); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_datas_patch_version, + tvb, offset, 2, ENC_BIG_ENDIAN); + if (length > 2) { + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_version_loader, tvb, + offset+2, 2, ENC_BIG_ENDIAN); } } else { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Datas Version: %s", - version_number_computer(tvb_get_ntohs(tvb, offset))); - offset += 2; - length -= 2; - - if (length > 0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 2, - "Firmware Version (Bootloader): %s", - version_number_computer(tvb_get_ntohs(tvb, offset))); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_datas_version, tvb, offset, 2, ENC_BIG_ENDIAN); + + if (length > 2) { + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_firmware_version_bootloader, + tvb, offset+2, 2, ENC_BIG_ENDIAN); } } } @@ -4468,50 +3546,31 @@ decode_unsolicited_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, } case 0x02: /* Illegal Command Received */ { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Opcode Of Bad Command: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_opcode_of_bad_command, tvb, offset, 1, ENC_NA); - while (length >0) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Next Byte Of Bad Command: %d", tvb_get_guint8(tvb, offset)); - offset++; - length--; + if (length > 1) { + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_next_byte_of_bad_command, tvb, offset+1, length-1, ENC_NA); } break; } case 0x05: /* Subdevice Down */ { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Subdevice Address: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_subdevice_address, tvb, offset, 1, ENC_NA); break; } case 0x06: /* Segment Failure */ { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "T: %d", - (tvb_get_guint8(tvb, offset) & 0x01)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Num: %d", - (tvb_get_guint8(tvb, offset) & 0x02)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "/S: %d", - (tvb_get_guint8(tvb, offset) & 0x04)); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "L: %d", - (tvb_get_guint8(tvb, offset) & 0x08)); - offset++; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Opcode Bad Segment: %d", tvb_get_guint8(tvb, offset)); - offset++; - - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Next Byte Of Bad Segment: %d", - tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_t, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_num, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_s, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_segment_failure_l, tvb, offset, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_opcode_bad_segment, tvb, offset+1, 1, ENC_NA); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_next_byte_of_bad_segment, tvb, offset+2, 1, ENC_NA); break; } case 0x07: /* UA Device Event */ { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Device Event: %d", tvb_get_guint8(tvb, offset)); + proto_tree_add_item(ua3g_body_tree, hf_ua3g_unsolicited_msg_device_event, tvb, offset, 1, ENC_NA); break; } default: @@ -4530,8 +3589,7 @@ decode_unsolicited_msg(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo, ---------------------------------------------------------------------------*/ static void decode_key_number(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode _U_, - proto_item *ua3g_body_item _U_) + guint offset, guint length) { #if 0 proto_tree *ua3g_body_tree; @@ -4548,9 +3606,6 @@ decode_key_number(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, return; if (length > 0) { -#if 0 - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); -#endif proto_tree_add_text(tree, tvb, offset, length, "Key Number: Row %d, Column %d", (tvb_get_guint8(tvb, offset) & 0xF0), (tvb_get_guint8(tvb, offset) & 0x0F)); @@ -4562,18 +3617,9 @@ decode_key_number(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, I'M HERE - 22h - Only for UA NOE (MESSAGE FROM THE TERMINAL) ---------------------------------------------------------------------------*/ static void -decode_i_m_here(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length _U_, guint8 opcode _U_, - proto_item *ua3g_body_item) +decode_i_m_here(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; - - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "Id Code: %s", - val_to_str_const(tvb_get_guint8(tvb, offset), str_device_type, "Unknown")); + proto_tree_add_item(tree, hf_ua3g_i_m_here_id_code, tvb, offset, 1, ENC_NA); } @@ -4586,51 +3632,34 @@ static const value_string str_special_key_parameters[] = { {0x02, "Downloaded Values In Effect"}, {0, NULL} }; -static const value_string str_special_key_status[] = { - {0x00, "Released"}, - {0, NULL} -}; -static const char *const str_special_key_name[] = { - "Shift ", - "Ctrl ", - "Alt ", - "Cmd ", - "Shift'", - "Ctrl' ", - "Alt' ", - "Cmd' " -}; + +const true_false_string tfs_released_pressed = { "Released", "Pressed" }; static void -decode_special_key(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, - guint offset, guint length, guint8 opcode, - proto_item *ua3g_body_item) +decode_special_key(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, + guint offset, guint8 opcode) { - guint8 special_key_status; - proto_tree *ua3g_body_tree; - int i; - - if (!ua3g_body_item) + if (!tree) return; - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); if (opcode == 0x23) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, + proto_tree_add_text(tree, tvb, offset, 1, "Parameters Received for DTMF: %s", val_to_str_const((tvb_get_guint8(tvb, offset) & 0x02), str_special_key_parameters, "Unknown")); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, + proto_tree_add_text(tree, tvb, offset, 1, "Hookswitch Status: %shook", STR_ON_OFF(tvb_get_guint8(tvb, offset) & 0x01)); offset++; - length--; } - special_key_status = tvb_get_guint8(tvb, offset); - for (i = 0; i < 8; i++) { - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s: %s", - str_special_key_name[i], - val_to_str_const(special_key_status & (0x01 << i), str_special_key_status, "Pressed")); - } + proto_tree_add_item(tree, hf_ua3g_special_key_shift, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_ctrl, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_alt, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_cmd, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_shift_prime, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_ctrl_prime, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_alt_prime, tvb, offset, 1, ENC_NA); + proto_tree_add_item(tree, hf_ua3g_special_key_cmd_prime, tvb, offset, 1, ENC_NA); } @@ -4638,26 +3667,19 @@ decode_special_key(proto_tree *tree _U_, tvbuff_t *tvb, packet_info *pinfo _U_, SUBDEVICE STATE ENQUIRY - 24h (MESSAGE FROM THE TERMINAL) ---------------------------------------------------------------------------*/ static void -decode_subdevice_state(proto_tree *tree _U_, tvbuff_t *tvb, - packet_info *pinfo _U_, guint offset, guint length _U_, - guint8 opcode _U_, proto_item *ua3g_body_item) +decode_subdevice_state(proto_tree *tree, tvbuff_t *tvb, + packet_info *pinfo _U_, guint offset) { - proto_tree *ua3g_body_tree; guint8 info; int i; - if (!ua3g_body_item) - return; - - ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); - for (i = 0; i <= 7; i++) { info = tvb_get_guint8(tvb, offset); - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, + proto_tree_add_text(tree, tvb, offset, 1, "Subdevice %d State: %d", i, info & 0x0F); i++; - proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, + proto_tree_add_text(tree, tvb, offset, 1, "Subdevice %d State: %d", i, (info & 0xF0) >> 4); offset++; @@ -4672,9 +3694,8 @@ static void dissect_ua3g(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gint offset = 0; - proto_item *ua3g_item; - proto_tree *ua3g_tree; - proto_item *ua3g_body_item = NULL; + proto_item *ua3g_item, *ua3g_body_item; + proto_tree *ua3g_tree, *ua3g_body_tree; gint length; guint8 opcode; const gchar* opcode_str; @@ -4713,208 +3734,209 @@ dissect_ua3g(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(ua3g_item, ", %s", opcode_str); - if (length > 0) - ua3g_body_item = proto_tree_add_text(ua3g_tree, tvb, offset, - length, "UA3G Body - %s", opcode_str); + if (length > 0) { + ua3g_body_item = proto_tree_add_text(ua3g_tree, tvb, offset, length, "UA3G Body"); + ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body); + } if (message_direction == SYS_TO_TERM) { switch (opcode) { case SC_PRODUCTION_TEST: /* 0x01 */ { - decode_with_one_parameter(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_production_test, ua3g_body_item); + decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_production_test); break; } case SC_SUBDEVICE_RESET: /* 0x06 */ { - decode_with_one_parameter(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_subservice_reset, ua3g_body_item); + decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_subservice_reset); break; } case SC_ARE_YOU_THERE: /* 0x2B */ { - decode_with_one_parameter(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_are_you_there, ua3g_body_item); + decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_are_you_there); break; } case SC_SET_SPEAKER_VOL: /* 0x3B */ { - decode_with_one_parameter(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_set_speaker_vol, ua3g_body_item); + decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_set_speaker_vol); break; } case SC_TRACE_ON: /* 0x42 */ { - decode_with_one_parameter(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_trace_on, ua3g_body_item); + decode_with_one_parameter(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_opcode_trace_on); break; } case SC_SUBDEVICE_ESCAPE: /* 0x02 */ { - decode_subdevice_escape(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_subdevice_escape(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_SOFT_RESET: /* 0x03 */ { - decode_software_reset(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_software_reset(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_IP_PHONE_WARMSTART: /* 0x04 */ { - decode_ip_phone_warmstart(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_ip_phone_warmstart(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_SUPER_MSG: /* 0x0B */ case SC_SUPER_MSG_2: /* 0x17 */ { - decode_super_msg(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_super_msg(ua3g_body_tree, tvb, pinfo, offset, length, opcode); break; } case SC_SEGMENT_MSG: /* 0x0C */ { - decode_segment_msg(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_segment_msg(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_IP_DEVICE_ROUTING: /* 0x13 */ { - decode_ip_device_routing(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_ip_device_routing(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_DEBUG_IN_LINE: /* 0x18 */ { - decode_debug_in_line(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_debug_in_line(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_LED_COMMAND: /* 0x21 */ { - decode_led_command(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_led_command(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_LCD_LINE_1_CMD: /* 0x27 */ case SC_LCD_LINE_2_CMD: /* 0x28 */ { - decode_lcd_line_cmd(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_lcd_line_cmd(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_MAIN_VOICE_MODE: /* 0x29 */ { - decode_main_voice_mode(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_main_voice_mode(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_SUBDEVICE_METASTATE: /* 0x2C */ { - decode_subdevice_metastate(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_subdevice_metastate(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_DWL_DTMF_CLCK_FORMAT: /* 0x30 */ { - decode_dwl_dtmf_clck_format(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_dwl_dtmf_clck_format(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_SET_CLCK: /* 0x31 */ { - decode_set_clck(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_set_clck(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_VOICE_CHANNEL: /* 0x32 */ { - decode_voice_channel(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_voice_channel(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_EXTERNAL_RINGING: /* 0x33 */ { - decode_external_ringing(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_external_ringing(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_LCD_CURSOR: /* 0x35 */ { - decode_lcd_cursor(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_lcd_cursor(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_DWL_SPECIAL_CHAR: /* 0x36 */ { - decode_dwl_special_char(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_dwl_special_char(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_SET_CLCK_TIMER_POS: /* 0x38 */ { - decode_set_clck_timer_pos(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_set_clck_timer_pos(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_SET_LCD_CONTRAST: /* 0x39 */ { - decode_set_lcd_contrast(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_set_lcd_contrast(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_BEEP: /* 0x3C */ { - decode_beep(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_beep(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_SIDETONE: /* 0x3D */ { - decode_sidetone(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_sidetone(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_RINGING_CADENCE: /* 0x3E */ { - decode_ringing_cadence(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_ringing_cadence(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_MUTE: /* 0x3F */ { - decode_mute(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_mute(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_FEEDBACK: /* 0x40 */ { - decode_feedback(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_feedback(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_READ_PERIPHERAL: /* 0x44 */ case SC_WRITE_PERIPHERAL: /* 0x45 */ { - decode_r_w_peripheral(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_r_w_peripheral(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_ICON_CMD: /* 0x47 */ { - decode_icon_cmd(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_icon_cmd(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_AUDIO_CONFIG: /* 0x49 */ { - decode_audio_config(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_audio_config(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_AUDIO_PADDED_PATH: /* 0x4A */ { - decode_audio_padded_path(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_audio_padded_path(ua3g_body_tree, tvb, pinfo, offset); break; } case SC_KEY_RELEASE: /* 0x41 */ { - decode_on_off_level(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_command_key_release, ua3g_item, ua3g_body_item); + decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_key_release); break; } case SC_AMPLIFIED_HANDSET: /* 0x48 */ { - decode_on_off_level(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_command_amplified_handset, ua3g_item, ua3g_body_item); + decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_amplified_handset); break; } case SC_LOUDSPEAKER: /* 0x4D */ { - decode_on_off_level(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_command_loudspeaker, ua3g_item, ua3g_body_item); + decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_loudspeaker); break; } case SC_ANNOUNCE: /* 0x4E */ { - decode_on_off_level(ua3g_tree, tvb, pinfo, offset, length, hf_ua3g_command_announce, ua3g_item, ua3g_body_item); + decode_on_off_level(ua3g_body_tree, tvb, pinfo, offset, length, hf_ua3g_command_announce); break; } case SC_RING: /* 0x4F */ { - decode_ring(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_ring(ua3g_body_tree, tvb, pinfo, offset, length); break; } case SC_UA_DWL_PROTOCOL: /* 0x50 */ { - decode_ua_dwl_protocol(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_ua_dwl_protocol(ua3g_body_tree, tvb, pinfo, offset, length); break; } /* Case for UA3G message with only opcode (No body) */ @@ -4952,33 +3974,33 @@ dissect_ua3g(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) switch (opcode) { case CS_DIGIT_DIALED: /* 0x03 */ { - decode_digit_dialed(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_digit_dialed(ua3g_body_tree, tvb, pinfo, offset); break; } case CS_SUBDEVICE_MSG: /* 0x04 */ { - decode_subdevice_msg(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_subdevice_msg(ua3g_body_tree, tvb, pinfo, offset, length); break; } case CS_SUPER_MSG: /* 0x0B */ case CS_SUPER_MSG_2: /* 0x17 */ { - decode_super_msg(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_super_msg(ua3g_body_tree, tvb, pinfo, offset, length, opcode); break; } case CS_SEGMENT_MSG: /* 0x0C */ { - decode_segment_msg(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_segment_msg(ua3g_body_tree, tvb, pinfo, offset, length); break; } case CS_IP_DEVICE_ROUTING: /* 0x13 */ { - decode_cs_ip_device_routing(ua3g_tree, tvb, pinfo, offset, length, opcode,ua3g_item, ua3g_body_item); + decode_cs_ip_device_routing(ua3g_body_tree, tvb, pinfo, offset, length); break; } case CS_DEBUG_IN_LINE: /* 0x18 */ { - decode_debug_in_line(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_debug_in_line(ua3g_body_tree, tvb, pinfo, offset, length); break; } case CS_NON_DIGIT_KEY_PUSHED: /* 0x20 Key translation not sure */ @@ -4986,39 +4008,39 @@ dissect_ua3g(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case CS_KEY_RELEASED: /* 0x2A */ case CS_TM_KEY_PUSHED: /* 0x2D Key translation not sure */ { - decode_key_number(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_key_number(ua3g_body_tree, tvb, pinfo, offset, length); break; } case CS_UNSOLICITED_MSG: /* 0x9F (0x1F) */ case CS_VERSION_RESPONSE: /* 0x21 */ { - decode_unsolicited_msg(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_unsolicited_msg(ua3g_body_tree, tvb, pinfo, offset, length, opcode); break; } case CS_I_M_HERE: /* 0x22 */ { - decode_i_m_here(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_i_m_here(ua3g_body_tree, tvb, pinfo, offset); break; } case CS_RSP_STATUS_INQUIRY: /* 0x23 */ case CS_SPECIAL_KEY_STATUS: /* 0x29 */ { - decode_special_key(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_special_key(ua3g_body_tree, tvb, pinfo, offset, opcode); break; } case CS_SUBDEVICE_STATE: /* 0x24 */ { - decode_subdevice_state(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_subdevice_state(ua3g_body_tree, tvb, pinfo, offset); break; } case CS_PERIPHERAL_CONTENT: /* 0x2B */ { - decode_r_w_peripheral(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_body_item); + decode_r_w_peripheral(ua3g_body_tree, tvb, pinfo, offset, length); break; } case CS_UA_DWL_PROTOCOL: /* 0x50 */ { - decode_ua_dwl_protocol(ua3g_tree, tvb, pinfo, offset, length, opcode, ua3g_item, ua3g_body_item); + decode_ua_dwl_protocol(ua3g_body_tree, tvb, pinfo, offset, length); break; } /* Case for UA3G message with only opcode (No body) */ @@ -5194,6 +4216,308 @@ proto_register_ua3g(void) FT_UINT8, BASE_HEX, VALS(str_command_unsolicited_msg), 0x00, NULL, HFILL } }, + { &hf_ua3g_ip_device_routing_stop_rtp_parameter, + { "Parameter", "ua3g.ip.stop_rtp.parameter", + FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_stop_rtp_vals), 0x00, + NULL, HFILL } + }, + { &hf_ua3g_ip_device_routing_stop_rtp_parameter_length, + { "Length", "ua3g.ip.stop_rtp.parameter.length", + FT_UINT8, BASE_DEC, NULL, 0x00, + NULL, HFILL } + }, + { &hf_ua3g_ip_device_routing_stop_rtp_parameter_value_num, + { "Value", "ua3g.ip.stop_rtp.parameter.value.num", + FT_UINT64, BASE_HEX, NULL, 0x00, + NULL, HFILL } + }, + { &hf_ua3g_ip_device_routing_stop_rtp_parameter_value_bytes, + { "Value", "ua3g.ip.stop_rtp.parameter.value.bytes", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + /* Generated from convert_proto_tree_add_text.pl */ + { &hf_ua3g_subdevice_address, { "Subdevice Address", "ua3g.subdevice.address", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }}, + { &hf_ua3g_subdevice_opcode, { "Subdevice Opcode", "ua3g.subdevice.opcode", FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL }}, + { &hf_ua3g_subdevice_parameter_bytes, { "Parameter Bytes", "ua3g.subdevice.parameter_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_software_reset, { "Software Reset", "ua3g.software_reset", FT_UINT8, BASE_DEC, VALS(software_reset_verswitch_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_phone_warmstart, { "IP Phone Warmstart", "ua3g.ip_phone_warmstart", FT_UINT8, BASE_DEC, VALS(str_command_ip_phone_warmstart), 0x0, NULL, HFILL }}, + { &hf_ua3g_super_msg_length, { "Length", "ua3g.super_msg.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_super_msg_data, { "Data", "ua3g.super_msg.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_segment_msg_num_remaining, { "Number Of Remaining Segments", "ua3g.segment_msg.num_remaining", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }}, + { &hf_ua3g_segment_msg_length, { "Length", "ua3g.segment_msg.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_segment_message_data, { "Segment Message Data", "ua3g.segment_message.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter, { "Parameter", "ua3g.ip.reset.parameter", FT_UINT8, BASE_DEC, VALS(ip_device_routing_cmd_reset_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_length, { "Length", "ua3g.ip.reset.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_direction, { "Direction", "ua3g.ip.start_rtp.direction", FT_UINT8, BASE_DEC, VALS(start_rtp_str_direction), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter, { "Parameter", "ua3g.ip.start_rtp.parameter", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ip_device_routing_cmd_start_rtp_vals_ext, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_length, { "Length", "ua3g.ip.start_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_redirect_parameter, { "Parameter", "ua3g.ip.redirect.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_redirect_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_redirect_parameter_length, { "Length", "ua3g.ip.redirect.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_def_tones_num_entries, { "Number Of Entries", "ua3g.ip.def_tones.num_entries", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_def_tones_frequency_1, { "Frequency 1 (Hz)", "ua3g.ip.def_tones.frequency_1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_def_tones_level_1, { "Level 1 (dB)", "ua3g.ip.def_tones.level_1", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_def_tones_frequency_2, { "Frequency 2 (Hz)", "ua3g.ip.def_tones.frequency_2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_def_tones_level_2, { "Level 2 (dB)", "ua3g.ip.def_tones.level_2", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_tone_direction, { "Direction", "ua3g.ip.start_tone.direction", FT_UINT8, BASE_DEC, VALS(ip_device_routing_tone_direction_vals), 0xC0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_tone_num_entries, { "Number of entries", "ua3g.ip.start_tone.num_entries", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_tone_identification, { "Identification", "ua3g.ip.start_tone.identification", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_tone_duration, { "Duration (ms)", "ua3g.ip.start_tone.duration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_listen_rtp_parameter, { "Parameter", "ua3g.ip.listen_rtp.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_listen_rtp_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_listen_rtp_parameter_length, { "Length", "ua3g.ip.listen_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_get_param_req_parameter, { "Parameter", "ua3g.ip.get_param_req.parameter", FT_UINT8, BASE_DEC, VALS(ip_device_routing_cmd_get_param_req_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter, { "Parameter", "ua3g.ip.set_param_req.parameter", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ip_device_routing_cmd_set_param_req_vals_ext, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_length, { "Length", "ua3g.ip.set_param_req.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_digit_value, { "Digit Value", "ua3g.ip.digit_value", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &str_digit_ext, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter, { "Parameter", "ua3g.ip.pause_restart_rtp.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_pause_restart_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_length, { "Length", "ua3g.ip.pause_restart_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_value, { "Value", "ua3g.ip.pause_restart_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter, { "Parameter", "ua3g.ip.start_stop_record_rtp.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_record_rtp_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_length, { "Length", "ua3g.ip.start_stop_record_rtp.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_debug_in_line, { "Text String With Debug", "ua3g.debug_in_line", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_command_led_number, { "Led Number", "ua3g.command.led.number", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options, { "LCD Options", "ua3g.command.lcd_line.lcd_options", FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_starting_column, { "Starting Column", "ua3g.command.lcd_line.starting_column", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_tune, { "Tune", "ua3g.main_voice_mode.tune", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_cadence, { "Cadence", "ua3g.main_voice_mode.cadence", FT_UINT8, BASE_DEC, VALS(str_cadence), 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_speaker_volume, { "Speaker Volume", "ua3g.main_voice_mode.speaker_volume", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_microphone_volume, { "Microphone Volume", "ua3g.main_voice_mode.microphone_volume", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_sending_level, { "Sending Level (dB)", "ua3g.main_voice_mode.sending_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_handset_level, { "Receiving Level (dB)", "ua3g.main_voice_mode.handset_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_headset_level, { "Receiving Level (dB)", "ua3g.main_voice_mode.headset_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_main_voice_mode_handsfree_level, { "Sending Level (dB)", "ua3g.main_voice_mode.handsfree_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_subdevice_metastate_subchannel_address, { "Subchannel Address", "ua3g.subdevice_metastate.subchannel_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_subdevice_metastate_new_metastate, { "New Metastate", "ua3g.subdevice_metastate.new_metastate", FT_UINT8, BASE_DEC, VALS(str_new_metastate), 0x0, NULL, HFILL }}, + { &hf_ua3g_dwl_dtmf_clck_format_minimum_on_time, { "Minimum 'ON' Time (ms)", "ua3g.dwl_dtmf_clck_format.minimum_on_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_dwl_dtmf_clck_format_inter_digit_pause_time, { "Inter-Digit Pause Time (ms)", "ua3g.dwl_dtmf_clck_format.inter_digit_pause_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_dwl_dtmf_clck_format_clock_time_format, { "Clock Time Format", "ua3g.dwl_dtmf_clck_format.clock_time_format", FT_UINT8, BASE_DEC, VALS(str_clock_format), 0x0, NULL, HFILL }}, + { &hf_ua3g_dwl_dtmf_clck_format_dtmf_country_adaptation, { "DTMF Country Adaptation", "ua3g.dwl_dtmf_clck_format.dtmf_country_adaptation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_voice_channel_channel_mode, { "Channel Mode", "ua3g.voice_channel.channel_mode", FT_BOOLEAN, 8, TFS(&tfs_voice_channel_channel_mode), 0x01, NULL, HFILL }}, + { &hf_ua3g_voice_channel_codec, { "Codec", "ua3g.voice_channel.codec", FT_BOOLEAN, 8, TFS(&tfs_voice_channel_codec), 0x02, NULL, HFILL }}, + { &hf_ua3g_voice_channel_voice_channel, { "Voice Channel", "ua3g.voice_channel.voice_channel", FT_BOOLEAN, 8, TFS(&tfs_voice_channel_voice_channel), 0x04, NULL, HFILL }}, + { &hf_ua3g_voice_channel_main_voice, { "Main Voice", "ua3g.voice_channel.main_voice", FT_UINT8, BASE_DEC, VALS(str_voice_channel), 0x0, NULL, HFILL }}, + { &hf_ua3g_voice_channel_announce, { "Announce", "ua3g.voice_channel.announce", FT_UINT8, BASE_DEC, VALS(str_voice_channel), 0x0, NULL, HFILL }}, + { &hf_ua3g_voice_channel_b_general, { "B General", "ua3g.voice_channel.b_general", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_voice_channel_b_loud_speaker, { "B Loud Speaker", "ua3g.voice_channel.b_loud_speaker", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_voice_channel_b_ear_piece, { "B Ear Piece", "ua3g.voice_channel.b_ear_piece", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_voice_channel_b_microphones, { "B Microphones", "ua3g.voice_channel.b_microphones", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_lcd_cursor_line_number, { "Line Number", "ua3g.lcd_cursor.line_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_dwl_special_char_character_number, { "Character Number", "ua3g.dwl_special_char.character_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_dwl_special_char_byte, { "Byte", "ua3g.dwl_special_char.byte", FT_UINT8, BASE_DEC, NULL, 0xFF, NULL, HFILL }}, + { &hf_ua3g_set_clck_timer_pos_clock_line_number, { "Clock Line Number", "ua3g.set_clck_timer_pos.clock_line_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_set_clck_timer_pos_clock_column_number, { "Clock Column Number", "ua3g.set_clck_timer_pos.clock_column_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_set_clck_timer_pos_call_timer_line_number, { "Call Timer Line Number", "ua3g.set_clck_timer_pos.call_timer_line_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_set_clck_timer_pos_call_timer_column_number, { "Call Timer Column Number", "ua3g.set_clck_timer_pos.call_timer_column_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_set_lcd_contrast_driver_number, { "Driver Number", "ua3g.set_lcd_contrast.driver_number", FT_UINT8, BASE_DEC, VALS(str_driver_number), 0x0, NULL, HFILL }}, + { &hf_ua3g_set_lcd_contrast_contrast_value, { "Contrast Value", "ua3g.set_lcd_contrast.contrast_value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_beep_destination, { "Destination", "ua3g.command.beep.destination", FT_UINT8, BASE_DEC, VALS(str_beep_start_destination), 0x0, NULL, HFILL }}, + { &hf_ua3g_beep_on_off, { "On / Off", "ua3g.command.beep.on_off", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x80, NULL, HFILL }}, + { &hf_ua3g_beep_cadence, { "Cadence", "ua3g.command.beep.cadence", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_beep_beep_number, { "Beep Number", "ua3g.command.beep.beep_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_beep_number_of_notes, { "Number Of Notes", "ua3g.command.beep.number_of_notes", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_beep_terminator, { "Terminator", "ua3g.command.beep.terminator", FT_UINT8, BASE_DEC, VALS(str_beep_terminator), 0x0, NULL, HFILL }}, + { &hf_ua3g_sidetone_level, { "Level", "ua3g.command.sidetone.level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ringing_cadence_cadence, { "Cadence", "ua3g.ringing_cadence.cadence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ringing_cadence_on_off, { "On / Off", "ua3g.ringing_cadence.on_off", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x80, NULL, HFILL }}, + { &hf_ua3g_ringing_cadence_length, { "Length (ms)", "ua3g.ringing_cadence.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_feedback_level, { "Level (dB)", "ua3g.command.feedback.level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_feedback_duration, { "Duration (ms)", "ua3g.command.feedback.duration", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_r_w_peripheral_address, { "Address", "ua3g.r_w_peripheral.address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_r_w_peripheral_content, { "Content", "ua3g.r_w_peripheral.content", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_icon_cmd_icon_number, { "Icon Number", "ua3g.icon_cmd.icon_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_icon_cmd_segment, { "Segment", "ua3g.icon_cmd.segment", FT_UINT16, BASE_DEC, VALS(str_icon_cmd_state), 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_ignored, { "Ignored", "ua3g.command.audio_config.ignored", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_law, { "Law", "ua3g.command.audio_config.law", FT_UINT8, BASE_DEC, VALS(str_audio_coding_law), 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_volume_level, { "Volume Level", "ua3g.command.audio_config.volume_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_handsfree_return, { "Return", "ua3g.command.audio_config.handsfree_return", FT_BOOLEAN, 8, TFS(&tfs_audio_config_handsfree_return), 0x01, NULL, HFILL }}, + { &hf_ua3g_audio_config_handsfree_handsfree, { "Handsfree", "ua3g.command.audio_config.handsfree", FT_BOOLEAN, 8, TFS(&tfs_audio_config_handsfree_handsfree), 0x02, NULL, HFILL }}, + { &hf_ua3g_audio_padded_path_emission_padded_level, { "Emission Padded Level", "ua3g.audio_padded_path.emission_padded_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_padded_path_reception_padded_level, { "Reception Padded Level", "ua3g.audio_padded_path.reception_padded_level", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_on_off_level_level_on_loudspeaker, { "Level on Loudspeaker (dB)", "ua3g.on_off_level.level_on_loudspeaker", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ring_melody, { "Melody", "ua3g.command.ring.melody", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ring_cadence, { "Cadence", "ua3g.command.ring.cadence", FT_UINT8, BASE_DEC, VALS(str_cadence), 0x0, NULL, HFILL }}, + { &hf_ua3g_ring_speaker_level, { "Speaker level (dB)", "ua3g.command.ring.speaker_level", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ring_beep_number, { "Beep number", "ua3g.command.ring.beep_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ring_silent, { "Silent", "ua3g.command.ring.silent", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x80, NULL, HFILL }}, + { &hf_ua3g_ring_progressive, { "Progressive", "ua3g.command.ring.progressive", FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_item_identifier, { "Item Identifier", "ua3g.ua_dwl_protocol.item_identifier", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_cause, { "Cause", "ua3g.ua_dwl_protocol.cause", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_force_mode, { "Force Mode", "ua3g.ua_dwl_protocol.force_mode", FT_UINT8, BASE_DEC, VALS(str_download_req_force_mode), 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_item_version, { "Item Version", "ua3g.ua_dwl_protocol.item_version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_item_version_nc, { "Item Version", "ua3g.ua_dwl_protocol.item_version", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_binary_length, { "Binary Length", "ua3g.ua_dwl_protocol.binary_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_packet_number, { "Packet Number", "ua3g.ua_dwl_protocol.packet_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_download_ack_status, { "Status", "ua3g.ua_dwl_protocol.download_ack_status", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &str_download_ack_status_ext, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_packet_download_end_ack_ok_status, { "Status", "ua3g.ua_dwl_protocol_packet.download_end_ack_ok_status", FT_UINT8, BASE_DEC, VALS(str_download_end_ack_ok), 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_checksum, { "Checksum", "ua3g.ua_dwl_protocol.checksum", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_acknowledge, { "Acknowledge", "ua3g.ua_dwl_protocol.acknowledge", FT_UINT8, BASE_DEC, VALS(str_iso_checksum_ack_status), 0x0, NULL, HFILL }}, + { &hf_ua3g_digit_dialed_digit_value, { "Digit Value", "ua3g.digit_dialed.digit_value", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &str_digit_ext, 0x0, NULL, HFILL }}, + { &hf_ua3g_subdevice_msg_subdev_type, { "Subdev Type", "ua3g.subdevice_msg.subdev_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_subdevice_msg_subdev_address, { "Subdev Address", "ua3g.subdevice_msg.subdev_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_subdevice_msg_subdevice_opcode, { "Subdevice Opcode", "ua3g.subdevice_msg.subdevice_opcode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_subdevice_msg_parameter_bytes, { "Parameter Bytes", "ua3g.subdevice_msg.parameter_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd00_vta_type, { "VTA Type", "ua3g.ip.cs.cmd00.vta_type", FT_UINT8, BASE_DEC, VALS(str_cs_ip_device_routing_vta_type), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd00_characteristic_number, { "Characteristic Number", "ua3g.ip.cs.cmd00.characteristic_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd01_incident_0, { "Incident 0", "ua3g.ip.cs.cmd01.incident_0", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter, { "Parameter", "ua3g.ip.cs.cmd02.parameter", FT_UINT8, BASE_HEX, VALS(ip_device_routing_cmd_get_param_req_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_length, { "Length", "ua3g.ip.cs.cmd02.parameter.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter, { "Parameter", "ua3g.ip.cs.cmd03.parameter", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &cs_ip_device_routing_03_parameter_id_vals_ext, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_length, { "Length", "ua3g.ip.cs.cmd03.parameter.length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_device_type, { "Device Type", "ua3g.unsolicited_msg.device_type", FT_UINT8, BASE_DEC, VALS(str_device_type), 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_self_test_result, { "Self-Test Result", "ua3g.unsolicited_msg.self_test_result", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_vta_type, { "VTA Type", "ua3g.unsolicited_msg.vta_type", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_vta_type), 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_other_information, { "Other Information", "ua3g.unsolicited_msg.other_information", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_other_info_2), 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_other_information_1, { "Other Information 1", "ua3g.unsolicited_msg.other_information_1", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_other_info_1), 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_version, { "Hardware Version", "ua3g.unsolicited_msg.hardware_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_other_information_2, { "Other Information 2", "ua3g.unsolicited_msg.other_information_2", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_other_info_2), 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_firmware_datas_patch_version, { "Firmware Datas Patch Version", "ua3g.unsolicited_msg.firmware_datas_patch_version", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_firmware_version_loader, { "Firmware Version (Loader)", "ua3g.unsolicited_msg.firmware_version_loader", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_firmware_version, { "Firmware Version", "ua3g.unsolicited_msg.firmware_version", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_datas_version, { "Datas Version", "ua3g.unsolicited_msg.datas_version", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_firmware_version_bootloader, { "Firmware Version (Bootloader)", "ua3g.unsolicited_msg.firmware_version_bootloader", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_opcode_of_bad_command, { "Opcode Of Bad Command", "ua3g.unsolicited_msg.opcode_of_bad_command", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_next_byte_of_bad_command, { "Next Byte Of Bad Command", "ua3g.unsolicited_msg.next_byte_of_bad_command", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_subdevice_address, { "Subdevice Address", "ua3g.unsolicited_msg.subdevice_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_segment_failure_t, { "T", "ua3g.unsolicited_msg.segment_failure.t", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_segment_failure_num, { "Num", "ua3g.unsolicited_msg.segment_failurenum", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_segment_failure_s, { "/S", "ua3g.unsolicited_msg.segment_failure.s", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_segment_failure_l, { "L", "ua3g.unsolicited_msg.segment_failure.l", FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_opcode_bad_segment, { "Opcode Bad Segment", "ua3g.unsolicited_msg.opcode_bad_segment", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_next_byte_of_bad_segment, { "Next Byte Of Bad Segment", "ua3g.unsolicited_msg.next_byte_of_bad_segment", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_device_event, { "Device Event", "ua3g.unsolicited_msg.device_event", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_i_m_here_id_code, { "Id Code", "ua3g.i_m_here.id_code", FT_UINT8, BASE_DEC, VALS(str_device_type), 0x0, NULL, HFILL }}, + { &hf_ua3g_segment_msg_segment, { "F/S", "ua3g.segment_msg.segment", FT_BOOLEAN, 8, TFS(&tfs_segment_msg_segment), 0x80, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update, { "NOE Update Mode", "ua3g.ip.reset.parameter.noe_update", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_bootloader, { "Bootloader", "ua3g.ip.reset.parameter.noe_update.bootloader", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_data, { "Data", "ua3g.ip.reset.parameter.noe_update.data", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_customization, { "Customization", "ua3g.ip.reset.parameter.noe_update.customization", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_localization, { "Localization", "ua3g.ip.reset.parameter.noe_update.localization", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_code, { "Code", "ua3g.ip.reset.parameter.noe_update.code", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_noe_update_sip, { "SIP", "ua3g.ip.reset.parameter.noe_update.sip", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_bad_sec_mode, { "Bad Sec Mode", "ua3g.ip.reset.parameter.bad_sec_mode", FT_UINT8, BASE_DEC, VALS(reset_param_bad_sec_mode), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_value, { "Value", "ua3g.ip.reset.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_cust_name, { "Cust_Name", "ua3g.ip.reset.parameter.cust_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_reset_parameter_l10n_name, { "L10N_Name", "ua3g.ip.reset.parameter.l10n_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_value, { "Value", "ua3g.ip.start_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_ip, { "IP", "ua3g.ip.start_rtp.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, { "Compressor", "ua3g.ip.start_rtp.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(str_start_rtp_compressor), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_enabler, { "Enabler", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos, { "Must Send QOS Tickets", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_uint, { "Value", "ua3g.ip.start_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_dtmf_sending, { "Send DTMF", "ua3g.ip.start_rtp.parameter.dtmf_sending", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_rfc2198, { "Enable RFC 2198", "ua3g.ip.start_rtp.parameter.rfc2198", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_rtp_parameter_srtp_encryption, { "Enable SRTP Encryption", "ua3g.ip.start_rtp.parameter.srtp_encryption", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_redirect_parameter_value, { "Value", "ua3g.ip.redirect.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_redirect_parameter_ip, { "IP", "ua3g.ip.redirect.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_redirect_parameter_uint, { "Value", "ua3g.ip.redirect.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_listen_rtp_parameter_value, { "Value", "ua3g.ip.listen_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_listen_rtp_parameter_ip, { "IP", "ua3g.ip.listen_rtp.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_listen_rtp_parameter_port, { "Port", "ua3g.ip.listen_rtp.parameter.port", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_value, { "Value", "ua3g.ip.set_param_req.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_tftp_backup_ip, { "TFTP Backup IP", "ua3g.ip.set_param_req.parameter.tftp_backup_ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_uint, { "Value", "ua3g.ip.set_param_req.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_err_string, { "Value", "ua3g.ip.set_param_req.parameter.err_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_compressor, { "Compressor", "ua3g.ip.set_param_req.parameter.compressor", FT_UINT8, BASE_DEC, VALS(str_set_param_req_compressor), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_set_pc_port_status, { "Set PC Port status", "ua3g.ip.set_param_req.parameter.set_pc_port_status", FT_UINT8, BASE_DEC, VALS(str_set_pc_port_status), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_record_rtp_auth, { "Record RTP Authorization", "ua3g.ip.set_param_req.parameter.record_rtp_auth", FT_UINT8, BASE_DEC, VALS(str_enable_feature), 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_set_param_req_parameter_security_flag_filter, { "Filtering", "ua3g.ip.set_param_req.parameter.security_flag.filter", FT_BOOLEAN, 8, TFS(&tfs_active_inactive), 0x01, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_pause_restart_rtp_parameter_uint, { "Value", "ua3g.ip.pause_restart_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_value, { "Value", "ua3g.ip.start_stop_record_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_remote_ip, { "Remote IP", "ua3g.ip.start_stop_record_rtp.parameter.remote_ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ip_device_routing_start_stop_record_rtp_parameter_uint, { "Value", "ua3g.ip.start_stop_record_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_dpi_chan_ua_tx1, { "UA Channel UA-TX1", "ua3g.command.audio_config.dpi_chan.ua_tx1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_dpi_chan_ua_tx2, { "UA Channel UA-TX2", "ua3g.command.audio_config.dpi_chan.ua_tx2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_dpi_chan_gci_tx1, { "GCI Channel GCI-TX1", "ua3g.command.audio_config.dpi_chan.gci_tx1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_dpi_chan_gci_tx2, { "GCI Channel GCI-TX2", "ua3g.command.audio_config.dpi_chan.gci_tx2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_dpi_chan_cod_tx, { "Codec Channel COD-TX", "ua3g.command.audio_config.dpi_chan.cod_tx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_dth, { "Anti-Distortion Coeff 1(DTH)", "ua3g.command.audio_config.audio_circuit.dth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_dtr, { "Anti-Distortion Coeff 2(DTR)", "ua3g.command.audio_config.audio_circuit.dtr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_dtf, { "Anti-Distortion Coeff 3(DTF)", "ua3g.command.audio_config.audio_circuit.dtf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_str, { "Sidetone Attenuation (STR)", "ua3g.command.audio_config.audio_circuit.str", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_ahp1, { "Anti-Larsen Coeff 1 (AHP1)", "ua3g.command.audio_config.audio_circuit.ahp1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_ahp2, { "Anti-Larsen Coeff 2 (AHP2)", "ua3g.command.audio_config.audio_circuit.ahp2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_ath, { "Anti-Larsen Coeff 3 (ATH)", "ua3g.command.audio_config.audio_circuit.ath", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_atr, { "Anti-Larsen Coeff 4 (ATR)", "ua3g.command.audio_config.audio_circuit.atr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_atf, { "Anti-Larsen Coeff 5 (ATF)", "ua3g.command.audio_config.audio_circuit.atf", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_audio_circuit_alm, { "Anti-Larsen Coeff 6 (ALM)", "ua3g.command.audio_config.audio_circuit.alm", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_group_listen, { "Group Listening Attenuation Constant", "ua3g.command.audio_config.loudspeaker_aco_param.group_listen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_attenuation, { "Handsfree Attenuation Constant", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_attenuation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_stay_in_send, { "Handsfree Number Of ms To Stay In Send State Before Going To Another State", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_stay_in_send", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mtx, { "Handsfree Number Of Positions To Shift Right MTx", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_shift_right_mtx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_shift_right_mrc, { "Handsfree Number Of Positions To Shift Right MRc", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_shift_right_mrc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_trans_threshold, { "Handsfree Idle Transmission Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_idle_trans_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_trans_threshold, { "Handsfree Low Transmission Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_low_trans_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_idle_recv_threshold, { "Handsfree Idle Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_idle_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_low_recv_threshold, { "Handsfree Low Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_low_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_med_recv_threshold, { "Handsfree Medium Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_med_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_audio_config_loudspeaker_aco_param_handsfree_high_recv_threshold, { "Handsfree High Reception Threshold", "ua3g.command.audio_config.loudspeaker_aco_param.handsfree_high_recv_threshold", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_files_inc_boot_binary, { "Boot Binary Included", "ua3g.ua_dwl_protocol.files_inc.boot_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_files_inc_loader_binary, { "Loader Binary Included", "ua3g.ua_dwl_protocol.files_inc.loader_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_files_inc_appli_binary, { "Appli Binary Included", "ua3g.ua_dwl_protocol.files_inc.appli_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_files_inc_data_binary, { "Datas Binary Included", "ua3g.ua_dwl_protocol.files_inc.data_binary", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_model_selection_a, { "For A Model", "ua3g.ua_dwl_protocol.model_selection.a", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_model_selection_b, { "For B Model", "ua3g.ua_dwl_protocol.model_selection.b", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_model_selection_c, { "For C Model", "ua3g.ua_dwl_protocol.model_selection.c", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_model_selection_country_ver, { "Country Version", "ua3g.ua_dwl_protocol.model_selection.country_ver", FT_UINT8, BASE_DEC, VALS(str_download_req_mode_selection_country), 0xE0, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe1, { "For Ivanoe 1", "ua3g.ua_dwl_protocol.hardware_selection.ivanoe1", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_hardware_selection_ivanoe2, { "For Ivanoe 2", "ua3g.ua_dwl_protocol.hardware_selection.ivanoe2", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_memory_sizes_flash, { "Flash Min Size", "ua3g.ua_dwl_protocol.memory_sizes.flash", FT_UINT8, BASE_DEC, VALS(str_mem_size), 0x07, NULL, HFILL }}, + { &hf_ua3g_ua_dwl_protocol_memory_sizes_ext_ram, { "External Ram Min Size", "ua3g.ua_dwl_protocol.memory_sizes.ext_ram", FT_UINT8, BASE_DEC, VALS(str_mem_size), 0x38, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_char_num_vta_subtype, { "VTA SubType", "ua3g.unsolicited_msg.char_num.vta_subtype", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_subtype), 0xC0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_char_num_generation, { "Generation", "ua3g.unsolicited_msg.char_num.generation", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_generation), 0x38, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_char_num_design, { "Design", "ua3g.unsolicited_msg.char_num.design", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_design), 0x07, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_vta_type, { "VTA Type", "ua3g.unsolicited_msg.hardware_config.vta_type", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_vta_type), 0xE0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_design, { "Design", "ua3g.unsolicited_msg.hardware_config.design", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_design), 0x1C, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_subtype, { "VTA SubType", "ua3g.unsolicited_msg.hardware_config.subtype", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_subtype), 0x03, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_hard_config_chip, { "Chip Id", "ua3g.unsolicited_msg.hardware_config.hard_config_chip", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_chip), 0x03, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_hard_config_flash, { "Flash Size", "ua3g.unsolicited_msg.hardware_config.hard_config_flash", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_flash), 0x1C, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_config_ram, { "External RAM Size", "ua3g.unsolicited_msg.hardware_config.config_ram", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_ram), 0xE0, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hardware_config_hard_config_ip, { "Hardware Configuration", "ua3g.unsolicited_msg.hardware_config.ip", FT_UINT8, BASE_DEC, VALS(str_unsolicited_msg_hard_config_ip), 0x01, NULL, HFILL }}, + { &hf_ua3g_unsolicited_msg_hook_status, { "Hook Status", "ua3g.unsolicited_msg.hook_status", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x00, NULL, HFILL }}, + { &hf_ua3g_special_key_shift, { "Shift", "ua3g.special_key.shift", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x01, NULL, HFILL }}, + { &hf_ua3g_special_key_ctrl, { "Ctrl", "ua3g.special_key.ctrl", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x02, NULL, HFILL }}, + { &hf_ua3g_special_key_alt, { "Alt", "ua3g.special_key.alt", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x04, NULL, HFILL }}, + { &hf_ua3g_special_key_cmd, { "Cmd", "ua3g.special_key.cmd", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x08, NULL, HFILL }}, + { &hf_ua3g_special_key_shift_prime, { "Shift'", "ua3g.special_key.shift_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x10, NULL, HFILL }}, + { &hf_ua3g_special_key_ctrl_prime, { "Ctrl'", "ua3g.special_key.ctrl_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x20, NULL, HFILL }}, + { &hf_ua3g_special_key_alt_prime, { "Alt'", "ua3g.special_key.alt_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x40, NULL, HFILL }}, + { &hf_ua3g_special_key_cmd_prime, { "Cmd'", "ua3g.special_key.cmd_prime", FT_BOOLEAN, 8, TFS(&tfs_released_pressed), 0x80, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options_call_timer, { "Call Timer", "ua3g.lcd_line_cmd.lcd_options.call_timer", FT_UINT8, BASE_DEC, VALS(str_call_timer_ctrl), 0x03, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options_blink, { "Blink", "ua3g.lcd_line_cmd.lcd_options.blink", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options_call_timer_control, { "Call Timer Control", "ua3g.lcd_line_cmd.lcd_options.call_timer_control", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options_call_timer_display, { "Call Timer Display", "ua3g.lcd_line_cmd.lcd_options.call_timer_display", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options_time_of_day_display, { "Time Of Day Display", "ua3g.lcd_line_cmd.lcd_options.time_of_day_display", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x40, NULL, HFILL }}, + { &hf_ua3g_lcd_line_cmd_lcd_options_suspend_display_refresh, { "Suspend Display Refresh", "ua3g.lcd_line_cmd.lcd_options.suspend_display_refresh", FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_value, { "Value", "ua3g.ip.cs.cmd02.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_ip, { "IP", "ua3g.ip.cs.cmd02.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_mac_address, { "MAC Address", "ua3g.ip.cs.cmd02.parameter.mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_uint, { "Value", "ua3g.ip.cs.cmd02.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_bytes, { "Default Codec", "ua3g.ip.cs.cmd02.parameter.default_codec.bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_default_codec_uint, { "Default Codec", "ua3g.ip.cs.cmd02.parameter.default_codec.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_firmware_version, { "Firmware Version", "ua3g.ip.cs.cmd02.parameter.firmware_version", FT_UINT16, BASE_CUSTOM, version_number_computer, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_speed, { "Port Lan Speed", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_lan_speed", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_lan_duplex, { "Port Lan Duplex", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_lan_duplex", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_speed, { "Port PC Speed", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_pc_speed", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd02_parameter_eth_driver_config_port_pc_duplex, { "Port PC Duplex", "ua3g.ip.cs.cmd02.parameter.eth_driver_config.port_pc_duplex", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_ip, { "IP", "ua3g.ip.cs.cmd03.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_string, { "IP", "ua3g.ip.cs.cmd03.parameter.string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip1, { "Type Of Equipment (first byte)", "ua3g.ip.cs.cmd03.parameter.type_of_equip1", FT_UINT8, BASE_DEC, VALS(cs_ip_device_routing_cmd03_first_byte_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip2, { "Type Of Equipment (second byte)", "ua3g.ip.cs.cmd03.parameter.type_of_equip2", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_cmd03_second_byte_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, { "Default Codec", "ua3g.ip.cs.cmd03.parameter.default_codec", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(str_cs_ip_device_routing_0F_compressor), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad, { "VAD", "ua3g.ip.cs.cmd03.parameter.vad", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece, { "ECE", "ua3g.ip.cs.cmd03.parameter.ece", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, { "Voice Mode", "ua3g.ip.cs.cmd03.parameter.voice_mode", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(cs_ip_device_routing_cmd03_voice_mode_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution, { "Delay Distribution", "ua3g.ip.cs.cmd03.parameter.delay_distribution", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_delay_distribution_range_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi, { "Consecutive BFI", "ua3g.ip.cs.cmd03.parameter.consecutive_bfi", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_consecutive_bfi_range_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution, { "BFI Distribution", "ua3g.ip.cs.cmd03.parameter.bfi_distribution", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_bfi_distribution_range_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021Q_used, { "802.1 Q Used", "ua3g.ip.cs.cmd03.parameter.8021Q_used", FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_8021P_priority, { "802.1p Priority", "ua3g.ip.cs.cmd03.parameter.8021P_priority", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_vlan_id, { "VLAN Id", "ua3g.ip.cs.cmd03.parameter.vlan_id", FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_diffserv, { "DiffServ", "ua3g.ip.cs.cmd03.parameter.diffserv", FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution_200ms, { "200 ms BFI Distribution", "ua3g.ip.cs.cmd03.parameter.bfi_distribution_200ms", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_200ms_bfi_distribution_range_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_uint, { "Value", "ua3g.ip.cs.cmd03.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_rtp_lost, { "Consecutive RTP Lost", "ua3g.ip.cs.cmd03.parameter.consecutive_rtp_lost", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_consecutive_rtp_lost_range_vals), 0x0, NULL, HFILL }}, + { &hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution, { "Jitter Depth Distribution", "ua3g.ip.cs.cmd03.parameter.jitter_depth_distribution", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = @@ -5201,6 +4525,7 @@ proto_register_ua3g(void) &ett_ua3g, &ett_ua3g_body, &ett_ua3g_param, + &ett_ua3g_param_sub, &ett_ua3g_option, }; |