Reverse Revision 41134 (Need to fix error/warning before...)
authoralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Feb 2012 09:18:30 +0000 (09:18 +0000)
committeralagoutte <alagoutte@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 22 Feb 2012 09:18:30 +0000 (09:18 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41135 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
epan/CMakeLists.txt
epan/dissectors/Makefile.common
epan/dissectors/packet-noe.c [deleted file]
epan/dissectors/packet-ua.c
epan/dissectors/packet-ua3g.c [deleted file]
epan/dissectors/packet-uasip.c [deleted file]
epan/dissectors/packet-uaudp.c
epan/dissectors/packet-uaudp.h [deleted file]

diff --git a/AUTHORS b/AUTHORS
index 2710329..43e2c91 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2014,7 +2014,7 @@ Graeme Reid             <graeme.reid [AT] norwoodsystems.com> {
        H.450 support
 }
 
-Lars Ruoff              <lars.ruoff [AT] alcatel-lucent.com> {
+Lars Ruoff              <lars.ruoff [AT] sxb.bsf.alcatel.fr> {
        Rewritten RTP analysis tap
 }
 
index dba8e70..c49fa09 100644 (file)
@@ -1084,11 +1084,8 @@ set(DISSECTOR_SRC
        dissectors/packet-turnchannel.c
        dissectors/packet-tuxedo.c
        dissectors/packet-tzsp.c
-       dissectors/packet-uaudp.c
        dissectors/packet-ua.c
-       dissectors/packet-ua3g.c
-       dissectors/packet-noe.c
-       dissectors/packet-uasip.c
+       dissectors/packet-uaudp.c
        dissectors/packet-ucp.c
        dissectors/packet-udld.c
        dissectors/packet-udp.c
index 2a73b12..2e32105 100644 (file)
@@ -1002,11 +1002,8 @@ DISSECTOR_SRC = \
        packet-turnchannel.c    \
        packet-tuxedo.c         \
        packet-tzsp.c           \
+       packet-ua.c             \
        packet-uaudp.c          \
-       packet-ua.c                     \
-       packet-ua3g.c           \
-       packet-noe.c            \
-       packet-uasip.c          \
        packet-ucp.c            \
        packet-udld.c           \
        packet-udp.c            \
diff --git a/epan/dissectors/packet-noe.c b/epan/dissectors/packet-noe.c
deleted file mode 100644 (file)
index d4a8d78..0000000
+++ /dev/null
@@ -1,1740 +0,0 @@
-/* packet-noe.c
- * Routines for UA/UDP (Universal Alcatel over UDP) and NOE packet dissection.
- * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
- *
- * $Id: 
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <glib.h>
-#include "epan/packet.h"
-#include "epan/prefs.h"
-#include "epan/tap.h"
-#include "epan/value_string.h"
-
-#define OPCODE_C_context 0
-#define OPCODE_C_terminal 1
-#define OPCODE_C_keyboard 2
-#define OPCODE_C_audioconfig 3
-#define OPCODE_C_security 4
-#define OPCODE_C_leds 5
-#define OPCODE_C_screen 6
-#define OPCODE_C_date 7
-#define OPCODE_C_AOMV 8
-#define OPCODE_C_bluetooth 9
-#define OPCODE_C_callstate 12
-#define OPCODE_C_resource 13
-#define OPCODE_C_widgets_default 14
-#define OPCODE_C_framebox 128
-#define OPCODE_C_tabbox 129
-#define OPCODE_C_listbox 130
-#define OPCODE_C_actionlistbox 131
-#define OPCODE_C_textbox 132
-#define OPCODE_C_actionbox 133
-#define OPCODE_C_inputbox 134
-#define OPCODE_C_checkbox 135
-#define OPCODE_C_datebox 136
-#define OPCODE_C_timerbox 137
-#define OPCODE_C_popupbox 138
-#define OPCODE_C_dialogbox 139
-#define OPCODE_C_sliderbar 140
-#define OPCODE_C_progressbar 141
-#define OPCODE_C_imagebox 142
-#define OPCODE_C_iconbox 143
-#define OPCODE_C_AOMVbox 144
-#define OPCODE_C_telephonicbox 145
-#define OPCODE_C_keyboard_context 146
-#define OPCODE_C_AOMEL 147
-#define OPCODE_C_AOM10 148
-#define OPCODE_C_AOM40 149
-#define OPCODE_C_idletimer 150
-#define OPCODE_C_telephonicboxitem 151
-#define OPCODE_C_bluetooth_device 152
-#define OPCODE_C_headerbox 153
-#define OPCODE_C_ime_context 154
-
-static const value_string val_str_class[] = {
-  {OPCODE_C_context, "Context"},
-  {OPCODE_C_terminal, "Terminal"},
-  {OPCODE_C_keyboard, "Keyboard"},
-  {OPCODE_C_audioconfig, "AudioConfig"},
-  {OPCODE_C_security, "Security"},
-  {OPCODE_C_leds, "Leds"},
-  {OPCODE_C_screen, "Screen"},
-  {OPCODE_C_date, "Date"},
-  {OPCODE_C_AOMV, "AOMV"},
-  {OPCODE_C_bluetooth, "Bluetooth"},
-  {OPCODE_C_callstate, "Callstate"},
-  {OPCODE_C_framebox, "FrameBox"},
-  {OPCODE_C_tabbox, "TabBox"},
-  {OPCODE_C_listbox, "ListBox"},
-  {OPCODE_C_actionlistbox, "ActionlistBox"},
-  {OPCODE_C_textbox, "TextBox"},
-  {OPCODE_C_actionbox, "ActionBox"},
-  {OPCODE_C_inputbox, "InputBox"},
-  {OPCODE_C_checkbox, "CheckBox"},
-  {OPCODE_C_datebox, "DateBox"},
-  {OPCODE_C_timerbox, "TimerBox"},
-  {OPCODE_C_popupbox, "PopupBox"},
-  {OPCODE_C_dialogbox, "DialogBox"},
-  {OPCODE_C_sliderbar, "SliderBar"},
-  {OPCODE_C_progressbar, "ProgressBar"},
-  {OPCODE_C_imagebox, "ImageBox"},
-  {OPCODE_C_iconbox, "IconBox"},
-  {OPCODE_C_AOMVbox, "AOMVBox"},
-  {OPCODE_C_telephonicbox, "TelephonicBox"},
-  {OPCODE_C_keyboard_context, "Keyboard_context"},
-  {OPCODE_C_AOMEL, "AOMEL"},
-  {OPCODE_C_AOM10, "AOM10"},
-  {OPCODE_C_AOM40, "AOM40"},
-  {OPCODE_C_idletimer, "IdleTimer"},
-  {OPCODE_C_telephonicboxitem, "TelephonicBoxItem"},
-  {OPCODE_C_bluetooth_device, "Bluetooth_device"},
-  {OPCODE_C_headerbox, "HeaderBox"},
-  {OPCODE_C_ime_context, "ime_context"}
-};
-
-#define OPCODE_P_B_objectid 0
-#define OPCODE_P_B_ownership 1
-#define OPCODE_P_B_reset_mode 2
-#define OPCODE_P_B_mtu 3
-#define OPCODE_P_B_negative_ack 4
-#define OPCODE_P_B_type 5
-#define OPCODE_P_B_help_timeout 6
-#define OPCODE_P_B_longpress 7
-#define OPCODE_P_B_count 8
-#define OPCODE_P_B_eventmode 9
-#define OPCODE_P_B_numpad_ownership 10
-#define OPCODE_P_B_navigator_ownership 11
-#define OPCODE_P_B_telephony_ownership 12
-#define OPCODE_P_B_progkeys_ownership 13
-#define OPCODE_P_B_alphakeys_ownership 14
-#define OPCODE_P_B_numpad_eventmode 15
-#define OPCODE_P_B_onoff 16
-#define OPCODE_P_B_bpp 17
-#define OPCODE_P_B_w 18
-#define OPCODE_P_B_h 19
-#define OPCODE_P_B_contrast 20
-#define OPCODE_P_B_clearscreen 21
-#define OPCODE_P_B_year 24
-#define OPCODE_P_B_month 25
-#define OPCODE_P_B_day 26
-#define OPCODE_P_B_m 27
-#define OPCODE_P_B_s 28
-#define OPCODE_P_B_enable 29
-#define OPCODE_P_B_address 30
-#define OPCODE_P_B_port 31
-#define OPCODE_P_B_protocol 32
-#define OPCODE_P_B_name 33
-#define OPCODE_P_B_checked 34
-#define OPCODE_P_B_unchecked 35
-#define OPCODE_P_B_anchorid 36
-#define OPCODE_P_B_grid 37
-#define OPCODE_P_B_x 38
-#define OPCODE_P_B_y 39
-#define OPCODE_P_B_visible 40
-#define OPCODE_P_B_border 41
-#define OPCODE_P_B_fontid 42
-#define OPCODE_P_B_active 43
-#define OPCODE_P_B_halign 44
-#define OPCODE_P_B_valign 45
-#define OPCODE_P_B_size 46
-#define OPCODE_P_B_mode 47
-#define OPCODE_P_B_showevent 48
-#define OPCODE_P_B_showactive 49
-#define OPCODE_P_B_action_active 50
-#define OPCODE_P_B_action_count 51
-#define OPCODE_P_B_foreground 52
-#define OPCODE_P_B_background 53
-#define OPCODE_P_B_icon 54
-#define OPCODE_P_B_label 55
-#define OPCODE_P_B_value 56
-#define OPCODE_P_B_password 57
-#define OPCODE_P_B_cursor 58
-#define OPCODE_P_B_mask 59
-#define OPCODE_P_B_qos_ticket 60
-#define OPCODE_P_B_focus 61
-#define OPCODE_P_B_state 62
-#define OPCODE_P_B_format 63
-#define OPCODE_P_B_incdec 64
-#define OPCODE_P_B_value_notify 65
-#define OPCODE_P_B_timeout 66
-#define OPCODE_P_B_min 67
-#define OPCODE_P_B_max 68
-#define OPCODE_P_B_data 69
-#define OPCODE_P_B_custversion 70
-#define OPCODE_P_B_L10Nversion 71
-#define OPCODE_P_B_append 72
-#define OPCODE_P_B_shortpress 73
-#define OPCODE_P_B_autorepeat 74
-#define OPCODE_P_B_repetition 75
-#define OPCODE_P_B_vsplit 76
-#define OPCODE_P_B_accesskey 77
-#define OPCODE_P_B_realcount 78
-#define OPCODE_P_B_start 79
-#define OPCODE_P_B_modal 80
-#define OPCODE_P_B_session_timeout 81
-#define OPCODE_P_B_softkeys_ownership 82
-#define OPCODE_P_B_ringings_count 83
-#define OPCODE_P_B_cod 84
-#define OPCODE_P_B_bonded 85
-#define OPCODE_P_B_link_key 86
-#define OPCODE_P_B_pin 87
-#define OPCODE_P_B_term_type 88
-#define OPCODE_P_B_link_type 89
-#define OPCODE_P_B_circular 90
-#define OPCODE_P_B_autospread 91
-#define OPCODE_P_B_backlight_timeout 92
-#define OPCODE_P_B_screensaver_timeout 93
-#define OPCODE_P_B_cycling 94
-#define OPCODE_P_B_CS_idle_state 95
-#define OPCODE_P_B_PS_idle_state 96
-#define OPCODE_P_B_bonded_devices 97
-#define OPCODE_P_B_serialnum 98
-#define OPCODE_P_B_hardversion 99
-#define OPCODE_P_B_softversion 100
-#define OPCODE_P_B_rom_size 101
-#define OPCODE_P_B_ram_size 102
-#define OPCODE_P_B_reset_cause 103
-#define OPCODE_P_B_cycling_time 104
-#define OPCODE_P_B_inputborder 106
-#define OPCODE_P_B_disablelongpress 107
-#define OPCODE_P_B_all_icons_off 108
-#define OPCODE_P_B_all_labels_off 109
-#define OPCODE_P_B_widgets_size 110
-#define OPCODE_P_B_list_type 111
-#define OPCODE_P_B_frame_type 112
-#define OPCODE_P_B_bth_ringing 113
-#define OPCODE_P_B_URI 114
-#define OPCODE_P_B_fetch_timeout 115
-#define OPCODE_P_B_mask_subst 116
-#define OPCODE_P_B_use_customisation 117
-#define OPCODE_P_B_ADTTS_request 118
-#define OPCODE_P_B_AP_mac_notify 119
-#define OPCODE_P_B_page_active 120
-#define OPCODE_P_B_overwrite 121
-#define OPCODE_P_B_ime_lock 122
-#define OPCODE_P_B_method 123
-#define OPCODE_P_B_login 124
-#define OPCODE_P_B_binary_suffix 125
-#define OPCODE_P_B_binary_count 126
-#define OPCODE_P_B_SIPCversion 127
-#define OPCODE_P_A_dflt 128
-#define OPCODE_P_A_shift 129
-#define OPCODE_P_A_alt 130
-#define OPCODE_P_A_key_ownership 131
-#define OPCODE_P_A_key_eventmode 132
-#define OPCODE_P_A_value 133
-#define OPCODE_P_A_mode 134
-#define OPCODE_P_A_color 135
-#define OPCODE_P_A_type 136
-#define OPCODE_P_A_icon 137
-#define OPCODE_P_A_label 138
-#define OPCODE_P_A_ownership 139
-#define OPCODE_P_A_enable 140
-#define OPCODE_P_A_state 141
-#define OPCODE_P_A_name 142
-#define OPCODE_P_A_number 143
-#define OPCODE_P_A_action_icon 144
-#define OPCODE_P_A_action_label 145
-#define OPCODE_P_A_action_value 146
-#define OPCODE_P_A_today 147
-#define OPCODE_P_A_tomorrow 148
-#define OPCODE_P_A_action_key 149
-#define OPCODE_P_A_code 150
-#define OPCODE_P_A_data 151
-#define OPCODE_P_A_delay_max_handset 152
-#define OPCODE_P_A_delay_max_handsfree 153
-#define OPCODE_P_A_delay_tx 154
-#define OPCODE_P_A_delay_rx 155
-#define OPCODE_P_A_pem_data 156
-#define OPCODE_P_A_serial_number 157
-#define OPCODE_P_A_owner_name 158
-#define OPCODE_P_A_issuer_name 159
-#define OPCODE_P_A_end_date 160
-
-static const value_string val_str_props[] = {
-  {OPCODE_P_B_objectid, "objectid"},
-  {OPCODE_P_B_ownership, "ownership"},
-  {OPCODE_P_B_reset_mode, "reset_mode"},
-  {OPCODE_P_B_mtu, "mtu"},
-  {OPCODE_P_B_negative_ack, "negative_ack"},
-  {OPCODE_P_B_type, "type"},
-  {OPCODE_P_B_help_timeout, "help_timeout"},
-  {OPCODE_P_B_longpress, "longpress"},
-  {OPCODE_P_B_count, "count"},
-  {OPCODE_P_B_eventmode, "eventmode"},
-  {OPCODE_P_B_numpad_ownership, "numpad_ownership"},
-  {OPCODE_P_B_navigator_ownership, "navigator_ownership"},
-  {OPCODE_P_B_telephony_ownership, "telephony_ownership"},
-  {OPCODE_P_B_progkeys_ownership, "progkeys_ownership"},
-  {OPCODE_P_B_alphakeys_ownership, "alphakeys_ownership"},
-  {OPCODE_P_B_numpad_eventmode, "numpad_eventmode"},
-  {OPCODE_P_B_onoff, "onoff"},
-  {OPCODE_P_B_bpp, "bpp"},
-  {OPCODE_P_B_w, "w"},
-  {OPCODE_P_B_h, "h"},
-  {OPCODE_P_B_contrast, "contrast"},
-  {OPCODE_P_B_clearscreen, "clearscreen"},
-  {OPCODE_P_B_year, "year"},
-  {OPCODE_P_B_month, "month"},
-  {OPCODE_P_B_day, "day"},
-  {OPCODE_P_B_m, "m"},
-  {OPCODE_P_B_s, "s"},
-  {OPCODE_P_B_enable, "enable"},
-  {OPCODE_P_B_address, "address"},
-  {OPCODE_P_B_name, "name"},
-  {OPCODE_P_B_anchorid, "anchorid"},
-  {OPCODE_P_B_grid, "grid"},
-  {OPCODE_P_B_x, "x"},
-  {OPCODE_P_B_y, "y"},
-  {OPCODE_P_B_visible, "visible"},
-  {OPCODE_P_B_border, "border"},
-  {OPCODE_P_B_fontid, "fontid"},
-  {OPCODE_P_B_active, "active"},
-  {OPCODE_P_B_halign, "halign"},
-  {OPCODE_P_B_valign, "valign"},
-  {OPCODE_P_B_size, "size"},
-  {OPCODE_P_B_mode, "mode"},
-  {OPCODE_P_B_showevent, "showevent"},
-  {OPCODE_P_B_showactive, "showactive"},
-  {OPCODE_P_B_icon, "icon"},
-  {OPCODE_P_B_label, "label"},
-  {OPCODE_P_B_value, "value"},
-  {OPCODE_P_B_password, "password"},
-  {OPCODE_P_B_cursor, "cursor"},
-  {OPCODE_P_B_mask, "mask"},
-  {OPCODE_P_B_qos_ticket, "qos_ticket"},
-  {OPCODE_P_B_focus, "focus"},
-  {OPCODE_P_B_state, "state"},
-  {OPCODE_P_B_format, "format"},
-  {OPCODE_P_B_incdec, "incdec"},
-  {OPCODE_P_B_value_notify, "value_notify"},
-  {OPCODE_P_B_timeout, "timeout"},
-  {OPCODE_P_B_min, "min"},
-  {OPCODE_P_B_max, "max"},
-  {OPCODE_P_B_data, "data"},
-  {OPCODE_P_B_custversion, "custversion"},
-  {OPCODE_P_B_L10Nversion, "L10Nversion"},
-  {OPCODE_P_B_append, "append"},
-  {OPCODE_P_B_shortpress, "shortpress"},
-  {OPCODE_P_B_autorepeat, "autorepeat"},
-  {OPCODE_P_B_repetition, "repetition"},
-  {OPCODE_P_B_vsplit, "vsplit"},
-  {OPCODE_P_B_accesskey, "accesskey"},
-  {OPCODE_P_B_realcount, "realcount"},
-  {OPCODE_P_B_start, "start"},
-  {OPCODE_P_B_modal, "modal"},
-  {OPCODE_P_B_session_timeout, "session_timeout"},
-  {OPCODE_P_B_softkeys_ownership, "softkeys_ownership"},
-  {OPCODE_P_B_ringings_count, "ringings_count"},
-  {OPCODE_P_B_cod, "cod"},
-  {OPCODE_P_B_bonded, "bonded"},
-  {OPCODE_P_B_link_key, "link_key"},
-  {OPCODE_P_B_pin, "pin"},
-  {OPCODE_P_B_term_type, "term_type"},
-  {OPCODE_P_B_link_type, "link_type"},
-  {OPCODE_P_B_circular, "circular"},
-  {OPCODE_P_B_autospread, "autospread"},
-  {OPCODE_P_B_backlight_timeout, "backlight_timeout"},
-  {OPCODE_P_B_screensaver_timeout, "screensaver_timeout"},
-  {OPCODE_P_B_cycling, "cycling"},
-  {OPCODE_P_B_CS_idle_state, "CS_idle_state"},
-  {OPCODE_P_B_PS_idle_state, "PS_idle_state"},
-  {OPCODE_P_B_bonded_devices, "bonded_devices"},
-  {OPCODE_P_B_serialnum, "serialnum"},
-  {OPCODE_P_B_hardversion, "hardversion"},
-  {OPCODE_P_B_softversion, "softversion"},
-  {OPCODE_P_B_rom_size, "rom_size"},
-  {OPCODE_P_B_ram_size, "ram_size"},
-  {OPCODE_P_B_reset_cause, "reset_cause"},
-  {OPCODE_P_B_cycling_time, "cycling_time"},
-  {OPCODE_P_B_inputborder, "inputborder"},
-  {OPCODE_P_B_disablelongpress, "disablelongpress"},
-  {OPCODE_P_B_all_icons_off, "all_icons_off"},
-  {OPCODE_P_B_all_labels_off, "all_labels_off"},
-  {OPCODE_P_B_widgets_size, "widgets_size"},
-  {OPCODE_P_B_list_type, "list_type"},
-  {OPCODE_P_B_frame_type, "frame_type"},
-  {OPCODE_P_B_bth_ringing, "bth_ringing"},
-  {OPCODE_P_B_URI, "URI"},
-  {OPCODE_P_B_fetch_timeout, "fetch_timeout"},
-  {OPCODE_P_B_mask_subst, "mask_subst"},
-  {OPCODE_P_B_use_customisation, "use_customisation"},
-  {OPCODE_P_B_page_active, "page_active"},
-  {OPCODE_P_B_overwrite, "overwrite"},
-  {OPCODE_P_B_ime_lock, "ime_lock"},
-  {OPCODE_P_B_method, "method"},
-  {OPCODE_P_B_login, "login"},
-  {OPCODE_P_B_binary_suffix, "binary_suffix"},
-  {OPCODE_P_B_binary_count, "binary_count"},
-  {OPCODE_P_B_SIPCversion, "SIPCversion"},
-  {OPCODE_P_A_key_ownership, "key_ownership"},
-  {OPCODE_P_A_key_eventmode, "key_eventmode"},
-  {OPCODE_P_A_value, "value"},
-  {OPCODE_P_A_mode, "mode"},
-  {OPCODE_P_A_color, "color"},
-  {OPCODE_P_A_type, "type"},
-  {OPCODE_P_A_icon, "icon"},
-  {OPCODE_P_A_label, "label"},
-  {OPCODE_P_A_ownership, "ownership"},
-  {OPCODE_P_A_enable, "enable"},
-  {OPCODE_P_A_state, "state"},
-  {OPCODE_P_A_name, "name"},
-  {OPCODE_P_A_number, "number"},
-  {OPCODE_P_A_action_icon, "action_icon"},
-  {OPCODE_P_A_action_label, "action_label"},
-  {OPCODE_P_A_action_value, "action_value"},
-  {OPCODE_P_A_today, "today"},
-  {OPCODE_P_A_tomorrow, "tomorrow"},
-  {OPCODE_P_A_code, "code"},
-  {OPCODE_P_A_data, "data"},
-  {OPCODE_P_A_delay_max_handset, "delay_max_handset"},
-  {OPCODE_P_A_delay_max_handsfree, "delay_max_handsfree"},
-  {OPCODE_P_A_delay_tx, "delay_tx"},
-  {OPCODE_P_A_delay_rx, "delay_rx"},
-  {OPCODE_P_A_pem_data, "pem_data"},
-  {OPCODE_P_A_serial_number, "serial_number"},
-  {OPCODE_P_A_owner_name, "owner_name"},
-  {OPCODE_P_A_issuer_name, "issuer_name"},
-  {OPCODE_P_A_end_date, "end_date"}
-};
-
-#define OPCODE_EVT_CONTEXT_SWITCH 0
-#define OPCODE_EVT_RESET 1
-#define OPCODE_EVT_KEY_PRESS 2
-#define OPCODE_EVT_KEY_RELEASE 3
-#define OPCODE_EVT_KEY_SHORTPRESS 4
-#define OPCODE_EVT_KEY_LONGPRESS 5
-#define OPCODE_EVT_ONHOOK 6
-#define OPCODE_EVT_OFFHOOK 7
-#define OPCODE_EVT_HELP 8
-#define OPCODE_EVT_WIDGETS_GC 9
-#define OPCODE_EVT_ERROR_PROTOCOL 10
-#define OPCODE_EVT_ERROR_CREATE 11
-#define OPCODE_EVT_ERROR_DELETE 12
-#define OPCODE_EVT_ERROR_SET_PROPERTY 13
-#define OPCODE_EVT_ERROR_GET_PROPERTY 14
-#define OPCODE_EVT_SUCCESS_CREATE 15
-#define OPCODE_EVT_SUCCESS_DELETE 16
-#define OPCODE_EVT_SUCCESS_SET_PROPERTY 17
-#define OPCODE_EVT_ERROR_INSERT_ITEM 18
-#define OPCODE_EVT_ERROR_DELETE_ITEM 19
-#define OPCODE_EVT_SUCCESS_INSERT_ITEM 20
-#define OPCODE_EVT_DEVICE_PRESENCE 21
-#define OPCODE_EVT_KEY_LINE 22
-#define OPCODE_EVT_SUCCESS_DELETE_ITEM 23
-#define OPCODE_EVT_BT_BONDING_RESULT 24
-#define OPCODE_EVT_BT_KEY_SHORTPRESS 25
-#define OPCODE_EVT_BT_KEY_LONGPRESS 26
-#define OPCODE_EVT_BT_KEY_VERYLONGPRESS 27
-#define OPCODE_EVT_LOCAL_APPLICATION 28
-#define OPCODE_EVT_WARNING_CREATE 29
-#define OPCODE_EVT_WARNING_SET_PROPERTY 30
-#define OPCODE_EVT_ARP_SPOOFING 31
-#define OPCODE_EVT_CHAR_NOT_FOUND 32
-#define OPCODE_EVT_CHAR_BAD_LENGTH 33
-#define OPCODE_EVT_QOS_TICKET 34
-#define OPCODE_EVT_UA3_ERROR 35
-#define OPCODE_EVT_TABBOX 128
-#define OPCODE_EVT_LISTBOX 129
-#define OPCODE_EVT_LISTBOX_FIRST 130
-#define OPCODE_EVT_LISTBOX_LAST 131
-#define OPCODE_EVT_ACTIONLISTBOX 132
-#define OPCODE_EVT_ACTIONBOX 133
-#define OPCODE_EVT_INPUTBOX 134
-#define OPCODE_EVT_INPUTBOX_FOCUS_LOST 135
-#define OPCODE_EVT_CHECKBOX 136
-#define OPCODE_EVT_TIMERBOX 137
-#define OPCODE_EVT_POPUPBOX_TIMEOUT 138
-#define OPCODE_EVT_DIALOGBOX 139
-#define OPCODE_EVT_SLIDERBAR 140
-#define OPCODE_EVT_PROGRESSBAR 141
-#define OPCODE_EVT_AOMVBOX 142
-#define OPCODE_EVT_TELEPHONICBOX_FOCUS 143
-#define OPCODE_EVT_AOM_INSERTED 144
-#define OPCODE_EVT_AOM_REMOVED 145
-#define OPCODE_EVT_AOM_KEY_PRESS 146
-#define OPCODE_EVT_IDLETIMER 147
-#define OPCODE_EVT_GET_PROPERTY_RESULT 148
-#define OPCODE_EVT_AOM_KEY_RELEASE 149
-#define OPCODE_EVT_POPUPBOX_DISMISSED 150
-#define OPCODE_EVT_DIALOGBOX_TIMEOUT 151
-#define OPCODE_EVT_DIALOGBOX_DISMISSED 152
-#define OPCODE_EVT_BT_BONDED_DEVICE 153
-#define OPCODE_EVT_BT_INQUIRY_RESULT 154
-#define OPCODE_EVT_BT_NAME_DISCOVERY 155
-#define OPCODE_EVT_IME_REMOTEOPEN 156
-#define OPCODE_EVT_BT_BATTERY 158
-#define OPCODE_EVT_IME_LIST 159
-#define OPCODE_EVT_IME_CHANGE 160
-#define OPCODE_EVT_IME_OPEN 161
-#define OPCODE_EVT_TELEPHONICBOX_EVENT 162
-#define OPCODE_EVT_ACTLISTBOX_TIMEOUT 163
-#define OPCODE_EVT_ACTLISTBOX_DISMISSED 164
-#define OPCODE_EVT_ADTTS_RESPONSE 165
-#define OPCODE_EVT_AP_MAC 166
-
-static const value_string val_str_event[] = {
-  {OPCODE_EVT_CONTEXT_SWITCH, "EVT_CONTEXT_SWITCH"},
-  {OPCODE_EVT_RESET, "EVT_RESET"},
-  {OPCODE_EVT_KEY_PRESS, "EVT_KEY_PRESS"},
-  {OPCODE_EVT_KEY_RELEASE, "EVT_KEY_RELEASE"},
-  {OPCODE_EVT_KEY_SHORTPRESS, "EVT_KEY_SHORTPRESS"},
-  {OPCODE_EVT_KEY_LONGPRESS, "EVT_KEY_LONGPRESS"},
-  {OPCODE_EVT_ONHOOK, "EVT_ONHOOK"},
-  {OPCODE_EVT_OFFHOOK, "EVT_OFFHOOK"},
-  {OPCODE_EVT_HELP, "EVT_HELP"},
-  {OPCODE_EVT_WIDGETS_GC, "EVT_WIDGETS_GC"},
-  {OPCODE_EVT_ERROR_PROTOCOL, "EVT_ERROR_PROTOCOL"},
-  {OPCODE_EVT_ERROR_CREATE, "EVT_ERROR_CREATE"},
-  {OPCODE_EVT_ERROR_DELETE, "EVT_ERROR_DELETE"},
-  {OPCODE_EVT_ERROR_SET_PROPERTY, "EVT_ERROR_SET_PROPERTY"},
-  {OPCODE_EVT_ERROR_GET_PROPERTY, "EVT_ERROR_GET_PROPERTY"},
-  {OPCODE_EVT_SUCCESS_CREATE, "EVT_SUCCESS_CREATE"},
-  {OPCODE_EVT_SUCCESS_DELETE, "EVT_SUCCESS_DELETE"},
-  {OPCODE_EVT_SUCCESS_SET_PROPERTY, "EVT_SUCCESS_SET_PROPERTY"},
-  {OPCODE_EVT_ERROR_INSERT_ITEM, "EVT_ERROR_INSERT_ITEM"},
-  {OPCODE_EVT_ERROR_DELETE_ITEM, "EVT_ERROR_DELETE_ITEM"},
-  {OPCODE_EVT_SUCCESS_INSERT_ITEM, "EVT_SUCCESS_INSERT_ITEM"},
-  {OPCODE_EVT_DEVICE_PRESENCE, "EVT_DEVICE_PRESENCE"},
-  {OPCODE_EVT_KEY_LINE, "EVT_KEY_LINE"},
-  {OPCODE_EVT_SUCCESS_DELETE_ITEM, "EVT_SUCCESS_DELETE_ITEM"},
-  {OPCODE_EVT_BT_BONDING_RESULT, "EVT_BT_BONDING_RESULT"},
-  {OPCODE_EVT_BT_KEY_SHORTPRESS, "EVT_BT_KEY_SHORTPRESS"},
-  {OPCODE_EVT_BT_KEY_LONGPRESS, "EVT_BT_KEY_LONGPRESS"},
-  {OPCODE_EVT_BT_KEY_VERYLONGPRESS, "EVT_BT_KEY_VERYLONGPRESS"},
-  {OPCODE_EVT_LOCAL_APPLICATION, "EVT_LOCAL_APPLICATION"},
-  {OPCODE_EVT_WARNING_CREATE, "EVT_WARNING_CREATE"},
-  {OPCODE_EVT_WARNING_SET_PROPERTY, "EVT_WARNING_SET_PROPERTY"},
-  {OPCODE_EVT_ARP_SPOOFING, "EVT_ARP_SPOOFING"},
-  {OPCODE_EVT_CHAR_NOT_FOUND, "EVT_CHAR_NOT_FOUND"},
-  {OPCODE_EVT_QOS_TICKET, "EVT_QOS_TICKET"},
-  {OPCODE_EVT_UA3_ERROR, "EVT_UA3_ERROR"},
-  {OPCODE_EVT_TABBOX, "EVT_TABBOX"},
-  {OPCODE_EVT_LISTBOX, "EVT_LISTBOX"},
-  {OPCODE_EVT_LISTBOX_FIRST, "EVT_LISTBOX_FIRST"},
-  {OPCODE_EVT_LISTBOX_LAST, "EVT_LISTBOX_LAST"},
-  {OPCODE_EVT_ACTIONLISTBOX, "EVT_ACTIONLISTBOX"},
-  {OPCODE_EVT_ACTIONBOX, "EVT_ACTIONBOX"},
-  {OPCODE_EVT_INPUTBOX, "EVT_INPUTBOX"},
-  {OPCODE_EVT_INPUTBOX_FOCUS_LOST, "EVT_INPUTBOX_FOCUS_LOST"},
-  {OPCODE_EVT_CHECKBOX, "EVT_CHECKBOX"},
-  {OPCODE_EVT_TIMERBOX, "EVT_TIMERBOX"},
-  {OPCODE_EVT_POPUPBOX_TIMEOUT, "EVT_POPUPBOX_TIMEOUT"},
-  {OPCODE_EVT_DIALOGBOX, "EVT_DIALOGBOX"},
-  {OPCODE_EVT_SLIDERBAR, "EVT_SLIDERBAR"},
-  {OPCODE_EVT_PROGRESSBAR, "EVT_PROGRESSBAR"},
-  {OPCODE_EVT_AOMVBOX, "EVT_AOMVBOX"},
-  {OPCODE_EVT_TELEPHONICBOX_FOCUS, "EVT_TELEPHONICBOX_FOCUS"},
-  {OPCODE_EVT_AOM_INSERTED, "EVT_AOM_INSERTED"},
-  {OPCODE_EVT_AOM_REMOVED, "EVT_AOM_REMOVED"},
-  {OPCODE_EVT_AOM_KEY_PRESS, "EVT_AOM_KEY_PRESS"},
-  {OPCODE_EVT_IDLETIMER, "EVT_IDLETIMER"},
-  {OPCODE_EVT_GET_PROPERTY_RESULT, "EVT_GET_PROPERTY_RESULT"},
-  {OPCODE_EVT_AOM_KEY_RELEASE, "EVT_AOM_KEY_RELEASE"},
-  {OPCODE_EVT_POPUPBOX_DISMISSED, "EVT_POPUPBOX_DISMISSED"},
-  {OPCODE_EVT_DIALOGBOX_TIMEOUT, "EVT_DIALOGBOX_TIMEOUT"},
-  {OPCODE_EVT_DIALOGBOX_DISMISSED, "EVT_DIALOGBOX_DISMISSED"},
-  {OPCODE_EVT_BT_BONDED_DEVICE, "EVT_BT_BONDED_DEVICE"},
-  {OPCODE_EVT_BT_INQUIRY_RESULT, "EVT_BT_INQUIRY_RESULT"},
-  {OPCODE_EVT_BT_NAME_DISCOVERY, "EVT_BT_NAME_DISCOVERY"},
-  {OPCODE_EVT_IME_REMOTEOPEN, "EVT_IME_REMOTEOPEN"},
-  {OPCODE_EVT_BT_BATTERY, "EVT_BT_BATTERY"},
-  {OPCODE_EVT_IME_LIST, "EVT_IME_LIST"},
-  {OPCODE_EVT_IME_CHANGE, "EVT_IME_CHANGE"},
-  {OPCODE_EVT_IME_OPEN, "EVT_IME_OPEN"},
-  {OPCODE_EVT_TELEPHONICBOX_EVENT, "EVT_TELEPHONICBOX_EVENT"},
-  {OPCODE_EVT_ACTLISTBOX_TIMEOUT, "EVT_ACTLISTBOX_TIMEOUT"},
-  {OPCODE_EVT_ACTLISTBOX_DISMISSED, "EVT_ACTLISTBOX_DISMISSED"}
-};
-
-#define P_BASIC         0
-#define P_ARRAY         128
-#define P_INVALID       255
-#define P_INVALID_INDEX 255
-
-#define C_STATIC    0
-#define C_DYNAMIC   128
-#define C_INVALID   255
-
-#define E_INVALID   255
-
-
-/*-----------------------------------------------------------------------------
-  globals
-  ---------------------------------------------------------------------------*/
-static int  proto_noe                  = -1;
-static gint ett_noe                            = -1;
-static gint ett_body                   = -1;
-static gint ett_property               = -1;
-static gint ett_value                  = -1;
-static int  hf_noe_length              = -1;
-static int  hf_noe_server              = -1;
-static int  hf_noe_method_ack  = -1;
-static int  hf_noe_method              = -1;
-static int  hf_noe_class               = -1;
-static int  hf_noe_event               = -1;
-static int  hf_noe_objectid            = -1;
-static int  hf_noe_method_index        = -1;
-static int  hf_noe_pcode               = -1;
-static int  hf_noe_aindx               = -1;
-static int  hf_noe_psize               = -1;
-
-static const value_string servers_vals[] = {
-       {0x15,  "Call Server"                   },
-       {0x16,  "Presentation Server"   },
-       {0, NULL}
-};
-static const value_string servers_short_vals[] = {
-       {0x15,  "CS"},
-       {0x16,  "PS"},
-       {0, NULL}
-};
-enum
-{
-    METHOD_CREATE              = 0x00,
-    METHOD_DELETE              = 0x01,
-    METHOD_SET_PROPERTY        = 0x02,
-    METHOD_GET_PROPERTY        = 0x03,
-    METHOD_NOTIFY              = 0x04,
-    METHOD_DELETE_ITEM = 0x05,
-    METHOD_INSERT_ITEM = 0x06,
-    METHOD_INVALID
-};
-static const value_string methods_vals[] = {
-       {METHOD_CREATE,                 "Create"                },
-       {METHOD_DELETE,                 "Delete"                },
-       {METHOD_SET_PROPERTY,   "SetProperty"   },
-       {METHOD_GET_PROPERTY,   "GetProperty"   },
-       {METHOD_NOTIFY,                 "Notify"                },
-       {METHOD_DELETE_ITEM,    "DeleteItem"    },
-       {METHOD_INSERT_ITEM,    "InsertItem"    },
-       {0, NULL}
-};
-
-
-#define ERROR_INVALID_METHOD           0
-#define ERROR_UNKNOWN_CLASS                    1
-#define ERROR_STATIC_CLASS                     2
-#define ERROR_DUPLICATE_OBJECTID       3
-#define ERROR_UNKNOWN_PROPERTY_                4
-#define ERROR_BAD_INDEX                                5
-#define ERROR_BAD_LENGTH__                     6
-#define ERROR_REQUIRED_MISSING         7
-#define ERROR_BAD_VALUE                                8
-#define ERROR_READONLY_PROPERTY                9
-#define ERROR_UNKNOWN_OBJECTID         10
-#define ERROR_INVALID_CONTAINER                11
-#define ERROR_PROPERTY_VMIN                    12
-#define ERROR_PROPERTY_VMAX                    13
-#define ERROR_POSITIVE_ACK                     14
-#define ERROR_NOT_IMPLEMENTED          15
-#define ERROR_INVALID_CLASS                    16
-#define ERROR_INVALID_PROPERTY         17
-#define ERROR_BAD_UTF8                         18
-
-#define ERROR_MESSAGE_DROP                     128
-#define ERROR_MAX_SET_PROPERTY         129
-#define ERROR_INTERNAL                         130
-
-
-static const value_string errcode_vals[] = {
-       {ERROR_INVALID_METHOD           , "An invalid method opcode was received"                                                                                       },
-       {ERROR_UNKNOWN_CLASS            , "An invalid class opcode was received"                                                                                        },
-       {ERROR_STATIC_CLASS                     , "Trying to create or delete a static class"                                                                           },
-       {ERROR_DUPLICATE_OBJECTID       , "Trying to create an existing object"                                                                                         },
-       {ERROR_UNKNOWN_PROPERTY_        , "Property opcode doesn\92t exist in specified class"                                                            },
-       {ERROR_BAD_INDEX                        , "Bad property index (array overflow)"                                                                                         },
-       {ERROR_BAD_LENGTH__                     , "Short message or bad property length"                                                                                        },
-       {ERROR_REQUIRED_MISSING         , "A required property was not specified in create method"                                                      },
-       {ERROR_BAD_VALUE                        , "Bad property value"                                                                                                                          },
-       {ERROR_READONLY_PROPERTY        , "Trying to set a read-only property"                                                                                          },
-       {ERROR_UNKNOWN_OBJECTID         , "The specified object doesn\92t exist (delete, setProperty or getProperty methods)"     },
-       {ERROR_INVALID_CONTAINER        , "Invalid container"                                                                                                                           },
-       {ERROR_PROPERTY_VMIN            , "Property value < property minimum value"                                                                                     },
-       {ERROR_PROPERTY_VMAX            , "Property value > property maximum value"                                                                                     },
-       {ERROR_POSITIVE_ACK                     , "Positive ack requested with a getProperty method"                                                            },
-       {ERROR_NOT_IMPLEMENTED          , "The specified property is not implemented"                                                                           },
-       {ERROR_INVALID_CLASS            , "Invalid class specified with insertItem and deleteItem"                                                      },
-       {ERROR_INVALID_PROPERTY         , "Invalid property specified with insertItem and deleteItem"                                           },
-       {ERROR_BAD_UTF8                         , "Invalid UTF8 value in UA message"                                                                                            },
-       {ERROR_MESSAGE_DROP                     , "Decoder queue is full"                                                                                                                       },
-       {ERROR_MAX_SET_PROPERTY         , "A maximum of 256 properties can be received in a setProperty method"                         },
-       {ERROR_INTERNAL                         , "Internal error"                                                                                                                                      },
-       {0, NULL}
-};
-
-static const value_string str_key_name[] = {
-       {0x00   , "Null Char."                          },
-       {0x01   , "Start Of Header"                     },
-       {0x02   , "Start Of Text"                       },
-       {0x03   , "End Of Text"                         },
-       {0x04   , "End Of Transmission"         },
-       {0x05   , "Enquiry"                                     },
-       {0x06   , "Acknowledgment"                      },
-       {0x07   , "Bell"                                        },
-       {0x08   , "Backspace"                           },
-       {0x09   , "Horizontal Tab"                      },
-       {0x0A   , "Line Feed"                           },
-       {0x0B   , "Vertical Tab"                        },
-       {0x0C   , "Form Feed"                           },
-       {0x0D   , "Enter"                                       },
-       {0x0E   , "Shift Out"                           },
-       {0x0F   , "Shift In"                            },
-       {0x10   , "Data Link Escape"            },
-       {0x11   , "Device Control 1"            },
-       {0x12   , "Device Control 2"            },
-       {0x13   , "Device Control 3"            },
-       {0x14   , "Device Control 4"            },
-       {0x15   , "Negative Acknowledgment"     },
-       {0x16   , "Synchronous Idle"            },
-       {0x17   , "End Of Trans. Block"         },
-       {0x18   , "Cancel"                                      },
-       {0x19   , "End Of Medium"                       },
-       {0x1A   , "Substitute"                          },
-       {0x1B   , "Escape"                                      },
-       {0x1C   , "File Separator"                      },
-       {0x1D   , "Group Separator"                     },
-       {0x1E   , "Request To Send"                     },
-       {0x1F   , "Unit Separator"                      },
-       {0x20   , "Space"                                       },
-       {0x7F   , "Delete"                                      },
-       {0xE0   , "a`"                                          },
-       {0xE7   , "c,"                                          },
-       {0xE8   , "e`"                                          },
-       {0xE9   , "e'"                                          },
-       {0xF9   , "u`"                                          },
-       {0x20AC , "Euro Character"                      },
-       {0xE100 , "Release"                                     },
-       {0xE101 , "Bis"                                         },
-       {0xE102 , "Message"                                     },
-       {0xE103 , "Handsfree"                           },
-       {0xE104 , "Mute"                                        },
-       {0xE105 , "Volume Dec"                          },
-       {0xE106 , "Volume Inc"                          },
-       {0xE107 , "Hookswitch"                          },
-       {0xE110 , "Ok"                                          },
-       {0xE111 , "Left"                                        },
-       {0xE112 , "Right"                                       },
-       {0xE113 , "Down"                                        },
-       {0xE114 , "Up"                                          },
-       {0xE115 , "Home"                                        },
-       {0xE116 , "Help"                                        },
-       {0xE117 , "Directory"                           },
-       {0xE120 , "ProgKey 0"                           },
-       {0xE121 , "ProgKey 1"                           },
-       {0xE122 , "ProgKey 2"                           },
-       {0xE123 , "ProgKey 3"                           },
-       {0xE124 , "ProgKey 4"                           },
-       {0xE125 , "ProgKey 5"                           },
-       {0xE130 , "SoftKey 0"                           },
-       {0xE131 , "SoftKey 1"                           },
-       {0xE132 , "SoftKey 2"                           },
-       {0xE133 , "SoftKey 3"                           },
-       {0xE134 , "SoftKey 4"                           },
-       {0xE135 , "SoftKey 5"                           },
-       {0xE136 , "SoftKey 6"                           },
-       {0xE137 , "SoftKey 7"                           },
-       {0xE138 , "SoftKey 8"                           },
-       {0xE139 , "SoftKey 9"                           },
-       {0, NULL}
-};
-
-
-/*-----------------------------------------------------------------------------
-       DECODE UTF8 TO UNICODE
-       This function translates an UTF8 vale to an UNICODE one.
-       Need to have at least 48 bits value.
-       ---------------------------------------------------------------------------*/
-static guint64 decode_utf8(guint64 utf8)
-{
-       static guint64 unicode;
-
-       if(utf8 <= 0xFF)
-       {
-               unicode =
-                       utf8 & 0x7F;
-       }
-       else if(utf8 <= 0xFFFF)
-       {
-               unicode =
-                       ((utf8 & 0x1F00) >> 2) +
-                       (utf8 & 0x3F);
-       }
-       else if(utf8 <= 0xFFFFFF)
-       {
-               unicode =
-                       ((utf8 & 0x0F0000) >> 4) +
-                       ((utf8 & 0x3F00) >> 2) +
-                       (utf8 & 0x3F);
-       }
-       else if(utf8 <= 0xFFFFFFFF)
-       {
-               unicode =
-                       ((utf8 & 0x07000000) >> 6) +
-                       ((utf8 & 0x3F0000) >> 4) +
-                       ((utf8 & 0x3F00) >> 2) +
-                       (utf8 & 0x3F);
-       }
-       else if(utf8 <= 0xFFFFFFFFFF)
-       {
-               unicode =
-                       ((utf8 & 0x0300000000) >> 8) +
-                       ((utf8 & 0x3F000000) >> 6) +
-                       ((utf8 & 0x3F0000) >> 4) +
-                       ((utf8 & 0x3F00) >> 2) +
-                       (utf8 & 0x3F);
-       }
-       else if(utf8 <= 0xFFFFFFFFFFFF)
-       {
-               unicode =
-                       ((utf8 & 0x010000000000) >> 10) +
-                       ((utf8 & 0x3F00000000) >> 8) +
-                       ((utf8 & 0x3F000000) >> 6) +
-                       ((utf8 & 0x3F0000) >> 4) +
-                       ((utf8 & 0x3F00) >> 2) +
-                       (utf8 & 0x3F);
-       }
-       else
-       {
-               unicode = 0;
-       }
-       return unicode;
-} 
-
-
-/*-----------------------------------------------------------------------------
-       DECODE KEY NAME
-       This function translates an UNICODE to the name associated.
-       Need to have at least 48 bits value.
-       ---------------------------------------------------------------------------*/
-static char *decode_key_name(int unicode)
-{
-       static char key_name[10];
-
-       if((unicode <= 0x20)
-               || (unicode == 0x7F)
-               || (unicode == 0xE0)
-               || (unicode == 0xE7)
-               || (unicode == 0xE8)
-               || (unicode == 0xE9)
-               || (unicode == 0xF9))
-       {
-               g_snprintf(key_name, 10, "%s", val_to_str(unicode, str_key_name, "Unknown"));
-       }
-       else if(unicode <= 0xFF)
-       {
-               g_snprintf(key_name, 10, "%c", unicode);
-       }
-       else
-       {
-               g_snprintf(key_name, 10, "%s", val_to_str(unicode, str_key_name, "Unknown"));
-       }
-       return key_name;
-} 
-
-
-/*-----------------------------------------------------------------------------
-       DECODE EVT ERROR
-       ---------------------------------------------------------------------------*/
-static void
-decode_evt_error(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
-{
-       guint8  method, class, index, property;
-       guint16 objectid, errcode, Psize;
-       guint32 Pdata;
-
-       errcode = tvb_get_ntohs (tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               2,
-               "ErrCode : %s (%d)",
-               val_to_str(errcode, VALS(errcode_vals), "Unknown"),
-               errcode);
-       offset += 2;
-       length -= 2;
-
-       method = tvb_get_guint8(tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               1,
-               "Method  : %s (%d)",
-               val_to_str(method, VALS(methods_vals), "Unknown"),
-               method);
-       offset ++;
-       length --;
-
-       class = tvb_get_guint8(tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               1,
-               "Class   : %s (%d)",
-               val_to_str(class, val_str_class, "Unknown"),
-               class);
-       offset ++;
-       length --;
-
-       objectid = tvb_get_ntohs (tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               2,
-               "Objectid: %04xh (%d)",
-               objectid,
-               objectid);
-       offset += 2;
-       length -= 2;
-
-       property = tvb_get_guint8(tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               1,
-               "Property   : %s (%d)",
-               val_to_str(property, val_str_props, "Unknown"),
-               property);
-       offset ++;
-       length --;
-
-       index = tvb_get_guint8(tvb, offset);
-               proto_tree_add_text(tree,
-               tvb,
-               offset,
-               1,
-               "Index   : %d",
-               index);
-       offset ++;
-       length --;
-
-       Psize = tvb_get_ntohs (tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               2,
-               "Length   : %d",
-               Psize);
-       offset += 2;
-       length -= 2;
-
-       Pdata = tvb_get_ntohl (tvb, offset);
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               4,
-               "Value   : %x",
-               Pdata);
-       offset += 4;
-       length -= 4;
-
-       proto_tree_add_text(tree,
-               tvb,
-               offset,
-               length,
-               "Message : %s",
-               tvb_bytes_to_str(tvb, offset, length));
-}
-
-
-/*-----------------------------------------------------------------------------
-       MESSAGE BODY DECODER
-       This function decodes the message body of an 0x15 (and 0x16) UA3G message.
-       ---------------------------------------------------------------------------*/
-static void decode_tlv(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
-{
-       proto_item *property_item, *value_item;
-       proto_tree *property_tree, *value_tree;
-       guint8 property_type;
-       guint16 property_length, property_value_index;
-       guint64 property_index = 0;
-
-       /* add text to the frame tree */
-       property_item = proto_tree_add_text(tree,
-               tvb,
-               offset,
-               length,
-               "NOE Message Body");
-       property_tree = proto_item_add_subtree(property_item, ett_body);
-
-       while(length > 0)
-       {
-               property_type = tvb_get_guint8(tvb, offset);
-
-               proto_tree_add_text(property_item,
-                       tvb,
-                       offset,
-                       1,
-                       "Property Opcode: %s (0x%02x)",
-                       val_to_str(property_type, val_str_props, "Unknown"),
-                       property_type);
-               offset++;
-               length--;
-
-               if(property_type >= P_ARRAY)
-               {
-                       proto_tree_add_text(property_item,
-                               tvb,
-                               offset,
-                               1,
-                               "Index          : %d",
-                               tvb_get_guint8(tvb, offset));
-                       offset++;
-                       length--;
-               }
-
-               property_length = tvb_get_guint8(tvb, offset);
-               if(property_length & 0x80)
-               {
-                       property_length = tvb_get_ntohs(tvb, offset);
-                       property_length &= 0x7fff;
-                       proto_tree_add_text(property_item,
-                               tvb,
-                               offset,
-                               2,
-                               "Length         : %d",
-                               tvb_get_guint8(tvb, offset) * 256 + tvb_get_guint8(tvb, offset+1));
-                       offset += 2;
-                       length -= 2;
-               }
-               else
-               {
-                       proto_tree_add_text(property_item,
-                               tvb,
-                               offset,
-                               1,
-                               "Length         : %d",
-                               tvb_get_guint8(tvb, offset));
-                       offset++;
-                       length--;
-               }
-               
-               switch(property_length)
-               {
-               case 0:
-                       {
-                               break;
-                       }
-               case 1:
-                       {
-                               proto_tree_add_text(property_item,
-                                       tvb,
-                                       offset,
-                                       1,
-                                       "Value          : %d",
-                                       tvb_get_guint8(tvb, offset));
-                               offset++;
-                               length--;
-                               break;
-                       }
-               case 2:
-                       {
-                               guint16 property_value;
-                               property_value = tvb_get_guint8(tvb, offset) * 256 + tvb_get_guint8(tvb, offset+1);
-                               proto_tree_add_text(property_item,
-                                       tvb,
-                                       offset,
-                                       2,
-                                       "Value          : %d",
-                                       property_value);
-                               offset += 2;
-                               length -= 2;
-                               break;
-                       }
-               case 3:
-                       {
-                               guint64 property_value;
-                               property_value = tvb_get_guint8(tvb, offset) * 65536 +
-                                       tvb_get_guint8(tvb, offset + 1) * 256 +
-                                       tvb_get_guint8(tvb, offset + 2);
-                               proto_tree_add_text(property_item,
-                                       tvb,
-                                       offset,
-                                       3,
-                                       "Value          : %llu",
-                                       property_value);
-                               offset += 3;
-                               length -= 3;
-                               break;
-                       }
-               case 4:
-                       {
-                               guint64 property_value;
-                               property_value = tvb_get_guint8(tvb, offset) * 16777216 +
-                                       tvb_get_guint8(tvb, offset + 1) * 65536 +
-                                       tvb_get_guint8(tvb, offset + 2) * 256 +
-                                       tvb_get_guint8(tvb, offset + 3);
-                               proto_tree_add_text(property_item,
-                                       tvb,
-                                       offset,
-                                       4,
-                                       "Value          : %llu",
-                                       property_value);
-                               offset += 4;
-                               length -= 4;
-                               break;
-                       }
-               default:
-                       {
-                               /* add text to the frame tree */
-                               value_item = proto_tree_add_text(property_tree,
-                                       tvb,
-                                       offset,
-                                       property_length,
-                                       "Value (> 4 bytes)");
-
-                               value_tree = proto_item_add_subtree(value_item, ett_value);
-
-                               property_value_index = 0;
-                               while(property_length > 0)
-                               {
-                                       property_value_index++;
-                                       proto_tree_add_text(value_item,
-                                               tvb,
-                                               offset,
-                                               1,
-                                               "Value %5d: 0x%02x",
-                                               property_value_index, tvb_get_guint8(tvb, offset));
-                                       offset++;
-                                       length--;
-                                       property_length--;
-                               }
-                               break;
-                       }
-               }
-       }
-}
-
-
-
-/*-----------------------------------------------------------------------------
-       GETPROPERTY MESSAGE BODY DECODER
-       This function decodes the message body of an 0x15 (and 0x16) UA3G message.
-       ---------------------------------------------------------------------------*/
-static void decode_getproperty_tlv(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
-{
-       proto_item *body_item;
-       proto_tree *body_tree;
-       guint8 body_type;
-
-       /* add text to the frame tree */
-       body_item = proto_tree_add_text(tree,
-               tvb,
-               offset,
-               length,
-               "NOE Message Body");
-       body_tree = proto_item_add_subtree(body_item, ett_property);
-
-       while(length > 0)
-       {
-               body_type = tvb_get_guint8(tvb, offset);
-
-               proto_tree_add_text(body_item,
-                       tvb,
-                       offset,
-                       1,
-                       "Property Opcode: %s (0x%02x)",
-                       val_to_str(body_type, val_str_props, "Unknown"),
-                       body_type);
-               offset++;
-               length--;
-
-               if(body_type >= P_ARRAY)
-               {
-                       proto_tree_add_text(body_item,
-                               tvb,
-                               offset,
-                               1,
-                               "Index: %d",
-                               tvb_get_guint8(tvb, offset));
-                       offset++;
-                       length--;
-               }
-       }
-}
-
-
-
-/*-----------------------------------------------------------------------------
-       TERMINAL TO SERVER EVENT MESSAGE BODY DECODER
-       This function decodes the message body of an 0x15 (and 0x16) UA3G message.
-       ---------------------------------------------------------------------------*/
-static void decode_evt(proto_tree *tree,
-                                          tvbuff_t *tvb,
-                                          packet_info *pinfo,
-                                          guint offset,
-                                          guint length)
-{
-       guint8 event = tvb_get_guint8(tvb, offset);
-
-       proto_tree_add_uint_format(tree,
-               hf_noe_event,
-               tvb,
-               offset,
-               1,
-               event,
-               "Event   : %s (%d)",
-               val_to_str(event, val_str_event, "Unknown"),
-               event);
-
-       /* add text to the frame "INFO" column */
-       if(check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
-               val_to_str(event, val_str_event, "Unknown"));
-       /* update text of the main proto item */
-       proto_item_append_text(tree, ", %s",
-               val_to_str(event, val_str_event, "Unknown"));
-
-       offset++;
-       length--;
-
-       switch(event)
-       {
-       case OPCODE_EVT_BT_KEY_SHORTPRESS:
-       case OPCODE_EVT_BT_KEY_LONGPRESS:
-       case OPCODE_EVT_BT_KEY_VERYLONGPRESS:
-       case OPCODE_EVT_KEY_LINE:
-       case OPCODE_EVT_ONHOOK:
-       case OPCODE_EVT_OFFHOOK:
-               {
-                       static const value_string str_struct[] = {
-                               {0x00, "RJ9 Plug"               },
-                               {0x01, "BT Handset Link"},
-                               {0, NULL}
-                               };
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               length,
-                               "Value   : %s (%d)",
-                               val_to_str(tvb_get_guint8(tvb, offset), str_struct, "Unknown"), tvb_get_guint8(tvb, offset));
-                       break;
-               }
-       case OPCODE_EVT_KEY_PRESS:
-       case OPCODE_EVT_KEY_RELEASE:
-       case OPCODE_EVT_KEY_SHORTPRESS:
-       case OPCODE_EVT_KEY_LONGPRESS:
-       case OPCODE_EVT_HELP:
-               {
-                       /* utf8_value is the utf8 value to translate into Unicode with the decode_uft8 function */
-                       guint64 utf8_value = 0;
-                       guint64 unicode_value;
-                       static char key_name[30];
-                       int pt_length = length;
-                       int pt_offset = offset;
-
-                       while(pt_length > 0)
-                       {
-                               utf8_value = (utf8_value << 8) + tvb_get_guint8(tvb, pt_offset);
-                               pt_offset ++;
-                               pt_length --;
-                       }
-                       unicode_value = decode_utf8(utf8_value);
-                       g_snprintf(key_name, 30, "\"%s\"", decode_key_name((int)unicode_value));
-
-                       /* add text to the frame "INFO" column */
-                       if(check_col(pinfo->cinfo, COL_INFO))
-                               col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
-                               key_name);
-                       /* update text of the main proto item */
-                       proto_item_append_text(tree, ", %s",
-                               key_name);
-
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               length,
-                               "Key Name: %s (UTF-8 Value: %s, Unicode Value: 0x%x)",
-                               key_name,
-                               tvb_bytes_to_str(tvb, offset, length),
-                               unicode_value);
-                       break;
-               }
-       case OPCODE_EVT_ERROR_PROTOCOL:
-       case OPCODE_EVT_ERROR_CREATE:
-       case OPCODE_EVT_ERROR_DELETE:
-       case OPCODE_EVT_ERROR_SET_PROPERTY:
-       case OPCODE_EVT_ERROR_GET_PROPERTY:
-               {
-                       decode_evt_error(tree, tvb, offset, length);
-                       break;
-               }
-       case OPCODE_EVT_CONTEXT_SWITCH:
-               {
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               1,
-                               "Context : %s",
-                               val_to_str(tvb_get_guint8(tvb, offset),
-                               VALS(servers_vals),
-                               "Unknown"));
-                       break;
-               }
-       case OPCODE_EVT_SUCCESS_CREATE:
-       case OPCODE_EVT_SUCCESS_DELETE:
-       case OPCODE_EVT_SUCCESS_SET_PROPERTY:
-       case OPCODE_EVT_SUCCESS_INSERT_ITEM:
-       case OPCODE_EVT_SUCCESS_DELETE_ITEM:
-               {
-                       proto_tree_add_uint(tree,
-                               hf_noe_objectid,
-                               tvb,
-                               offset,
-                               2,
-                               tvb_get_ntohs(tvb, offset));
-                       /* update text of the main proto item */
-                       proto_item_append_text(tree, ", Objectid: 0x%x",
-                               (guint) tvb_get_ntohs(tvb, offset));
-                       break;
-               }
-       case OPCODE_EVT_WIDGETS_GC:
-               {
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               4,
-                               "FreeMem : %d bytes",
-                               tvb_get_ntohl(tvb, offset));
-                       break;
-               }
-       case OPCODE_EVT_BT_BONDING_RESULT:
-               {
-                       proto_tree_add_uint(tree,
-                               hf_noe_objectid,
-                               tvb,
-                               offset,
-                               2,
-                               tvb_get_ntohs(tvb, offset));
-                       /* update text of the main proto item */
-                       proto_item_append_text(tree, ", Objectid: 0x%x",
-                               (guint) tvb_get_ntohs(tvb, offset));
-                       offset += 2;
-                       length -= 2;
-
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               1,
-                               "Bonded : %d",
-                               tvb_get_ntohs(tvb, offset));
-                       offset += 1;
-                       length -= 1;
-
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               1,
-                               "Value  : %d",
-                               tvb_get_ntohs(tvb, offset));
-                       break;
-               }
-       default:
-               {
-                       proto_tree_add_uint(tree,
-                               hf_noe_objectid,
-                               tvb,
-                               offset,
-                               2,
-                               tvb_get_ntohs(tvb, offset));
-                       /* update text of the main proto item */
-                       proto_item_append_text(tree, ", Objectid: 0x%x",
-                               (guint) tvb_get_ntohs(tvb, offset));
-                       offset += 2;
-                       length -= 2;
-
-                       if(length > 0)
-                               decode_tlv(tree, tvb, offset, length);
-                       break;
-               }
-       }
-}
-
-
-
-/*-----------------------------------------------------------------------------
-       METHOD DECODER
-       This function decodes the method of an 0x15 (and 0x16) UA3G message.
-       ---------------------------------------------------------------------------*/
-static void decode_mtd(proto_tree *tree,
-                                          tvbuff_t *tvb,
-                                          packet_info *pinfo,
-                                          guint8 method,
-                                          guint offset,
-                                          guint length)
-{
-       guint8 class = tvb_get_guint8(tvb, offset);
-
-       proto_tree_add_uint_format(tree,
-               hf_noe_class,
-               tvb,
-               offset,
-               1,
-               class,
-               "Class   : %s (%d)",
-               val_to_str(class, val_str_class, "Unknown"),
-               class);
-
-       /* add text to the frame "INFO" column */
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
-               val_to_str(class, val_str_class, "Unknown"));
-       /* update text of the main proto item */
-       proto_item_append_text(tree, ", %s",
-               val_to_str(class, val_str_class, "Unknown"));
-
-       offset++;
-       length--;
-
-       if(class >= C_DYNAMIC)
-       {
-               proto_tree_add_uint(tree,
-                       hf_noe_objectid,
-                       tvb,
-                       offset,
-                       2,
-                       tvb_get_ntohs(tvb, offset));
-
-               /* update text of the main proto item */
-               proto_item_append_text(tree, ", Objectid: 0x%x",
-                       (guint) tvb_get_ntohs(tvb, offset));
-
-               offset += 2;
-               length -= 2;
-       }
-
-       switch(method)
-       {
-       case METHOD_INSERT_ITEM:
-               {
-                       proto_tree_add_uint(tree,
-                               hf_noe_method_index,
-                               tvb,
-                               offset,
-                               1,
-                               tvb_get_guint8(tvb, offset));
-                       offset += 1;
-                       length -= 1;
-                       if(length > 0)
-                               decode_tlv(tree, tvb, offset, length);
-                       break;
-               }
-       case METHOD_DELETE_ITEM:
-               {
-                       proto_tree_add_uint(tree,
-                               hf_noe_method_index,
-                               tvb,
-                               offset,
-                               1,
-                               tvb_get_guint8(tvb, offset));
-                       break;
-               }
-       case METHOD_GET_PROPERTY:
-               {
-                       decode_getproperty_tlv(tree, tvb, offset, length);
-                       break;
-               }
-       default:
-               {
-                       if(length > 0)
-                               decode_tlv(tree, tvb, offset, length);
-                       break;
-               }
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-  NOE DISSECTOR
-  ---------------------------------------------------------------------------*/
-static void dissect_noe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
-       proto_item    *noe_item  = NULL;
-       proto_tree    *noe_tree  = NULL;
-       gint           length    = 0;
-       guint8         server    = 0;
-       gint           offset    = 0;
-       guint8         method    = 0xff;
-       guint8         methodack = 0;
-
-       (void)pinfo;
-
-       if(tree)
-       {
-               noe_item = proto_tree_add_item(tree, proto_noe, tvb, 0, -1, FALSE);
-               noe_tree = proto_item_add_subtree(noe_item, ett_noe);
-
-               length = tvb_get_letohs(tvb, offset);
-
-               proto_tree_add_uint(noe_tree,
-                       hf_noe_length,
-                       tvb,
-                       offset,
-                       2,
-                       length);
-               offset += 2;
-
-               server = tvb_get_guint8(tvb, offset);
-
-               /* add text to the frame "INFO" column */
-               if(check_col(pinfo->cinfo, COL_INFO))
-                       col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
-                       val_to_str(server, VALS(servers_short_vals), "Unknown"));
-               
-               proto_tree_add_uint(noe_tree,
-                       hf_noe_server,
-                       tvb,
-                       offset,
-                       1,
-                       tvb_get_guint8(tvb, offset));
-               offset++;
-               length--;
-               
-               /* update text of the main proto item */
-               proto_item_append_text(noe_item, ", %s",
-                       val_to_str(server, VALS(servers_short_vals), "Unknown"));
-
-               method    = tvb_get_guint8(tvb, offset);
-               methodack = (method & 0x80) ? 1 : 0;
-               method    = (method & 0x7f);
-
-               proto_tree_add_uint(noe_tree,
-                       hf_noe_method,
-                       tvb,
-                       offset,
-                       1,
-                       method);
-
-               if(method >= METHOD_INVALID)
-                       return;
-
-               /* add text to the frame "INFO" column */
-               if(check_col(pinfo->cinfo, COL_INFO))
-                       col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
-                       val_to_str(method, VALS(methods_vals), "Unknown"));
-
-               /* update text of the main proto item */
-               proto_item_append_text(noe_item, ", %s",
-                       val_to_str(method, VALS(methods_vals), "Unknown"));
-
-               if(method == METHOD_NOTIFY)
-               {
-                       offset++;
-                       length--;
-                       decode_evt(noe_tree, tvb, pinfo, offset, length);
-               }
-               else
-               /* Create, Delete, SetProperty, GetProperty, DeleteItem, InsertItem properties */
-               {
-                       proto_tree_add_boolean(noe_tree,
-                               hf_noe_method_ack,
-                               tvb,
-                               offset,
-                               1,
-                               methodack);
-                       offset++;
-                       length--;
-                       decode_mtd(noe_tree, tvb, pinfo, method, offset, length);
-               }
-       }
-}
-
-
-
-/*-----------------------------------------------------------------------------
-  DISSECTORS REGISTRATION FUNCTIONS
-  ---------------------------------------------------------------------------*/
-void proto_register_noe(void)
-{
-       static hf_register_info hf_noe[] =
-       {
-               { &hf_noe_length,
-               {
-                       "Length  ",
-                       "noe.length",
-                       FT_UINT16,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Method Length",
-                       HFILL
-               }
-               },  
-               { &hf_noe_server,
-               {
-                       "Server  ",
-                       "noe.server",
-                       FT_UINT8,
-                       BASE_HEX,
-                       VALS(servers_vals),
-                       0x0,
-                       "Method Opcode",
-                       HFILL
-               }
-               },  
-               { &hf_noe_method_ack,
-               {
-                       "Ack     ",
-                       "noe.method_ack",
-                       FT_BOOLEAN,
-                       BASE_NONE,
-                       NULL,
-                       0x0,
-                       "Method Acknowlege",
-                       HFILL
-               }
-               },
-               { &hf_noe_method,
-               {
-                       "Method  ",
-                       "noe.method",
-                       FT_UINT8,
-                       BASE_DEC,
-                       VALS(methods_vals),
-                       0x0,
-                       "Method Opcode",
-                       HFILL
-               }
-               },
-               { &hf_noe_class,
-               {
-                       "Class   ",
-                       "noe.class",
-                       FT_UINT8,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Class Opcode",
-                       HFILL
-               }
-               },
-               { &hf_noe_event,
-               {
-                       "Event   ",
-                       "noe.event",
-                       FT_UINT8,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Event Opcode",
-                       HFILL
-               }
-               },
-               { &hf_noe_objectid,
-               {
-                       "Objectid",
-                       "noe.objectid",
-                       FT_UINT16,
-                       BASE_HEX,
-                       NULL,
-                       0x0,
-                       "Object Identifier",
-                       HFILL
-               }
-               },
-               { &hf_noe_method_index,
-               {
-                       "ItemIndx",
-                       "noe.item_index",
-                       FT_UINT8,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Delete/Insert Index",
-                       HFILL
-               }
-               },
-               { &hf_noe_pcode,
-               {
-                       "Property",
-                       "noe.property",
-                       FT_UINT8,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Property Identifier",
-                       HFILL
-               }
-               },
-               { &hf_noe_aindx,
-               {
-                       "ArrIndex",
-                       "noe.array_index",
-                       FT_UINT8,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Array Index",
-                       HFILL
-               }
-               },
-               { &hf_noe_psize,
-               {
-                       "PropSize",
-                       "noe.property_size",
-                       FT_UINT16,
-                       BASE_DEC,
-                       NULL,
-                       0x0,
-                       "Property Size",
-                       HFILL
-               }
-               }
-       };
-
-       static gint *ett[] =
-       {
-               &ett_noe,
-               &ett_body,
-               &ett_property,
-               &ett_value,
-       };
-
-       /* NOE dissector registration */
-       proto_noe = proto_register_protocol("NOE Protocol", "NOE", "noe");
-
-       proto_register_field_array(proto_noe, hf_noe, array_length(hf_noe));
-
-       register_dissector("noe", dissect_noe, proto_noe);
-
-       /* Common subtree array registration */
-       proto_register_subtree_array(ett, array_length(ett));
-}
-
-
-
-void proto_reg_handoff_noe(void)
-{
-       dissector_handle_t handle_noe = find_dissector("noe");
-
-       /* hooking of UA on UAUDP */
-       register_dissector_table("ua.opcode",
-               "ua.opcode",
-               FT_UINT8,
-               BASE_HEX);
-
-       dissector_add("ua.opcode", 0x15, handle_noe);
-}
index c05e58d..e88cd82 100644 (file)
 /* packet-ua.c
- * Routines for UA/UDP (Universal Alcatel over UDP) packet dissection.
- * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
- *
- * $Id: 
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
+* Routines for UA (Universal Alcatel) packet dissection.
+* Copyright 2011, Marek Tews <marek@trx.com.pl>
+*
+* $Id$
+*
+* Wireshark - Network traffic analyzer
+* By Gerald Combs <gerald@wireshark.org>
+* Copyright 1998 Gerald Combs
+*
+* Copied from WHATEVER_FILE_YOU_USED (where "WHATEVER_FILE_YOU_USED"
+* is a dissector file; if you just copied this from README.developer,
+* don't bother with the "Copied from" - you don't even need to put
+* in a "Copied from" if you copied an existing dissector, especially
+* if the bulk of the code in the new dissector is your code)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include "epan/packet.h"
-#include "epan/prefs.h"
-#include "epan/tap.h"
-#include "epan/value_string.h"
-#include "epan/dissectors/packet-rtp.h"
-#include "epan/dissectors/packet-rtcp.h"
-#include <string.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
 
-#include "packet-uaudp.h"
+#include <epan/packet.h>
+
+static void DissectNOE(tvbuff_t *pTvb, proto_tree *pRootUA);
+static void DissectNOE_type(tvbuff_t *pTvb, proto_tree *pNoeItem);
+static void DissectNOE_voicemode(tvbuff_t *pTvb, proto_tree *pNoeItem);
+static void DissectNOE_callserver(tvbuff_t *pTvb, proto_tree *pNoeItem);
+static void DissectNOE_ip(tvbuff_t *pTvb, proto_tree *pNoeItem);
+static void DissectNOE_ip_startrtp(tvbuff_t *pTvb, proto_tree *pNoeItem);
+static void DissectNOE_ip_startrtp_properties(tvbuff_t *pTvb, proto_tree *pNoeItem);
+
+static void DissectTLV(tvbuff_t *pTvb, proto_tree *pNoeItem, gboolean bIsArrIndex);
+static void DissectTLV_data(tvbuff_t *pTvb, proto_tree *pTlv, guint8 u8Property);
+
+/*
+* Here are the global variables associated with
+* the various user definable characteristics of the dissection
+*/
+
+/* Define the UA proto */
+static int proto_ua = -1;
+
+/* Define many header fields for UA (Universal Alcatel Protocol) */
+static int hf_noe = -1;
+static int hf_noe_length = -1;
+static int hf_noe_type = -1;
+static int hf_noe_method = -1;
+static int hf_noe_class = -1;
+static int hf_noe_objid = -1;
+static int hf_noe_event = -1;
+static int hf_noe_keychar = -1;
+static int hf_noe_action = -1;
+static int hf_noe_reserved = -1;
+static int hf_noe_property = -1;
+static int hf_noe_id = -1;
+static int hf_noe_size = -1;
+static int hf_noe_local_port = -1;
+static int hf_noe_remote_ip = -1;
+static int hf_noe_remote_port = -1;
+static int hf_noe_data = -1;
+static int hf_noe_compressor = -1;
+static int hf_noe_typeofservice = -1;
+static int hf_noe_payloadconcat = -1;
+static int hf_noe_voicemode = -1;
+
+static int hf_tlv = -1;
+static int hf_tlv_property = -1;
+static int hf_tlv_arrindex = -1;
+static int hf_tlv_propsize = -1;
+static int hf_tlv_label = -1;
+static int hf_tlv_data = -1;
+static int hf_tlv_year = -1;
+static int hf_tlv_number = -1;
+
+/* Define the trees for UA (Universal Alcatel Protocol) */
+static int ett_ua = -1;
+
+static int ett_noe = -1;
+static int ett_noe_property = -1;
+
+static int ett_tlv = -1;
+static int ett_tlv_sub = -1;
+
+
+/************************************************************
+* Value Strings
+************************************************************/
+
+/**
+* NOE
+*/
+static const value_string szNoeType[] =
+{
+    { 0x00, "Unknown" },
+    { 0x01, "HandsetOffHook" },
+    { 0x02, "HandsetOnHook" },
+    { 0x03, "DigitDialed" },
+    { 0x13, "IP" },
+    { 0x15, "CallServer" },
+    { 0x20, "KeyPushed" },
+    { 0x21, "LedCmd" },
+    { 0x27, "WriteLine1" },
+    { 0x28, "WriteLine2" },
+    { 0x29, "VoiceMode" },
+    { 0x31, "SetClockComd" },
+    { 0x35, "CursorBlink" },
+    { 0x38, "ClockTimerPosition" },
+    { 0x3a, "Error_0x3a" },
+    { 0x3d, "SideTone" },
+    { 0x3f, "Mute" },
+    { 0x46, "AllIconsOff" },
+    { 0x47, "IconsCmd" },
+    { 0x48, "AmplifiedHandset" },
+    { 0x49, "DPIConfiguration" },
+    { 0x4a, "AudioPaddedPath" },
+    { 0x4f, "Error_0x4f" },
+    { 0, NULL }
+};
+
+static const value_string szCallServerMethod[] =
+{
+    { 0x00, "Create" },
+    { 0x01, "Delete" },
+    { 0x02, "SetProperty" },
+    { 0x04, "Notify" },
+    { 0, NULL }
+};
+
+static const value_string szCallServerClass[] =
+{
+    { 1,   "Terminal" },
+    { 5,   "Leds" },
+    { 6,   "Screen" },
+    { 7,   "Date" },
+    { 8,   "AOMV" },
+    { 12,  "CallState" },
+    { 128, "FrameBox" },
+    { 129, "TabBox" },
+    { 130, "ListBox" },
+    { 132, "TextBox" },
+    { 133, "ActionBox" },
+    { 136, "DataBox" },
+    { 137, "TimerBox" },
+    { 144, "AOMVBox" },
+    { 145, "TelephonicBox" },
+    { 146, "KeyboardContext" },
+    { 151, "TelephonicBoxItem" },
+    { 158, "HeaderBox" },
+    { 0, NULL }
+};
+
+static const value_string szCallServerEvent[] =
+{
+    { 2,   "KeyPress" },
+    { 4,   "KeyShortPress" },
+    { 6,   "OnHook" },
+    { 7,   "OffHook" },
+    { 128, "TabBox" },
+    { 133, "ActionBox" },
+    { 152, "DialogBoxDismissed" },
+    { 0, NULL }
+};
+
+static const value_string szStartRtpPropID[] =
+{
+    { 0x00, "LocalUDPPort" },
+    { 0x01, "RemoteIP" },
+    { 0x02, "RemoteUDPPort" },
+    { 0x03, "TypeOfService" },
+    { 0x04, "Payload" },
+    { 0x05, "PayloadConcatenation" }, /* in ms */
+    { 0x06, "EchoCancelationEnabler" },
+    { 0x07, "SilenceCompression" },
+    { 0x08, "_802_1QUserPriority" },
+    { 0x0A, "PostFiltering" },
+    { 0x0B, "HighPassFilter" },
+    { 0, NULL }
+};
+
+static const value_string szStartRtpPayload[] =
+{
+    { 0,    "G.711 A-law" },
+    { 1,    "G.711 mu-law" },
+    { 2,    "G.723.1 5.3 kbps" },
+    { 3,    "G.723.1 6.3 kbps" },
+    { 0x11, "G.729A 8kbps"},
+    { 0, NULL }
+};
+
+static const value_string szNoeAction[] =
+{
+    { 0x01, "Start RTP" },
+    { 0x02, "Stop RTP" },
+    { 0, NULL }
+};
 
