convert to proto_tree_add_subtree[_format]
[metze/wireshark/wip.git] / epan / dissectors / packet-noe.c
1 /* packet-noe.c
2  * Routines for UA/UDP (Universal Alcatel over UDP) and NOE packet dissection.
3  * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #include "config.h"
25
26 #include <glib.h>
27
28 #include "epan/packet.h"
29 #include <epan/wmem/wmem.h>
30
31 void proto_register_noe(void);
32 void proto_reg_handoff_noe(void);
33
34 #define OPCODE_C_context             0
35 #define OPCODE_C_terminal            1
36 #define OPCODE_C_keyboard            2
37 #define OPCODE_C_audioconfig         3
38 #define OPCODE_C_security            4
39 #define OPCODE_C_leds                5
40 #define OPCODE_C_screen              6
41 #define OPCODE_C_date                7
42 #define OPCODE_C_AOMV                8
43 #define OPCODE_C_bluetooth           9
44 #define OPCODE_C_callstate          12
45 #define OPCODE_C_resource           13
46 #define OPCODE_C_widgets_default    14
47 #define OPCODE_C_framebox          128
48 #define OPCODE_C_tabbox            129
49 #define OPCODE_C_listbox           130
50 #define OPCODE_C_actionlistbox     131
51 #define OPCODE_C_textbox           132
52 #define OPCODE_C_actionbox         133
53 #define OPCODE_C_inputbox          134
54 #define OPCODE_C_checkbox          135
55 #define OPCODE_C_datebox           136
56 #define OPCODE_C_timerbox          137
57 #define OPCODE_C_popupbox          138
58 #define OPCODE_C_dialogbox         139
59 #define OPCODE_C_sliderbar         140
60 #define OPCODE_C_progressbar       141
61 #define OPCODE_C_imagebox          142
62 #define OPCODE_C_iconbox           143
63 #define OPCODE_C_AOMVbox           144
64 #define OPCODE_C_telephonicbox     145
65 #define OPCODE_C_keyboard_context  146
66 #define OPCODE_C_AOMEL             147
67 #define OPCODE_C_AOM10             148
68 #define OPCODE_C_AOM40             149
69 #define OPCODE_C_idletimer         150
70 #define OPCODE_C_telephonicboxitem 151
71 #define OPCODE_C_bluetooth_device  152
72 #define OPCODE_C_headerbox         153
73 #define OPCODE_C_ime_context       154
74
75 static const value_string val_str_class[] = {
76     {OPCODE_C_context           , "Context"},
77     {OPCODE_C_terminal          , "Terminal"},
78     {OPCODE_C_keyboard          , "Keyboard"},
79     {OPCODE_C_audioconfig       , "AudioConfig"},
80     {OPCODE_C_security          , "Security"},
81     {OPCODE_C_leds              , "Leds"},
82     {OPCODE_C_screen            , "Screen"},
83     {OPCODE_C_date              , "Date"},
84     {OPCODE_C_AOMV              , "AOMV"},
85     {OPCODE_C_bluetooth         , "Bluetooth"},
86     {OPCODE_C_callstate         , "Callstate"},
87     {OPCODE_C_framebox          , "FrameBox"},
88     {OPCODE_C_tabbox            , "TabBox"},
89     {OPCODE_C_listbox           , "ListBox"},
90     {OPCODE_C_actionlistbox     , "ActionlistBox"},
91     {OPCODE_C_textbox           , "TextBox"},
92     {OPCODE_C_actionbox         , "ActionBox"},
93     {OPCODE_C_inputbox          , "InputBox"},
94     {OPCODE_C_checkbox          , "CheckBox"},
95     {OPCODE_C_datebox           , "DateBox"},
96     {OPCODE_C_timerbox          , "TimerBox"},
97     {OPCODE_C_popupbox          , "PopupBox"},
98     {OPCODE_C_dialogbox         , "DialogBox"},
99     {OPCODE_C_sliderbar         , "SliderBar"},
100     {OPCODE_C_progressbar       , "ProgressBar"},
101     {OPCODE_C_imagebox          , "ImageBox"},
102     {OPCODE_C_iconbox           , "IconBox"},
103     {OPCODE_C_AOMVbox           , "AOMVBox"},
104     {OPCODE_C_telephonicbox     , "TelephonicBox"},
105     {OPCODE_C_keyboard_context  , "Keyboard_context"},
106     {OPCODE_C_AOMEL             , "AOMEL"},
107     {OPCODE_C_AOM10             , "AOM10"},
108     {OPCODE_C_AOM40             , "AOM40"},
109     {OPCODE_C_idletimer         , "IdleTimer"},
110     {OPCODE_C_telephonicboxitem , "TelephonicBoxItem"},
111     {OPCODE_C_bluetooth_device  , "Bluetooth_device"},
112     {OPCODE_C_headerbox         , "HeaderBox"},
113     {OPCODE_C_ime_context       , "ime_context"},
114     {0, NULL}
115 };
116 static value_string_ext val_str_class_ext = VALUE_STRING_EXT_INIT(val_str_class);
117
118 #define OPCODE_P_B_objectid              0
119 #define OPCODE_P_B_ownership             1
120 #define OPCODE_P_B_reset_mode            2
121 #define OPCODE_P_B_mtu                   3
122 #define OPCODE_P_B_negative_ack          4
123 #define OPCODE_P_B_type                  5
124 #define OPCODE_P_B_help_timeout          6
125 #define OPCODE_P_B_longpress             7
126 #define OPCODE_P_B_count                 8
127 #define OPCODE_P_B_eventmode             9
128 #define OPCODE_P_B_numpad_ownership     10
129 #define OPCODE_P_B_navigator_ownership  11
130 #define OPCODE_P_B_telephony_ownership  12
131 #define OPCODE_P_B_progkeys_ownership   13
132 #define OPCODE_P_B_alphakeys_ownership  14
133 #define OPCODE_P_B_numpad_eventmode     15
134 #define OPCODE_P_B_onoff                16
135 #define OPCODE_P_B_bpp                  17
136 #define OPCODE_P_B_w                    18
137 #define OPCODE_P_B_h                    19
138 #define OPCODE_P_B_contrast             20
139 #define OPCODE_P_B_clearscreen          21
140 #define OPCODE_P_B_year                 24
141 #define OPCODE_P_B_month                25
142 #define OPCODE_P_B_day                  26
143 #define OPCODE_P_B_m                    27
144 #define OPCODE_P_B_s                    28
145 #define OPCODE_P_B_enable               29
146 #define OPCODE_P_B_address              30
147 #define OPCODE_P_B_port                 31
148 #define OPCODE_P_B_protocol             32
149 #define OPCODE_P_B_name                 33
150 #define OPCODE_P_B_checked              34
151 #define OPCODE_P_B_unchecked            35
152 #define OPCODE_P_B_anchorid             36
153 #define OPCODE_P_B_grid                 37
154 #define OPCODE_P_B_x                    38
155 #define OPCODE_P_B_y                    39
156 #define OPCODE_P_B_visible              40
157 #define OPCODE_P_B_border               41
158 #define OPCODE_P_B_fontid               42
159 #define OPCODE_P_B_active               43
160 #define OPCODE_P_B_halign               44
161 #define OPCODE_P_B_valign               45
162 #define OPCODE_P_B_size                 46
163 #define OPCODE_P_B_mode                 47
164 #define OPCODE_P_B_showevent            48
165 #define OPCODE_P_B_showactive           49
166 #define OPCODE_P_B_action_active        50
167 #define OPCODE_P_B_action_count         51
168 #define OPCODE_P_B_foreground           52
169 #define OPCODE_P_B_background           53
170 #define OPCODE_P_B_icon                 54
171 #define OPCODE_P_B_label                55
172 #define OPCODE_P_B_value                56
173 #define OPCODE_P_B_password             57
174 #define OPCODE_P_B_cursor               58
175 #define OPCODE_P_B_mask                 59
176 #define OPCODE_P_B_qos_ticket           60
177 #define OPCODE_P_B_focus                61
178 #define OPCODE_P_B_state                62
179 #define OPCODE_P_B_format               63
180 #define OPCODE_P_B_incdec               64
181 #define OPCODE_P_B_value_notify         65
182 #define OPCODE_P_B_timeout              66
183 #define OPCODE_P_B_min                  67
184 #define OPCODE_P_B_max                  68
185 #define OPCODE_P_B_data                 69
186 #define OPCODE_P_B_custversion          70
187 #define OPCODE_P_B_L10Nversion          71
188 #define OPCODE_P_B_append               72
189 #define OPCODE_P_B_shortpress           73
190 #define OPCODE_P_B_autorepeat           74
191 #define OPCODE_P_B_repetition           75
192 #define OPCODE_P_B_vsplit               76
193 #define OPCODE_P_B_accesskey            77
194 #define OPCODE_P_B_realcount            78
195 #define OPCODE_P_B_start                79
196 #define OPCODE_P_B_modal                80
197 #define OPCODE_P_B_session_timeout      81
198 #define OPCODE_P_B_softkeys_ownership   82
199 #define OPCODE_P_B_ringings_count       83
200 #define OPCODE_P_B_cod                  84
201 #define OPCODE_P_B_bonded               85
202 #define OPCODE_P_B_link_key             86
203 #define OPCODE_P_B_pin                  87
204 #define OPCODE_P_B_term_type            88
205 #define OPCODE_P_B_link_type            89
206 #define OPCODE_P_B_circular             90
207 #define OPCODE_P_B_autospread           91
208 #define OPCODE_P_B_backlight_timeout    92
209 #define OPCODE_P_B_screensaver_timeout  93
210 #define OPCODE_P_B_cycling              94
211 #define OPCODE_P_B_CS_idle_state        95
212 #define OPCODE_P_B_PS_idle_state        96
213 #define OPCODE_P_B_bonded_devices       97
214 #define OPCODE_P_B_serialnum            98
215 #define OPCODE_P_B_hardversion          99
216 #define OPCODE_P_B_softversion         100
217 #define OPCODE_P_B_rom_size            101
218 #define OPCODE_P_B_ram_size            102
219 #define OPCODE_P_B_reset_cause         103
220 #define OPCODE_P_B_cycling_time        104
221 #define OPCODE_P_B_inputborder         106
222 #define OPCODE_P_B_disablelongpress    107
223 #define OPCODE_P_B_all_icons_off       108
224 #define OPCODE_P_B_all_labels_off      109
225 #define OPCODE_P_B_widgets_size        110
226 #define OPCODE_P_B_list_type           111
227 #define OPCODE_P_B_frame_type          112
228 #define OPCODE_P_B_bth_ringing         113
229 #define OPCODE_P_B_URI                 114
230 #define OPCODE_P_B_fetch_timeout       115
231 #define OPCODE_P_B_mask_subst          116
232 #define OPCODE_P_B_use_customisation   117
233 #define OPCODE_P_B_ADTTS_request       118
234 #define OPCODE_P_B_AP_mac_notify       119
235 #define OPCODE_P_B_page_active         120
236 #define OPCODE_P_B_overwrite           121
237 #define OPCODE_P_B_ime_lock            122
238 #define OPCODE_P_B_method              123
239 #define OPCODE_P_B_login               124
240 #define OPCODE_P_B_binary_suffix       125
241 #define OPCODE_P_B_binary_count        126
242 #define OPCODE_P_B_SIPCversion         127
243 #define OPCODE_P_A_dflt                128
244 #define OPCODE_P_A_shift               129
245 #define OPCODE_P_A_alt                 130
246 #define OPCODE_P_A_key_ownership       131
247 #define OPCODE_P_A_key_eventmode       132
248 #define OPCODE_P_A_value               133
249 #define OPCODE_P_A_mode                134
250 #define OPCODE_P_A_color               135
251 #define OPCODE_P_A_type                136
252 #define OPCODE_P_A_icon                137
253 #define OPCODE_P_A_label               138
254 #define OPCODE_P_A_ownership           139
255 #define OPCODE_P_A_enable              140
256 #define OPCODE_P_A_state               141
257 #define OPCODE_P_A_name                142
258 #define OPCODE_P_A_number              143
259 #define OPCODE_P_A_action_icon         144
260 #define OPCODE_P_A_action_label        145
261 #define OPCODE_P_A_action_value        146
262 #define OPCODE_P_A_today               147
263 #define OPCODE_P_A_tomorrow            148
264 #define OPCODE_P_A_action_key          149
265 #define OPCODE_P_A_code                150
266 #define OPCODE_P_A_data                151
267 #define OPCODE_P_A_delay_max_handset   152
268 #define OPCODE_P_A_delay_max_handsfree 153
269 #define OPCODE_P_A_delay_tx            154
270 #define OPCODE_P_A_delay_rx            155
271 #define OPCODE_P_A_pem_data            156
272 #define OPCODE_P_A_serial_number       157
273 #define OPCODE_P_A_owner_name          158
274 #define OPCODE_P_A_issuer_name         159
275 #define OPCODE_P_A_end_date            160
276
277 static const value_string val_str_props[] = {
278     {OPCODE_P_B_objectid            , "objectid"},
279     {OPCODE_P_B_ownership           , "ownership"},
280     {OPCODE_P_B_reset_mode          , "reset_mode"},
281     {OPCODE_P_B_mtu                 , "mtu"},
282     {OPCODE_P_B_negative_ack        , "negative_ack"},
283     {OPCODE_P_B_type                , "type"},
284     {OPCODE_P_B_help_timeout        , "help_timeout"},
285     {OPCODE_P_B_longpress           , "longpress"},
286     {OPCODE_P_B_count               , "count"},
287     {OPCODE_P_B_eventmode           , "eventmode"},
288     {OPCODE_P_B_numpad_ownership    , "numpad_ownership"},
289     {OPCODE_P_B_navigator_ownership , "navigator_ownership"},
290     {OPCODE_P_B_telephony_ownership , "telephony_ownership"},
291     {OPCODE_P_B_progkeys_ownership  , "progkeys_ownership"},
292     {OPCODE_P_B_alphakeys_ownership , "alphakeys_ownership"},
293     {OPCODE_P_B_numpad_eventmode    , "numpad_eventmode"},
294     {OPCODE_P_B_onoff               , "onoff"},
295     {OPCODE_P_B_bpp                 , "bpp"},
296     {OPCODE_P_B_w                   , "w"},
297     {OPCODE_P_B_h                   , "h"},
298     {OPCODE_P_B_contrast            , "contrast"},
299     {OPCODE_P_B_clearscreen         , "clearscreen"},
300     {OPCODE_P_B_year                , "year"},
301     {OPCODE_P_B_month               , "month"},
302     {OPCODE_P_B_day                 , "day"},
303     {OPCODE_P_B_m                   , "m"},
304     {OPCODE_P_B_s                   , "s"},
305     {OPCODE_P_B_enable              , "enable"},
306     {OPCODE_P_B_address             , "address"},
307     {OPCODE_P_B_name                , "name"},
308     {OPCODE_P_B_anchorid            , "anchorid"},
309     {OPCODE_P_B_grid                , "grid"},
310     {OPCODE_P_B_x                   , "x"},
311     {OPCODE_P_B_y                   , "y"},
312     {OPCODE_P_B_visible             , "visible"},
313     {OPCODE_P_B_border              , "border"},
314     {OPCODE_P_B_fontid              , "fontid"},
315     {OPCODE_P_B_active              , "active"},
316     {OPCODE_P_B_halign              , "halign"},
317     {OPCODE_P_B_valign              , "valign"},
318     {OPCODE_P_B_size                , "size"},
319     {OPCODE_P_B_mode                , "mode"},
320     {OPCODE_P_B_showevent           , "showevent"},
321     {OPCODE_P_B_showactive          , "showactive"},
322     {OPCODE_P_B_icon                , "icon"},
323     {OPCODE_P_B_label               , "label"},
324     {OPCODE_P_B_value               , "value"},
325     {OPCODE_P_B_password            , "password"},
326     {OPCODE_P_B_cursor              , "cursor"},
327     {OPCODE_P_B_mask                , "mask"},
328     {OPCODE_P_B_qos_ticket          , "qos_ticket"},
329     {OPCODE_P_B_focus               , "focus"},
330     {OPCODE_P_B_state               , "state"},
331     {OPCODE_P_B_format              , "format"},
332     {OPCODE_P_B_incdec              , "incdec"},
333     {OPCODE_P_B_value_notify        , "value_notify"},
334     {OPCODE_P_B_timeout             , "timeout"},
335     {OPCODE_P_B_min                 , "min"},
336     {OPCODE_P_B_max                 , "max"},
337     {OPCODE_P_B_data                , "data"},
338     {OPCODE_P_B_custversion         , "custversion"},
339     {OPCODE_P_B_L10Nversion         , "L10Nversion"},
340     {OPCODE_P_B_append              , "append"},
341     {OPCODE_P_B_shortpress          , "shortpress"},
342     {OPCODE_P_B_autorepeat          , "autorepeat"},
343     {OPCODE_P_B_repetition          , "repetition"},
344     {OPCODE_P_B_vsplit              , "vsplit"},
345     {OPCODE_P_B_accesskey           , "accesskey"},
346     {OPCODE_P_B_realcount           , "realcount"},
347     {OPCODE_P_B_start               , "start"},
348     {OPCODE_P_B_modal               , "modal"},
349     {OPCODE_P_B_session_timeout     , "session_timeout"},
350     {OPCODE_P_B_softkeys_ownership  , "softkeys_ownership"},
351     {OPCODE_P_B_ringings_count      , "ringings_count"},
352     {OPCODE_P_B_cod                 , "cod"},
353     {OPCODE_P_B_bonded              , "bonded"},
354     {OPCODE_P_B_link_key            , "link_key"},
355     {OPCODE_P_B_pin                 , "pin"},
356     {OPCODE_P_B_term_type           , "term_type"},
357     {OPCODE_P_B_link_type           , "link_type"},
358     {OPCODE_P_B_circular            , "circular"},
359     {OPCODE_P_B_autospread          , "autospread"},
360     {OPCODE_P_B_backlight_timeout   , "backlight_timeout"},
361     {OPCODE_P_B_screensaver_timeout , "screensaver_timeout"},
362     {OPCODE_P_B_cycling             , "cycling"},
363     {OPCODE_P_B_CS_idle_state       , "CS_idle_state"},
364     {OPCODE_P_B_PS_idle_state       , "PS_idle_state"},
365     {OPCODE_P_B_bonded_devices      , "bonded_devices"},
366     {OPCODE_P_B_serialnum           , "serialnum"},
367     {OPCODE_P_B_hardversion         , "hardversion"},
368     {OPCODE_P_B_softversion         , "softversion"},
369     {OPCODE_P_B_rom_size            , "rom_size"},
370     {OPCODE_P_B_ram_size            , "ram_size"},
371     {OPCODE_P_B_reset_cause         , "reset_cause"},
372     {OPCODE_P_B_cycling_time        , "cycling_time"},
373     {OPCODE_P_B_inputborder         , "inputborder"},
374     {OPCODE_P_B_disablelongpress    , "disablelongpress"},
375     {OPCODE_P_B_all_icons_off       , "all_icons_off"},
376     {OPCODE_P_B_all_labels_off      , "all_labels_off"},
377     {OPCODE_P_B_widgets_size        , "widgets_size"},
378     {OPCODE_P_B_list_type           , "list_type"},
379     {OPCODE_P_B_frame_type          , "frame_type"},
380     {OPCODE_P_B_bth_ringing         , "bth_ringing"},
381     {OPCODE_P_B_URI                 , "URI"},
382     {OPCODE_P_B_fetch_timeout       , "fetch_timeout"},
383     {OPCODE_P_B_mask_subst          , "mask_subst"},
384     {OPCODE_P_B_use_customisation   , "use_customisation"},
385     {OPCODE_P_B_page_active         , "page_active"},
386     {OPCODE_P_B_overwrite           , "overwrite"},
387     {OPCODE_P_B_ime_lock            , "ime_lock"},
388     {OPCODE_P_B_method              , "method"},
389     {OPCODE_P_B_login               , "login"},
390     {OPCODE_P_B_binary_suffix       , "binary_suffix"},
391     {OPCODE_P_B_binary_count        , "binary_count"},
392     {OPCODE_P_B_SIPCversion         , "SIPCversion"},
393     {OPCODE_P_A_key_ownership       , "key_ownership"},
394     {OPCODE_P_A_key_eventmode       , "key_eventmode"},
395     {OPCODE_P_A_value               , "value"},
396     {OPCODE_P_A_mode                , "mode"},
397     {OPCODE_P_A_color               , "color"},
398     {OPCODE_P_A_type                , "type"},
399     {OPCODE_P_A_icon                , "icon"},
400     {OPCODE_P_A_label               , "label"},
401     {OPCODE_P_A_ownership           , "ownership"},
402     {OPCODE_P_A_enable              , "enable"},
403     {OPCODE_P_A_state               , "state"},
404     {OPCODE_P_A_name                , "name"},
405     {OPCODE_P_A_number              , "number"},
406     {OPCODE_P_A_action_icon         , "action_icon"},
407     {OPCODE_P_A_action_label        , "action_label"},
408     {OPCODE_P_A_action_value        , "action_value"},
409     {OPCODE_P_A_today               , "today"},
410     {OPCODE_P_A_tomorrow            , "tomorrow"},
411     {OPCODE_P_A_code                , "code"},
412     {OPCODE_P_A_data                , "data"},
413     {OPCODE_P_A_delay_max_handset   , "delay_max_handset"},
414     {OPCODE_P_A_delay_max_handsfree , "delay_max_handsfree"},
415     {OPCODE_P_A_delay_tx            , "delay_tx"},
416     {OPCODE_P_A_delay_rx            , "delay_rx"},
417     {OPCODE_P_A_pem_data            , "pem_data"},
418     {OPCODE_P_A_serial_number       , "serial_number"},
419     {OPCODE_P_A_owner_name          , "owner_name"},
420     {OPCODE_P_A_issuer_name         , "issuer_name"},
421     {OPCODE_P_A_end_date            , "end_date"},
422     {0, NULL}
423 };
424 static value_string_ext val_str_props_ext = VALUE_STRING_EXT_INIT(val_str_props);
425
426 #define OPCODE_EVT_CONTEXT_SWITCH         0
427 #define OPCODE_EVT_RESET                  1
428 #define OPCODE_EVT_KEY_PRESS              2
429 #define OPCODE_EVT_KEY_RELEASE            3
430 #define OPCODE_EVT_KEY_SHORTPRESS         4
431 #define OPCODE_EVT_KEY_LONGPRESS          5
432 #define OPCODE_EVT_ONHOOK                 6
433 #define OPCODE_EVT_OFFHOOK                7
434 #define OPCODE_EVT_HELP                   8
435 #define OPCODE_EVT_WIDGETS_GC             9
436 #define OPCODE_EVT_ERROR_PROTOCOL        10
437 #define OPCODE_EVT_ERROR_CREATE          11
438 #define OPCODE_EVT_ERROR_DELETE          12
439 #define OPCODE_EVT_ERROR_SET_PROPERTY    13
440 #define OPCODE_EVT_ERROR_GET_PROPERTY    14
441 #define OPCODE_EVT_SUCCESS_CREATE        15
442 #define OPCODE_EVT_SUCCESS_DELETE        16
443 #define OPCODE_EVT_SUCCESS_SET_PROPERTY  17
444 #define OPCODE_EVT_ERROR_INSERT_ITEM     18
445 #define OPCODE_EVT_ERROR_DELETE_ITEM     19
446 #define OPCODE_EVT_SUCCESS_INSERT_ITEM   20
447 #define OPCODE_EVT_DEVICE_PRESENCE       21
448 #define OPCODE_EVT_KEY_LINE              22
449 #define OPCODE_EVT_SUCCESS_DELETE_ITEM   23
450 #define OPCODE_EVT_BT_BONDING_RESULT     24
451 #define OPCODE_EVT_BT_KEY_SHORTPRESS     25
452 #define OPCODE_EVT_BT_KEY_LONGPRESS      26
453 #define OPCODE_EVT_BT_KEY_VERYLONGPRESS  27
454 #define OPCODE_EVT_LOCAL_APPLICATION     28
455 #define OPCODE_EVT_WARNING_CREATE        29
456 #define OPCODE_EVT_WARNING_SET_PROPERTY  30
457 #define OPCODE_EVT_ARP_SPOOFING          31
458 #define OPCODE_EVT_CHAR_NOT_FOUND        32
459 #define OPCODE_EVT_CHAR_BAD_LENGTH       33
460 #define OPCODE_EVT_QOS_TICKET            34
461 #define OPCODE_EVT_UA3_ERROR             35
462 #define OPCODE_EVT_TABBOX               128
463 #define OPCODE_EVT_LISTBOX              129
464 #define OPCODE_EVT_LISTBOX_FIRST        130
465 #define OPCODE_EVT_LISTBOX_LAST         131
466 #define OPCODE_EVT_ACTIONLISTBOX        132
467 #define OPCODE_EVT_ACTIONBOX            133
468 #define OPCODE_EVT_INPUTBOX             134
469 #define OPCODE_EVT_INPUTBOX_FOCUS_LOST  135
470 #define OPCODE_EVT_CHECKBOX             136
471 #define OPCODE_EVT_TIMERBOX             137
472 #define OPCODE_EVT_POPUPBOX_TIMEOUT     138
473 #define OPCODE_EVT_DIALOGBOX            139
474 #define OPCODE_EVT_SLIDERBAR            140
475 #define OPCODE_EVT_PROGRESSBAR          141
476 #define OPCODE_EVT_AOMVBOX              142
477 #define OPCODE_EVT_TELEPHONICBOX_FOCUS  143
478 #define OPCODE_EVT_AOM_INSERTED         144
479 #define OPCODE_EVT_AOM_REMOVED          145
480 #define OPCODE_EVT_AOM_KEY_PRESS        146
481 #define OPCODE_EVT_IDLETIMER            147
482 #define OPCODE_EVT_GET_PROPERTY_RESULT  148
483 #define OPCODE_EVT_AOM_KEY_RELEASE      149
484 #define OPCODE_EVT_POPUPBOX_DISMISSED   150
485 #define OPCODE_EVT_DIALOGBOX_TIMEOUT    151
486 #define OPCODE_EVT_DIALOGBOX_DISMISSED  152
487 #define OPCODE_EVT_BT_BONDED_DEVICE     153
488 #define OPCODE_EVT_BT_INQUIRY_RESULT    154
489 #define OPCODE_EVT_BT_NAME_DISCOVERY    155
490 #define OPCODE_EVT_IME_REMOTEOPEN       156
491 #define OPCODE_EVT_BT_BATTERY           158
492 #define OPCODE_EVT_IME_LIST             159
493 #define OPCODE_EVT_IME_CHANGE           160
494 #define OPCODE_EVT_IME_OPEN             161
495 #define OPCODE_EVT_TELEPHONICBOX_EVENT  162
496 #define OPCODE_EVT_ACTLISTBOX_TIMEOUT   163
497 #define OPCODE_EVT_ACTLISTBOX_DISMISSED 164
498 #define OPCODE_EVT_ADTTS_RESPONSE       165
499 #define OPCODE_EVT_AP_MAC               166
500
501 static const value_string val_str_event[] = {
502     {OPCODE_EVT_CONTEXT_SWITCH       , "EVT_CONTEXT_SWITCH"},
503     {OPCODE_EVT_RESET                , "EVT_RESET"},
504     {OPCODE_EVT_KEY_PRESS            , "EVT_KEY_PRESS"},
505     {OPCODE_EVT_KEY_RELEASE          , "EVT_KEY_RELEASE"},
506     {OPCODE_EVT_KEY_SHORTPRESS       , "EVT_KEY_SHORTPRESS"},
507     {OPCODE_EVT_KEY_LONGPRESS        , "EVT_KEY_LONGPRESS"},
508     {OPCODE_EVT_ONHOOK               , "EVT_ONHOOK"},
509     {OPCODE_EVT_OFFHOOK              , "EVT_OFFHOOK"},
510     {OPCODE_EVT_HELP                 , "EVT_HELP"},
511     {OPCODE_EVT_WIDGETS_GC           , "EVT_WIDGETS_GC"},
512     {OPCODE_EVT_ERROR_PROTOCOL       , "EVT_ERROR_PROTOCOL"},
513     {OPCODE_EVT_ERROR_CREATE         , "EVT_ERROR_CREATE"},
514     {OPCODE_EVT_ERROR_DELETE         , "EVT_ERROR_DELETE"},
515     {OPCODE_EVT_ERROR_SET_PROPERTY   , "EVT_ERROR_SET_PROPERTY"},
516     {OPCODE_EVT_ERROR_GET_PROPERTY   , "EVT_ERROR_GET_PROPERTY"},
517     {OPCODE_EVT_SUCCESS_CREATE       , "EVT_SUCCESS_CREATE"},
518     {OPCODE_EVT_SUCCESS_DELETE       , "EVT_SUCCESS_DELETE"},
519     {OPCODE_EVT_SUCCESS_SET_PROPERTY , "EVT_SUCCESS_SET_PROPERTY"},
520     {OPCODE_EVT_ERROR_INSERT_ITEM    , "EVT_ERROR_INSERT_ITEM"},
521     {OPCODE_EVT_ERROR_DELETE_ITEM    , "EVT_ERROR_DELETE_ITEM"},
522     {OPCODE_EVT_SUCCESS_INSERT_ITEM  , "EVT_SUCCESS_INSERT_ITEM"},
523     {OPCODE_EVT_DEVICE_PRESENCE      , "EVT_DEVICE_PRESENCE"},
524     {OPCODE_EVT_KEY_LINE             , "EVT_KEY_LINE"},
525     {OPCODE_EVT_SUCCESS_DELETE_ITEM  , "EVT_SUCCESS_DELETE_ITEM"},
526     {OPCODE_EVT_BT_BONDING_RESULT    , "EVT_BT_BONDING_RESULT"},
527     {OPCODE_EVT_BT_KEY_SHORTPRESS    , "EVT_BT_KEY_SHORTPRESS"},
528     {OPCODE_EVT_BT_KEY_LONGPRESS     , "EVT_BT_KEY_LONGPRESS"},
529     {OPCODE_EVT_BT_KEY_VERYLONGPRESS , "EVT_BT_KEY_VERYLONGPRESS"},
530     {OPCODE_EVT_LOCAL_APPLICATION    , "EVT_LOCAL_APPLICATION"},
531     {OPCODE_EVT_WARNING_CREATE       , "EVT_WARNING_CREATE"},
532     {OPCODE_EVT_WARNING_SET_PROPERTY , "EVT_WARNING_SET_PROPERTY"},
533     {OPCODE_EVT_ARP_SPOOFING         , "EVT_ARP_SPOOFING"},
534     {OPCODE_EVT_CHAR_NOT_FOUND       , "EVT_CHAR_NOT_FOUND"},
535     {OPCODE_EVT_QOS_TICKET           , "EVT_QOS_TICKET"},
536     {OPCODE_EVT_UA3_ERROR            , "EVT_UA3_ERROR"},
537     {OPCODE_EVT_TABBOX               , "EVT_TABBOX"},
538     {OPCODE_EVT_LISTBOX              , "EVT_LISTBOX"},
539     {OPCODE_EVT_LISTBOX_FIRST        , "EVT_LISTBOX_FIRST"},
540     {OPCODE_EVT_LISTBOX_LAST         , "EVT_LISTBOX_LAST"},
541     {OPCODE_EVT_ACTIONLISTBOX        , "EVT_ACTIONLISTBOX"},
542     {OPCODE_EVT_ACTIONBOX            , "EVT_ACTIONBOX"},
543     {OPCODE_EVT_INPUTBOX             , "EVT_INPUTBOX"},
544     {OPCODE_EVT_INPUTBOX_FOCUS_LOST  , "EVT_INPUTBOX_FOCUS_LOST"},
545     {OPCODE_EVT_CHECKBOX             , "EVT_CHECKBOX"},
546     {OPCODE_EVT_TIMERBOX             , "EVT_TIMERBOX"},
547     {OPCODE_EVT_POPUPBOX_TIMEOUT     , "EVT_POPUPBOX_TIMEOUT"},
548     {OPCODE_EVT_DIALOGBOX            , "EVT_DIALOGBOX"},
549     {OPCODE_EVT_SLIDERBAR            , "EVT_SLIDERBAR"},
550     {OPCODE_EVT_PROGRESSBAR          , "EVT_PROGRESSBAR"},
551     {OPCODE_EVT_AOMVBOX              , "EVT_AOMVBOX"},
552     {OPCODE_EVT_TELEPHONICBOX_FOCUS  , "EVT_TELEPHONICBOX_FOCUS"},
553     {OPCODE_EVT_AOM_INSERTED         , "EVT_AOM_INSERTED"},
554     {OPCODE_EVT_AOM_REMOVED          , "EVT_AOM_REMOVED"},
555     {OPCODE_EVT_AOM_KEY_PRESS        , "EVT_AOM_KEY_PRESS"},
556     {OPCODE_EVT_IDLETIMER            , "EVT_IDLETIMER"},
557     {OPCODE_EVT_GET_PROPERTY_RESULT  , "EVT_GET_PROPERTY_RESULT"},
558     {OPCODE_EVT_AOM_KEY_RELEASE      , "EVT_AOM_KEY_RELEASE"},
559     {OPCODE_EVT_POPUPBOX_DISMISSED   , "EVT_POPUPBOX_DISMISSED"},
560     {OPCODE_EVT_DIALOGBOX_TIMEOUT    , "EVT_DIALOGBOX_TIMEOUT"},
561     {OPCODE_EVT_DIALOGBOX_DISMISSED  , "EVT_DIALOGBOX_DISMISSED"},
562     {OPCODE_EVT_BT_BONDED_DEVICE     , "EVT_BT_BONDED_DEVICE"},
563     {OPCODE_EVT_BT_INQUIRY_RESULT    , "EVT_BT_INQUIRY_RESULT"},
564     {OPCODE_EVT_BT_NAME_DISCOVERY    , "EVT_BT_NAME_DISCOVERY"},
565     {OPCODE_EVT_IME_REMOTEOPEN       , "EVT_IME_REMOTEOPEN"},
566     {OPCODE_EVT_BT_BATTERY           , "EVT_BT_BATTERY"},
567     {OPCODE_EVT_IME_LIST             , "EVT_IME_LIST"},
568     {OPCODE_EVT_IME_CHANGE           , "EVT_IME_CHANGE"},
569     {OPCODE_EVT_IME_OPEN             , "EVT_IME_OPEN"},
570     {OPCODE_EVT_TELEPHONICBOX_EVENT  , "EVT_TELEPHONICBOX_EVENT"},
571     {OPCODE_EVT_ACTLISTBOX_TIMEOUT   , "EVT_ACTLISTBOX_TIMEOUT"},
572     {OPCODE_EVT_ACTLISTBOX_DISMISSED , "EVT_ACTLISTBOX_DISMISSED"},
573     {0, NULL}
574 };
575 static value_string_ext val_str_event_ext = VALUE_STRING_EXT_INIT(val_str_event);
576
577 #define P_BASIC           0
578 #define P_ARRAY         128
579 #define P_INVALID       255
580 #define P_INVALID_INDEX 255
581
582 #define C_STATIC          0
583 #define C_DYNAMIC       128
584 #define C_INVALID       255
585
586 #define E_INVALID       255
587
588
589 /*-----------------------------------------------------------------------------
590   globals
591   ---------------------------------------------------------------------------*/
592 static int  proto_noe           = -1;
593 static gint ett_noe             = -1;
594 static gint ett_body            = -1;
595 static gint ett_property        = -1;
596 static gint ett_value           = -1;
597
598 static int  hf_noe_length               = -1;
599 static int  hf_noe_server               = -1;
600 static int  hf_noe_method_ack           = -1;
601 static int  hf_noe_method               = -1;
602 static int  hf_noe_class                = -1;
603 static int  hf_noe_event                = -1;
604 static int  hf_noe_objectid             = -1;
605 static int  hf_noe_method_index         = -1;
606 static int  hf_noe_pcode                = -1;
607 static int  hf_noe_psize                = -1;
608 static int  hf_noe_aindx                = -1;
609 static int  hf_noe_errcode              = -1;
610 static int  hf_noe_value                = -1;
611 static int  hf_noe_message              = -1;
612 static int  hf_noe_property_item_u8     = -1;
613 static int  hf_noe_property_item_u16    = -1;
614 static int  hf_noe_property_item_u24    = -1;
615 static int  hf_noe_property_item_u32    = -1;
616 static int  hf_noe_property_item_bytes  = -1;
617 static int  hf_event_value_u8           = -1;
618 static int  hf_event_context_switch     = -1;
619 static int  hf_event_widget_gc          = -1;
620
621 static const value_string servers_vals[] = {
622     {0x15,  "Call Server"},
623     {0x16,  "Presentation Server"},
624     {0, NULL}
625 };
626 static const value_string servers_short_vals[] = {
627     {0x15,  "CS"},
628     {0x16,  "PS"},
629     {0, NULL}
630 };
631
632 enum
633 {
634     METHOD_CREATE       = 0x00,
635     METHOD_DELETE       = 0x01,
636     METHOD_SET_PROPERTY = 0x02,
637     METHOD_GET_PROPERTY = 0x03,
638     METHOD_NOTIFY       = 0x04,
639     METHOD_DELETE_ITEM  = 0x05,
640     METHOD_INSERT_ITEM  = 0x06,
641     METHOD_INVALID
642 };
643 static const value_string methods_vals[] = {
644     {METHOD_CREATE       , "Create"},
645     {METHOD_DELETE       , "Delete"},
646     {METHOD_SET_PROPERTY , "SetProperty"},
647     {METHOD_GET_PROPERTY , "GetProperty"},
648     {METHOD_NOTIFY       , "Notify"},
649     {METHOD_DELETE_ITEM  , "DeleteItem"},
650     {METHOD_INSERT_ITEM  , "InsertItem"},
651     {0, NULL}
652 };
653
654
655 #define ERROR_INVALID_METHOD         0
656 #define ERROR_UNKNOWN_CLASS          1
657 #define ERROR_STATIC_CLASS           2
658 #define ERROR_DUPLICATE_OBJECTID     3
659 #define ERROR_UNKNOWN_PROPERTY_      4
660 #define ERROR_BAD_INDEX              5
661 #define ERROR_BAD_LENGTH__           6
662 #define ERROR_REQUIRED_MISSING       7
663 #define ERROR_BAD_VALUE              8
664 #define ERROR_READONLY_PROPERTY      9
665 #define ERROR_UNKNOWN_OBJECTID      10
666 #define ERROR_INVALID_CONTAINER     11
667 #define ERROR_PROPERTY_VMIN         12
668 #define ERROR_PROPERTY_VMAX         13
669 #define ERROR_POSITIVE_ACK          14
670 #define ERROR_NOT_IMPLEMENTED       15
671 #define ERROR_INVALID_CLASS         16
672 #define ERROR_INVALID_PROPERTY      17
673 #define ERROR_BAD_UTF8              18
674
675 #define ERROR_MESSAGE_DROP         128
676 #define ERROR_MAX_SET_PROPERTY     129
677 #define ERROR_INTERNAL             130
678
679
680 static const value_string errcode_vals[] = {
681     {ERROR_INVALID_METHOD       , "An invalid method opcode was received"},
682     {ERROR_UNKNOWN_CLASS        , "An invalid class opcode was received"},
683     {ERROR_STATIC_CLASS         , "Trying to create or delete a static class"},
684     {ERROR_DUPLICATE_OBJECTID   , "Trying to create an existing object"},
685     {ERROR_UNKNOWN_PROPERTY_    , "Property opcode doesn't exist in specified class"},
686     {ERROR_BAD_INDEX            , "Bad property index (array overflow)"},
687     {ERROR_BAD_LENGTH__         , "Short message or bad property length"},
688     {ERROR_REQUIRED_MISSING     , "A required property was not specified in create method"},
689     {ERROR_BAD_VALUE            , "Bad property value"},
690     {ERROR_READONLY_PROPERTY    , "Trying to set a read-only property"},
691     {ERROR_UNKNOWN_OBJECTID     , "The specified object doesn't exist (delete, setProperty or getProperty methods)"},
692     {ERROR_INVALID_CONTAINER    , "Invalid container"},
693     {ERROR_PROPERTY_VMIN        , "Property value < property minimum value"},
694     {ERROR_PROPERTY_VMAX        , "Property value > property maximum value"},
695     {ERROR_POSITIVE_ACK         , "Positive ack requested with a getProperty method"},
696     {ERROR_NOT_IMPLEMENTED      , "The specified property is not implemented"},
697     {ERROR_INVALID_CLASS        , "Invalid class specified with insertItem and deleteItem"},
698     {ERROR_INVALID_PROPERTY     , "Invalid property specified with insertItem and deleteItem"},
699     {ERROR_BAD_UTF8             , "Invalid UTF8 value in UA message"},
700     {ERROR_MESSAGE_DROP         , "Decoder queue is full"},
701     {ERROR_MAX_SET_PROPERTY     , "A maximum of 256 properties can be received in a setProperty method"},
702     {ERROR_INTERNAL             , "Internal error"},
703     {0, NULL}
704 };
705 static value_string_ext errcode_vals_ext = VALUE_STRING_EXT_INIT(errcode_vals);
706
707 static const value_string str_key_name[] = {
708     {0x00   , "Null Char."},
709     {0x01   , "Start Of Header"},
710     {0x02   , "Start Of Text"},
711     {0x03   , "End Of Text"},
712     {0x04   , "End Of Transmission"},
713     {0x05   , "Enquiry"},
714     {0x06   , "Acknowledgment"},
715     {0x07   , "Bell"},
716     {0x08   , "Backspace"},
717     {0x09   , "Horizontal Tab"},
718     {0x0A   , "Line Feed"},
719     {0x0B   , "Vertical Tab"},
720     {0x0C   , "Form Feed"},
721     {0x0D   , "Enter"},
722     {0x0E   , "Shift Out"},
723     {0x0F   , "Shift In"},
724     {0x10   , "Data Link Escape"},
725     {0x11   , "Device Control 1"},
726     {0x12   , "Device Control 2"},
727     {0x13   , "Device Control 3"},
728     {0x14   , "Device Control 4"},
729     {0x15   , "Negative Acknowledgment"},
730     {0x16   , "Synchronous Idle"},
731     {0x17   , "End Of Trans. Block"},
732     {0x18   , "Cancel"},
733     {0x19   , "End Of Medium"},
734     {0x1A   , "Substitute"},
735     {0x1B   , "Escape"},
736     {0x1C   , "File Separator"},
737     {0x1D   , "Group Separator"},
738     {0x1E   , "Request To Send"},
739     {0x1F   , "Unit Separator"},
740     {0x20   , "Space"},
741     {0x7F   , "Delete"},
742     {0xE0   , "a`"},
743     {0xE7   , "c,"},
744     {0xE8   , "e`"},
745     {0xE9   , "e'"},
746     {0xF9   , "u`"},
747     {0x20AC , "Euro Character"},
748     {0xE100 , "Release"},
749     {0xE101 , "Bis"},
750     {0xE102 , "Message"},
751     {0xE103 , "Handsfree"},
752     {0xE104 , "Mute"},
753     {0xE105 , "Volume Dec"},
754     {0xE106 , "Volume Inc"},
755     {0xE107 , "Hookswitch"},
756     {0xE110 , "Ok"},
757     {0xE111 , "Left"},
758     {0xE112 , "Right"},
759     {0xE113 , "Down"},
760     {0xE114 , "Up"},
761     {0xE115 , "Home"},
762     {0xE116 , "Help"},
763     {0xE117 , "Directory"},
764     {0xE120 , "ProgKey 0"},
765     {0xE121 , "ProgKey 1"},
766     {0xE122 , "ProgKey 2"},
767     {0xE123 , "ProgKey 3"},
768     {0xE124 , "ProgKey 4"},
769     {0xE125 , "ProgKey 5"},
770     {0xE130 , "SoftKey 0"},
771     {0xE131 , "SoftKey 1"},
772     {0xE132 , "SoftKey 2"},
773     {0xE133 , "SoftKey 3"},
774     {0xE134 , "SoftKey 4"},
775     {0xE135 , "SoftKey 5"},
776     {0xE136 , "SoftKey 6"},
777     {0xE137 , "SoftKey 7"},
778     {0xE138 , "SoftKey 8"},
779     {0xE139 , "SoftKey 9"},
780     {0, NULL}
781 };
782 static value_string_ext str_key_name_ext = VALUE_STRING_EXT_INIT(str_key_name);
783
784 static const value_string noe_event_str_struct[] = {
785     {0x00, "RJ9 Plug"},
786     {0x01, "BT Handset Link"},
787     {0, NULL}
788     };
789
790 /*-----------------------------------------------------------------------------
791     DECODE UTF8 TO UNICODE
792     This function translates an UTF8 vale to an UNICODE one.
793     Need to have at least 48 bits value.
794     ---------------------------------------------------------------------------*/
795 static guint64 decode_utf8(guint64 utf8)
796 {
797     static guint64 unicode;
798
799     if (utf8 <= G_GUINT64_CONSTANT(0xFF))
800     {
801         unicode =
802             utf8 & G_GUINT64_CONSTANT(0x7F);
803     }
804     else if (utf8 <= G_GUINT64_CONSTANT(0xFFFF))
805     {
806         unicode =
807             ((utf8 & G_GUINT64_CONSTANT(0x1F00) >> 2) +
808              (utf8 & G_GUINT64_CONSTANT(0x3F)));
809     }
810     else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFF))
811     {
812         unicode =
813             ((utf8 & G_GUINT64_CONSTANT(0x0F0000)) >> 4) +
814             ((utf8 & G_GUINT64_CONSTANT(0x3F00)) >> 2) +
815             (utf8 & G_GUINT64_CONSTANT(0x3F));
816     }
817     else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFFFF))
818     {
819         unicode =
820             ((utf8 & G_GUINT64_CONSTANT(0x07000000)) >> 6) +
821             ((utf8 & G_GUINT64_CONSTANT(0x3F0000)) >> 4) +
822             ((utf8 & G_GUINT64_CONSTANT(0x3F00)) >> 2) +
823             (utf8 & G_GUINT64_CONSTANT(0x3F));
824     }
825     else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFFFFFF))
826     {
827         unicode =
828             ((utf8 & G_GUINT64_CONSTANT(0x0300000000)) >> 8) +
829             ((utf8 & G_GUINT64_CONSTANT(0x3F000000)) >> 6) +
830             ((utf8 & G_GUINT64_CONSTANT(0x3F0000)) >> 4) +
831             ((utf8 & G_GUINT64_CONSTANT(0x3F00)) >> 2) +
832             (utf8 & G_GUINT64_CONSTANT(0x3F));
833     }
834     else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFFFFFFFF))
835     {
836         unicode =
837             ((utf8 & G_GUINT64_CONSTANT(0x010000000000)) >> 10) +
838             ((utf8 & G_GUINT64_CONSTANT(0x3F00000000)) >> 8) +
839             ((utf8 & G_GUINT64_CONSTANT(0x3F000000)) >> 6) +
840             ((utf8 & G_GUINT64_CONSTANT(0x3F0000)) >> 4) +
841             ((utf8 & G_GUINT64_CONSTANT(0x3F00)) >> 2) +
842             (utf8 & G_GUINT64_CONSTANT(0x3F));
843     }
844     else
845     {
846         unicode = G_GUINT64_CONSTANT(0);
847     }
848     return unicode;
849 }
850
851
852 /*-----------------------------------------------------------------------------
853     DECODE KEY NAME
854     This function translates an UNICODE to the name associated.
855     Need to have at least 48 bits value.
856     ---------------------------------------------------------------------------*/
857 static char *decode_key_name(int unicode)
858 {
859     char *key_name;
860
861     key_name = (char *)wmem_alloc(wmem_packet_scope(), 10);
862
863     if ((unicode <= 0x20)
864         || (unicode == 0x7F)
865         || (unicode == 0xE0)
866         || (unicode == 0xE7)
867         || (unicode == 0xE8)
868         || (unicode == 0xE9)
869         || (unicode == 0xF9))
870     {
871         g_snprintf(key_name, 10, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown"));
872     }
873     else if (unicode <= 0xFF)
874     {
875         g_snprintf(key_name, 10, "%c", unicode);
876     }
877     else
878     {
879         g_snprintf(key_name, 10, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown"));
880     }
881     return key_name;
882 }
883
884
885 /*-----------------------------------------------------------------------------
886     DECODE EVT ERROR
887     ---------------------------------------------------------------------------*/
888 static void decode_evt_error(proto_tree *tree,
889                              tvbuff_t   *tvb,
890                              guint       offset,
891                              guint       length)
892 {
893     if (!tree)
894         return;
895
896     proto_tree_add_item(tree, hf_noe_errcode, tvb, offset, 2, ENC_BIG_ENDIAN);
897     offset += 2;
898     length -= 2;
899
900     proto_tree_add_item(tree, hf_noe_method, tvb, offset, 1, ENC_BIG_ENDIAN);
901     offset  += 1;
902     length  -= 1;
903
904     proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
905     offset  += 1;
906     length  -= 1;
907
908     proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
909     offset += 2;
910     length -= 2;
911
912     proto_tree_add_item(tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
913     offset  += 1;
914     length  -= 1;
915
916     proto_tree_add_item(tree, hf_noe_aindx, tvb, offset, 1, ENC_NA);
917     offset  += 1;
918     length  -= 1;
919
920     proto_tree_add_item(tree, hf_noe_length, tvb, offset, 2, ENC_BIG_ENDIAN);
921     offset += 2;
922     length -= 2;
923
924     proto_tree_add_item(tree, hf_noe_value, tvb, offset, 4, ENC_BIG_ENDIAN);
925     offset += 4;
926     length -= 4;
927
928     proto_tree_add_item(tree, hf_noe_message, tvb, offset, length, ENC_NA);
929 }
930
931
932 /*-----------------------------------------------------------------------------
933     MESSAGE BODY DECODER
934     This function decodes the message body of an 0x15 (and 0x16) UA3G message.
935     ---------------------------------------------------------------------------*/
936 static void decode_tlv(proto_tree *tree,
937                        tvbuff_t   *tvb,
938                        guint       offset,
939                        guint       length)
940 {
941     proto_tree *property_tree;
942     guint8      property_type;
943     guint16     property_length;
944 /*  guint64     property_index;*/
945
946     /* add text to the frame tree */
947     property_tree = proto_tree_add_subtree(tree,
948         tvb,
949         offset,
950         length, ett_body, NULL,
951         "NOE Message Body");
952
953     while(length > 0)
954     {
955         property_type = tvb_get_guint8(tvb, offset);
956         proto_tree_add_item(property_tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
957         offset += 1;
958         length -= 1;
959
960         if (property_type >= P_ARRAY)
961         {
962             proto_tree_add_item(property_tree, hf_noe_aindx, tvb, offset, 1, ENC_NA);
963             offset += 1;
964             length -= 1;
965         }
966
967         property_length = tvb_get_guint8(tvb, offset);
968         if (property_length & 0x80)
969         {
970             property_length = tvb_get_ntohs(tvb, offset);
971             property_length &= 0x7fff;
972             proto_tree_add_uint(property_tree, hf_noe_psize, tvb, offset, 2,
973                 tvb_get_guint8(tvb, offset) * 256 + tvb_get_guint8(tvb, offset+1));
974             offset += 2;
975             length -= 2;
976         }
977         else
978         {
979             proto_tree_add_uint(property_tree, hf_noe_psize, tvb, offset, 1,
980                 tvb_get_guint8(tvb, offset));
981             offset += 1;
982             length -= 1;
983         }
984
985         switch(property_length)
986         {
987         case 0:
988             {
989                 break;
990             }
991         case 1:
992             proto_tree_add_item(property_tree, hf_noe_property_item_u8, tvb, offset, 1, ENC_BIG_ENDIAN);
993             offset += 1;
994             length -= 1;
995             break;
996         case 2:
997             proto_tree_add_item(property_tree, hf_noe_property_item_u16, tvb, offset, 2, ENC_BIG_ENDIAN);
998             offset += 2;
999             length -= 2;
1000             break;
1001         case 3:
1002             proto_tree_add_item(property_tree, hf_noe_property_item_u24, tvb, offset, 3, ENC_BIG_ENDIAN);
1003             offset += 3;
1004             length -= 3;
1005             break;
1006         case 4:
1007             proto_tree_add_item(property_tree, hf_noe_property_item_u32, tvb, offset, 4, ENC_BIG_ENDIAN);
1008             offset += 4;
1009             length -= 4;
1010             break;
1011         default:
1012             proto_tree_add_item(property_tree, hf_noe_property_item_bytes, tvb, offset, property_length, ENC_NA);
1013             offset += property_length;
1014             length -= property_length;
1015             break;
1016         }
1017     }
1018 }
1019
1020
1021
1022 /*-----------------------------------------------------------------------------
1023     GETPROPERTY MESSAGE BODY DECODER
1024     This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1025     ---------------------------------------------------------------------------*/
1026 static void decode_getproperty_tlv(proto_tree *tree,
1027                                    tvbuff_t   *tvb,
1028                                    guint       offset,
1029                                    guint       length)
1030 {
1031     proto_tree *body_tree;
1032     guint8      body_type;
1033
1034     /* add text to the frame tree */
1035     body_tree = proto_tree_add_subtree(tree,
1036         tvb,
1037         offset,
1038         length, ett_property, NULL,
1039         "NOE Message Body");
1040
1041     while(length > 0)
1042     {
1043         body_type = tvb_get_guint8(tvb, offset);
1044         proto_tree_add_item(body_tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1045
1046         offset += 1;
1047         length -= 1;
1048
1049         if (body_type >= P_ARRAY)
1050         {
1051             proto_tree_add_item(body_tree, hf_noe_aindx, tvb, offset, 1, ENC_NA);
1052             offset += 1;
1053             length -= 1;
1054         }
1055     }
1056 }
1057
1058
1059
1060 /*-----------------------------------------------------------------------------
1061     TERMINAL TO SERVER EVENT MESSAGE BODY DECODER
1062     This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1063     ---------------------------------------------------------------------------*/
1064 static void decode_evt(proto_tree  *tree,
1065                        tvbuff_t    *tvb,
1066                        packet_info *pinfo,
1067                        guint        offset,
1068                        guint        length)
1069 {
1070     proto_item *ti;
1071     guint8 event = tvb_get_guint8(tvb, offset);
1072
1073     proto_tree_add_item(tree, hf_noe_event, tvb, offset, 1, ENC_BIG_ENDIAN);
1074
1075     /* add text to the frame "INFO" column */
1076     col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
1077         val_to_str_ext_const(event, &val_str_event_ext, "Unknown"));
1078     /* update text of the main proto item */
1079     proto_item_append_text(tree, ", %s",
1080         val_to_str_ext_const(event, &val_str_event_ext, "Unknown"));
1081
1082     offset += 1;
1083     length -= 1;
1084
1085     switch(event)
1086     {
1087     case OPCODE_EVT_BT_KEY_SHORTPRESS:
1088     case OPCODE_EVT_BT_KEY_LONGPRESS:
1089     case OPCODE_EVT_BT_KEY_VERYLONGPRESS:
1090     case OPCODE_EVT_KEY_LINE:
1091     case OPCODE_EVT_ONHOOK:
1092     case OPCODE_EVT_OFFHOOK:
1093         ti = proto_tree_add_item(tree, hf_event_value_u8, tvb, offset, 1, ENC_BIG_ENDIAN);
1094         proto_item_set_len(ti, length);
1095         break;
1096     case OPCODE_EVT_KEY_PRESS:
1097     case OPCODE_EVT_KEY_RELEASE:
1098     case OPCODE_EVT_KEY_SHORTPRESS:
1099     case OPCODE_EVT_KEY_LONGPRESS:
1100     case OPCODE_EVT_HELP:
1101         {
1102             /* utf8_value is the utf8 value to translate into Unicode with the decode_uft8 function */
1103             guint64  utf8_value = 0;
1104             guint64  unicode_value;
1105             char    *key_name;
1106             int      pt_length  = length;
1107             int      pt_offset  = offset;
1108
1109             while(pt_length > 0)
1110             {
1111                 utf8_value = (utf8_value << 8) + tvb_get_guint8(tvb, pt_offset);
1112                 pt_offset  += 1;
1113                 pt_length  -= 1;
1114             }
1115             unicode_value = decode_utf8(utf8_value);
1116             key_name      = (char *)wmem_alloc(wmem_packet_scope(), 30);
1117             g_snprintf(key_name, 30, "\"%s\"", decode_key_name((int)unicode_value));
1118
1119             /* add text to the frame "INFO" column */
1120             col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", key_name);
1121             /* update text of the main proto item */
1122             proto_item_append_text(tree, ", %s",
1123                 key_name);
1124
1125             proto_tree_add_text(tree,
1126                 tvb,
1127                 offset,
1128                 length,
1129                 "Key Name: %s (UTF-8 Value: %s, Unicode Value: 0x%" G_GINT64_MODIFIER "x)",
1130                 key_name,
1131                 tvb_bytes_to_ep_str(tvb, offset, length),
1132                 unicode_value);
1133             break;
1134         }
1135     case OPCODE_EVT_ERROR_PROTOCOL:
1136     case OPCODE_EVT_ERROR_CREATE:
1137     case OPCODE_EVT_ERROR_DELETE:
1138     case OPCODE_EVT_ERROR_SET_PROPERTY:
1139     case OPCODE_EVT_ERROR_GET_PROPERTY:
1140         {
1141             decode_evt_error(tree, tvb, offset, length);
1142             break;
1143         }
1144     case OPCODE_EVT_CONTEXT_SWITCH:
1145         proto_tree_add_item(tree, hf_event_context_switch, tvb, offset, 1, ENC_BIG_ENDIAN);
1146         break;
1147     case OPCODE_EVT_SUCCESS_CREATE:
1148     case OPCODE_EVT_SUCCESS_DELETE:
1149     case OPCODE_EVT_SUCCESS_SET_PROPERTY:
1150     case OPCODE_EVT_SUCCESS_INSERT_ITEM:
1151     case OPCODE_EVT_SUCCESS_DELETE_ITEM:
1152         proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1153         break;
1154     case OPCODE_EVT_WIDGETS_GC:
1155         proto_tree_add_item(tree, hf_event_widget_gc, tvb, offset, 4, ENC_BIG_ENDIAN);
1156         break;
1157     case OPCODE_EVT_BT_BONDING_RESULT:
1158         {
1159             proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1160             offset += 2;
1161             /*length -= 2;*/
1162
1163             /* XXX - should a 16-bit value be gotten if the size is only 8-bit? */
1164             proto_tree_add_text(tree,
1165                 tvb,
1166                 offset,
1167                 1,
1168                 "Bonded: %d",
1169                 tvb_get_ntohs(tvb, offset));
1170             offset += 1;
1171             /*length -= 1;*/
1172
1173             proto_tree_add_text(tree,
1174                 tvb,
1175                 offset,
1176                 1,
1177                 "Value: %d",
1178                 tvb_get_ntohs(tvb, offset));
1179             break;
1180         }
1181     default:
1182         proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1183         offset += 2;
1184         length -= 2;
1185
1186         if (length > 0)
1187             decode_tlv(tree, tvb, offset, length);
1188         break;
1189     }
1190 }
1191
1192
1193
1194 /*-----------------------------------------------------------------------------
1195     METHOD DECODER
1196     This function decodes the method of an 0x15 (and 0x16) UA3G message.
1197     ---------------------------------------------------------------------------*/
1198 static void decode_mtd(proto_tree  *tree,
1199                        tvbuff_t    *tvb,
1200                        packet_info *pinfo,
1201                        guint8       method,
1202                        guint        offset,
1203                        guint        length)
1204 {
1205     guint8 noe_class = tvb_get_guint8(tvb, offset);
1206
1207     proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
1208
1209     /* add text to the frame "INFO" column */
1210     col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
1211         val_to_str_ext_const(noe_class, &val_str_class_ext, "Unknown"));
1212     /* update text of the main proto item */
1213     proto_item_append_text(tree, ", %s",
1214         val_to_str_ext_const(noe_class, &val_str_class_ext, "Unknown"));
1215
1216     offset += 1;
1217     length -= 1;
1218
1219     if (noe_class >= C_DYNAMIC)
1220     {
1221         proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1222         offset += 2;
1223         length -= 2;
1224     }
1225
1226     switch(method)
1227     {
1228     case METHOD_INSERT_ITEM:
1229         {
1230             proto_tree_add_item(tree, hf_noe_method_index, tvb, offset, 1, ENC_BIG_ENDIAN);
1231             offset += 1;
1232             length -= 1;
1233             if (length > 0)
1234                 decode_tlv(tree, tvb, offset, length);
1235             break;
1236         }
1237     case METHOD_DELETE_ITEM:
1238         {
1239             proto_tree_add_item(tree, hf_noe_method_index, tvb, offset, 1, ENC_BIG_ENDIAN);
1240             break;
1241         }
1242     case METHOD_GET_PROPERTY:
1243         {
1244             decode_getproperty_tlv(tree, tvb, offset, length);
1245             break;
1246         }
1247     default:
1248         {
1249             if (length > 0)
1250                 decode_tlv(tree, tvb, offset, length);
1251             break;
1252         }
1253     }
1254 }
1255
1256
1257 /*-----------------------------------------------------------------------------
1258   NOE DISSECTOR
1259   ---------------------------------------------------------------------------*/
1260 static void dissect_noe(tvbuff_t    *tvb,
1261                         packet_info *pinfo,
1262                         proto_tree  *tree)
1263 {
1264     proto_item *noe_item;
1265     proto_tree *noe_tree;
1266     gint        length;
1267     guint8      server;
1268     guint8      method;
1269     gboolean    methodack;
1270     gint        offset    = 0;
1271
1272     noe_item = proto_tree_add_item(tree, proto_noe, tvb, 0, -1, ENC_NA);
1273     noe_tree = proto_item_add_subtree(noe_item, ett_noe);
1274
1275     length = tvb_get_letohs(tvb, offset);
1276
1277     proto_tree_add_uint(noe_tree,
1278         hf_noe_length,
1279         tvb,
1280         offset,
1281         2,
1282         length);
1283     offset += 2;
1284
1285     server = tvb_get_guint8(tvb, offset);
1286
1287     /* add text to the frame "INFO" column */
1288     col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
1289         val_to_str_const(server, servers_short_vals, "Unknown"));
1290
1291     proto_tree_add_uint(noe_tree,
1292         hf_noe_server,
1293         tvb,
1294         offset,
1295         1,
1296         server);
1297     offset += 1;
1298     length -= 1;
1299
1300     /* update text of the main proto item */
1301     proto_item_append_text(noe_item, ", %s",
1302         val_to_str_const(server, servers_short_vals, "Unknown"));
1303
1304     method    = tvb_get_guint8(tvb, offset);
1305     methodack = (method & 0x80) != 0;
1306     method    = (method & 0x7f);
1307
1308     proto_tree_add_uint_format_value(noe_tree,
1309         hf_noe_method,
1310         tvb,
1311         offset,
1312         1,
1313         method,
1314         "%s (%d)",
1315         val_to_str_const(method, methods_vals, "Unknown"),
1316         method);
1317
1318     if (method >= METHOD_INVALID)
1319         return;
1320
1321     /* add text to the frame "INFO" column */
1322     col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
1323         val_to_str_const(method, methods_vals, "Unknown"));
1324
1325     /* update text of the main proto item */
1326     proto_item_append_text(noe_item, ", %s",
1327         val_to_str_const(method, methods_vals, "Unknown"));
1328
1329     if (method == METHOD_NOTIFY)
1330     {
1331         offset += 1;
1332         length -= 1;
1333         decode_evt(noe_tree, tvb, pinfo, offset, length);
1334     }
1335     else
1336     /* Create, Delete, SetProperty, GetProperty, DeleteItem, InsertItem properties */
1337     {
1338         proto_tree_add_boolean(noe_tree,
1339             hf_noe_method_ack,
1340             tvb,
1341             offset,
1342             1,
1343             methodack);
1344         offset += 1;
1345         length -= 1;
1346         decode_mtd(noe_tree, tvb, pinfo, method, offset, length);
1347     }
1348 }
1349
1350
1351
1352 /*-----------------------------------------------------------------------------
1353   DISSECTORS REGISTRATION FUNCTIONS
1354   ---------------------------------------------------------------------------*/
1355 void proto_register_noe(void)
1356 {
1357     static hf_register_info hf_noe[] =
1358         {
1359             { &hf_noe_length,
1360               {
1361                   "Length",
1362                   "noe.length",
1363                   FT_UINT16,
1364                   BASE_DEC,
1365                   NULL,
1366                   0x0,
1367                   "Method Length",
1368                   HFILL
1369               }
1370             },
1371             { &hf_noe_server,
1372               {
1373                   "Server",
1374                   "noe.server",
1375                   FT_UINT8,
1376                   BASE_HEX,
1377                   VALS(servers_vals),
1378                   0x0,
1379                   "Method Opcode",
1380                   HFILL
1381               }
1382             },
1383             { &hf_noe_method_ack,
1384               {
1385                   "Ack",
1386                   "noe.method_ack",
1387                   FT_BOOLEAN,
1388                   BASE_NONE,
1389                   NULL,
1390                   0x0,
1391                   "Method Acknowledge",
1392                   HFILL
1393               }
1394             },
1395             { &hf_noe_method,
1396               {
1397                   "Method",
1398                   "noe.method",
1399                   FT_UINT8,
1400                   BASE_DEC,
1401                   VALS(methods_vals),
1402                   0x0,
1403                   "Method Opcode",
1404                   HFILL
1405               }
1406             },
1407             { &hf_noe_class,
1408               {
1409                   "Class",
1410                   "noe.class",
1411                   FT_UINT8,
1412                   BASE_DEC|BASE_EXT_STRING,
1413                   &val_str_class_ext,
1414                   0x0,
1415                   "Class Opcode",
1416                   HFILL
1417               }
1418             },
1419             { &hf_noe_event,
1420               {
1421                   "Event",
1422                   "noe.event",
1423                   FT_UINT8,
1424                   BASE_DEC|BASE_EXT_STRING,
1425                   &val_str_event_ext,
1426                   0x0,
1427                   "Event Opcode",
1428                   HFILL
1429               }
1430             },
1431             { &hf_noe_objectid,
1432               {
1433                   "Objectid",
1434                   "noe.objectid",
1435                   FT_UINT16,
1436                   BASE_HEX,
1437                   NULL,
1438                   0x0,
1439                   "Object Identifier",
1440                   HFILL
1441               }
1442             },
1443             { &hf_noe_method_index,
1444               {
1445                   "ItemIndx",
1446                   "noe.item_index",
1447                   FT_UINT8,
1448                   BASE_DEC,
1449                   NULL,
1450                   0x0,
1451                   "Delete/Insert Index",
1452                   HFILL
1453               }
1454             },
1455             { &hf_noe_pcode,
1456               {
1457                   "Property",
1458                   "noe.property",
1459                   FT_UINT8,
1460                   BASE_HEX|BASE_EXT_STRING,
1461                   &val_str_props_ext,
1462                   0x0,
1463                   "Property Identifier",
1464                   HFILL
1465               }
1466             },
1467             { &hf_noe_psize,
1468               {
1469                   "PropLength",
1470                   "noe.prop_len",
1471                   FT_UINT16,
1472                   BASE_DEC,
1473                   NULL,
1474                   0x0,
1475                   "Property Length",
1476                   HFILL
1477               }
1478             },
1479             { &hf_noe_errcode,
1480               {
1481                   "ErrCode",
1482                   "noe.errcode",
1483                   FT_UINT16,
1484                   BASE_DEC|BASE_EXT_STRING,
1485                   &errcode_vals_ext,
1486                   0x0,
1487                   "Error Code",
1488                   HFILL
1489               }
1490             },
1491             { &hf_noe_aindx,
1492               {
1493                   "ArrIndex",
1494                   "noe.array_index",
1495                   FT_UINT8,
1496                   BASE_DEC,
1497                   NULL,
1498                   0x0,
1499                   "Array Index",
1500                   HFILL
1501               }
1502             },
1503             { &hf_noe_value,
1504               {
1505                   "Value",
1506                   "noe.value",
1507                   FT_UINT32,
1508                   BASE_HEX,
1509                   NULL,
1510                   0x0,
1511                   NULL,
1512                   HFILL
1513               }
1514             },
1515             { &hf_noe_message,
1516               {
1517                   "Message",
1518                   "noe.messages",
1519                   FT_BYTES,
1520                   BASE_NONE,
1521                   NULL,
1522                   0x0,
1523                   NULL,
1524                   HFILL
1525               }
1526             },
1527             { &hf_noe_property_item_u8,
1528               {
1529                   "Value",
1530                   "noe.property_item.uint",
1531                   FT_UINT8,
1532                   BASE_DEC,
1533                   NULL,
1534                   0x0,
1535                   NULL,
1536                   HFILL
1537               }
1538             },
1539             { &hf_noe_property_item_u16,
1540               {
1541                   "Value",
1542                   "noe.property_item.uint",
1543                   FT_UINT16,
1544                   BASE_DEC,
1545                   NULL,
1546                   0x0,
1547                   NULL,
1548                   HFILL
1549               }
1550             },
1551             { &hf_noe_property_item_u24,
1552               {
1553                   "Value",
1554                   "noe.property_item.uint",
1555                   FT_UINT24,
1556                   BASE_DEC,
1557                   NULL,
1558                   0x0,
1559                   NULL,
1560                   HFILL
1561               }
1562             },
1563             { &hf_noe_property_item_u32,
1564               {
1565                   "Value",
1566                   "noe.property_item.uint",
1567                   FT_UINT32,
1568                   BASE_DEC,
1569                   NULL,
1570                   0x0,
1571                   NULL,
1572                   HFILL
1573               }
1574             },
1575             { &hf_noe_property_item_bytes,
1576               {
1577                   "Value",
1578                   "noe.property_item.bytes",
1579                   FT_BYTES,
1580                   BASE_NONE,
1581                   NULL,
1582                   0x0,
1583                   NULL,
1584                   HFILL
1585               }
1586             },
1587             { &hf_event_value_u8,
1588               {
1589                   "Value",
1590                   "noe.event_value.uint",
1591                   FT_UINT8,
1592                   BASE_DEC,
1593                   VALS(noe_event_str_struct),
1594                   0x0,
1595                   NULL,
1596                   HFILL
1597               }
1598             },
1599             { &hf_event_context_switch,
1600               {
1601                   "Context",
1602                   "noe.event_context_switch",
1603                   FT_UINT8,
1604                   BASE_DEC,
1605                   VALS(servers_vals),
1606                   0x0,
1607                   NULL,
1608                   HFILL
1609               }
1610             },
1611             { &hf_event_widget_gc,
1612               {
1613                   "FreeMem (bytes)",
1614                   "noe.event_widget_gc",
1615                   FT_UINT32,
1616                   BASE_DEC,
1617                   NULL,
1618                   0x0,
1619                   NULL,
1620                   HFILL
1621               }
1622             },
1623         };
1624
1625     static gint *ett[] =
1626         {
1627             &ett_noe,
1628             &ett_body,
1629             &ett_property,
1630             &ett_value,
1631         };
1632
1633     /* NOE dissector registration */
1634     proto_noe = proto_register_protocol("NOE Protocol", "NOE", "noe");
1635
1636     proto_register_field_array(proto_noe, hf_noe, array_length(hf_noe));
1637
1638     register_dissector("noe", dissect_noe, proto_noe);
1639
1640     /* Common subtree array registration */
1641     proto_register_subtree_array(ett, array_length(ett));
1642 }
1643
1644
1645
1646 void proto_reg_handoff_noe(void)
1647 {
1648 #if 0 /*  Future */
1649     dissector_handle_t handle_noe = find_dissector("noe");
1650
1651     /* hooking of NOE on UA */
1652     dissector_add_uint("ua.opcode", 0x15, handle_noe);
1653 #endif
1654 }