2 * Routines for UA/UDP (Universal Alcatel over UDP) and NOE packet dissection.
3 * Copyright 2012, Alcatel-Lucent Enterprise <lars.ruoff@alcatel-lucent.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include "epan/packet.h"
31 #include <epan/wmem/wmem.h>
33 #define OPCODE_C_context 0
34 #define OPCODE_C_terminal 1
35 #define OPCODE_C_keyboard 2
36 #define OPCODE_C_audioconfig 3
37 #define OPCODE_C_security 4
38 #define OPCODE_C_leds 5
39 #define OPCODE_C_screen 6
40 #define OPCODE_C_date 7
41 #define OPCODE_C_AOMV 8
42 #define OPCODE_C_bluetooth 9
43 #define OPCODE_C_callstate 12
44 #define OPCODE_C_resource 13
45 #define OPCODE_C_widgets_default 14
46 #define OPCODE_C_framebox 128
47 #define OPCODE_C_tabbox 129
48 #define OPCODE_C_listbox 130
49 #define OPCODE_C_actionlistbox 131
50 #define OPCODE_C_textbox 132
51 #define OPCODE_C_actionbox 133
52 #define OPCODE_C_inputbox 134
53 #define OPCODE_C_checkbox 135
54 #define OPCODE_C_datebox 136
55 #define OPCODE_C_timerbox 137
56 #define OPCODE_C_popupbox 138
57 #define OPCODE_C_dialogbox 139
58 #define OPCODE_C_sliderbar 140
59 #define OPCODE_C_progressbar 141
60 #define OPCODE_C_imagebox 142
61 #define OPCODE_C_iconbox 143
62 #define OPCODE_C_AOMVbox 144
63 #define OPCODE_C_telephonicbox 145
64 #define OPCODE_C_keyboard_context 146
65 #define OPCODE_C_AOMEL 147
66 #define OPCODE_C_AOM10 148
67 #define OPCODE_C_AOM40 149
68 #define OPCODE_C_idletimer 150
69 #define OPCODE_C_telephonicboxitem 151
70 #define OPCODE_C_bluetooth_device 152
71 #define OPCODE_C_headerbox 153
72 #define OPCODE_C_ime_context 154
74 static const value_string val_str_class
[] = {
75 {OPCODE_C_context
, "Context"},
76 {OPCODE_C_terminal
, "Terminal"},
77 {OPCODE_C_keyboard
, "Keyboard"},
78 {OPCODE_C_audioconfig
, "AudioConfig"},
79 {OPCODE_C_security
, "Security"},
80 {OPCODE_C_leds
, "Leds"},
81 {OPCODE_C_screen
, "Screen"},
82 {OPCODE_C_date
, "Date"},
83 {OPCODE_C_AOMV
, "AOMV"},
84 {OPCODE_C_bluetooth
, "Bluetooth"},
85 {OPCODE_C_callstate
, "Callstate"},
86 {OPCODE_C_framebox
, "FrameBox"},
87 {OPCODE_C_tabbox
, "TabBox"},
88 {OPCODE_C_listbox
, "ListBox"},
89 {OPCODE_C_actionlistbox
, "ActionlistBox"},
90 {OPCODE_C_textbox
, "TextBox"},
91 {OPCODE_C_actionbox
, "ActionBox"},
92 {OPCODE_C_inputbox
, "InputBox"},
93 {OPCODE_C_checkbox
, "CheckBox"},
94 {OPCODE_C_datebox
, "DateBox"},
95 {OPCODE_C_timerbox
, "TimerBox"},
96 {OPCODE_C_popupbox
, "PopupBox"},
97 {OPCODE_C_dialogbox
, "DialogBox"},
98 {OPCODE_C_sliderbar
, "SliderBar"},
99 {OPCODE_C_progressbar
, "ProgressBar"},
100 {OPCODE_C_imagebox
, "ImageBox"},
101 {OPCODE_C_iconbox
, "IconBox"},
102 {OPCODE_C_AOMVbox
, "AOMVBox"},
103 {OPCODE_C_telephonicbox
, "TelephonicBox"},
104 {OPCODE_C_keyboard_context
, "Keyboard_context"},
105 {OPCODE_C_AOMEL
, "AOMEL"},
106 {OPCODE_C_AOM10
, "AOM10"},
107 {OPCODE_C_AOM40
, "AOM40"},
108 {OPCODE_C_idletimer
, "IdleTimer"},
109 {OPCODE_C_telephonicboxitem
, "TelephonicBoxItem"},
110 {OPCODE_C_bluetooth_device
, "Bluetooth_device"},
111 {OPCODE_C_headerbox
, "HeaderBox"},
112 {OPCODE_C_ime_context
, "ime_context"},
115 static value_string_ext val_str_class_ext
= VALUE_STRING_EXT_INIT(val_str_class
);
117 #define OPCODE_P_B_objectid 0
118 #define OPCODE_P_B_ownership 1
119 #define OPCODE_P_B_reset_mode 2
120 #define OPCODE_P_B_mtu 3
121 #define OPCODE_P_B_negative_ack 4
122 #define OPCODE_P_B_type 5
123 #define OPCODE_P_B_help_timeout 6
124 #define OPCODE_P_B_longpress 7
125 #define OPCODE_P_B_count 8
126 #define OPCODE_P_B_eventmode 9
127 #define OPCODE_P_B_numpad_ownership 10
128 #define OPCODE_P_B_navigator_ownership 11
129 #define OPCODE_P_B_telephony_ownership 12
130 #define OPCODE_P_B_progkeys_ownership 13
131 #define OPCODE_P_B_alphakeys_ownership 14
132 #define OPCODE_P_B_numpad_eventmode 15
133 #define OPCODE_P_B_onoff 16
134 #define OPCODE_P_B_bpp 17
135 #define OPCODE_P_B_w 18
136 #define OPCODE_P_B_h 19
137 #define OPCODE_P_B_contrast 20
138 #define OPCODE_P_B_clearscreen 21
139 #define OPCODE_P_B_year 24
140 #define OPCODE_P_B_month 25
141 #define OPCODE_P_B_day 26
142 #define OPCODE_P_B_m 27
143 #define OPCODE_P_B_s 28
144 #define OPCODE_P_B_enable 29
145 #define OPCODE_P_B_address 30
146 #define OPCODE_P_B_port 31
147 #define OPCODE_P_B_protocol 32
148 #define OPCODE_P_B_name 33
149 #define OPCODE_P_B_checked 34
150 #define OPCODE_P_B_unchecked 35
151 #define OPCODE_P_B_anchorid 36
152 #define OPCODE_P_B_grid 37
153 #define OPCODE_P_B_x 38
154 #define OPCODE_P_B_y 39
155 #define OPCODE_P_B_visible 40
156 #define OPCODE_P_B_border 41
157 #define OPCODE_P_B_fontid 42
158 #define OPCODE_P_B_active 43
159 #define OPCODE_P_B_halign 44
160 #define OPCODE_P_B_valign 45
161 #define OPCODE_P_B_size 46
162 #define OPCODE_P_B_mode 47
163 #define OPCODE_P_B_showevent 48
164 #define OPCODE_P_B_showactive 49
165 #define OPCODE_P_B_action_active 50
166 #define OPCODE_P_B_action_count 51
167 #define OPCODE_P_B_foreground 52
168 #define OPCODE_P_B_background 53
169 #define OPCODE_P_B_icon 54
170 #define OPCODE_P_B_label 55
171 #define OPCODE_P_B_value 56
172 #define OPCODE_P_B_password 57
173 #define OPCODE_P_B_cursor 58
174 #define OPCODE_P_B_mask 59
175 #define OPCODE_P_B_qos_ticket 60
176 #define OPCODE_P_B_focus 61
177 #define OPCODE_P_B_state 62
178 #define OPCODE_P_B_format 63
179 #define OPCODE_P_B_incdec 64
180 #define OPCODE_P_B_value_notify 65
181 #define OPCODE_P_B_timeout 66
182 #define OPCODE_P_B_min 67
183 #define OPCODE_P_B_max 68
184 #define OPCODE_P_B_data 69
185 #define OPCODE_P_B_custversion 70
186 #define OPCODE_P_B_L10Nversion 71
187 #define OPCODE_P_B_append 72
188 #define OPCODE_P_B_shortpress 73
189 #define OPCODE_P_B_autorepeat 74
190 #define OPCODE_P_B_repetition 75
191 #define OPCODE_P_B_vsplit 76
192 #define OPCODE_P_B_accesskey 77
193 #define OPCODE_P_B_realcount 78
194 #define OPCODE_P_B_start 79
195 #define OPCODE_P_B_modal 80
196 #define OPCODE_P_B_session_timeout 81
197 #define OPCODE_P_B_softkeys_ownership 82
198 #define OPCODE_P_B_ringings_count 83
199 #define OPCODE_P_B_cod 84
200 #define OPCODE_P_B_bonded 85
201 #define OPCODE_P_B_link_key 86
202 #define OPCODE_P_B_pin 87
203 #define OPCODE_P_B_term_type 88
204 #define OPCODE_P_B_link_type 89
205 #define OPCODE_P_B_circular 90
206 #define OPCODE_P_B_autospread 91
207 #define OPCODE_P_B_backlight_timeout 92
208 #define OPCODE_P_B_screensaver_timeout 93
209 #define OPCODE_P_B_cycling 94
210 #define OPCODE_P_B_CS_idle_state 95
211 #define OPCODE_P_B_PS_idle_state 96
212 #define OPCODE_P_B_bonded_devices 97
213 #define OPCODE_P_B_serialnum 98
214 #define OPCODE_P_B_hardversion 99
215 #define OPCODE_P_B_softversion 100
216 #define OPCODE_P_B_rom_size 101
217 #define OPCODE_P_B_ram_size 102
218 #define OPCODE_P_B_reset_cause 103
219 #define OPCODE_P_B_cycling_time 104
220 #define OPCODE_P_B_inputborder 106
221 #define OPCODE_P_B_disablelongpress 107
222 #define OPCODE_P_B_all_icons_off 108
223 #define OPCODE_P_B_all_labels_off 109
224 #define OPCODE_P_B_widgets_size 110
225 #define OPCODE_P_B_list_type 111
226 #define OPCODE_P_B_frame_type 112
227 #define OPCODE_P_B_bth_ringing 113
228 #define OPCODE_P_B_URI 114
229 #define OPCODE_P_B_fetch_timeout 115
230 #define OPCODE_P_B_mask_subst 116
231 #define OPCODE_P_B_use_customisation 117
232 #define OPCODE_P_B_ADTTS_request 118
233 #define OPCODE_P_B_AP_mac_notify 119
234 #define OPCODE_P_B_page_active 120
235 #define OPCODE_P_B_overwrite 121
236 #define OPCODE_P_B_ime_lock 122
237 #define OPCODE_P_B_method 123
238 #define OPCODE_P_B_login 124
239 #define OPCODE_P_B_binary_suffix 125
240 #define OPCODE_P_B_binary_count 126
241 #define OPCODE_P_B_SIPCversion 127
242 #define OPCODE_P_A_dflt 128
243 #define OPCODE_P_A_shift 129
244 #define OPCODE_P_A_alt 130
245 #define OPCODE_P_A_key_ownership 131
246 #define OPCODE_P_A_key_eventmode 132
247 #define OPCODE_P_A_value 133
248 #define OPCODE_P_A_mode 134
249 #define OPCODE_P_A_color 135
250 #define OPCODE_P_A_type 136
251 #define OPCODE_P_A_icon 137
252 #define OPCODE_P_A_label 138
253 #define OPCODE_P_A_ownership 139
254 #define OPCODE_P_A_enable 140
255 #define OPCODE_P_A_state 141
256 #define OPCODE_P_A_name 142
257 #define OPCODE_P_A_number 143
258 #define OPCODE_P_A_action_icon 144
259 #define OPCODE_P_A_action_label 145
260 #define OPCODE_P_A_action_value 146
261 #define OPCODE_P_A_today 147
262 #define OPCODE_P_A_tomorrow 148
263 #define OPCODE_P_A_action_key 149
264 #define OPCODE_P_A_code 150
265 #define OPCODE_P_A_data 151
266 #define OPCODE_P_A_delay_max_handset 152
267 #define OPCODE_P_A_delay_max_handsfree 153
268 #define OPCODE_P_A_delay_tx 154
269 #define OPCODE_P_A_delay_rx 155
270 #define OPCODE_P_A_pem_data 156
271 #define OPCODE_P_A_serial_number 157
272 #define OPCODE_P_A_owner_name 158
273 #define OPCODE_P_A_issuer_name 159
274 #define OPCODE_P_A_end_date 160
276 static const value_string val_str_props
[] = {
277 {OPCODE_P_B_objectid
, "objectid"},
278 {OPCODE_P_B_ownership
, "ownership"},
279 {OPCODE_P_B_reset_mode
, "reset_mode"},
280 {OPCODE_P_B_mtu
, "mtu"},
281 {OPCODE_P_B_negative_ack
, "negative_ack"},
282 {OPCODE_P_B_type
, "type"},
283 {OPCODE_P_B_help_timeout
, "help_timeout"},
284 {OPCODE_P_B_longpress
, "longpress"},
285 {OPCODE_P_B_count
, "count"},
286 {OPCODE_P_B_eventmode
, "eventmode"},
287 {OPCODE_P_B_numpad_ownership
, "numpad_ownership"},
288 {OPCODE_P_B_navigator_ownership
, "navigator_ownership"},
289 {OPCODE_P_B_telephony_ownership
, "telephony_ownership"},
290 {OPCODE_P_B_progkeys_ownership
, "progkeys_ownership"},
291 {OPCODE_P_B_alphakeys_ownership
, "alphakeys_ownership"},
292 {OPCODE_P_B_numpad_eventmode
, "numpad_eventmode"},
293 {OPCODE_P_B_onoff
, "onoff"},
294 {OPCODE_P_B_bpp
, "bpp"},
295 {OPCODE_P_B_w
, "w"},
296 {OPCODE_P_B_h
, "h"},
297 {OPCODE_P_B_contrast
, "contrast"},
298 {OPCODE_P_B_clearscreen
, "clearscreen"},
299 {OPCODE_P_B_year
, "year"},
300 {OPCODE_P_B_month
, "month"},
301 {OPCODE_P_B_day
, "day"},
302 {OPCODE_P_B_m
, "m"},
303 {OPCODE_P_B_s
, "s"},
304 {OPCODE_P_B_enable
, "enable"},
305 {OPCODE_P_B_address
, "address"},
306 {OPCODE_P_B_name
, "name"},
307 {OPCODE_P_B_anchorid
, "anchorid"},
308 {OPCODE_P_B_grid
, "grid"},
309 {OPCODE_P_B_x
, "x"},
310 {OPCODE_P_B_y
, "y"},
311 {OPCODE_P_B_visible
, "visible"},
312 {OPCODE_P_B_border
, "border"},
313 {OPCODE_P_B_fontid
, "fontid"},
314 {OPCODE_P_B_active
, "active"},
315 {OPCODE_P_B_halign
, "halign"},
316 {OPCODE_P_B_valign
, "valign"},
317 {OPCODE_P_B_size
, "size"},
318 {OPCODE_P_B_mode
, "mode"},
319 {OPCODE_P_B_showevent
, "showevent"},
320 {OPCODE_P_B_showactive
, "showactive"},
321 {OPCODE_P_B_icon
, "icon"},
322 {OPCODE_P_B_label
, "label"},
323 {OPCODE_P_B_value
, "value"},
324 {OPCODE_P_B_password
, "password"},
325 {OPCODE_P_B_cursor
, "cursor"},
326 {OPCODE_P_B_mask
, "mask"},
327 {OPCODE_P_B_qos_ticket
, "qos_ticket"},
328 {OPCODE_P_B_focus
, "focus"},
329 {OPCODE_P_B_state
, "state"},
330 {OPCODE_P_B_format
, "format"},
331 {OPCODE_P_B_incdec
, "incdec"},
332 {OPCODE_P_B_value_notify
, "value_notify"},
333 {OPCODE_P_B_timeout
, "timeout"},
334 {OPCODE_P_B_min
, "min"},
335 {OPCODE_P_B_max
, "max"},
336 {OPCODE_P_B_data
, "data"},
337 {OPCODE_P_B_custversion
, "custversion"},
338 {OPCODE_P_B_L10Nversion
, "L10Nversion"},
339 {OPCODE_P_B_append
, "append"},
340 {OPCODE_P_B_shortpress
, "shortpress"},
341 {OPCODE_P_B_autorepeat
, "autorepeat"},
342 {OPCODE_P_B_repetition
, "repetition"},
343 {OPCODE_P_B_vsplit
, "vsplit"},
344 {OPCODE_P_B_accesskey
, "accesskey"},
345 {OPCODE_P_B_realcount
, "realcount"},
346 {OPCODE_P_B_start
, "start"},
347 {OPCODE_P_B_modal
, "modal"},
348 {OPCODE_P_B_session_timeout
, "session_timeout"},
349 {OPCODE_P_B_softkeys_ownership
, "softkeys_ownership"},
350 {OPCODE_P_B_ringings_count
, "ringings_count"},
351 {OPCODE_P_B_cod
, "cod"},
352 {OPCODE_P_B_bonded
, "bonded"},
353 {OPCODE_P_B_link_key
, "link_key"},
354 {OPCODE_P_B_pin
, "pin"},
355 {OPCODE_P_B_term_type
, "term_type"},
356 {OPCODE_P_B_link_type
, "link_type"},
357 {OPCODE_P_B_circular
, "circular"},
358 {OPCODE_P_B_autospread
, "autospread"},
359 {OPCODE_P_B_backlight_timeout
, "backlight_timeout"},
360 {OPCODE_P_B_screensaver_timeout
, "screensaver_timeout"},
361 {OPCODE_P_B_cycling
, "cycling"},
362 {OPCODE_P_B_CS_idle_state
, "CS_idle_state"},
363 {OPCODE_P_B_PS_idle_state
, "PS_idle_state"},
364 {OPCODE_P_B_bonded_devices
, "bonded_devices"},
365 {OPCODE_P_B_serialnum
, "serialnum"},
366 {OPCODE_P_B_hardversion
, "hardversion"},
367 {OPCODE_P_B_softversion
, "softversion"},
368 {OPCODE_P_B_rom_size
, "rom_size"},
369 {OPCODE_P_B_ram_size
, "ram_size"},
370 {OPCODE_P_B_reset_cause
, "reset_cause"},
371 {OPCODE_P_B_cycling_time
, "cycling_time"},
372 {OPCODE_P_B_inputborder
, "inputborder"},
373 {OPCODE_P_B_disablelongpress
, "disablelongpress"},
374 {OPCODE_P_B_all_icons_off
, "all_icons_off"},
375 {OPCODE_P_B_all_labels_off
, "all_labels_off"},
376 {OPCODE_P_B_widgets_size
, "widgets_size"},
377 {OPCODE_P_B_list_type
, "list_type"},
378 {OPCODE_P_B_frame_type
, "frame_type"},
379 {OPCODE_P_B_bth_ringing
, "bth_ringing"},
380 {OPCODE_P_B_URI
, "URI"},
381 {OPCODE_P_B_fetch_timeout
, "fetch_timeout"},
382 {OPCODE_P_B_mask_subst
, "mask_subst"},
383 {OPCODE_P_B_use_customisation
, "use_customisation"},
384 {OPCODE_P_B_page_active
, "page_active"},
385 {OPCODE_P_B_overwrite
, "overwrite"},
386 {OPCODE_P_B_ime_lock
, "ime_lock"},
387 {OPCODE_P_B_method
, "method"},
388 {OPCODE_P_B_login
, "login"},
389 {OPCODE_P_B_binary_suffix
, "binary_suffix"},
390 {OPCODE_P_B_binary_count
, "binary_count"},
391 {OPCODE_P_B_SIPCversion
, "SIPCversion"},
392 {OPCODE_P_A_key_ownership
, "key_ownership"},
393 {OPCODE_P_A_key_eventmode
, "key_eventmode"},
394 {OPCODE_P_A_value
, "value"},
395 {OPCODE_P_A_mode
, "mode"},
396 {OPCODE_P_A_color
, "color"},
397 {OPCODE_P_A_type
, "type"},
398 {OPCODE_P_A_icon
, "icon"},
399 {OPCODE_P_A_label
, "label"},
400 {OPCODE_P_A_ownership
, "ownership"},
401 {OPCODE_P_A_enable
, "enable"},
402 {OPCODE_P_A_state
, "state"},
403 {OPCODE_P_A_name
, "name"},
404 {OPCODE_P_A_number
, "number"},
405 {OPCODE_P_A_action_icon
, "action_icon"},
406 {OPCODE_P_A_action_label
, "action_label"},
407 {OPCODE_P_A_action_value
, "action_value"},
408 {OPCODE_P_A_today
, "today"},
409 {OPCODE_P_A_tomorrow
, "tomorrow"},
410 {OPCODE_P_A_code
, "code"},
411 {OPCODE_P_A_data
, "data"},
412 {OPCODE_P_A_delay_max_handset
, "delay_max_handset"},
413 {OPCODE_P_A_delay_max_handsfree
, "delay_max_handsfree"},
414 {OPCODE_P_A_delay_tx
, "delay_tx"},
415 {OPCODE_P_A_delay_rx
, "delay_rx"},
416 {OPCODE_P_A_pem_data
, "pem_data"},
417 {OPCODE_P_A_serial_number
, "serial_number"},
418 {OPCODE_P_A_owner_name
, "owner_name"},
419 {OPCODE_P_A_issuer_name
, "issuer_name"},
420 {OPCODE_P_A_end_date
, "end_date"},
423 static value_string_ext val_str_props_ext
= VALUE_STRING_EXT_INIT(val_str_props
);
425 #define OPCODE_EVT_CONTEXT_SWITCH 0
426 #define OPCODE_EVT_RESET 1
427 #define OPCODE_EVT_KEY_PRESS 2
428 #define OPCODE_EVT_KEY_RELEASE 3
429 #define OPCODE_EVT_KEY_SHORTPRESS 4
430 #define OPCODE_EVT_KEY_LONGPRESS 5
431 #define OPCODE_EVT_ONHOOK 6
432 #define OPCODE_EVT_OFFHOOK 7
433 #define OPCODE_EVT_HELP 8
434 #define OPCODE_EVT_WIDGETS_GC 9
435 #define OPCODE_EVT_ERROR_PROTOCOL 10
436 #define OPCODE_EVT_ERROR_CREATE 11
437 #define OPCODE_EVT_ERROR_DELETE 12
438 #define OPCODE_EVT_ERROR_SET_PROPERTY 13
439 #define OPCODE_EVT_ERROR_GET_PROPERTY 14
440 #define OPCODE_EVT_SUCCESS_CREATE 15
441 #define OPCODE_EVT_SUCCESS_DELETE 16
442 #define OPCODE_EVT_SUCCESS_SET_PROPERTY 17
443 #define OPCODE_EVT_ERROR_INSERT_ITEM 18
444 #define OPCODE_EVT_ERROR_DELETE_ITEM 19
445 #define OPCODE_EVT_SUCCESS_INSERT_ITEM 20
446 #define OPCODE_EVT_DEVICE_PRESENCE 21
447 #define OPCODE_EVT_KEY_LINE 22
448 #define OPCODE_EVT_SUCCESS_DELETE_ITEM 23
449 #define OPCODE_EVT_BT_BONDING_RESULT 24
450 #define OPCODE_EVT_BT_KEY_SHORTPRESS 25
451 #define OPCODE_EVT_BT_KEY_LONGPRESS 26
452 #define OPCODE_EVT_BT_KEY_VERYLONGPRESS 27
453 #define OPCODE_EVT_LOCAL_APPLICATION 28
454 #define OPCODE_EVT_WARNING_CREATE 29
455 #define OPCODE_EVT_WARNING_SET_PROPERTY 30
456 #define OPCODE_EVT_ARP_SPOOFING 31
457 #define OPCODE_EVT_CHAR_NOT_FOUND 32
458 #define OPCODE_EVT_CHAR_BAD_LENGTH 33
459 #define OPCODE_EVT_QOS_TICKET 34
460 #define OPCODE_EVT_UA3_ERROR 35
461 #define OPCODE_EVT_TABBOX 128
462 #define OPCODE_EVT_LISTBOX 129
463 #define OPCODE_EVT_LISTBOX_FIRST 130
464 #define OPCODE_EVT_LISTBOX_LAST 131
465 #define OPCODE_EVT_ACTIONLISTBOX 132
466 #define OPCODE_EVT_ACTIONBOX 133
467 #define OPCODE_EVT_INPUTBOX 134
468 #define OPCODE_EVT_INPUTBOX_FOCUS_LOST 135
469 #define OPCODE_EVT_CHECKBOX 136
470 #define OPCODE_EVT_TIMERBOX 137
471 #define OPCODE_EVT_POPUPBOX_TIMEOUT 138
472 #define OPCODE_EVT_DIALOGBOX 139
473 #define OPCODE_EVT_SLIDERBAR 140
474 #define OPCODE_EVT_PROGRESSBAR 141
475 #define OPCODE_EVT_AOMVBOX 142
476 #define OPCODE_EVT_TELEPHONICBOX_FOCUS 143
477 #define OPCODE_EVT_AOM_INSERTED 144
478 #define OPCODE_EVT_AOM_REMOVED 145
479 #define OPCODE_EVT_AOM_KEY_PRESS 146
480 #define OPCODE_EVT_IDLETIMER 147
481 #define OPCODE_EVT_GET_PROPERTY_RESULT 148
482 #define OPCODE_EVT_AOM_KEY_RELEASE 149
483 #define OPCODE_EVT_POPUPBOX_DISMISSED 150
484 #define OPCODE_EVT_DIALOGBOX_TIMEOUT 151
485 #define OPCODE_EVT_DIALOGBOX_DISMISSED 152
486 #define OPCODE_EVT_BT_BONDED_DEVICE 153
487 #define OPCODE_EVT_BT_INQUIRY_RESULT 154
488 #define OPCODE_EVT_BT_NAME_DISCOVERY 155
489 #define OPCODE_EVT_IME_REMOTEOPEN 156
490 #define OPCODE_EVT_BT_BATTERY 158
491 #define OPCODE_EVT_IME_LIST 159
492 #define OPCODE_EVT_IME_CHANGE 160
493 #define OPCODE_EVT_IME_OPEN 161
494 #define OPCODE_EVT_TELEPHONICBOX_EVENT 162
495 #define OPCODE_EVT_ACTLISTBOX_TIMEOUT 163
496 #define OPCODE_EVT_ACTLISTBOX_DISMISSED 164
497 #define OPCODE_EVT_ADTTS_RESPONSE 165
498 #define OPCODE_EVT_AP_MAC 166
500 static const value_string val_str_event
[] = {
501 {OPCODE_EVT_CONTEXT_SWITCH
, "EVT_CONTEXT_SWITCH"},
502 {OPCODE_EVT_RESET
, "EVT_RESET"},
503 {OPCODE_EVT_KEY_PRESS
, "EVT_KEY_PRESS"},
504 {OPCODE_EVT_KEY_RELEASE
, "EVT_KEY_RELEASE"},
505 {OPCODE_EVT_KEY_SHORTPRESS
, "EVT_KEY_SHORTPRESS"},
506 {OPCODE_EVT_KEY_LONGPRESS
, "EVT_KEY_LONGPRESS"},
507 {OPCODE_EVT_ONHOOK
, "EVT_ONHOOK"},
508 {OPCODE_EVT_OFFHOOK
, "EVT_OFFHOOK"},
509 {OPCODE_EVT_HELP
, "EVT_HELP"},
510 {OPCODE_EVT_WIDGETS_GC
, "EVT_WIDGETS_GC"},
511 {OPCODE_EVT_ERROR_PROTOCOL
, "EVT_ERROR_PROTOCOL"},
512 {OPCODE_EVT_ERROR_CREATE
, "EVT_ERROR_CREATE"},
513 {OPCODE_EVT_ERROR_DELETE
, "EVT_ERROR_DELETE"},
514 {OPCODE_EVT_ERROR_SET_PROPERTY
, "EVT_ERROR_SET_PROPERTY"},
515 {OPCODE_EVT_ERROR_GET_PROPERTY
, "EVT_ERROR_GET_PROPERTY"},
516 {OPCODE_EVT_SUCCESS_CREATE
, "EVT_SUCCESS_CREATE"},
517 {OPCODE_EVT_SUCCESS_DELETE
, "EVT_SUCCESS_DELETE"},
518 {OPCODE_EVT_SUCCESS_SET_PROPERTY
, "EVT_SUCCESS_SET_PROPERTY"},
519 {OPCODE_EVT_ERROR_INSERT_ITEM
, "EVT_ERROR_INSERT_ITEM"},
520 {OPCODE_EVT_ERROR_DELETE_ITEM
, "EVT_ERROR_DELETE_ITEM"},
521 {OPCODE_EVT_SUCCESS_INSERT_ITEM
, "EVT_SUCCESS_INSERT_ITEM"},
522 {OPCODE_EVT_DEVICE_PRESENCE
, "EVT_DEVICE_PRESENCE"},
523 {OPCODE_EVT_KEY_LINE
, "EVT_KEY_LINE"},
524 {OPCODE_EVT_SUCCESS_DELETE_ITEM
, "EVT_SUCCESS_DELETE_ITEM"},
525 {OPCODE_EVT_BT_BONDING_RESULT
, "EVT_BT_BONDING_RESULT"},
526 {OPCODE_EVT_BT_KEY_SHORTPRESS
, "EVT_BT_KEY_SHORTPRESS"},
527 {OPCODE_EVT_BT_KEY_LONGPRESS
, "EVT_BT_KEY_LONGPRESS"},
528 {OPCODE_EVT_BT_KEY_VERYLONGPRESS
, "EVT_BT_KEY_VERYLONGPRESS"},
529 {OPCODE_EVT_LOCAL_APPLICATION
, "EVT_LOCAL_APPLICATION"},
530 {OPCODE_EVT_WARNING_CREATE
, "EVT_WARNING_CREATE"},
531 {OPCODE_EVT_WARNING_SET_PROPERTY
, "EVT_WARNING_SET_PROPERTY"},
532 {OPCODE_EVT_ARP_SPOOFING
, "EVT_ARP_SPOOFING"},
533 {OPCODE_EVT_CHAR_NOT_FOUND
, "EVT_CHAR_NOT_FOUND"},
534 {OPCODE_EVT_QOS_TICKET
, "EVT_QOS_TICKET"},
535 {OPCODE_EVT_UA3_ERROR
, "EVT_UA3_ERROR"},
536 {OPCODE_EVT_TABBOX
, "EVT_TABBOX"},
537 {OPCODE_EVT_LISTBOX
, "EVT_LISTBOX"},
538 {OPCODE_EVT_LISTBOX_FIRST
, "EVT_LISTBOX_FIRST"},
539 {OPCODE_EVT_LISTBOX_LAST
, "EVT_LISTBOX_LAST"},
540 {OPCODE_EVT_ACTIONLISTBOX
, "EVT_ACTIONLISTBOX"},
541 {OPCODE_EVT_ACTIONBOX
, "EVT_ACTIONBOX"},
542 {OPCODE_EVT_INPUTBOX
, "EVT_INPUTBOX"},
543 {OPCODE_EVT_INPUTBOX_FOCUS_LOST
, "EVT_INPUTBOX_FOCUS_LOST"},
544 {OPCODE_EVT_CHECKBOX
, "EVT_CHECKBOX"},
545 {OPCODE_EVT_TIMERBOX
, "EVT_TIMERBOX"},
546 {OPCODE_EVT_POPUPBOX_TIMEOUT
, "EVT_POPUPBOX_TIMEOUT"},
547 {OPCODE_EVT_DIALOGBOX
, "EVT_DIALOGBOX"},
548 {OPCODE_EVT_SLIDERBAR
, "EVT_SLIDERBAR"},
549 {OPCODE_EVT_PROGRESSBAR
, "EVT_PROGRESSBAR"},
550 {OPCODE_EVT_AOMVBOX
, "EVT_AOMVBOX"},
551 {OPCODE_EVT_TELEPHONICBOX_FOCUS
, "EVT_TELEPHONICBOX_FOCUS"},
552 {OPCODE_EVT_AOM_INSERTED
, "EVT_AOM_INSERTED"},
553 {OPCODE_EVT_AOM_REMOVED
, "EVT_AOM_REMOVED"},
554 {OPCODE_EVT_AOM_KEY_PRESS
, "EVT_AOM_KEY_PRESS"},
555 {OPCODE_EVT_IDLETIMER
, "EVT_IDLETIMER"},
556 {OPCODE_EVT_GET_PROPERTY_RESULT
, "EVT_GET_PROPERTY_RESULT"},
557 {OPCODE_EVT_AOM_KEY_RELEASE
, "EVT_AOM_KEY_RELEASE"},
558 {OPCODE_EVT_POPUPBOX_DISMISSED
, "EVT_POPUPBOX_DISMISSED"},
559 {OPCODE_EVT_DIALOGBOX_TIMEOUT
, "EVT_DIALOGBOX_TIMEOUT"},
560 {OPCODE_EVT_DIALOGBOX_DISMISSED
, "EVT_DIALOGBOX_DISMISSED"},
561 {OPCODE_EVT_BT_BONDED_DEVICE
, "EVT_BT_BONDED_DEVICE"},
562 {OPCODE_EVT_BT_INQUIRY_RESULT
, "EVT_BT_INQUIRY_RESULT"},
563 {OPCODE_EVT_BT_NAME_DISCOVERY
, "EVT_BT_NAME_DISCOVERY"},
564 {OPCODE_EVT_IME_REMOTEOPEN
, "EVT_IME_REMOTEOPEN"},
565 {OPCODE_EVT_BT_BATTERY
, "EVT_BT_BATTERY"},
566 {OPCODE_EVT_IME_LIST
, "EVT_IME_LIST"},
567 {OPCODE_EVT_IME_CHANGE
, "EVT_IME_CHANGE"},
568 {OPCODE_EVT_IME_OPEN
, "EVT_IME_OPEN"},
569 {OPCODE_EVT_TELEPHONICBOX_EVENT
, "EVT_TELEPHONICBOX_EVENT"},
570 {OPCODE_EVT_ACTLISTBOX_TIMEOUT
, "EVT_ACTLISTBOX_TIMEOUT"},
571 {OPCODE_EVT_ACTLISTBOX_DISMISSED
, "EVT_ACTLISTBOX_DISMISSED"},
574 static value_string_ext val_str_event_ext
= VALUE_STRING_EXT_INIT(val_str_event
);
578 #define P_INVALID 255
579 #define P_INVALID_INDEX 255
582 #define C_DYNAMIC 128
583 #define C_INVALID 255
585 #define E_INVALID 255
588 /*-----------------------------------------------------------------------------
590 ---------------------------------------------------------------------------*/
591 static int proto_noe
= -1;
592 static gint ett_noe
= -1;
593 static gint ett_body
= -1;
594 static gint ett_property
= -1;
595 static gint ett_value
= -1;
597 static int hf_noe_length
= -1;
598 static int hf_noe_server
= -1;
599 static int hf_noe_method_ack
= -1;
600 static int hf_noe_method
= -1;
601 static int hf_noe_class
= -1;
602 static int hf_noe_event
= -1;
603 static int hf_noe_objectid
= -1;
604 static int hf_noe_method_index
= -1;
605 static int hf_noe_pcode
= -1;
606 static int hf_noe_psize
= -1;
607 static int hf_noe_aindx
= -1;
608 static int hf_noe_errcode
= -1;
609 static int hf_noe_value
= -1;
610 static int hf_noe_message
= -1;
611 static int hf_noe_property_item_u8
= -1;
612 static int hf_noe_property_item_u16
= -1;
613 static int hf_noe_property_item_u24
= -1;
614 static int hf_noe_property_item_u32
= -1;
615 static int hf_noe_property_item_bytes
= -1;
616 static int hf_event_value_u8
= -1;
617 static int hf_event_context_switch
= -1;
618 static int hf_event_widget_gc
= -1;
620 static const value_string servers_vals
[] = {
621 {0x15, "Call Server"},
622 {0x16, "Presentation Server"},
625 static const value_string servers_short_vals
[] = {
633 METHOD_CREATE
= 0x00,
634 METHOD_DELETE
= 0x01,
635 METHOD_SET_PROPERTY
= 0x02,
636 METHOD_GET_PROPERTY
= 0x03,
637 METHOD_NOTIFY
= 0x04,
638 METHOD_DELETE_ITEM
= 0x05,
639 METHOD_INSERT_ITEM
= 0x06,
642 static const value_string methods_vals
[] = {
643 {METHOD_CREATE
, "Create"},
644 {METHOD_DELETE
, "Delete"},
645 {METHOD_SET_PROPERTY
, "SetProperty"},
646 {METHOD_GET_PROPERTY
, "GetProperty"},
647 {METHOD_NOTIFY
, "Notify"},
648 {METHOD_DELETE_ITEM
, "DeleteItem"},
649 {METHOD_INSERT_ITEM
, "InsertItem"},
654 #define ERROR_INVALID_METHOD 0
655 #define ERROR_UNKNOWN_CLASS 1
656 #define ERROR_STATIC_CLASS 2
657 #define ERROR_DUPLICATE_OBJECTID 3
658 #define ERROR_UNKNOWN_PROPERTY_ 4
659 #define ERROR_BAD_INDEX 5
660 #define ERROR_BAD_LENGTH__ 6
661 #define ERROR_REQUIRED_MISSING 7
662 #define ERROR_BAD_VALUE 8
663 #define ERROR_READONLY_PROPERTY 9
664 #define ERROR_UNKNOWN_OBJECTID 10
665 #define ERROR_INVALID_CONTAINER 11
666 #define ERROR_PROPERTY_VMIN 12
667 #define ERROR_PROPERTY_VMAX 13
668 #define ERROR_POSITIVE_ACK 14
669 #define ERROR_NOT_IMPLEMENTED 15
670 #define ERROR_INVALID_CLASS 16
671 #define ERROR_INVALID_PROPERTY 17
672 #define ERROR_BAD_UTF8 18
674 #define ERROR_MESSAGE_DROP 128
675 #define ERROR_MAX_SET_PROPERTY 129
676 #define ERROR_INTERNAL 130
679 static const value_string errcode_vals
[] = {
680 {ERROR_INVALID_METHOD
, "An invalid method opcode was received"},
681 {ERROR_UNKNOWN_CLASS
, "An invalid class opcode was received"},
682 {ERROR_STATIC_CLASS
, "Trying to create or delete a static class"},
683 {ERROR_DUPLICATE_OBJECTID
, "Trying to create an existing object"},
684 {ERROR_UNKNOWN_PROPERTY_
, "Property opcode doesn't exist in specified class"},
685 {ERROR_BAD_INDEX
, "Bad property index (array overflow)"},
686 {ERROR_BAD_LENGTH__
, "Short message or bad property length"},
687 {ERROR_REQUIRED_MISSING
, "A required property was not specified in create method"},
688 {ERROR_BAD_VALUE
, "Bad property value"},
689 {ERROR_READONLY_PROPERTY
, "Trying to set a read-only property"},
690 {ERROR_UNKNOWN_OBJECTID
, "The specified object doesn't exist (delete, setProperty or getProperty methods)"},
691 {ERROR_INVALID_CONTAINER
, "Invalid container"},
692 {ERROR_PROPERTY_VMIN
, "Property value < property minimum value"},
693 {ERROR_PROPERTY_VMAX
, "Property value > property maximum value"},
694 {ERROR_POSITIVE_ACK
, "Positive ack requested with a getProperty method"},
695 {ERROR_NOT_IMPLEMENTED
, "The specified property is not implemented"},
696 {ERROR_INVALID_CLASS
, "Invalid class specified with insertItem and deleteItem"},
697 {ERROR_INVALID_PROPERTY
, "Invalid property specified with insertItem and deleteItem"},
698 {ERROR_BAD_UTF8
, "Invalid UTF8 value in UA message"},
699 {ERROR_MESSAGE_DROP
, "Decoder queue is full"},
700 {ERROR_MAX_SET_PROPERTY
, "A maximum of 256 properties can be received in a setProperty method"},
701 {ERROR_INTERNAL
, "Internal error"},
704 static value_string_ext errcode_vals_ext
= VALUE_STRING_EXT_INIT(errcode_vals
);
706 static const value_string str_key_name
[] = {
707 {0x00 , "Null Char."},
708 {0x01 , "Start Of Header"},
709 {0x02 , "Start Of Text"},
710 {0x03 , "End Of Text"},
711 {0x04 , "End Of Transmission"},
713 {0x06 , "Acknowledgment"},
715 {0x08 , "Backspace"},
716 {0x09 , "Horizontal Tab"},
717 {0x0A , "Line Feed"},
718 {0x0B , "Vertical Tab"},
719 {0x0C , "Form Feed"},
721 {0x0E , "Shift Out"},
723 {0x10 , "Data Link Escape"},
724 {0x11 , "Device Control 1"},
725 {0x12 , "Device Control 2"},
726 {0x13 , "Device Control 3"},
727 {0x14 , "Device Control 4"},
728 {0x15 , "Negative Acknowledgment"},
729 {0x16 , "Synchronous Idle"},
730 {0x17 , "End Of Trans. Block"},
732 {0x19 , "End Of Medium"},
733 {0x1A , "Substitute"},
735 {0x1C , "File Separator"},
736 {0x1D , "Group Separator"},
737 {0x1E , "Request To Send"},
738 {0x1F , "Unit Separator"},
746 {0x20AC , "Euro Character"},
747 {0xE100 , "Release"},
749 {0xE102 , "Message"},
750 {0xE103 , "Handsfree"},
752 {0xE105 , "Volume Dec"},
753 {0xE106 , "Volume Inc"},
754 {0xE107 , "Hookswitch"},
762 {0xE117 , "Directory"},
763 {0xE120 , "ProgKey 0"},
764 {0xE121 , "ProgKey 1"},
765 {0xE122 , "ProgKey 2"},
766 {0xE123 , "ProgKey 3"},
767 {0xE124 , "ProgKey 4"},
768 {0xE125 , "ProgKey 5"},
769 {0xE130 , "SoftKey 0"},
770 {0xE131 , "SoftKey 1"},
771 {0xE132 , "SoftKey 2"},
772 {0xE133 , "SoftKey 3"},
773 {0xE134 , "SoftKey 4"},
774 {0xE135 , "SoftKey 5"},
775 {0xE136 , "SoftKey 6"},
776 {0xE137 , "SoftKey 7"},
777 {0xE138 , "SoftKey 8"},
778 {0xE139 , "SoftKey 9"},
781 static value_string_ext str_key_name_ext
= VALUE_STRING_EXT_INIT(str_key_name
);
783 static const value_string noe_event_str_struct
[] = {
785 {0x01, "BT Handset Link"},
789 /*-----------------------------------------------------------------------------
790 DECODE UTF8 TO UNICODE
791 This function translates an UTF8 vale to an UNICODE one.
792 Need to have at least 48 bits value.
793 ---------------------------------------------------------------------------*/
794 static guint64
decode_utf8(guint64 utf8
)
796 static guint64 unicode
;
798 if (utf8
<= G_GUINT64_CONSTANT(0xFF))
801 utf8
& G_GUINT64_CONSTANT(0x7F);
803 else if (utf8
<= G_GUINT64_CONSTANT(0xFFFF))
806 ((utf8
& G_GUINT64_CONSTANT(0x1F00) >> 2) +
807 (utf8
& G_GUINT64_CONSTANT(0x3F)));
809 else if (utf8
<= G_GUINT64_CONSTANT(0xFFFFFF))
812 ((utf8
& G_GUINT64_CONSTANT(0x0F0000)) >> 4) +
813 ((utf8
& G_GUINT64_CONSTANT(0x3F00)) >> 2) +
814 (utf8
& G_GUINT64_CONSTANT(0x3F));
816 else if (utf8
<= G_GUINT64_CONSTANT(0xFFFFFFFF))
819 ((utf8
& G_GUINT64_CONSTANT(0x07000000)) >> 6) +
820 ((utf8
& G_GUINT64_CONSTANT(0x3F0000)) >> 4) +
821 ((utf8
& G_GUINT64_CONSTANT(0x3F00)) >> 2) +
822 (utf8
& G_GUINT64_CONSTANT(0x3F));
824 else if (utf8
<= G_GUINT64_CONSTANT(0xFFFFFFFFFF))
827 ((utf8
& G_GUINT64_CONSTANT(0x0300000000)) >> 8) +
828 ((utf8
& G_GUINT64_CONSTANT(0x3F000000)) >> 6) +
829 ((utf8
& G_GUINT64_CONSTANT(0x3F0000)) >> 4) +
830 ((utf8
& G_GUINT64_CONSTANT(0x3F00)) >> 2) +
831 (utf8
& G_GUINT64_CONSTANT(0x3F));
833 else if (utf8
<= G_GUINT64_CONSTANT(0xFFFFFFFFFFFF))
836 ((utf8
& G_GUINT64_CONSTANT(0x010000000000)) >> 10) +
837 ((utf8
& G_GUINT64_CONSTANT(0x3F00000000)) >> 8) +
838 ((utf8
& G_GUINT64_CONSTANT(0x3F000000)) >> 6) +
839 ((utf8
& G_GUINT64_CONSTANT(0x3F0000)) >> 4) +
840 ((utf8
& G_GUINT64_CONSTANT(0x3F00)) >> 2) +
841 (utf8
& G_GUINT64_CONSTANT(0x3F));
845 unicode
= G_GUINT64_CONSTANT(0);
851 /*-----------------------------------------------------------------------------
853 This function translates an UNICODE to the name associated.
854 Need to have at least 48 bits value.
855 ---------------------------------------------------------------------------*/
856 static char *decode_key_name(int unicode
)
860 key_name
= (char *)wmem_alloc(wmem_packet_scope(), 10);
862 if ((unicode
<= 0x20)
868 || (unicode
== 0xF9))
870 g_snprintf(key_name
, 10, "%s", val_to_str_ext_const(unicode
, &str_key_name_ext
, "Unknown"));
872 else if (unicode
<= 0xFF)
874 g_snprintf(key_name
, 10, "%c", unicode
);
878 g_snprintf(key_name
, 10, "%s", val_to_str_ext_const(unicode
, &str_key_name_ext
, "Unknown"));
884 /*-----------------------------------------------------------------------------
886 ---------------------------------------------------------------------------*/
887 static void decode_evt_error(proto_tree
*tree
,
895 proto_tree_add_item(tree
, hf_noe_errcode
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
899 proto_tree_add_item(tree
, hf_noe_method
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
903 proto_tree_add_item(tree
, hf_noe_class
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
907 proto_tree_add_item(tree
, hf_noe_objectid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
911 proto_tree_add_item(tree
, hf_noe_pcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
915 proto_tree_add_item(tree
, hf_noe_aindx
, tvb
, offset
, 1, ENC_NA
);
919 proto_tree_add_item(tree
, hf_noe_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
923 proto_tree_add_item(tree
, hf_noe_value
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
927 proto_tree_add_item(tree
, hf_noe_message
, tvb
, offset
, length
, ENC_NA
);
931 /*-----------------------------------------------------------------------------
933 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
934 ---------------------------------------------------------------------------*/
935 static void decode_tlv(proto_tree
*tree
,
940 proto_item
*property_item
;
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_item
= proto_tree_add_text(tree
,
952 property_tree
= proto_item_add_subtree(property_item
, ett_body
);
956 property_type
= tvb_get_guint8(tvb
, offset
);
957 proto_tree_add_item(property_tree
, hf_noe_pcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
961 if (property_type
>= P_ARRAY
)
963 proto_tree_add_item(property_item
, hf_noe_aindx
, tvb
, offset
, 1, ENC_NA
);
968 property_length
= tvb_get_guint8(tvb
, offset
);
969 if (property_length
& 0x80)
971 property_length
= tvb_get_ntohs(tvb
, offset
);
972 property_length
&= 0x7fff;
973 proto_tree_add_uint(property_tree
, hf_noe_psize
, tvb
, offset
, 2,
974 tvb_get_guint8(tvb
, offset
) * 256 + tvb_get_guint8(tvb
, offset
+1));
980 proto_tree_add_uint(property_tree
, hf_noe_psize
, tvb
, offset
, 1,
981 tvb_get_guint8(tvb
, offset
));
986 switch(property_length
)
993 proto_tree_add_item(property_tree
, hf_noe_property_item_u8
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
998 proto_tree_add_item(property_tree
, hf_noe_property_item_u16
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1003 proto_tree_add_item(property_tree
, hf_noe_property_item_u24
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1008 proto_tree_add_item(property_tree
, hf_noe_property_item_u32
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1013 proto_tree_add_item(property_tree
, hf_noe_property_item_bytes
, tvb
, offset
, property_length
, ENC_NA
);
1014 offset
+= property_length
;
1015 length
-= property_length
;
1023 /*-----------------------------------------------------------------------------
1024 GETPROPERTY MESSAGE BODY DECODER
1025 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1026 ---------------------------------------------------------------------------*/
1027 static void decode_getproperty_tlv(proto_tree
*tree
,
1032 proto_item
*body_item
;
1033 proto_tree
*body_tree
;
1036 /* add text to the frame tree */
1037 body_item
= proto_tree_add_text(tree
,
1041 "NOE Message Body");
1042 body_tree
= proto_item_add_subtree(body_item
, ett_property
);
1046 body_type
= tvb_get_guint8(tvb
, offset
);
1047 proto_tree_add_item(body_tree
, hf_noe_pcode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1052 if (body_type
>= P_ARRAY
)
1054 proto_tree_add_item(body_item
, hf_noe_aindx
, tvb
, offset
, 1, ENC_NA
);
1063 /*-----------------------------------------------------------------------------
1064 TERMINAL TO SERVER EVENT MESSAGE BODY DECODER
1065 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1066 ---------------------------------------------------------------------------*/
1067 static void decode_evt(proto_tree
*tree
,
1074 guint8 event
= tvb_get_guint8(tvb
, offset
);
1076 proto_tree_add_item(tree
, hf_noe_event
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1078 /* add text to the frame "INFO" column */
1079 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " %s",
1080 val_to_str_ext_const(event
, &val_str_event_ext
, "Unknown"));
1081 /* update text of the main proto item */
1082 proto_item_append_text(tree
, ", %s",
1083 val_to_str_ext_const(event
, &val_str_event_ext
, "Unknown"));
1090 case OPCODE_EVT_BT_KEY_SHORTPRESS
:
1091 case OPCODE_EVT_BT_KEY_LONGPRESS
:
1092 case OPCODE_EVT_BT_KEY_VERYLONGPRESS
:
1093 case OPCODE_EVT_KEY_LINE
:
1094 case OPCODE_EVT_ONHOOK
:
1095 case OPCODE_EVT_OFFHOOK
:
1096 ti
= proto_tree_add_item(tree
, hf_event_value_u8
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1097 proto_item_set_len(ti
, length
);
1099 case OPCODE_EVT_KEY_PRESS
:
1100 case OPCODE_EVT_KEY_RELEASE
:
1101 case OPCODE_EVT_KEY_SHORTPRESS
:
1102 case OPCODE_EVT_KEY_LONGPRESS
:
1103 case OPCODE_EVT_HELP
:
1105 /* utf8_value is the utf8 value to translate into Unicode with the decode_uft8 function */
1106 guint64 utf8_value
= 0;
1107 guint64 unicode_value
;
1109 int pt_length
= length
;
1110 int pt_offset
= offset
;
1112 while(pt_length
> 0)
1114 utf8_value
= (utf8_value
<< 8) + tvb_get_guint8(tvb
, pt_offset
);
1118 unicode_value
= decode_utf8(utf8_value
);
1119 key_name
= (char *)wmem_alloc(wmem_packet_scope(), 30);
1120 g_snprintf(key_name
, 30, "\"%s\"", decode_key_name((int)unicode_value
));
1122 /* add text to the frame "INFO" column */
1123 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": %s", key_name
);
1124 /* update text of the main proto item */
1125 proto_item_append_text(tree
, ", %s",
1128 proto_tree_add_text(tree
,
1132 "Key Name: %s (UTF-8 Value: %s, Unicode Value: 0x%" G_GINT64_MODIFIER
"x)",
1134 tvb_bytes_to_str(tvb
, offset
, length
),
1138 case OPCODE_EVT_ERROR_PROTOCOL
:
1139 case OPCODE_EVT_ERROR_CREATE
:
1140 case OPCODE_EVT_ERROR_DELETE
:
1141 case OPCODE_EVT_ERROR_SET_PROPERTY
:
1142 case OPCODE_EVT_ERROR_GET_PROPERTY
:
1144 decode_evt_error(tree
, tvb
, offset
, length
);
1147 case OPCODE_EVT_CONTEXT_SWITCH
:
1148 proto_tree_add_item(tree
, hf_event_context_switch
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1150 case OPCODE_EVT_SUCCESS_CREATE
:
1151 case OPCODE_EVT_SUCCESS_DELETE
:
1152 case OPCODE_EVT_SUCCESS_SET_PROPERTY
:
1153 case OPCODE_EVT_SUCCESS_INSERT_ITEM
:
1154 case OPCODE_EVT_SUCCESS_DELETE_ITEM
:
1155 proto_tree_add_item(tree
, hf_noe_objectid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1157 case OPCODE_EVT_WIDGETS_GC
:
1158 proto_tree_add_item(tree
, hf_event_widget_gc
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1160 case OPCODE_EVT_BT_BONDING_RESULT
:
1162 proto_tree_add_item(tree
, hf_noe_objectid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1166 /* XXX - should a 16-bit value be gotten if the size is only 8-bit? */
1167 proto_tree_add_text(tree
,
1172 tvb_get_ntohs(tvb
, offset
));
1176 proto_tree_add_text(tree
,
1181 tvb_get_ntohs(tvb
, offset
));
1185 proto_tree_add_item(tree
, hf_noe_objectid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1190 decode_tlv(tree
, tvb
, offset
, length
);
1197 /*-----------------------------------------------------------------------------
1199 This function decodes the method of an 0x15 (and 0x16) UA3G message.
1200 ---------------------------------------------------------------------------*/
1201 static void decode_mtd(proto_tree
*tree
,
1208 guint8 noe_class
= tvb_get_guint8(tvb
, offset
);
1210 proto_tree_add_item(tree
, hf_noe_class
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1212 /* add text to the frame "INFO" column */
1213 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " %s",
1214 val_to_str_ext_const(noe_class
, &val_str_class_ext
, "Unknown"));
1215 /* update text of the main proto item */
1216 proto_item_append_text(tree
, ", %s",
1217 val_to_str_ext_const(noe_class
, &val_str_class_ext
, "Unknown"));
1222 if (noe_class
>= C_DYNAMIC
)
1224 proto_tree_add_item(tree
, hf_noe_objectid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1231 case METHOD_INSERT_ITEM
:
1233 proto_tree_add_item(tree
, hf_noe_method_index
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1237 decode_tlv(tree
, tvb
, offset
, length
);
1240 case METHOD_DELETE_ITEM
:
1242 proto_tree_add_item(tree
, hf_noe_method_index
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1245 case METHOD_GET_PROPERTY
:
1247 decode_getproperty_tlv(tree
, tvb
, offset
, length
);
1253 decode_tlv(tree
, tvb
, offset
, length
);
1260 /*-----------------------------------------------------------------------------
1262 ---------------------------------------------------------------------------*/
1263 static void dissect_noe(tvbuff_t
*tvb
,
1267 proto_item
*noe_item
;
1268 proto_tree
*noe_tree
;
1275 noe_item
= proto_tree_add_item(tree
, proto_noe
, tvb
, 0, -1, ENC_NA
);
1276 noe_tree
= proto_item_add_subtree(noe_item
, ett_noe
);
1278 length
= tvb_get_letohs(tvb
, offset
);
1280 proto_tree_add_uint(noe_tree
,
1288 server
= tvb_get_guint8(tvb
, offset
);
1290 /* add text to the frame "INFO" column */
1291 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - NOE Protocol (%s)",
1292 val_to_str_const(server
, servers_short_vals
, "Unknown"));
1294 proto_tree_add_uint(noe_tree
,
1303 /* update text of the main proto item */
1304 proto_item_append_text(noe_item
, ", %s",
1305 val_to_str_const(server
, servers_short_vals
, "Unknown"));
1307 method
= tvb_get_guint8(tvb
, offset
);
1308 methodack
= (method
& 0x80) != 0;
1309 method
= (method
& 0x7f);
1311 proto_tree_add_uint_format_value(noe_tree
,
1318 val_to_str_const(method
, methods_vals
, "Unknown"),
1321 if (method
>= METHOD_INVALID
)
1324 /* add text to the frame "INFO" column */
1325 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": %s",
1326 val_to_str_const(method
, methods_vals
, "Unknown"));
1328 /* update text of the main proto item */
1329 proto_item_append_text(noe_item
, ", %s",
1330 val_to_str_const(method
, methods_vals
, "Unknown"));
1332 if (method
== METHOD_NOTIFY
)
1336 decode_evt(noe_tree
, tvb
, pinfo
, offset
, length
);
1339 /* Create, Delete, SetProperty, GetProperty, DeleteItem, InsertItem properties */
1341 proto_tree_add_boolean(noe_tree
,
1349 decode_mtd(noe_tree
, tvb
, pinfo
, method
, offset
, length
);
1355 /*-----------------------------------------------------------------------------
1356 DISSECTORS REGISTRATION FUNCTIONS
1357 ---------------------------------------------------------------------------*/
1358 void proto_register_noe(void)
1360 static hf_register_info hf_noe
[] =
1386 { &hf_noe_method_ack
,
1394 "Method Acknowledge",
1415 BASE_DEC
|BASE_EXT_STRING
,
1427 BASE_DEC
|BASE_EXT_STRING
,
1442 "Object Identifier",
1446 { &hf_noe_method_index
,
1454 "Delete/Insert Index",
1463 BASE_HEX
|BASE_EXT_STRING
,
1466 "Property Identifier",
1487 BASE_DEC
|BASE_EXT_STRING
,
1530 { &hf_noe_property_item_u8
,
1533 "noe.property_item.uint",
1542 { &hf_noe_property_item_u16
,
1545 "noe.property_item.uint",
1554 { &hf_noe_property_item_u24
,
1557 "noe.property_item.uint",
1566 { &hf_noe_property_item_u32
,
1569 "noe.property_item.uint",
1578 { &hf_noe_property_item_bytes
,
1581 "noe.property_item.bytes",
1590 { &hf_event_value_u8
,
1593 "noe.event_value.uint",
1596 VALS(noe_event_str_struct
),
1602 { &hf_event_context_switch
,
1605 "noe.event_context_switch",
1614 { &hf_event_widget_gc
,
1617 "noe.event_widget_gc",
1628 static gint
*ett
[] =
1636 /* NOE dissector registration */
1637 proto_noe
= proto_register_protocol("NOE Protocol", "NOE", "noe");
1639 proto_register_field_array(proto_noe
, hf_noe
, array_length(hf_noe
));
1641 register_dissector("noe", dissect_noe
, proto_noe
);
1643 /* Common subtree array registration */
1644 proto_register_subtree_array(ett
, array_length(ett
));
1649 void proto_reg_handoff_noe(void)
1652 dissector_handle_t handle_noe
= find_dissector("noe");
1654 /* hooking of NOE on UA */
1655 dissector_add_uint("ua.opcode", 0x15, handle_noe
);