+static const value_string szNoeVoiceMode[] =
+{
+    { 0x10, "Disable" },
+    { 0x11, "Handset" },
+    { 0x13, "Speaker" },
+    { 0, NULL }
+};
+
+/**
+* TLV PROPERTY
+*/
+static const value_string szTlvProperty[] =
+{
+    { 8,   "Count" },
+    { 11,  "NavigatorOwnerShip" },
+    { 15,  "NumpadEvent" },
+    { 16,  "Format_16" },
+    { 18,  "W" },
+    { 19,  "Hour" },
+    { 24,  "Year" },
+    { 25,  "Month" },
+    { 26,  "Day" },
+    { 27,  "Minutes" },
+    { 28,  "Seconds" },
+    { 36,  "AnchorID" },
+    { 39,  "Y" },
+    { 40,  "Visible" },
+    { 42,  "FontID" },
+    { 44,  "HAlign" },
+    { 54,  "Icon_54" },
+    { 55,  "Label" },
+    { 56,  "Value" },
+    { 61,  "Focus" },
+    { 62,  "State_62" },
+    { 63,  "Format_63" },
+    { 76,  "VSplit" },
+    { 78,  "RealCount" },
+    { 79,  "Start" },
+    { 95,  "_95" },
+    { 131, "Key Ownership" },
+    { 134, "Mode" },
+    { 135, "Color" },
+    { 137, "Icon_137" },
+    { 138, "Label_138" },
+    { 141, "State_141" },
+    { 142, "Name" },
+    { 143, "Number" },
+    { 147, "Today" },
+    { 148, "Tomorrow" },
+    { 0, NULL }
+};
+
+/************************************************************
+* Check whether it can be protocol data
+************************************************************/
+gboolean is_ua(tvbuff_t *tvb)
+{
+    gint nLen, iOffs;
+    gint nNoeLen;
 
+    nLen = tvb_length(tvb);
+    for(iOffs = 0; iOffs < nLen; )
+    {
+        nNoeLen = tvb_get_letohs(tvb, iOffs) +2;
+        if(nNoeLen > nLen -iOffs)
+            return FALSE;
+        iOffs += nNoeLen;
+    }
+    return TRUE;
+}
 
