2 * Routines for UA/UDP (Universal Alcatel over UDP) and NOE packet dissection.
3 * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
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.
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.
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.
28 #include "epan/packet.h"
29 #include <epan/wmem/wmem.h>
31 void proto_register_noe(void);
32 void proto_reg_handoff_noe(void);
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
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"},
116 static value_string_ext val_str_class_ext = VALUE_STRING_EXT_INIT(val_str_class);
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
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"},
424 static value_string_ext val_str_props_ext = VALUE_STRING_EXT_INIT(val_str_props);
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
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"},
575 static value_string_ext val_str_event_ext = VALUE_STRING_EXT_INIT(val_str_event);
579 #define P_INVALID 255
580 #define P_INVALID_INDEX 255
583 #define C_DYNAMIC 128
584 #define C_INVALID 255
586 #define E_INVALID 255
589 /*-----------------------------------------------------------------------------
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;
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;
621 static const value_string servers_vals[] = {
622 {0x15, "Call Server"},
623 {0x16, "Presentation Server"},
626 static const value_string servers_short_vals[] = {
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,
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"},
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
675 #define ERROR_MESSAGE_DROP 128
676 #define ERROR_MAX_SET_PROPERTY 129
677 #define ERROR_INTERNAL 130
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"},
705 static value_string_ext errcode_vals_ext = VALUE_STRING_EXT_INIT(errcode_vals);
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"},
714 {0x06 , "Acknowledgment"},
716 {0x08 , "Backspace"},
717 {0x09 , "Horizontal Tab"},
718 {0x0A , "Line Feed"},
719 {0x0B , "Vertical Tab"},
720 {0x0C , "Form Feed"},
722 {0x0E , "Shift Out"},
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"},
733 {0x19 , "End Of Medium"},
734 {0x1A , "Substitute"},
736 {0x1C , "File Separator"},
737 {0x1D , "Group Separator"},
738 {0x1E , "Request To Send"},
739 {0x1F , "Unit Separator"},
747 {0x20AC , "Euro Character"},
748 {0xE100 , "Release"},
750 {0xE102 , "Message"},
751 {0xE103 , "Handsfree"},
753 {0xE105 , "Volume Dec"},
754 {0xE106 , "Volume Inc"},
755 {0xE107 , "Hookswitch"},
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"},
782 static value_string_ext str_key_name_ext = VALUE_STRING_EXT_INIT(str_key_name);
784 static const value_string noe_event_str_struct[] = {
786 {0x01, "BT Handset Link"},
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)
797 static guint64 unicode;
799 if (utf8 <= G_GUINT64_CONSTANT(0xFF))
802 utf8 & G_GUINT64_CONSTANT(0x7F);
804 else if (utf8 <= G_GUINT64_CONSTANT(0xFFFF))
807 ((utf8 & G_GUINT64_CONSTANT(0x1F00) >> 2) +
808 (utf8 & G_GUINT64_CONSTANT(0x3F)));
810 else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFF))
813 ((utf8 & G_GUINT64_CONSTANT(0x0F0000)) >> 4) +
814 ((utf8 & G_GUINT64_CONSTANT(0x3F00)) >> 2) +
815 (utf8 & G_GUINT64_CONSTANT(0x3F));
817 else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFFFF))
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));
825 else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFFFFFF))
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));
834 else if (utf8 <= G_GUINT64_CONSTANT(0xFFFFFFFFFFFF))
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));
846 unicode = G_GUINT64_CONSTANT(0);
852 /*-----------------------------------------------------------------------------
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)
861 key_name = (char *)wmem_alloc(wmem_packet_scope(), 10);
863 if ((unicode <= 0x20)
869 || (unicode == 0xF9))
871 g_snprintf(key_name, 10, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown"));
873 else if (unicode <= 0xFF)
875 g_snprintf(key_name, 10, "%c", unicode);
879 g_snprintf(key_name, 10, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown"));
885 /*-----------------------------------------------------------------------------
887 ---------------------------------------------------------------------------*/
888 static void decode_evt_error(proto_tree *tree,
896 proto_tree_add_item(tree, hf_noe_errcode, tvb, offset, 2, ENC_BIG_ENDIAN);
900 proto_tree_add_item(tree, hf_noe_method, tvb, offset, 1, ENC_BIG_ENDIAN);
904 proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
908 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
912 proto_tree_add_item(tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
916 proto_tree_add_item(tree, hf_noe_aindx, tvb, offset, 1, ENC_NA);
920 proto_tree_add_item(tree, hf_noe_length, tvb, offset, 2, ENC_BIG_ENDIAN);
924 proto_tree_add_item(tree, hf_noe_value, tvb, offset, 4, ENC_BIG_ENDIAN);
928 proto_tree_add_item(tree, hf_noe_message, tvb, offset, length, ENC_NA);
932 /*-----------------------------------------------------------------------------
934 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
935 ---------------------------------------------------------------------------*/
936 static void decode_tlv(proto_tree *tree,
941 proto_tree *property_tree;
942 guint8 property_type;
943 guint16 property_length;
944 /* guint64 property_index;*/
946 /* add text to the frame tree */
947 property_tree = proto_tree_add_subtree(tree,
950 length, ett_body, NULL,
955 property_type = tvb_get_guint8(tvb, offset);
956 proto_tree_add_item(property_tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
960 if (property_type >= P_ARRAY)
962 proto_tree_add_item(property_tree, hf_noe_aindx, tvb, offset, 1, ENC_NA);
967 property_length = tvb_get_guint8(tvb, offset);
968 if (property_length & 0x80)
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));
979 proto_tree_add_uint(property_tree, hf_noe_psize, tvb, offset, 1,
980 tvb_get_guint8(tvb, offset));
985 switch(property_length)
992 proto_tree_add_item(property_tree, hf_noe_property_item_u8, tvb, offset, 1, ENC_BIG_ENDIAN);
997 proto_tree_add_item(property_tree, hf_noe_property_item_u16, tvb, offset, 2, ENC_BIG_ENDIAN);
1002 proto_tree_add_item(property_tree, hf_noe_property_item_u24, tvb, offset, 3, ENC_BIG_ENDIAN);
1007 proto_tree_add_item(property_tree, hf_noe_property_item_u32, tvb, offset, 4, ENC_BIG_ENDIAN);
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;
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,
1031 proto_tree *body_tree;
1034 /* add text to the frame tree */
1035 body_tree = proto_tree_add_subtree(tree,
1038 length, ett_property, NULL,
1039 "NOE Message Body");
1043 body_type = tvb_get_guint8(tvb, offset);
1044 proto_tree_add_item(body_tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1049 if (body_type >= P_ARRAY)
1051 proto_tree_add_item(body_tree, hf_noe_aindx, tvb, offset, 1, ENC_NA);
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,
1071 guint8 event = tvb_get_guint8(tvb, offset);
1073 proto_tree_add_item(tree, hf_noe_event, tvb, offset, 1, ENC_BIG_ENDIAN);
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"));
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);
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:
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;
1106 int pt_length = length;
1107 int pt_offset = offset;
1109 while(pt_length > 0)
1111 utf8_value = (utf8_value << 8) + tvb_get_guint8(tvb, pt_offset);
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));
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",
1125 proto_tree_add_text(tree,
1129 "Key Name: %s (UTF-8 Value: %s, Unicode Value: 0x%" G_GINT64_MODIFIER "x)",
1131 tvb_bytes_to_ep_str(tvb, offset, length),
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:
1141 decode_evt_error(tree, tvb, offset, length);
1144 case OPCODE_EVT_CONTEXT_SWITCH:
1145 proto_tree_add_item(tree, hf_event_context_switch, tvb, offset, 1, ENC_BIG_ENDIAN);
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);
1154 case OPCODE_EVT_WIDGETS_GC:
1155 proto_tree_add_item(tree, hf_event_widget_gc, tvb, offset, 4, ENC_BIG_ENDIAN);
1157 case OPCODE_EVT_BT_BONDING_RESULT:
1159 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1163 /* XXX - should a 16-bit value be gotten if the size is only 8-bit? */
1164 proto_tree_add_text(tree,
1169 tvb_get_ntohs(tvb, offset));
1173 proto_tree_add_text(tree,
1178 tvb_get_ntohs(tvb, offset));
1182 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1187 decode_tlv(tree, tvb, offset, length);
1194 /*-----------------------------------------------------------------------------
1196 This function decodes the method of an 0x15 (and 0x16) UA3G message.
1197 ---------------------------------------------------------------------------*/
1198 static void decode_mtd(proto_tree *tree,
1205 guint8 noe_class = tvb_get_guint8(tvb, offset);
1207 proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
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"));
1219 if (noe_class >= C_DYNAMIC)
1221 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1228 case METHOD_INSERT_ITEM:
1230 proto_tree_add_item(tree, hf_noe_method_index, tvb, offset, 1, ENC_BIG_ENDIAN);
1234 decode_tlv(tree, tvb, offset, length);
1237 case METHOD_DELETE_ITEM:
1239 proto_tree_add_item(tree, hf_noe_method_index, tvb, offset, 1, ENC_BIG_ENDIAN);
1242 case METHOD_GET_PROPERTY:
1244 decode_getproperty_tlv(tree, tvb, offset, length);
1250 decode_tlv(tree, tvb, offset, length);
1257 /*-----------------------------------------------------------------------------
1259 ---------------------------------------------------------------------------*/
1260 static void dissect_noe(tvbuff_t *tvb,
1264 proto_item *noe_item;
1265 proto_tree *noe_tree;
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);
1275 length = tvb_get_letohs(tvb, offset);
1277 proto_tree_add_uint(noe_tree,
1285 server = tvb_get_guint8(tvb, offset);
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"));
1291 proto_tree_add_uint(noe_tree,
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"));
1304 method = tvb_get_guint8(tvb, offset);
1305 methodack = (method & 0x80) != 0;
1306 method = (method & 0x7f);
1308 proto_tree_add_uint_format_value(noe_tree,
1315 val_to_str_const(method, methods_vals, "Unknown"),
1318 if (method >= METHOD_INVALID)
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"));
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"));
1329 if (method == METHOD_NOTIFY)
1333 decode_evt(noe_tree, tvb, pinfo, offset, length);
1336 /* Create, Delete, SetProperty, GetProperty, DeleteItem, InsertItem properties */
1338 proto_tree_add_boolean(noe_tree,
1346 decode_mtd(noe_tree, tvb, pinfo, method, offset, length);
1352 /*-----------------------------------------------------------------------------
1353 DISSECTORS REGISTRATION FUNCTIONS
1354 ---------------------------------------------------------------------------*/
1355 void proto_register_noe(void)
1357 static hf_register_info hf_noe[] =
1383 { &hf_noe_method_ack,
1391 "Method Acknowledge",
1412 BASE_DEC|BASE_EXT_STRING,
1424 BASE_DEC|BASE_EXT_STRING,
1439 "Object Identifier",
1443 { &hf_noe_method_index,
1451 "Delete/Insert Index",
1460 BASE_HEX|BASE_EXT_STRING,
1463 "Property Identifier",
1484 BASE_DEC|BASE_EXT_STRING,
1527 { &hf_noe_property_item_u8,
1530 "noe.property_item.uint",
1539 { &hf_noe_property_item_u16,
1542 "noe.property_item.uint",
1551 { &hf_noe_property_item_u24,
1554 "noe.property_item.uint",
1563 { &hf_noe_property_item_u32,
1566 "noe.property_item.uint",
1575 { &hf_noe_property_item_bytes,
1578 "noe.property_item.bytes",
1587 { &hf_event_value_u8,
1590 "noe.event_value.uint",
1593 VALS(noe_event_str_struct),
1599 { &hf_event_context_switch,
1602 "noe.event_context_switch",
1611 { &hf_event_widget_gc,
1614 "noe.event_widget_gc",
1625 static gint *ett[] =
1633 /* NOE dissector registration */
1634 proto_noe = proto_register_protocol("NOE Protocol", "NOE", "noe");
1636 proto_register_field_array(proto_noe, hf_noe, array_length(hf_noe));
1638 register_dissector("noe", dissect_noe, proto_noe);
1640 /* Common subtree array registration */
1641 proto_register_subtree_array(ett, array_length(ett));
1646 void proto_reg_handoff_noe(void)
1649 dissector_handle_t handle_noe = find_dissector("noe");
1651 /* hooking of NOE on UA */
1652 dissector_add_uint("ua.opcode", 0x15, handle_noe);