-/*-----------------------------------------------------------------------------
-  GLOBALS
-  ---------------------------------------------------------------------------*/
-static int  proto_ua_msg               = -1;
-static gint ett_ua_msg                 = -1;
+/************************************************************
+* Dissectors
+************************************************************/
 
-e_ua_direction message_direction; /* Uses to determine UA3G messages */
+/*
+* DissectUA - The dissector for UA (Universal Alcatel Protocol)
+*/
+static int DissectUA(tvbuff_t *pTvb, packet_info *pInfo, proto_tree *pTree)
+{
+    gint        nLen, iOffs;
+    guint       nNoeLen;
+    proto_item *pRootUA;
+    proto_tree *pSubTreeUA;
+    tvbuff_t   *pTvbNoe;
 
-static gboolean setup_conversations_enabled = TRUE;
+    /* Check whether it can be protocol data */
+    if(!is_ua(pTvb))
+        return 0;
 
-static dissector_handle_t rtp_handle = NULL;
-static dissector_handle_t rtcp_handle = NULL;
+    /* INFO column */
+    col_append_str(pInfo->cinfo, COL_INFO, " - UA");
 
-extern gint find_terminal_port(guint port);
+    nLen = tvb_length(pTvb);
+    if(pTree)
+    {
+        /* root element "UA Protocol, ..." */
+        pRootUA = proto_tree_add_item(pTree, proto_ua, pTvb, 0, -1, ENC_NA);
+        pSubTreeUA = proto_item_add_subtree(pRootUA, ett_ua);
 
+        /* NOE items */
+        for(iOffs = 0; iOffs < nLen; )
+        {
+            nNoeLen = tvb_get_letohs(pTvb, iOffs);
+            nNoeLen += 2;
 
-extern void dhs2ua(char *p, const char *ptr, int opcode, int length);
-extern void ua2dhs(char *p, const char *ptr, int opcode, int length);
+            pTvbNoe = tvb_new_subset(pTvb, iOffs, nNoeLen, nNoeLen);
+            DissectNOE(pTvbNoe, pSubTreeUA);
 
+            iOffs += nNoeLen;
+        }
+    }
 
-static void uadecode(e_ua_direction direction,
-                                        proto_tree *tree,
-                                        packet_info *pinfo,
-                                        tvbuff_t *tvb,
-                                        gint offset,
-                                        gint opcode,
-                                        gint length)
-{
-       message_direction = direction;
-
-       switch(opcode & 0x7f) /* suppression of the CP bit */
-       {
-       case 0x15:
-       case 0x16:
-               {
-                       call_dissector(find_dissector("noe"),
-                               tvb_new_subset(tvb, offset, length, length),
-                               pinfo,
-                               tree);
-                       break;
-               }
-       case 0x00:
-       case 0x01:
-       case 0x02:
-       case 0x03:
-       case 0x04:
-       case 0x05:
-       case 0x06:
-       case 0x07:      /* Only UA NOE */
-       case 0x08:      /* Only UA NOE */
-       case 0x09:
-       case 0x0A:
-       case 0x0B:
-       case 0x0C:
-       case 0x0D:
-       case 0x0E:
-       case 0x0F:
-       case 0x11:
-       case 0x12:
-       case 0x13:
-       case 0x14:
-       case 0x17:
-       case 0x18:
-       case 0x1F:      /* case 0x9F */
-       case 0x20:
-       case 0x21:
-       case 0x22:
-       case 0x23:
-       case 0x24:      /* Only IP NOE */
-       case 0x25:      /* Only IP NOE */
-       case 0x26:
-       case 0x27:
-       case 0x28:
-       case 0x29:
-       case 0x2A:
-       case 0x2B:      /* Only UA NOE */
-       case 0x2C:
-       case 0x2D:
-       case 0x2E:
-       case 0x30:
-       case 0x31:
-       case 0x32:      /* Only UA NOE */
-       case 0x33:
-       case 0x35:
-       case 0x36:      /* IP Phone */
-       case 0x38:
-       case 0x39:
-       case 0x3A:
-       case 0x3B:
-       case 0x3C:
-       case 0x3D:
-       case 0x3E:
-       case 0x3F:
-       case 0x40:
-       case 0x41:
-       case 0x42:
-       case 0x43:
-       case 0x44:
-       case 0x45:
-       case 0x46:
-       case 0x47:
-       case 0x48:
-       case 0x49:
-       case 0x4A:
-       case 0x4B:
-       case 0x4C:
-       case 0x4D:
-       case 0x4E:
-       case 0x4F:
-       case 0x50:      /* Only UA NOE */
-               {
-                       call_dissector(find_dissector("ua3g"),
-                       tvb_new_subset(tvb, offset, length, length),
-                       pinfo,
-                       tree);
-                       break;
-               }
-       default:
-               {
-                       /* add text to the frame "INFO" column */
-                       if (check_col(pinfo->cinfo, COL_INFO))
-                               col_append_fstr(pinfo->cinfo, COL_INFO, " - UA3G Message ERR: Opcode Unknown");
-
-                       proto_tree_add_text(tree,
-                               tvb,
-                               offset,
-                               length,
-                               "Opcode Unknown 0x%02x",
-                               tvb_get_guint8(tvb, (offset + 2)));
-                       break;
-               }
-       }
+    return nLen;
 }
 
 
-
-/*-----------------------------------------------------------------------------
-  UA DISSECTOR
-  ---------------------------------------------------------------------------*/
-static void _dissect_ua_msg(tvbuff_t *tvb,
-                                               packet_info *pinfo,
-                                               proto_tree *tree,
-                        e_ua_direction direction)
+/**********************************************
+* NOE section
+***********************************************
+Noe
+NoeVoiceMode
+NoeMute
+NoeIP
+NoeIPStartRTP
+NoeCallServer
+NoeCallServerCreate
+NoeCallServerSetProperty
+NoeCallServerNotify
+NoeCallServerNotifyKeyPress
+NoeCallServerNotifyKeyShortPress
+***********************************************/
+static void DissectNOE(tvbuff_t *pTvb, proto_tree *pRootUA)
 {
-       proto_item *ua_msg_item = NULL;
-       proto_tree *ua_msg_tree = NULL;
-       gint offset = 0;
-       gint length = 0;
-       gint opcode = 0;
-       gint suboffset  = 0;
-    address remote_rtp_addr;
-       guint32 remote_rtp_port = 0;
-
-       if(tree)
-       {
-               ua_msg_item = proto_tree_add_protocol_format(tree, proto_ua_msg, tvb, 0, -1,
-                       "Universal Alcatel Protocol, %s",
-                       ((direction == SYS_TO_TERM) ?
-                       "System -> Terminal" : "Terminal -> System"));
-
-               ua_msg_tree = proto_item_add_subtree(ua_msg_item, ett_ua_msg);
-
-               while (tvb_offset_exists(tvb, offset))
-               {
-                       length = (tvb_get_guint8(tvb, offset+0) +
-                               tvb_get_guint8(tvb, offset+1) * 256) + 2;
-
-                       opcode = tvb_get_guint8(tvb, offset+2);
-
-                       /* RTP/RTCP conversation setup */
-                       if(setup_conversations_enabled && opcode==0x13 && tvb_get_guint8(tvb, offset+3)==0x01)
-                       {
-                               /* StartRTP */
-                               suboffset = offset+5;
-                               remote_rtp_addr.data = NULL;
-
-                               while(suboffset < offset+length)
-                               {
-                                       switch(tvb_get_guint8(tvb, suboffset))
-                                       {
-                                       case 0x00: /* local port */
-                                               {
-                                               /*local_rtp_port = tvb_get_ntohs(tvb, suboffset+2);*/
-                                               break;
-                                               }
-                                       case 0x01: /* remote IP */
-                                               {
-                                               remote_rtp_addr.type=AT_IPv4;
-                                               remote_rtp_addr.len=4;
-                                               remote_rtp_addr.data=tvb_get_ptr(tvb, suboffset+2, 4);
-                                               break;
-                                               }
-                                       case 0x02: /* remote port */
-                                               {
-                                               remote_rtp_port = tvb_get_ntohs(tvb, suboffset+2);
-                                               break;
-                                               }
-                                       }
-
-                               suboffset += tvb_get_guint8(tvb, suboffset+1) + 2;
-                               }
-
-                               if(remote_rtp_addr.data!=NULL && remote_rtp_port!=0)
-                               {
-                                       if(rtp_handle)
-                                       {
-                                               rtp_add_address(pinfo, &remote_rtp_addr, remote_rtp_port, 0,
-                                               "UA", pinfo->fd->num, 0, NULL);
-                                       }
-                                       if(rtcp_handle)
-                                       {
-                                               rtcp_add_address(pinfo, &remote_rtp_addr, remote_rtp_port+1, 0,
-                                               "UA", pinfo->fd->num);
-                                       }
-                               }
-                       }
-
-                       uadecode(direction, ua_msg_tree, pinfo, tvb, offset, opcode, length);
-
-                       offset += length;
-               }
-       }
+    proto_item *pNoeItem = proto_tree_add_item(pRootUA, hf_noe, pTvb, 0, -1, ENC_NA);
+    if(pNoeItem)
+    {
+        proto_tree* pSubTreeNOE;
+
+        pSubTreeNOE = proto_item_add_subtree(pNoeItem, ett_noe);
+        proto_tree_add_item(pSubTreeNOE, hf_noe_length, pTvb, 0, 2, ENC_LITTLE_ENDIAN);
+        DissectNOE_type(tvb_new_subset_remaining(pTvb, 2), pSubTreeNOE);
+    }
 }
 
+static void DissectNOE_type(tvbuff_t *pTvb, proto_tree *pNoeItem)
+{
+    proto_item_append_text(pNoeItem, ": %s", val_to_str_const(tvb_get_guint8(pTvb, 0), szNoeType, "Unknown"));
+    proto_tree_add_item(pNoeItem, hf_noe_type, pTvb, 0, 1, ENC_NA);
+
+    switch(tvb_get_guint8(pTvb, 0))
+    {
+    case 0x13: /*IP*/
+        {
+            DissectNOE_ip(tvb_new_subset_remaining(pTvb, 1), pNoeItem);
+            break;
+        }
+    case 0x15: /*CallServer*/
+        {
+            DissectNOE_callserver(tvb_new_subset_remaining(pTvb, 1), pNoeItem);
+            break;
+        }
+    case 0x29: /*VoiceMode*/
+        {
+            DissectNOE_voicemode(tvb_new_subset_remaining(pTvb, 1), pNoeItem);
+            break;
+        }
+    }
+}
 
-static void dissect_ua_sys_to_term(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void DissectNOE_voicemode(tvbuff_t *pTvb, proto_tree *pNoeItem)
 {
-       _dissect_ua_msg(tvb, pinfo, tree, SYS_TO_TERM);
+    proto_tree_add_item(pNoeItem, hf_noe_voicemode, pTvb, 0, 1, ENC_NA);
+    if(tvb_length(pTvb) > 1)
+        proto_tree_add_item(pNoeItem, hf_noe_data, pTvb, 1, -1, ENC_NA);
 }
 
-static void dissect_ua_term_to_sys(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void DissectNOE_callserver(tvbuff_t *pTvb, proto_tree *pNoeItem)
 {
-       _dissect_ua_msg(tvb, pinfo, tree, TERM_TO_SYS);
+    tvbuff_t *pTvbTlv;
+
+    gint nLen;
+    guint8 u8Method;
+
+    nLen = tvb_length(pTvb);
+    u8Method = tvb_get_guint8(pTvb, 0);
+
+    proto_item_append_text(pNoeItem, ", %s", val_to_str(u8Method, szCallServerMethod, "Unknown"));
+    proto_tree_add_item(pNoeItem, hf_noe_method, pTvb, 0, 1, ENC_NA);
+
+    switch(u8Method)
+    {
+    case 0x00: /*Create*/
+    case 0x01: /*Delete*/
+    case 0x02: /*SetProperty*/
+        {
+            guint8 u8Class; gint iOffs;
+
+            u8Class = tvb_get_guint8(pTvb, 1);
+            proto_item_append_text(pNoeItem, ", %s", val_to_str(u8Class, szCallServerClass, "Unknown"));
+            proto_tree_add_item(pNoeItem, hf_noe_class, pTvb, 1, 1, ENC_NA);
+
+            iOffs = 2;
+            if(u8Class >= 100)
+            {
+                proto_item_append_text(pNoeItem, ", Id(0x%04x)", tvb_get_ntohs(pTvb, 2));
+                proto_tree_add_item(pNoeItem, hf_noe_objid, pTvb, 2, 2, ENC_LITTLE_ENDIAN);
+                iOffs += 2;
+            }
+
+            /* TLV items */
+            for(; iOffs < nLen; )
+            {
+                guint    nTlvLen;
+                guint8   nTlvProperty;
+                gboolean bIsArrIndex;
+
+                nTlvProperty = tvb_get_guint8(pTvb, iOffs);
+                /* for property of more than 100 and equal 104 or 120 before the field is still arrindex propsize */
+                if((nTlvProperty < 100) || (nTlvProperty == 104) || (nTlvProperty == 120))
+                {
+                    nTlvLen = tvb_get_guint8(pTvb, iOffs+1);
+                    nTlvLen += 2;
+                    bIsArrIndex = FALSE;
+                }
+                else
+                {
+                    nTlvLen = tvb_get_guint8(pTvb, iOffs+2);
+                    nTlvLen += 3;
+                    bIsArrIndex = TRUE;
+                }
+                pTvbTlv = tvb_new_subset(pTvb, iOffs, nTlvLen, nTlvLen);
+                DissectTLV(pTvbTlv, pNoeItem, bIsArrIndex);
+
+                iOffs += nTlvLen;
+            }
+            break;
+        }
+    case 0x04: /*Notify*/
+        {
+            guint8 u8Event;
+
+            u8Event = tvb_get_guint8(pTvb, 1);
+            proto_tree_add_item(pNoeItem, hf_noe_event, pTvb, 1, 1, ENC_NA);
+
+            switch(u8Event)
+            {
+            case 2: /*KeyPress*/
+                {
+                    proto_tree_add_item(pNoeItem, hf_noe_keychar, pTvb, 2, -1, ENC_NA);
+                    break;
+                }
+            case 4: /*KeyShortPress*/
+                {
+                    proto_tree_add_item(pNoeItem, hf_noe_keychar, pTvb, 2, 2, ENC_NA);
+                    break;
+                }
+            }
+            break;
+        }
+    }
 }
 
+static void DissectNOE_ip(tvbuff_t *pTvb, proto_tree *pNoeItem)
+{
+    guint8 u8Action;
+
+    /* Action */
+    u8Action = tvb_get_guint8(pTvb, 0);
+    proto_item_append_text(pNoeItem, " %s", val_to_str(u8Action, szNoeAction, "Unknown"));
+    proto_tree_add_item(pNoeItem, hf_noe_action, pTvb, 0, 1, ENC_NA);
 
-/*-----------------------------------------------------------------------------
-  DISSECTORS REGISTRATION FUNCTIONS
-  ---------------------------------------------------------------------------*/
-static guint prefs_initialized = FALSE;
+    switch(u8Action)
+    {
+    case 0x01: /*Start RTP*/
+        {
+            DissectNOE_ip_startrtp(tvb_new_subset_remaining(pTvb, 1), pNoeItem);
+            break;
+        }
+    case 0x02: /*Stop RTP*/
+        {
+            break;
+        }
+    }
+}
 
-void proto_reg_handoff_ua_msg(void)
+static void DissectNOE_ip_startrtp(tvbuff_t *pTvb, proto_tree *pNoeItem)
 {
-    static gboolean prefs_initialized = FALSE;
-       dissector_handle_t handle_ua_msg;
+    gint nLen, iOffs;
+    nLen = tvb_length(pTvb);
 
-    if(!prefs_initialized)
+    /*Reserved*/
+    proto_tree_add_item(pNoeItem, hf_noe_reserved, pTvb, 0, 1, ENC_NA);
+
+    /*Properties*/
+    for(iOffs = 1; iOffs < nLen; )
     {
-               /* hooking of UA on UAUDP */
-               register_dissector_table("uaudp.opcode",
-                       "UAUDP opcode",
-                       FT_UINT8,
-                       BASE_DEC);
-
-               handle_ua_msg = find_dissector("ua_sys_to_term");
-               dissector_add("uaudp.opcode", UAUDP_DATA, handle_ua_msg);
-
-               handle_ua_msg = find_dissector("ua_term_to_sys");
-               dissector_add("uaudp.opcode", UAUDP_DATA, handle_ua_msg);
-        prefs_initialized = TRUE;
+        guint     u8PropSize;
+        tvbuff_t *pTvbTlv;
+
+        u8PropSize = tvb_get_guint8(pTvb, iOffs+1) + 2;
+        pTvbTlv = tvb_new_subset(pTvb, iOffs, u8PropSize, u8PropSize);
+
+        DissectNOE_ip_startrtp_properties(pTvbTlv, pNoeItem);
+        iOffs += u8PropSize;
     }
 }
 
+static void DissectNOE_ip_startrtp_properties(tvbuff_t *pTvb, proto_tree *pNoeItem)
+{
+    proto_item *pProp;
+
+    pProp = proto_tree_add_item(pNoeItem, hf_noe_property, pTvb, 0, -1, ENC_NA);
+    if(pProp)
+    {
+        guint8 u8ID, u8Size;
+        proto_tree* pSubTreeProp;
+
+        pSubTreeProp = proto_item_add_subtree(pProp, ett_noe_property);
+        /*ID*/
+        u8ID = tvb_get_guint8(pTvb, 0);
+        proto_item_append_text(pProp, " - %25s", val_to_str(u8ID, szStartRtpPropID, "Unknown"));
+        proto_tree_add_item(pSubTreeProp, hf_noe_id, pTvb, 0, 1, ENC_NA);
+
+        /*SIZE*/
+        u8Size = tvb_get_guint8(pTvb, 1);
+        proto_tree_add_item(pSubTreeProp, hf_noe_size, pTvb, 1, 1, ENC_NA);
+
+        /*data*/
+        switch(u8ID)
+        {
+        default:
+            {
+                proto_item_append_text(pProp, ": %s", tvb_bytes_to_str(pTvb, 2, u8Size));
+                proto_tree_add_item(pSubTreeProp, hf_noe_data, pTvb, 2, -1, ENC_NA);
+                break;
+            }
+        case 0x00: /*LocalUDPPort*/
+            {
+                proto_item_append_text(pProp, ": %u", tvb_get_ntohs(pTvb, 2));
+                proto_tree_add_item(pSubTreeProp, hf_noe_local_port, pTvb, 2, 2, ENC_BIG_ENDIAN);
+                break;
+            }
+        case 0x01: /*RemoteIP*/
+            {
+                proto_item_append_text(pProp, ": %s", tvb_ip_to_str(pTvb, 2));
+                proto_tree_add_item(pSubTreeProp, hf_noe_remote_ip, pTvb, 2, 4, ENC_NA);
+                break;
+            }
+        case 0x02: /*RemoteUDPPort*/
+            {
+                proto_item_append_text(pProp, ": %u", tvb_get_ntohs(pTvb, 2));
+                proto_tree_add_item(pSubTreeProp, hf_noe_remote_port, pTvb, 2, 2, ENC_BIG_ENDIAN);
+                break;
+            }
+        case 0x03: /*TypeOfService*/
+            {
+                proto_item_append_text(pProp, ": %u", tvb_get_guint8(pTvb, 2));
+                proto_tree_add_item(pSubTreeProp, hf_noe_typeofservice, pTvb, 2, 1, ENC_NA);
+                break;
+            }
+        case 0x04: /*Payload*/
+            {
+                proto_item_append_text(pProp, ": %s", val_to_str_const(tvb_get_guint8(pTvb, 2), szStartRtpPayload, "Unknown"));
+                proto_tree_add_item(pSubTreeProp, hf_noe_compressor, pTvb, 2, 1, ENC_NA);
+                break;
+            }
+        case 0x05: /*PayloadConcatenation*/
+            {
+                proto_item_append_text(pProp, ": %u ms", tvb_get_guint8(pTvb, 2));
+                proto_tree_add_item(pSubTreeProp, hf_noe_payloadconcat, pTvb, 2, 1, ENC_NA);
+                break;
+            }
+        }
+    }
+}
 
-void proto_register_ua_msg(void)
+/***********************************************
+* TLV section
+***********************************************/
+static void DissectTLV(tvbuff_t *pTvb, proto_tree *pNoeItem, gboolean bIsArrIndex)
 {
-    module_t *ua_msg_module;
+    proto_item *pTlv;
 
-       static gint *ett[] =
-       {
-               &ett_ua_msg,
-       };
+    pTlv = proto_tree_add_item(pNoeItem, hf_tlv, pTvb, 0, -1, ENC_NA);
+    if(pTlv)
+    {
+        gint iOffs;
+        guint8 u8Property, u8PropSize;
+        proto_tree* pSubTreeTLV;
+
+        iOffs = 0;
+        pSubTreeTLV = proto_item_add_subtree(pTlv, ett_tlv);
+        u8Property = tvb_get_guint8(pTvb, iOffs);
+        proto_item_append_text(pTlv, "%u %s ", u8Property, val_to_str(u8Property, szTlvProperty, "Unknown"));
+        proto_tree_add_item(pSubTreeTLV, hf_tlv_property, pTvb, iOffs++, 1, ENC_NA);
+
+        if(bIsArrIndex)
+            proto_tree_add_item(pTlv, hf_tlv_arrindex, pTvb, iOffs++, 1, ENC_NA);
+
+        u8PropSize = tvb_get_guint8(pTvb, iOffs);
+        proto_tree_add_item(pSubTreeTLV, hf_tlv_propsize, pTvb, iOffs++, 1, ENC_NA);
 
-       /* used for StartRTP conversation setup */
-       rtp_handle = find_dissector("rtp");
-       rtcp_handle = find_dissector("rtcp");
+        if(u8PropSize > 0)
+            DissectTLV_data(tvb_new_subset(pTvb, iOffs, u8PropSize, u8PropSize), pSubTreeTLV, u8Property);
+    }
+}
+
+/* TLV DATA */
+static void DissectTLV_data(tvbuff_t *pTvb, proto_tree *pTlv, guint8 u8Property)
+{
+    proto_tree* pNoeItem;
+    switch(u8Property)
+    {
+    default:
+        {
+            proto_item_append_text(pTlv, "%s", tvb_bytes_to_str(pTvb, 0, tvb_length(pTvb)));
+            proto_tree_add_item(pTlv, hf_tlv_data, pTvb, 0, -1, ENC_NA);
+            break;
+        }
+
+    case 24: /*Year*/
+        {
+            proto_item_append_text(pTlv, "%u", tvb_get_ntohs(pTvb, 0));
+            proto_tree_add_item(pTlv, hf_tlv_year, pTvb, 0, 2, ENC_BIG_ENDIAN);
+            break;
+        }
+
+    case 55: /*Label*/
+    case 138: /*Label_138*/
+        {
+            proto_item_append_text(pTlv, "'%s'", tvb_get_ephemeral_string(pTvb, 0, tvb_length(pTvb)));
+            proto_tree_add_item(pTlv, hf_tlv_label, pTvb, 0, -1, ENC_ASCII|ENC_NA);
+
+            /* append text on NOE level */
+            pNoeItem = proto_item_get_parent(pTlv);
+            proto_item_append_text(pNoeItem, ", Label='%s'", tvb_get_ephemeral_string(pTvb, 0, tvb_length(pTvb)));
+            break;
+        }
+
+    case 143: /*Phone number*/
+        {
+            proto_item_append_text(pTlv, "%s", tvb_get_ephemeral_string(pTvb, 0, tvb_length(pTvb)));
+            proto_tree_add_item(pTlv, hf_tlv_number, pTvb, 0, -1, ENC_NA);
+            break;
+        }
+
+    case 147: /*Today*/
+    case 148: /*Tomorrow*/
+        {
+            proto_item_append_text(pTlv, "'%s'", tvb_get_ephemeral_string(pTvb, 0, tvb_length(pTvb)));
+            proto_tree_add_item(pTlv, hf_tlv_data, pTvb, 0, -1, ENC_NA);
+            break;
+        }
+    }
+}
 
-       /* UA dissector registration */
-       proto_ua_msg = proto_register_protocol("Universal Alcatel Protocol", "UA", "ua");
 
-       register_dissector("ua_sys_to_term", dissect_ua_sys_to_term, proto_ua_msg);
-       register_dissector("ua_term_to_sys", dissect_ua_term_to_sys, proto_ua_msg);
 
-       /* Common subtree array registration */
-       proto_register_subtree_array(ett, array_length(ett));
+/* Register all the bits needed by the filtering engine */
+void proto_register_ua(void)
+{
+    static hf_register_info hf[] =
+    {
+        { &hf_noe,
+          { "NOE", "ua.noe",
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            NULL, HFILL }},
+        { &hf_noe_length,
+          { "Length", "ua.noe.length",
+            FT_UINT16, BASE_DEC, NULL, 0x0,
+            "NOE item length (without 2 bytes containing the length)", HFILL }},
+        { &hf_noe_type,
+          { "Type", "ua.noe.type",
+            FT_UINT8, BASE_DEC, VALS(szNoeType), 0x0,
+            "NOE item type", HFILL }},
+        { &hf_noe_method,
+          { "Method", "ua.noe.method",
+            FT_UINT8, BASE_DEC, VALS(szCallServerMethod), 0x0,
+            "Call Server method", HFILL }},
+        { &hf_noe_class,
+          { "Class", "ua.noe.class",
+            FT_UINT8, BASE_DEC,             VALS(szCallServerClass), 0x0,
+            "Call Server class", HFILL }},
+        { &hf_noe_objid,
+          { "ObjectID", "ua.noe.objid",
+            FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
+            "Call Server object id", HFILL }},
+        { &hf_noe_event,
+          { "Event", "ua.noe.event",
+            FT_UINT8, BASE_DEC, VALS(szCallServerEvent), 0x0,
+            "Call Server event", HFILL }},
+        { &hf_noe_keychar,
+          { "KeyChar", "ua.noe.event.keychar",
+            FT_BYTES, BASE_NONE, NULL, 0x0,
+            "Event key char", HFILL }},
+        { &hf_noe_voicemode,
+          { "VoiceMode", "ua.noe.voicemode",
+            FT_UINT8, BASE_DEC, VALS(szNoeVoiceMode), 0x0,
+            NULL, HFILL }},
+
+        { &hf_noe_action,
+          { "Action", "ua.noe.action",
+            FT_UINT8, BASE_DEC, VALS(szNoeAction), 0x0,
+            "IP action", HFILL }},
+        { &hf_noe_reserved,
+          { "Reserved", "ua.noe.action.startrtp.reserved",
+            FT_UINT8, BASE_DEC, NULL, 0x0,
+            "IP start rtp reserved", HFILL }},
+        { &hf_noe_property,
+          { "Property", "ua.noe.action.startrtp.property",
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            "IP property", HFILL }},
+        { &hf_noe_id,
+          { "ID", "ua.noe.action.startrtp.property.id",
+            FT_UINT8, BASE_DEC, VALS(szStartRtpPropID), 0x0,
+            "IP property id", HFILL }},
+        { &hf_noe_size,
+          { "Size", "ua.noe.action.startrtp.property.size",
+            FT_UINT8, BASE_DEC, NULL, 0x0,
+            "IP property size", HFILL }},
+        { &hf_noe_data,
+          { "Data", "ua.noe.action.startrtp.data",
+            FT_BYTES, BASE_NONE, NULL, 0x0,
+            NULL, HFILL }},
+
+        { &hf_noe_local_port,
+          { "LocalPort", "ua.noe.action.startrtp.localport",
+            FT_UINT16, BASE_DEC, NULL, 0x0,
+            "IP start rtp property localport", HFILL }},
+        { &hf_noe_remote_ip,
+          { "RemoteIP", "ua.noe.action.startrtp.remoteip",
+            FT_IPv4, BASE_NONE, NULL, 0x0,
+            "IP start rtp property remote ipv4", HFILL }},
+        { &hf_noe_remote_port,
+          { "RemotePort", "ua.noe.action.startrtp.remoteport",
+            FT_UINT16, BASE_DEC, NULL, 0x0,
+            "IP start rtp property remoteport", HFILL }},
+        { &hf_noe_compressor,
+          { "Payload", "ua.noe.action.startrtp.payload",
+            FT_UINT8, BASE_DEC, VALS(szStartRtpPayload), 0x0,
+            "IP start rtp property payload", HFILL }},
+        { &hf_noe_typeofservice,
+          { "TypeOfService", "ua.noe.action.startrtp.typeofservice",
+            FT_UINT8, BASE_DEC, NULL, 0x0,
+            "IP start rtp property type of service", HFILL }},
+        { &hf_noe_payloadconcat,
+          { "Payld Concat", "ua.noe.action.startrtp.payldconcat",
+            FT_UINT8, BASE_DEC, NULL, 0x0,
+            "IP start rtp property payload concatenation (in ms)", HFILL }},
+
+        { &hf_tlv,
+          { "TLV", "ua.noe.tlv",
+            FT_NONE, BASE_NONE, NULL, 0x0,
+            NULL, HFILL }},
+        { &hf_tlv_property,
+          { "Property", "ua.noe.tlv.property",
+            FT_UINT8, BASE_DEC, VALS(szTlvProperty), 0x0,
+            "TLV property", HFILL }},
+        { &hf_tlv_arrindex,
+          { "ArrIndex", "ua.noe.tlv.arrindex",
+            FT_UINT8, BASE_DEC, NULL, 0x0,
+            "TLV array index", HFILL }},
+        { &hf_tlv_propsize,
+          { "PropSize", "ua.noe.tlv.propsize",
+            FT_UINT8, BASE_DEC, NULL, 0x0,
+            "TLV property size", HFILL }},
+        { &hf_tlv_data,
+          { "Data", "ua.noe.tlv.data",
+            FT_BYTES, BASE_NONE, NULL, 0x0,
+            "TLV data", HFILL }},
+        { &hf_tlv_label,
+          { "Label", "ua.noe.tlv.label",
+            FT_STRING, BASE_NONE, NULL, 0x0,
+            "TLV label", HFILL }},
+        { &hf_tlv_year,
+          { "Year", "ua.noe.tlv.year",
+            FT_UINT16, BASE_DEC, NULL, 0x0,
+            "TLV year", HFILL }},
+        { &hf_tlv_number,
+          { "Number", "ua.noe.tlv.number",
+            FT_STRING, BASE_NONE, NULL, 0x0,
+            "TLV remote phone number", HFILL }},
+    };
+    static gint *ett[] =
+    {
+        &ett_ua,
+        &ett_noe,
+        &ett_noe_property,
+        &ett_tlv,
+        &ett_tlv_sub,
+    };
+
+    proto_ua = proto_register_protocol("UA Protocol (Universal Alcatel Protocol)", "UA", "ua");
+    proto_register_field_array(proto_ua, hf, array_length(hf));
+    proto_register_subtree_array(ett, array_length(ett));
+}
 
-    /* Register preferences */
-    ua_msg_module = prefs_register_protocol(proto_ua_msg, proto_reg_handoff_ua_msg);
 
-       prefs_register_bool_preference(ua_msg_module, "setup_conversations",
-               "Setup RTP/RTCP conversations on Start RTP",
-               "Setup RTP/RTCP conversations when parsing Start RTP messages",
-               &setup_conversations_enabled);
+/* The registration hand-off routine is called at startup */
+void proto_reg_handoff_ua(void)
+{
+    dissector_handle_t hDis = new_create_dissector_handle(DissectUA, proto_ua);
+    dissector_add_uint("uaudp.opcode", 7, hDis);
 }
+/*
+* Editor modelines - http://www.wireshark.org/tools/modelines.html
+*
+* Local variables:
+* c-basic-offset: 4
+* tab-width: 8
+* indent-tabs-mode: nil
+* End:
+*
+* ex: set shiftwidth=4 tabstop=8 expandtab:
+* :indentSize=4:tabSize=8:noTabs=true:
+*/
diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c
deleted file mode 100644 (file)
index 030517f..0000000
+++ /dev/null
@@ -1,6379 +0,0 @@
-/* packet-ua3g.c
- * Routines for UA/UDP (Universal Alcatel over UDP) packet dissection.
- * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
- *
- * $Id: 
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <glib.h>
-#include "epan/packet.h"
-#include "epan/prefs.h"
-#include "epan/tap.h"
-#include "epan/value_string.h"
-#include "packet-uaudp.h"
-
-extern int isprint( int ch );
-
-/*-----------------------------------------------------------------------------
-       Globals
-       ---------------------------------------------------------------------------*/
-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_option            = -1;
-static int  hf_ua3g_length             = -1;
-static int  hf_ua3g_opcode             = -1;
-static int     hf_ua3g_ip                      = -1;
-static int     hf_ua3g_command         = -1;
-
-extern e_ua_direction message_direction;
-
-/* Definition of opcodes */
-/* System To Terminal */
-#define NOP                                            0x00
-#define PRODUCTION_TEST                        0x01    /* IP Phone */
-#define SUBDEVICE_ESCAPE               0x02    /* IP Phone */
-#define SOFT_RESET                             0x03
-#define IP_PHONE_WARMSTART             0x04    /* IP Phone */
-#define HE_ROUTING                             0x05    /* IP Phone - NOT EXPECTED */
-#define SUBDEVICE_RESET                        0x06
-#define LOOPBACK_ON                            0x07    /* IP Phone & UA NOE */
-#define LOOPBACK_OFF                   0x08    /* IP Phone & UA NOE */
-#define VIDEO_ROUTING                  0x09    /* IP Phone - NOT EXPECTED */
-#define SUPER_MSG                              0x0B
-#define SEGMENT_MSG                            0x0C
-#define REMOTE_UA_ROUTING              0x0D    /* IP Phone - NOT EXPECTED */
-#define VERY_REMOTE_UA_ROUTING 0x0E    /* IP Phone - NOT EXPECTED */
-#define OSI_ROUTING                            0x0F    /* IP Phone - NOT EXPECTED */
-#define ABC_A_ROUTING                  0x11    /* IP Phone - NOT EXPECTED */
-#define IBS_ROUTING                            0x12    /* IP Phone - NOT EXPECTED */
-#define IP_DEVICE_ROUTING              0x13
-#define M_REFLEX_HUB_ROUTING   0x14    /* IP Phone - NOT EXPECTED */
-/*#define NOE_CS_ROUTING               0x15    // Decoded by packet-noe.c */
-/*#define NOE_PS_ROUTING               0x16    // Decoded by packet-noe.c */
-#define SUPER_MSG_2                            0x17
-#define DEBUG_IN_LINE                  0x18
-#define LED_COMMAND                            0x21    /* IP Phone */
-#define START_BUZZER                   0x22    /* VTA */
-#define STOP_BUZZER                            0x23    /* VTA */
-#define ENABLE_DTMF                            0x24    /* Only IP NOE */
-#define DISABLE_DTMF                   0x25    /* Only IP NOE */
-#define CLEAR_LCD_DISP                 0x26    /* IP Phone */
-#define LCD_LINE_1_CMD                 0x27    /* IP Phone */
-#define LCD_LINE_2_CMD                 0x28    /* IP Phone */
-#define MAIN_VOICE_MODE                        0x29
-#define VERSION_INQUIRY                        0x2A
-#define ARE_YOU_THERE                  0x2B    /* IP Phone & UA NOE */
-#define SUBDEVICE_METASTATE            0x2C
-#define VTA_STATUS_INQUIRY             0x2D    /* IP Phone */
-#define SUBDEVICE_STATE                        0x2E
-#define DWL_DTMF_CLCK_FORMAT   0x30    /* IP Phone */
-#define SET_CLCK                               0x31    /* IP Phone */
-#define VOICE_CHANNEL                  0x32    /* IP Phone & UA NOE */
-#define EXTERNAL_RINGING               0x33
-#define LCD_CURSOR                             0x35    /* IP Phone */
-#define DWL_SPECIAL_CHAR               0x36    /* IP Phone */
-#define SET_CLCK_TIMER_POS             0x38    /* IP Phone */
-#define SET_LCD_CONTRAST               0x39    /* IP Phone */
-#define AUDIO_IDLE                             0x3A
-#define SET_SPEAKER_VOL                        0x3B    /* IP Phone */
-#define BEEP                                   0x3C
-#define SIDETONE                               0x3D
-#define RINGING_CADENCE                        0x3E
-#define        MUTE                                    0x3F
-#define FEEDBACK                               0x40
-#define KEY_RELEASE                            0x41    /* IP Phone */
-#define TRACE_ON                               0x42    /* IP Phone - NOT EXPECTED */
-#define TRACE_OFF                              0x43    /* IP Phone - NOT EXPECTED */
-#define READ_PERIPHERAL                        0x44    /* IP Phone - NOT EXPECTED */
-#define WRITE_PERIPHERAL               0x45    /* IP Phone - NOT EXPECTED */
-#define ALL_ICONS_OFF                  0x46    /* IP Phone */
-#define ICON_CMD                               0x47    /* IP Phone */
-#define AMPLIFIED_HANDSET              0x48    /* IP Phone */
-#define AUDIO_CONFIG                   0x49
-#define AUDIO_PADDED_PATH              0x4A    /* IP Phone */
-#define RELEASE_RADIO_LINK             0x4B    /* IP Phone - NOT EXPECTED */
-#define DECT_HANDOVER                  0x4C    /* IP Phone - NOT EXPECTED */
-#define LOUDSPEAKER                            0x4D
-#define ANNOUNCE                               0x4E
-#define RING                                   0x4F
-#define UA_DWL_PROTOCOL                        0x50    /* Only UA NOE */
-/* Terminal To System */
-#define CS_NOP_ACK                             0x00
-#define CS_HANDSET_OFFHOOK             0x01    /* IP Phone */
-#define CS_HANDSET_ONHOOK              0x02    /* IP Phone */
-#define CS_DIGIT_DIALED                        0x03    /* IP Phone */
-#define CS_SUBDEVICE_MSG               0x04
-#define CS_HE_ROUTING                  0x05    /* IP Phone - NOT EXPECTED */
-#define CS_LOOPBACK_ON                 0x06    /* IP Phone & UA NOE */
-#define CS_LOOPBACK_OFF                        0x07    /* IP Phone & UA NOE */
-#define CS_VIDEO_ROUTING               0x09    /* IP Phone - NOT EXPECTED */
-#define CS_WARMSTART_ACK               0x0A    /* IP Phone */
-#define CS_SUPER_MSG                   0x0B    /* IP Phone - NOT EXPECTED */
-#define CS_SEGMENT_MSG                 0x0C
-#define CS_REMOTE_UA_ROUTING   0x0D    /* IP Phone - NOT EXPECTED */
-#define CS_VERY_REMOTE_UA_R            0x0E    /* IP Phone - NOT EXPECTED */
-#define CS_OSI_ROUTING                 0x0F    /* IP Phone - NOT EXPECTED */
-#define CS_ABC_A_ROUTING               0x11    /* IP Phone - NOT EXPECTED */
-#define CS_IBS_ROUTING                 0x12    /* IP Phone - NOT EXPECTED */
-#define CS_IP_DEVICE_ROUTING   0x13
-/*#define CS_NOE_CS_ROUTING            0x15    // Decoded by packet-noe.c */
-/*#define CS_NOE_PS_ROUTING            0x16    // Decoded by packet-noe.c */
-#define CS_SUPER_MSG_2                 0x17
-#define CS_DEBUG_IN_LINE               0x18
-#define CS_UNSOLICITED_MSG             0x9F
-#define CS_NON_DIGIT_KEY_PUSHED        0x20    /* IP Phone */
-#define CS_VERSION_RESPONSE            0x21
-#define CS_I_M_HERE                            0x22
-#define CS_RSP_STATUS_INQUIRY  0x23    /* IP Phone */
-#define CS_SUBDEVICE_STATE             0x24
-#define CS_DIGIT_KEY_RELEASED  0x26    /* IP Phone */
-#define CS_TRACE_ON_ACK                        0x27    /* IP Phone */
-#define CS_TRACE_OFF_ACK               0x28    /* IP Phone */
-#define CS_SPECIAL_KEY_STATUS  0x29    /* IP Phone */
-#define CS_KEY_RELEASED                        0x2A    /* IP Phone */
-#define CS_PERIPHERAL_CONTENT  0x2B    /* IP Phone */
-#define CS_TM_KEY_PUSHED               0x2D    /* IP Phone */
-#define CS_UA_DWL_PROTOCOL             0x50    /* Only UA NOE */
-
-
-static const value_string *opcodes_vals;
-
-/* System To Terminal Opcodes */
-static const value_string opcodes_vals_sys[] =
-{
-       {NOP                                    , "NOP"                                                                 },
-       {PRODUCTION_TEST                , "Production Test"                                             },      /* IP Phone */
-       {SUBDEVICE_ESCAPE               , "Subdevice Escape To Subdevice"               },      /* IP Phone */
-       {SOFT_RESET                             , "Software Reset"                                              },
-       {IP_PHONE_WARMSTART             , "IP-Phone Warmstart"                                  },      /* IP Phone */
-       {HE_ROUTING                             , "HE Routing Code"                                             },      /* IP Phone - NOT EXPECTED */
-       {SUBDEVICE_RESET                , "Subdevice Reset"                                             },
-       {LOOPBACK_ON                    , "Loopback On"                                                 },
-       {LOOPBACK_OFF                   , "Loopback Off"                                                },
-       {VIDEO_ROUTING                  , "Video Routing Code"                                  },      /* IP Phone - NOT EXPECTED */
-       {SUPER_MSG                              , "Super Message"                                               },
-       {SEGMENT_MSG                    , "Segment Message"                                             },
-       {REMOTE_UA_ROUTING              , "Remote UA Routing Code"                              },      /* IP Phone - NOT EXPECTED */
-       {VERY_REMOTE_UA_ROUTING , "Very Remote UA Routing Code"                 },      /* IP Phone - NOT EXPECTED */
-       {OSI_ROUTING                    , "OSI Routing Code"                                    },      /* IP Phone - NOT EXPECTED */
-       {ABC_A_ROUTING                  , "ABC-A Routing Code"                                  },      /* IP Phone - NOT EXPECTED */
-       {IBS_ROUTING                    , "IBS Routing Code"                                    },      /* IP Phone - NOT EXPECTED */
-       {IP_DEVICE_ROUTING              , "IP Device Routing"                                   },
-       {M_REFLEX_HUB_ROUTING   , "Mutli-Reflex Hub Routing Code"               },      /* IP Phone - NOT EXPECTED */
-       {SUPER_MSG_2                    , "Super Message 2"                                             },
-       {DEBUG_IN_LINE                  , "Debug In Line"                                               },
-       {LED_COMMAND                    , "Led Command"                                                 },      /* IP Phone */
-       {START_BUZZER                   , "Start Buzzer"                                                },      /* VTA */
-       {STOP_BUZZER                    , "Stop Buzzer"                                                 },      /* VTA */
-       {ENABLE_DTMF                    , "Enable DTMF"                                                 },
-       {DISABLE_DTMF                   , "Disable DTMF"                                                },
-       {CLEAR_LCD_DISP                 , "Clear LCD Display"                                   },      /* IP Phone */
-       {LCD_LINE_1_CMD                 , "LCD Line 1 Commands"                                 },      /* IP Phone */
-       {LCD_LINE_2_CMD                 , "LCD Line 2 Commands"                                 },      /* IP Phone */
-       {MAIN_VOICE_MODE                , "Main Voice Mode"                                             },
-       {VERSION_INQUIRY                , "Version Inquiry"                                             },
-       {ARE_YOU_THERE                  , "Are You There?"                                              },
-       {SUBDEVICE_METASTATE    , "Subdevice Metastate"                                 },
-       {VTA_STATUS_INQUIRY             , "VTA Status Inquiry"                                  },      /* IP Phone */
-       {SUBDEVICE_STATE                , "Subdevice State?"                                    },
-       {DWL_DTMF_CLCK_FORMAT   , "Download DTMF & Clock Format"                },      /* IP Phone */
-       {SET_CLCK                               , "Set Clock"                                                   },      /* IP Phone */
-       {VOICE_CHANNEL                  , "Voice Channel"                                               },      /* IP Phone & UA NOE */
-       {EXTERNAL_RINGING               , "External Ringing"                                    },
-       {LCD_CURSOR                             , "LCD Cursor"                                                  },      /* IP Phone */
-       {DWL_SPECIAL_CHAR               , "Download Special Character"                  },      /* IP Phone */
-       {SET_CLCK_TIMER_POS             , "Set Clock/Timer Position"                    },      /* IP Phone */
-       {SET_LCD_CONTRAST               , "Set LCD Contrast"                                    },      /* IP Phone */
-       {AUDIO_IDLE                             , "Audio Idle"                                                  },
-       {SET_SPEAKER_VOL                , "Set Speaker Volume"                                  },      /* IP Phone */
-       {BEEP                                   , "Beep"                                                                },
-       {SIDETONE                               , "Sidetone"                                                    },
-       {RINGING_CADENCE                , "Set Programmable Ringing Cadence"    },
-       {MUTE                                   , "Mute"                                                                },
-       {FEEDBACK                               , "Feedback"                                                    },
-       {KEY_RELEASE                    , "Key Release"                                                 },      /* IP Phone */
-       {TRACE_ON                               , "Trace On"                                                    },      /* IP Phone - NOT EXPECTED */
-       {TRACE_OFF                              , "Trace Off"                                                   },      /* IP Phone - NOT EXPECTED */
-       {READ_PERIPHERAL                , "Read Peripheral"                                             },      /* IP Phone - NOT EXPECTED */
-       {WRITE_PERIPHERAL               , "Write Peripheral"                                    },      /* IP Phone - NOT EXPECTED */
-       {ALL_ICONS_OFF                  , "All Icons Off"                                               },      /* IP Phone */
-       {ICON_CMD                               , "Icon Command"                                                },      /* IP Phone */
-       {AMPLIFIED_HANDSET              , "Amplified Handset (Boost)"                   },      /* IP Phone */
-       {AUDIO_CONFIG                   , "Audio Config"                                                },
-       {AUDIO_PADDED_PATH              , "Audio Padded Path"                                   },      /* IP Phone */
-       {RELEASE_RADIO_LINK             , "Release Radio Link"                                  },      /* IP Phone - NOT EXPECTED */
-       {DECT_HANDOVER                  , "DECT External Handover Routing Code" },      /* IP Phone - NOT EXPECTED */
-       {LOUDSPEAKER                    , "Loudspeaker"                                                 },
-       {ANNOUNCE                               , "Announce"                                                    },
-       {RING                                   , "Ring"                                                                },
-       {UA_DWL_PROTOCOL                , "UA Download Protocol"                                },
-};
-
-/* Terminal To System Opcodes */
-static const value_string opcodes_vals_term[] =
-{
-       {CS_NOP_ACK                             , "NOP Acknowledge"                                             },
-       {CS_HANDSET_OFFHOOK             , "Handset Offhook"                                             },      /* IP Phone */
-       {CS_HANDSET_ONHOOK              , "Hansdet Onhook"                                              },      /* IP Phone */
-       {CS_DIGIT_DIALED                , "Digital Dialed"                                              },      /* IP Phone */
-       {CS_SUBDEVICE_MSG               , "Subdevice Message"                                   },
-       {CS_HE_ROUTING                  , "HE Routing Response Code"                    },      /* IP Phone - NOT EXPECTED */
-       {CS_LOOPBACK_ON                 , "Loopback On Acknowledge"                             },      /* Same as CS To Terminal */
-       {CS_LOOPBACK_OFF                , "Loopback Off Acknowledge"                    },      /* Same as CS To Terminal */
-       {CS_VIDEO_ROUTING               , "Video Routing Response Code"                 },      /* IP Phone - NOT EXPECTED */
-       {CS_WARMSTART_ACK               , "Warmstart Acknowledge"                               },      /* IP Phone */
-       {CS_SUPER_MSG                   , "Super Message"                                               },      /* IP Phone - NOT EXPECTED */
-       {CS_SEGMENT_MSG                 , "Segment Message"                                             },      /* Same as CS To Terminal */
-       {CS_REMOTE_UA_ROUTING   , "Remote UA Routing Response Code"             },      /* IP Phone - NOT EXPECTED */
-       {CS_VERY_REMOTE_UA_R    , "Very Remote UA Routing Response Code"},      /* IP Phone - NOT EXPECTED */
-       {CS_OSI_ROUTING                 , "OSI Response Code"                                   },      /* IP Phone - NOT EXPECTED */
-       {CS_ABC_A_ROUTING               , "ABC-A Routing Response Code"                 },      /* IP Phone - NOT EXPECTED */
-       {CS_IBS_ROUTING                 , "IBS Routing Response Code"                   },      /* IP Phone - NOT EXPECTED */
-       {CS_IP_DEVICE_ROUTING   , "IP Device Routing"                                   },
-       {CS_SUPER_MSG_2                 , "Super Message 2"                                             },      /* Same as CS To Terminal */
-       {CS_DEBUG_IN_LINE               , "Debug Message"                                               },
-       {CS_UNSOLICITED_MSG             , "Unsolicited Message"                                 },
-       {CS_NON_DIGIT_KEY_PUSHED, "Non-Digit Key Pushed"                                },      /* IP Phone */
-       {CS_VERSION_RESPONSE    , "Version Information"                                 },
-       {CS_I_M_HERE                    , "I'm Here Response"                                   },
-       {CS_RSP_STATUS_INQUIRY  , "Response To Status Inquiry"                  },      /* IP Phone */
-       {CS_SUBDEVICE_STATE             , "Subdevice State Response"                    },
-       {CS_DIGIT_KEY_RELEASED  , "Digit Key Released"                                  },      /* IP Phone */
-       {CS_TRACE_ON_ACK                , "Trace On Acknowledge"                                },      /* IP Phone - NOT EXPECTED */
-       {CS_TRACE_OFF_ACK               , "Trace Off Acknowledge"                               },      /* IP Phone - NOT EXPECTED */
-       {CS_SPECIAL_KEY_STATUS  , "Special Key Status"                                  },      /* IP Phone */
-       {CS_KEY_RELEASED                , "Key Released"                                                },      /* IP Phone */
-       {CS_PERIPHERAL_CONTENT  , "Peripheral Content"                                  },      /* IP Phone - NOT EXPECTED */
-       {CS_TM_KEY_PUSHED               , "TM Key Pushed"                                               },      /* IP Phone - NOT EXPECTED */
-       {CS_UA_DWL_PROTOCOL             , "Download Protocol"                                   },
-       {0, NULL}
-};
-
-static const value_string str_on_off[] = {
-       {0x00, "Off"},
-       {0x01, "On"},
-       {0, NULL}
-};
-static const value_string str_yes_no[] = {
-       {0x00, "No"},
-       {0x01, "Yes"},
-       {0, NULL}
-};
-static const value_string str_device_type[] = {
-       {0x00, "Voice Terminal Adaptor"},
-       {0, NULL}
-};
-
-
-/*-----------------------------------------------------------------------------
-       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 char version[10];
-       int release, vers, fix;
-
-       release = (int)(hexa_version / 10000);
-       vers = (int)((hexa_version % 10000) / 100);
-       fix = (hexa_version % 10000) % 100;
-       g_snprintf(version, 10, "%d.%02d.%02d", release, vers, fix);
-       return version;
-}
-
-
-/*-----------------------------------------------------------------------------
-       Function for UA3G message with opcode and one parameter
-
-       PRODUCTION TEST - 01h (MESSAGE FROM THE SYSTEM)
-       SUBDEVICE RESET - 06h (MESSAGE FROM THE SYSTEM)
-       ARE YOU THERE - 2Bh - IPhone & UA NOE (MESSAGE FROM THE SYSTEM)
-       SET SPEAKER VOLUME - 3Bh (MESSAGE FROM THE SYSTEM)
-       TRACE ON - 42h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_with_one_parameter(proto_tree *tree,
-                                                 tvbuff_t *tvb,
-                                                 packet_info *pinfo,
-                                                 guint offset,
-                                                 guint length,
-                                                 guint8 opcode,
-                                                 proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       static const value_string str_first_parameter[] = {
-               {0x01, "Production Test Command"        },
-               {0x06, "Reserved For Compatibility"     },
-               {0x2B, "Temporization"                          },
-               {0x3B, "Volmue"                                         },
-               {0x42, "Subdevice Address"                      },
-               {0, NULL}
-       };
-
-       if(length > 0)
-       {
-               ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-               proto_tree_add_text(ua3g_body_item,
-                       tvb,
-                       offset,
-                       length,
-                       "%s: %d",
-                       val_to_str(opcode, str_first_parameter, "Unknown"), tvb_get_guint8(tvb, offset));
-               length--;
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       SUBDEVICE ESCAPE TO SUBDEVICE - 02h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_subdevice_escape(proto_tree *tree,
-                                               tvbuff_t *tvb,
-                                               packet_info *pinfo,
-                                               guint offset,
-                                               guint length,
-                                               guint8 opcode,
-                                               proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       int j = 0;
-
-       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--;
-
-       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--;
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       SOFTWARE RESET - 03h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_software_reset(proto_tree *tree,
-                                         tvbuff_t *tvb,
-                                         packet_info *pinfo,
-                                         guint offset,
-                                         guint length,
-                                         guint8 opcode,
-                                         proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       static const value_string str_verswitch[] = {
-               {0x00, "Reset Without Version Switch"   },
-               {0x01, "Reset With Version Switch"              },
-               {0, NULL}
-       };
-
-       if(length > 0)
-       {
-               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(tvb_get_guint8(tvb, offset), str_verswitch, "Unknown"));
-               offset++;
-               length--;
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       IP-PHONE WARMSTART - 04h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_ip_phone_warmstart(proto_tree *tree,
-                                                 tvbuff_t *tvb,
-                                                 packet_info *pinfo,
-                                                 guint offset,
-                                                 guint length,
-                                                 guint8 opcode,
-                                                 proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       int j = 0;
-       static const value_string str_command[] = {
-               {0x00, "Run In UA2G Emulation Mode"     },
-               {0x01, "Run In Full UA3G Mode"          },
-               {0, NULL}
-       };
-
-       if(length > 0)
-       {
-               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(tvb_get_guint8(tvb, offset), str_command, "Unknown"));
-               offset++;
-               length--;
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       SUPER MESSAGE - 0Bh (MESSAGE FROM THE SYSTEM)
-       SUPER MESSAGE 2 - 17h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_super_msg(proto_tree *tree,
-                                tvbuff_t *tvb,
-                                packet_info *pinfo,
-                                guint offset,
-                                guint length,
-                                guint8 opcode,
-                                proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       int i, parameter_length;
-       int j = 0;
-
-       ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-
-       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);
-                       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);
-                       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--;
-               }
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       SEGMENT MESSAGE - 0Ch (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_segment_msg(proto_tree *tree,
-                                  tvbuff_t *tvb,
-                                  packet_info *pinfo,
-                                  guint offset,
-                                  guint length,
-                                  guint8 opcode,
-                                  proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       int first_sub_segment;
-       int j = 0;
-       static const value_string str_first_sub_segment[] = {
-               {0x00, "Subsequent Segment"     },
-               {0x80, "Fisrt Segment"          },
-               {0, NULL}
-       };
-
-       ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-       first_sub_segment = (tvb_get_guint8(tvb, offset) & 0x80);
-       proto_tree_add_text(ua3g_body_tree,
-               tvb,
-               offset,
-               1,
-               "F/S                         : %s (%d)",
-               val_to_str(first_sub_segment, str_first_sub_segment, "Unknown"),
-               first_sub_segment);
-       proto_tree_add_text(ua3g_body_tree,
-               tvb,
-               offset,
-               1,
-               "Number Of Remaining Segments: %d",
-               (tvb_get_guint8(tvb, offset) & 0x7F));
-       offset++;
-       length--;
-
-       if(first_sub_segment == 0x80)
-       {
-               proto_tree_add_text(ua3g_body_tree,
-                       tvb,
-                       offset,
-                       2,
-                       "Length                      : %d",
-                       tvb_get_ntohs(tvb, offset));
-               offset += 2;
-               length -= 2;
-       }
-
-       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--;
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       IP DEVICE ROUTING - 13h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_ip_device_routing(proto_tree *tree,
-                                                tvbuff_t *tvb,
-                                                packet_info *pinfo,
-                                                guint offset,
-                                                guint length,
-                                                guint8 opcode,
-                                                proto_item *ua3g_item,
-                                                proto_item *ua3g_body_item)
-{
-       guint8 command = tvb_get_guint8(tvb, offset);
-    proto_tree *ua3g_body_tree;
-    proto_item *ua3g_param_item;
-    proto_tree *ua3g_param_tree;
-       static char parameter_value[160];
-       static const value_string str_command[] = {
-               {0x00, "Reset"                                  },
-               {0x01, "Start RTP"                              },
-               {0x02, "Stop RTP"                               },
-               {0x03, "Redirect"                               },
-               {0x04, "Tone Definition"                },
-               {0x05, "Start Tone"                             },
-               {0x06, "Stop Tone"                              },
-               {0x07, "Start Listen RTP"               },
-               {0x08, "Stop Listen RTP"                },
-               {0x09, "Get Parameters Value"   },
-               {0x0A, "Set Parameters Value"   },
-               {0x0B, "Send Digit"                             },
-               {0x0C, "Pause RTP"                              },
-               {0x0D, "Restart RTP"                    },
-               {0x0E, "Start Record RTP"               },
-               {0x0F, "Stop Record RTP"                },
-               {0, NULL}
-       };
-
-       /* add text to the frame tree */
-       proto_item_append_text(ua3g_item,
-               ", %s",
-               val_to_str(command, str_command, "Unknown"));
-       proto_item_append_text(ua3g_body_item,
-               " - %s",
-               val_to_str(command, str_command, "Unknown"));
-       ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-
-    /* add text to the frame "INFO" column */
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
-               val_to_str(command, str_command, "Unknown"));
-
-       proto_tree_add_uint_format(ua3g_body_tree,
-               hf_ua3g_ip,
-               tvb,
-               offset,
-               1,
-               command,
-               "Command: %s",
-               val_to_str(command, str_command, "Unknown"));
-       offset++;
-       length--;
-
-       switch(command)
-       {
-       case 0x00: /* RESET */
-               {
-                       int i, parameter_id, parameter_length;
-                       static const value_string str_parameter_id[] = {
-                               {0x00, "Update Mode"            },
-                               {0x01, "Bad Sec Mode"           },
-                               {0x02, "Customization Name"     },
-                               {0x03, "Localization Name"      },
-                               {0, NULL}
-                       };
-
-                       if(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: /* Update Mode */
-                                               {
-                                                       int i;
-                                                       static const value_string str_update_mode[] = {
-                                                               {0x00, "NOE Update Mode"        },
-                                                               {0x01, "Bootloader"                     },
-                                                               {0x02, "Data"                           },
-                                                               {0x04, "Customization"          },
-                                                               {0x08, "Localization"           },
-                                                               {0x10, "Code"                           },
-                                                               {0x20, "SIP"                            },
-                                                               {0, NULL}
-                                                       };
-                                                       static const value_string str_disable_enable[] = {
-                                                               {0, "Disable"   },
-                                                               {1, "Enable"    },
-                                                               {0, NULL}
-                                                       };
-
-                                                       if((tvb_get_guint8(tvb, offset + 2) & 0x80) == 0x00)
-                                                       {
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "%s: ",
-                                                                       val_to_str(tvb_get_guint8(tvb, offset + 2) & 0x80, str_update_mode, "Unknown"));
-
-                                                               for(i = 0; i < 6; i++)
-                                                               {
-                                                                       char param_value[30];
-                                                                       g_snprintf(param_value, 30,
-                                                                               "%s: %s, ",
-                                                                               val_to_str(0x01 << i, str_update_mode, "Unknown"),
-                                                                               val_to_str((tvb_get_guint8(tvb, offset + 2) >> i) & 0x01, str_disable_enable, ""));
-                                                                       strcat(parameter_value, param_value);
-                                                               }
-                                                       }
-
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "%s",
-                                                                       val_to_str(tvb_get_guint8(tvb, offset + 2) & 0x80, str_update_mode, "Unknown"));
-
-                                                       break;
-                                               }
-                                       case 0x01: /* Bad_Sec_Mode */
-                                               {
-                                                       static const value_string str_bad_sec_mode[] = {
-                                                               {0x01, "Binary is full, CS is secured, but terminal running in clear mode"},
-                                                               {0, NULL}
-                                                       };
-
-                                                       g_snprintf(parameter_value, 160,
-                                                               val_to_str(tvb_get_guint8(tvb, offset + 2), str_bad_sec_mode, "Unknown"));
-                                                       break;
-                                               }
-                                       case 0x02: /* Cust_Name */
-                                               {
-                                                       g_snprintf(parameter_value, 160, "\"");
-                                                       for(i = 1; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[5];
-                                                               if(isprint(tvb_get_guint8(tvb, offset + 1 + i)))
-                                                                       g_snprintf(param_value, 5, "%c", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               else
-                                                                       g_snprintf(param_value, 5, "'0x%02x'", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-
-                                                       strcat(parameter_value, "\"");
-                                                       break;
-                                               }
-                                       case 0x03: /* L10N_Name */
-                                               {
-                                                       g_snprintf(parameter_value, 160, "\"");
-                                                       for(i = 1; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[5];
-                                                               if(isprint(tvb_get_guint8(tvb, offset + 1 + i)))
-                                                                       g_snprintf(param_value, 5, "%c", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               else
-                                                                       g_snprintf(param_value, 5, "'0x%02x'", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-
-                                                       strcat(parameter_value, "\"");
-                                                       break;
-                                               }
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x01: /* START RTP */
-               {
-                       int i, parameter_length, parameter_id;
-                       static const value_string str_direction[] = {
-                               {0x00, "Terminal Input"                                                         },
-                               {0x01, "Terminal Output"                                                        },
-                               {0x02, "Terminal Input / Output (Both Direction)"       },
-                               {0, NULL}
-                       };
-                       static const value_string str_parameter_id[] = {
-                               {0x00, "Local UDP Port"                                                                         },
-                               {0x01, "Remote IP Address"                                                                      },
-                               {0x02, "Remote UDP Port"                                                                        },
-                               {0x03, "Type Of Service"                                                                        },
-                               {0x04, "Compressor"                                                                                     },
-                               {0x05, "Payload Concatenation (ms)"                                                     },
-                               {0x06, "Echo Cancelation Enabler"                                                       },
-                               {0x07, "Silence Suppression Enabler"                                            },
-                               {0x08, "802.1 Q User Priority"                                                          },
-                               {0x09, "Reserved"                                                                                       },
-                               {0x0a, "Post Filtering Enabler"                                                         },
-                               {0x0b, "High Pass Filtering Enabler"                                            },
-                               {0x0c, "Remote SSRC"                                                                            },
-                               {0x0d, "Must Send QOS Tickets"                                                          },
-                               {0x0e, "Local Identifier"                                                                       },
-                               {0x0f, "Distant Identifier"                                                                     },
-                               {0x10, "Destination For RTCP Sender Reports - Port Number"      },
-                               {0x11, "Destination For RTCP Sender Reports - IP Address"       },
-                               {0x12, "Destination For RTCP Receiver Reports - Port Number"},
-                               {0x13, "Destination For RTCP Receiver Reports - IP Address"     },
-                               {0x14, "Channel Number"                                                                         },
-                               {0x15, "DTMF Sending"                                                                           },
-                               {0x16, "Payload Type Of Redundancy"                                                     },
-                               {0x17, "Payload Type Of DTMF Events"                                            },
-                               {0x18, "Enable / Disable RFC 2198"                                                      },
-                               {0x31, "SRTP Encryption Enable For This Communication"          },
-                               {0x32, "Master Key For SRTP Session"                                            },
-                               {0x33, "Master Salt Key For SRTP Session"                                       },
-                               {0x34, "Master key for output stream of SRTP session"           },
-                               {0x35, "Master salt key for output stream of SRTP session"      },
-                               {0x36, "Integrity checking enabled for this communication"      },
-                               {0x37, "MKI value for SRTP packets in input stream"                     },
-                               {0x38, "MKI value for SRTP packets in output stream"            },
-                               {0x50, "MD5 Authentication"                                                                     },
-                               {0, NULL}
-                       };
-
-                       proto_tree_add_text(ua3g_body_tree,
-                               tvb,
-                               offset,
-                               1,
-                               "Direction: %s",
-                               val_to_str(tvb_get_guint8(tvb, offset), str_direction, "Unknown"));
-                       offset++;
-                       length--;
-
-                       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 0x01: /* Remote IP Address */
-                                       case 0x11: /* Destination For RTCP Sender Reports - IP Address */
-                                       case 0x13: /* Destination For RTCP Receiver Reports - IP Address */
-                                               {
-                                                       if(parameter_length > 0)
-                                                               g_snprintf(parameter_value, 160, "%d", tvb_get_guint8(tvb, offset + 2));
-
-                                                       for(i = 2; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[50];
-                                                               strcat(parameter_value, ".");
-                                                               g_snprintf(param_value, 50, "%d", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       break;
-                                               }
-                                       case 0x04: /* Compressor */
-                                               {
-                                                       static const value_string str_compressor[] = {
-                                                               {0x00, "G.711 A-law"            },
-                                                               {0x01, "G.711 mu-law"           },
-                                                               {0x0F, "G.723.1 5.3kbps"        },
-                                                               {0x10, "G.723.1 6.3kbps"        },
-                                                               {0x11, "G.729A 8 kbps"  },
-                                                               {0, NULL}
-                                                       };
-
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, val_to_str((guint8)(param_value), str_compressor, "Default Codec"));
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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 0x06: /* Echo Cancelation Enabler */
-                                       case 0x07: /* Silence Suppression Enabler */
-                                       case 0x0A: /* Post Filtering Enabler */
-                                       case 0x0B: /* High Pass Filtering Enabler */
-                                               {
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, val_to_str((guint8)(param_value), str_on_off, "On"));
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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 0x0D: /* Must Send QOS Tickets */
-                                               {
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, val_to_str((guint8)(param_value), str_yes_no, "No"));
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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 0x0E: /* Local Identifier */
-                                       case 0x0F: /* Distant Identifier */
-                                               {
-                                                       g_snprintf(parameter_value, 160, "\"");
-                                                       for(i = 1; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[5];
-                                                               if(isprint(tvb_get_guint8(tvb, offset + 1 + i)))
-                                                                       g_snprintf(param_value, 5, "%c", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               else
-                                                                       g_snprintf(param_value, 5, "'0x%02x'", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       strcat(parameter_value, "\"");
-                                                       break;
-                                               }
-                                       case 0x15: /* DTMF Sending */
-                                               {
-                                                       static const value_string str_dtmf_sending[] = {
-                                                               {0x00, "Don't Send DTMF"        },
-                                                               {0, NULL}
-                                                       };
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, val_to_str((guint8)(param_value), str_dtmf_sending, "Send DTMF"));
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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 0x18: /* Enable / Disable RFC 2198 */
-                                               {
-                                                       static const value_string str_enable_00[] = {
-                                                               {0x00, "Enable" },
-                                                               {0, NULL}
-                                                       };
-
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, val_to_str((guint8)(param_value), str_enable_00, "Disable"));
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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 0x31: /* SRTP Encryption Enable For This Communication */
-                                               {
-                                                       static const value_string str_enable_10[] = {
-                                                               {0x10, "Enable" },
-                                                               {0, NULL}
-                                                       };
-
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, val_to_str((guint8)(param_value), str_enable_10, "Disable"));
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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 0x00: /* Local UDP Port */
-                                       case 0x02: /* Remote UDP Port */
-                                       case 0x03: /* Type Of Service */
-                                       case 0x05: /* Payload Concatenation */
-                                       case 0x08: /* 802.1 Q User Priority */
-                                       case 0x09: /* Reserved */
-                                       case 0x0C: /* Remote SSRC */
-                                       case 0x10: /* Destination For RTCP Sender Reports - Port Number */
-                                       case 0x12: /* Destination For RTCP Receiver Reports - Port Number */
-                                       case 0x14: /* Channel Number */
-                                       case 0x16: /* Payload Type For Redundancy */
-                                       case 0x17: /* Payload Type For DTMF Events */
-                                       case 0x32: /* Master Key For SRTP Session */
-                                       case 0x33: /* Master Salt Key For SRTP Session */
-                                       case 0x34: /* Master key for output stream of SRTP session */
-                                       case 0x35: /* Master salt key for output stream of SRTP session */
-                                       case 0x36: /* Integrity checking enabled for this communication */
-                                       case 0x37: /* MKI value for SRTP packets in input stream */
-                                       case 0x38: /* MKI value for SRTP packets in output stream */
-                                       case 0x50: /* MD5 Authentication */
-                                       default:
-                                               {
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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;
-                                               }
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x02: /* STOP_RTP */
-               {
-                       int i, parameter_id, parameter_length;
-                       static const value_string str_parameter_id[] = {
-                               {0x0E, "Local Identifier"       },
-                               {0x0F, "Distant Identifier"     },
-                               {0x14, "Canal Identifier"       },
-                               {0, NULL}
-                       };
-
-                       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 0x0E: /* Local Identifer */
-                                       case 0x0F: /* Distant Identifier */
-                                               {
-                                                       g_snprintf(parameter_value, 160, "\"");
-                                                       for(i = 1; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[5];
-                                                               if(isprint(tvb_get_guint8(tvb, offset + 1 + i)))
-                                                                       g_snprintf(param_value, 5, "%c", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               else
-                                                                       g_snprintf(param_value, 5, "'0x%02x'", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       strcat(parameter_value, "\"");
-                                                       break;
-                                               }
-                                       case 0x14: /* Canal Identifier */
-                                       default:
-                                               {
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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;
-                                               }
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x03: /* REDIRECT */
-               {
-                       int i, parameter_length, parameter_id;
-                       static const value_string str_parameter_id[] = {
-                               {0x00, "Remote MainCPU Server IP Adress"},
-                               {0x01, "Remote MainCPU Server Port"             },
-                               {0, NULL}
-                       };
-
-                       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: /* Remote MainCPU Server IP Adress */
-                                               {
-                                                       if(parameter_length > 0)
-                                                               g_snprintf(parameter_value, 160, "%d", tvb_get_guint8(tvb, offset + 2));
-
-                                                       for(i = 2; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[50];
-                                                               strcat(parameter_value, ".");
-                                                               g_snprintf(param_value, 50, "%d", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       break;
-                                               }
-                                       case 0x01: /* Remote MainCPU Server Port */
-                                       default:
-                                               {
-                                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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;
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x04: /* DEF_TONES */
-               {
-                       int i, tone_nb_entries;
-                       guint16 frequency_1, frequency_2;
-                       signed char level_1, level_2;
-
-                       tone_nb_entries = tvb_get_guint8(tvb, offset);
-
-                       proto_tree_add_text(ua3g_body_tree,
-                               tvb,
-                               offset,
-                               1,
-                               "Nomber Of Entries: %d",
-                               tone_nb_entries);
-                       offset++;
-                       length--;
-
-                       while(length > 0)
-                       {
-                               for(i = 1; i <= tone_nb_entries; i++)
-                               {
-                                       frequency_1 = tvb_get_ntohs(tvb, offset);
-                                       level_1 = (signed char)(tvb_get_guint8(tvb, offset + 2)) / 2;
-                                       frequency_2 = tvb_get_ntohs(tvb, offset + 3);
-                                       level_2 = (signed char)(tvb_get_guint8(tvb, offset + 5)) / 2;
-                               
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               6,
-                                               "Tone Pair %d: %d Hz at %d dB / %d Hz at %d dB",
-                                               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);
-                                       offset += 2;
-                                       length -= 2;
-
-                                       proto_tree_add_text(ua3g_param_tree,
-                                               tvb,
-                                               offset,
-                                               1,
-                                               "Level      : %d dB",
-                                               level_1);
-                                       offset++;
-                                       length--;
-
-                                       proto_tree_add_text(ua3g_param_tree,
-                                               tvb,
-                                               offset,
-                                               2,
-                                               "Frequency 2: %d Hz",
-                                               frequency_2);
-                                       offset += 2;
-                                       length -= 2;
-
-                                       proto_tree_add_text(ua3g_param_tree,
-                                               tvb,
-                                               offset,
-                                               1,
-                                               "Level      : %d dB",
-                                               level_2);
-                                       offset++;
-                                       length--;
-                               }
-                       }
-                       break;
-               }
-       case 0x05: /* START TONE */
-               {
-                       guint8 i, tone_nb_entries, tone_direction, tone_id;
-/*                     guint8 i, tone_nb_entries, tone_direction, tone_id, tone_duration tone_silence; */
-                       int tone_duration;
-                       static const value_string str_tone_direction[] = {
-                               {0x00, "On The Phone"                                   },
-                               {0x40, "To The Network"                                 },
-                               {0x80, "On The Phone and To The Network"},
-                               {0, NULL}
-                       };
-
-                       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 - Nomber Of Entries: %d",
-                               val_to_str(tone_direction, str_tone_direction, "Unknown"), tone_nb_entries);
-                       offset++;
-                       length--;
-
-                       while(length > 0)
-                       {
-                               for(i = 1; i <= tone_nb_entries; i++)
-                               {
-                                       tone_id = tvb_get_guint8(tvb, offset);
-                                       tone_duration = tvb_get_ntohs(tvb, offset + 1);
-                                       /*tone_duration = tvb_get_guint8(tvb, offset + 1);
-                                       tone_silence = tvb_get_guint8(tvb, offset + 2);*/
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               6,
-                                               "Tone Pair %d: Id: %d, Duration: %d ms",
-/*                                             "Tone Pair %d: Id: %d, Duration: %d ms, Silence: %d ms", */
-                                               i, tone_id, tone_duration);
-/*                                             i, tone_id, tone_duration, tone_silence); */
-                                       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);
-                                       offset++;
-                                       length--;
-
-                                       proto_tree_add_text(ua3g_param_tree,
-                                               tvb,
-                                               offset,
-                                               2,
-                                               "Duration      : %d ms",
-                                               tone_duration);
-                                       offset += 2;
-                                       length -= 2;
-
-                                       /*proto_tree_add_text(ua3g_param_tree,
-                                               tvb,
-                                               offset,
-                                               1,
-                                               "Duration      : %d ms",
-                                               tone_duration);
-                                       offset++;
-                                       length--;
-
-                                       proto_tree_add_text(ua3g_param_tree,
-                                               tvb,
-                                               offset,
-                                               1,
-                                               "Silence       : %d ms",
-                                               tone_silence);
-                                       offset++;
-                                       length--;*/
-                               }
-                       }
-                       break;
-               }
-       case 0x07: /* START LISTEN RTP */
-       case 0x08: /* STOP LISTEN RTP */
-               {
-                       int i, parameter_length, parameter_id;
-                       static const value_string str_parameter_id[] = {
-                               {0x00, "Remote IP Adress     "  },
-                               {0x01, "Remote UDP Port In   "  },
-                               {0x02, "Remote UDP Port Out  "  },
-                               {0x03, "Remote IP Address Out"  },
-                               {0x04, "Canal Number"                   },
-                               {0, NULL}
-                       };
-                       
-                       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: /* Remote IP Adress - Not for start listening rtp */
-                                       case 0x03: /* Remote IP Adress Out - Not for start listening rtp */
-                                               {
-                                                       if(parameter_length > 0)
-                                                               g_snprintf(parameter_value, 160, "%d", tvb_get_guint8(tvb, offset + 2));
-
-                                                       for(i = 2; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[50];
-                                                               strcat(parameter_value, ".");
-                                                               g_snprintf(param_value, 50, "%d", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       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 > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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;
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x09: /* GET_PARAM_REQ */
-               {
-                       guint8 parameter;
-                       static const value_string str_parameter[] = {
-                               {0x00   , "Firmware Version"            },
-                               {0x01   , "Firmware Version"            },
-                               {0x02   , "DHCP IP Address"                     },
-                               {0x03   , "Local IP Address"            },
-                               {0x04   , "Subnetwork Mask"                     },
-                               {0x05   , "Router IP Address"           },
-                               {0x06   , "TFTP IP Address"                     },
-                               {0x07   , "MainCPU IP Address"          },
-                               {0x08   , "Default Codec"                       },
-                               {0x09   , "Ethernet Drivers Config"     },
-                               {0x0A   , "MAC Address"                         },
-                               {0, NULL}
-                       };
-
-                       while(length > 0)
-                       {
-                               parameter = tvb_get_guint8(tvb, offset);
-                               proto_tree_add_text(ua3g_body_tree,
-                                       tvb,
-                                       offset,
-                                       1,
-                                       "%s",
-                                       val_to_str(parameter, str_parameter, "Unknown"));
-                               offset++;
-                               length--;
-                       }
-                       break;
-               }
-       case 0x0A: /* SET_PARAM_REQ */
-               {
-                       int i, parameter_id, parameter_length;
-                       static const value_string str_parameter_id[] = {
-                               {0x00   , "QOS IP TOS"                                                  },
-                               {0x01   , "QOS 8021 VLID"                                               },
-                               {0x02   , "QOS 8021 PRI"                                                },
-                               {0x03   , "SNMP MIB2 SysContact"                                },
-                               {0x04   , "SNMP MIB2 SysName"                                   },
-                               {0x05   , "SNMP MIB2 SysLocation"                               },
-                               {0x06   , "Default Compressor"                                  },
-                               {0x07   , "Error String Net Down"                               },
-                               {0x08   , "Error String Cable PB"                               },
-                               {0x09   , "Error String Try Connect"                    },
-                               {0x0A   , "Error String Connected"                              },
-                               {0x0B   , "Error String Reset"                                  },
-                               {0x0C   , "Error String Duplicate IP Address"   },
-                               {0x0D   , "SNMP MIB Community"                                  },
-                               {0x0E   , "TFTP Backup Sec Mode"                                },
-                               {0x0F   , "TFTP Backup IP Address"                              },
-                               {0x10   , "Set MMI Password"                                    },
-                               {0x11   , "Set PC Port Status"                                  },
-                               {0x12   , "Record RTP Authorization"                    },
-                               {0x13   , "Security Flags"                                              },
-                               {0x14   , "ARP Spoofing"                                                },
-                               {0x15   , "Session Param"                                               },
-                               {0x30   , "MD5 Authentication"                                  },
-                               {0, NULL}
-                       };
-
-                       while(length > 0)
-                       {
-                               guint64 param_value = 0;
-
-                               parameter_id = tvb_get_guint8(tvb, offset);
-                               parameter_length = tvb_get_guint8(tvb, offset + 1);
-
-                               if(parameter_length > 0)
-                               {
-                                       switch(parameter_id)
-                                       {
-                                       case 0x06: /* Compressor */
-                                               {
-                                                       static const value_string str_compressor[] = {
-                                                               {0x00, "G.711 A-law"            },
-                                                               {0x01, "G.711 mu-law"           },
-                                                               {0x0F, "G.723.1 5.3kbps"        },
-                                                               {0x10, "G.723.1 6.3kbps"        },
-                                                               {0x11, "G.729A 8 kbps"  },
-                                                               {0, NULL}
-                                                       };
-
-                                                       g_snprintf(parameter_value, 160, val_to_str(tvb_get_guint8(tvb, offset + 2),
-                                                               str_compressor,
-                                                               "Default Codec"));
-                                                       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 */
-                                               {
-                                                       g_snprintf(parameter_value, 160, "\"");
-                                                       for(i = 1; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[5];
-                                                               if(isprint(tvb_get_guint8(tvb, offset + 1 + i)))
-                                                                       g_snprintf(param_value, 5, "%c", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               else
-                                                                       g_snprintf(param_value, 5, "'0x%02x'", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       strcat(parameter_value, "\"");
-                                                       break;
-                                               }
-                                       case 0x0F: /* TFTP BACKUP IP ADDR */
-                                               {
-                                                       if(parameter_length > 0)
-                                                               g_snprintf(parameter_value, 160, "%d", tvb_get_guint8(tvb, offset + 2));
-
-                                                       for(i = 2; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[50];
-                                                               strcat(parameter_value, ".");
-                                                               g_snprintf(param_value, 50, "%d", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       break;
-                                               }
-                                       case 0x11: /* Set PC Port status */
-                                               {
-                                                       static const value_string str_set_pc_port_status[] = {
-                                                               {0x00, "No PC Port Security"},
-                                                               {0x01, "Block PC Port"          },
-                                                               {0x02, "Filter VLAN"            },
-                                                               {0, NULL}
-                                                       };
-                                                       g_snprintf(parameter_value, 160, val_to_str(tvb_get_guint8(tvb, offset + 2),
-                                                               str_set_pc_port_status,
-                                                               "Unknown"));
-                                                       break;
-                                               }
-                                       case 0x12: /* Record RTP Authorization */
-                                               {
-                                                       static const value_string str_enable_feature[] = {
-                                                               {0x00, "Disable Feature"},
-                                                               {0x01, "Enable Feature" },
-                                                               {0, NULL}
-                                                       };
-
-                                                       g_snprintf(parameter_value, 160, val_to_str(tvb_get_guint8(tvb, offset + 2),
-                                                               str_enable_feature,
-                                                               "Unknown"));
-                                                       break;
-                                               }
-                                       case 0x13: /* Security Flags */
-                                               {
-                                                       static const value_string str_set_pc_port_status[] = {
-                                                               {0x00, "Filtering Not Active"   },
-                                                               {0x01, "Filtering Activated"    },
-                                                               {0, NULL}
-                                                       };
-                                                       g_snprintf(parameter_value, 160, val_to_str((tvb_get_guint8(tvb, offset + 2) & 0x01),
-                                                               str_set_pc_port_status,
-                                                               "Unknown"));
-                                                       break;
-                                               }
-                                       case 0x00: /* QOS IP TOS */
-                                       case 0x01: /* QOS 8021 VLID */
-                                       case 0x02: /* QOS 8021 PRI */
-                                       case 0x03: /* SNMP MIB2 SYSCONTACT */
-                                       case 0x04: /* SNMP MIB2 SYSNAME */
-                                       case 0x05: /* SNMP MIB2 SYSLOCATION */
-                                       case 0x0D: /* SNMP MIB COMMUNITY */
-                                       case 0x0E: /* TFTP BACKUP SEC MODE */
-                                       case 0x10: /* SET MMI PASSWORD */
-                                       case 0x14: /* ARP Spoofing */
-                                       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 += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                                       }
-                                                       else if(parameter_length > 8)
-                                                       {
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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;
-                                               }
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x0B: /* SEND_DIGIT */
-               {
-                       static const value_string str_digit[] = {
-                               {0, "0"         },
-                               {1, "1"         },
-                               {2, "2"         },
-                               {3, "3"         },
-                               {4, "4"         },
-                               {5, "5"         },
-                               {6, "6"         },
-                               {7, "7"         },
-                               {8, "8"         },
-                               {9, "9"         },
-                               {10, "*"        },
-                               {11, "#"        },
-                               {12, "A"        },
-                               {13, "B"        },
-                               {14, "C"        },
-                               {15, "D"        },
-                               {16, "Flash"},
-                               {0, NULL}
-                       };
-                       proto_tree_add_text(ua3g_body_tree,
-                               tvb,
-                               offset,
-                               1,
-                               "Digit Value: %s",
-                               val_to_str(tvb_get_guint8(tvb, offset), str_digit, "Unknown"));
-               break;
-               }
-       case 0x0C: /* PAUSE_RTP */
-       case 0x0D: /* RESTART_RTP */
-               {
-                       int i, parameter_length, parameter_id;
-                       static const value_string str_parameter_id[] = {
-                               {0x14, "Canal Identifier"},
-                               {0, NULL}
-                       };
-                       
-                       while(length > 0)
-                       {
-                               parameter_id = tvb_get_guint8(tvb, offset);
-                               parameter_length = tvb_get_guint8(tvb, offset + 1);
-
-                               if(parameter_length > 0)
-                               {
-                                       if((parameter_length > 0) && (parameter_length <= 8))
-                                       {
-                                               guint64 param_value = 0;
-
-                                               for(i = parameter_length; i > 0; i--)
-                                               {
-                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                               }
-                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                       }
-                                       else
-                                               g_snprintf(parameter_value, 160,
-                                                       "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));
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x0E: /* START_RECORD_RTP */
-       case 0x0F: /* STOP RECORD RTP */
-               {
-                       int i, parameter_length, parameter_id;
-                       static const value_string str_parameter_id[] = {
-                               {0x00   , "Recorder Index"                                      },
-                               {0x01   , "Remote IP Address"                           },
-                               {0x02   , "Remote UDP Port In"                          },
-                               {0x03   , "Remote UDP Port Out"                         },
-                               {0x04   , "Remote IP Address Out"                       },
-                               {0x05   , "Local UDP Port In"                           },
-                               {0x06   , "Local UDP Port Out"                          },
-                               {0x07   , "Type Of Service"                                     },
-                               {0x08   , "Master Key For SRTP Session"         },
-                               {0x09   , "Master Salt Key For SRTP Session"},
-                               {0x30   , "MD5 Authentication"                          },
-                               {0, NULL}
-                       };
-                       
-                       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 0x01: /* Remote IP Address */
-                                       case 0x04: /* Remote IP Address Out */
-                                               {
-                                                       if(parameter_length > 0)
-                                                               g_snprintf(parameter_value, 160, "%d", tvb_get_guint8(tvb, offset + 2));
-
-                                                       for(i = 2; i <= parameter_length; i++)
-                                                       {
-                                                               char param_value[50];
-                                                               strcat(parameter_value, ".");
-                                                               g_snprintf(param_value, 50, "%d", tvb_get_guint8(tvb, offset + 1 + i));
-                                                               strcat(parameter_value, param_value);
-                                                       }
-                                                       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 > 0) && (parameter_length <= 8))
-                                                       {
-                                                               guint64 param_value = 0;
-                                                               for(i = parameter_length; i > 0; i--)
-                                                               {
-                                                                       param_value += (tvb_get_guint8(tvb, offset + 1 + i) << (8 * (parameter_length - i)));
-                                                               }
-                                                               g_snprintf(parameter_value, 160, "%llu", param_value);
-                                                       }
-                                                       else
-                                                               g_snprintf(parameter_value, 160,
-                                                                       "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;
-                                       }
-
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s: %s",
-                                               val_to_str(parameter_id, str_parameter_id, "Unknown"), parameter_value);
-                               }
-                               else
-                                       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-                                               tvb,
-                                               offset,
-                                               parameter_length + 2,
-                                               "%s",
-                                               val_to_str(parameter_id, str_parameter_id, "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(parameter_id, str_parameter_id, "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",
-                                               parameter_value);
-                                       offset += parameter_length;
-                                       length -= parameter_length;
-                               }
-                       }
-                       break;
-               }
-       case 0x06: /* STOP TONE */
-       default:
-               {
-                       break;
-               }
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       DEBUG IN LINE - 18h (MESSAGE FROM THE TERMINAL AND FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_debug_in_line(proto_tree *tree,
-                       tvbuff_t *tvb,
-                       packet_info *pinfo,
-                       guint offset,
-                       guint length,
-                       guint8 opcode,
-                       proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       int i, parameter_length;
-       char parameter_value[100];
-
-       parameter_length = length;
-       ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-
-       g_snprintf(parameter_value, 160, "\"");
-       for(i = 0; i < parameter_length; i++)
-       {
-               char param_value[5];
-               if(isprint(tvb_get_guint8(tvb, offset + i)))
-                       g_snprintf(param_value, 5, "%c", tvb_get_guint8(tvb, offset + i));
-               else
-                       g_snprintf(param_value, 5, "'0x%02x'", tvb_get_guint8(tvb, offset + i));
-               strcat(parameter_value, param_value);
-       }
-       strcat(parameter_value, "\"");
-
-       proto_tree_add_text(ua3g_body_tree,
-               tvb,
-               offset,
-               length,
-               "Text String With Debug: %s",
-               parameter_value);
-}
-
-
-/*-----------------------------------------------------------------------------
-       LED COMMAND - 21h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_led_command(proto_tree *tree,
-                                  tvbuff_t *tvb,
-                                  packet_info *pinfo,
-                                  guint offset,
-                                  guint length,
-                                  guint8 opcode,
-                                  proto_item *ua3g_item,
-                                  proto_item *ua3g_body_item)
-{
-    proto_tree *ua3g_body_tree;
-       int command = tvb_get_guint8(tvb, offset);
-       static const value_string str_command[] = {
-               {0x00, "Led Off"                                },
-               {0x01, "Led On"                                 },
-               {0x02, "Red Led Fast Flash"             },
-               {0x03, "Red Led Slow Flash"             },
-               {0x04, "Green Led On"                   },
-               {0x05, "Green Led Fast Flash"   },
-               {0x06, "Green Led Slow Flash"   },
-               {0x07, "All Led Off"                    },
-               {0, NULL}
-       };
-       
-       /* add text to the frame tree */
-       proto_item_append_text(ua3g_item,
-               ", %s",
-               val_to_str(command, str_command, "Unknown"));
-       proto_item_append_text(ua3g_body_item,
-               "s - %s",
-               val_to_str(command, str_command, "Unknown"));
-       ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-
-    /* add text to the frame "INFO" column */
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
-               val_to_str(command, str_command, "Unknown"));
-
-       proto_tree_add_uint_format(ua3g_body_tree,
-               hf_ua3g_command,
-               tvb,
-               offset,
-               1,
-               command,
-               "Command   : %s",
-               val_to_str(command, str_command, "Unknown"));
-       offset++;
-       length--;
-
-       if(command != 0x07)
-       {
-               proto_tree_add_text(ua3g_body_tree,
-                       tvb,
-                       offset,
-                       1,
-                       "Led Number: %d",
-                       tvb_get_guint8(tvb, offset));
-       }
-}
-
-
-/*-----------------------------------------------------------------------------
-       LCD LINE 1 COMMANDS - 27h (MESSAGE FROM THE SYSTEM)
-       LCD LINE 2 COMMANDS - 28h (MESSAGE FROM THE SYSTEM)
-       ---------------------------------------------------------------------------*/
-static void
-decode_lcd_line_cmd(proto_tree *tree,
-                                       tvbuff_t *tvb,
-                                       packet_info *pinfo,
-                                       guint offset,
-                                       guint length,
-                                       guint8 opcode,
-                                       proto_item *ua3g_item,
-                                       proto_item *ua3g_body_item)
-{
-       guint8 i, lcd_options, command, column_n;
-    proto_tree *ua3g_body_tree;
-    proto_item *ua3g_param_item;
-    proto_tree *ua3g_param_tree;
-    proto_item *ua3g_option_item;
-    proto_tree *ua3g_option_tree;
-       static char str_ascii[40];
-       static char lcd_options_tab[6];
-       static const value_string str_command[] = {
-               {0, "Clear Line & Write From Column"},
-               {1, "Write From Column"                         },
-               {2, "Append To Current Line"            },
-               {0, NULL}
-       };
-       static const value_string str_enable_disable[] = {
-               {0, "Disable"   },
-               {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"                  },
-               {0x08, "Stop Call Timer"                                                },
-               {0x10, "Start Call Timer From Current Value"    },
-               {0x18, "Initialize And Call Timer"                              },
-               {0, NULL}
-       };
-
-       lcd_options = tvb_get_guint8(tvb, offset) & 0xFC;
-       command = tvb_get_guint8(tvb, offset) & 0x03;
-       column_n = tvb_get_guint8(tvb, offset + 1);
-
-       /* add text to the frame tree */
-       proto_item_append_text(ua3g_item,
-               ", %s %d",
-               val_to_str(command, str_command, "Unknown"),
-               column_n);
-       proto_item_append_text(ua3g_body_item,
-               " %s %d",
-               val_to_str(command, str_command, "Unknown"),
-               column_n);
-       ua3g_body_tree = proto_item_add_subtree(ua3g_body_item, ett_ua3g_body);
-
-    /* add text to the frame "INFO" column */
-       if (check_col(pinfo->cinfo, COL_INFO))
-               col_append_fstr(pinfo->cinfo, COL_INFO, ": %s %d",
-               val_to_str(command, str_command, "Unknown"),
-               column_n);
-       
-       g_snprintf(str_ascii, 40, "\"");
-       for(i = 0; i < length - 2; i++)
-       {
-               char ascii_value[5];
-               if(isprint(tvb_get_guint8(tvb, offset + 2 + i)))
-                       g_snprintf(str_ascii, 40, "%c", tvb_get_guint8(tvb, offset + 2 + i));
-               else
-                       g_snprintf(str_ascii, 40, "'0x%02x'", tvb_get_guint8(tvb, offset + 2 + i));
-               strcat(str_ascii, ascii_value);
-       }
-       strcat(str_ascii, "\"");
-
-       ua3g_param_item = proto_tree_add_text(ua3g_body_tree,
-               tvb,
-               offset,
-               length,
-               "%s %d: %s",
-               val_to_str(command, str_command, "Unknown"), column_n, str_ascii);
-       ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param);
-
-       proto_tree_add_uint_format(ua3g_body_tree,
-               hf_ua3g_command,
-               tvb,
-               offset,
-               1,
-               command,
-               "Command        : %s",
-               val_to_str(command, str_command, "Unknown"));
-       ua3g_option_item = proto_tree_add_text(ua3g_param_tree,
-               tvb,
-               offset,
-               1,
-               "LCD Options    : 0x%x",
-               lcd_options);
-       ua3g_option_tree = proto_item_add_subtree(ua3g_option_item, ett_ua3g_option);
-
-       for(i = 2; i <= 7; i++)
-       {
-               int shift_value = 1 << i;
-               if(i != 3)
-