Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-noe.c
blob2b131c38b7bd77a91133f4ac179c09e122ea568a
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 * Copyright 2017, Alcatel-Lucent Enterprise <nicolas.bertin@al-enterprise.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include <stdlib.h>
16 #include "epan/packet.h"
17 #include <wsutil/str_util.h>
19 void proto_register_noe(void);
20 void proto_reg_handoff_noe(void);
22 #define OPCODE_C_context 0
23 #define OPCODE_C_terminal 1
24 #define OPCODE_C_keyboard 2
25 #define OPCODE_C_audioconfig 3
26 #define OPCODE_C_security 4
27 #define OPCODE_C_leds 5
28 #define OPCODE_C_screen 6
29 #define OPCODE_C_date 7
30 #define OPCODE_C_AOMV 8
31 #define OPCODE_C_bluetooth 9
32 #define OPCODE_C_locappl 10
33 #define OPCODE_C_callstate 12
34 #define OPCODE_C_framebox 128
35 #define OPCODE_C_tabbox 129
36 #define OPCODE_C_listbox 130
37 #define OPCODE_C_actionlistbox 131
38 #define OPCODE_C_textbox 132
39 #define OPCODE_C_actionbox 133
40 #define OPCODE_C_inputbox 134
41 #define OPCODE_C_checkbox 135
42 #define OPCODE_C_datebox 136
43 #define OPCODE_C_timerbox 137
44 #define OPCODE_C_popupbox 138
45 #define OPCODE_C_dialogbox 139
46 #define OPCODE_C_sliderbar 140
47 #define OPCODE_C_progressbar 141
48 #define OPCODE_C_imagebox 142
49 #define OPCODE_C_iconbox 143
50 #define OPCODE_C_AOMVbox 144
51 #define OPCODE_C_telephonicbox 145
52 #define OPCODE_C_keyboard_context 146
53 #define OPCODE_C_AOMEL 147
54 #define OPCODE_C_AOM10 148
55 #define OPCODE_C_AOM40 149
56 #define OPCODE_C_idletimer 150
57 #define OPCODE_C_telephonicboxitem 151
58 #define OPCODE_C_bluetooth_device 152
59 #define OPCODE_C_headerbox 153
60 #define OPCODE_C_ime_context 154
62 static const value_string val_str_class[] = {
63 {OPCODE_C_context , "Context"},
64 {OPCODE_C_terminal , "Terminal"},
65 {OPCODE_C_keyboard , "Keyboard"},
66 {OPCODE_C_audioconfig , "AudioConfig"},
67 {OPCODE_C_security , "Security"},
68 {OPCODE_C_leds , "Leds"},
69 {OPCODE_C_screen , "Screen"},
70 {OPCODE_C_date , "Date"},
71 {OPCODE_C_AOMV , "AOMV"},
72 {OPCODE_C_bluetooth , "Bluetooth"},
73 {OPCODE_C_locappl , "Locappl"},
74 {OPCODE_C_callstate , "Callstate"},
75 {OPCODE_C_framebox , "FrameBox"},
76 {OPCODE_C_tabbox , "TabBox"},
77 {OPCODE_C_listbox , "ListBox"},
78 {OPCODE_C_actionlistbox , "ActionlistBox"},
79 {OPCODE_C_textbox , "TextBox"},
80 {OPCODE_C_actionbox , "ActionBox"},
81 {OPCODE_C_inputbox , "InputBox"},
82 {OPCODE_C_checkbox , "CheckBox"},
83 {OPCODE_C_datebox , "DateBox"},
84 {OPCODE_C_timerbox , "TimerBox"},
85 {OPCODE_C_popupbox , "PopupBox"},
86 {OPCODE_C_dialogbox , "DialogBox"},
87 {OPCODE_C_sliderbar , "SliderBar"},
88 {OPCODE_C_progressbar , "ProgressBar"},
89 {OPCODE_C_imagebox , "ImageBox"},
90 {OPCODE_C_iconbox , "IconBox"},
91 {OPCODE_C_AOMVbox , "AOMVBox"},
92 {OPCODE_C_telephonicbox , "TelephonicBox"},
93 {OPCODE_C_keyboard_context , "Keyboard_context"},
94 {OPCODE_C_AOMEL , "AOMEL"},
95 {OPCODE_C_AOM10 , "AOM10"},
96 {OPCODE_C_AOM40 , "AOM40"},
97 {OPCODE_C_idletimer , "IdleTimer"},
98 {OPCODE_C_telephonicboxitem , "TelephonicBoxItem"},
99 {OPCODE_C_bluetooth_device , "Bluetooth_device"},
100 {OPCODE_C_headerbox , "HeaderBox"},
101 {OPCODE_C_ime_context , "ime_context"},
102 {0, NULL}
104 static value_string_ext val_str_class_ext = VALUE_STRING_EXT_INIT(val_str_class);
106 #define OPCODE_P_B_objectid 0
107 #define OPCODE_P_B_ownership 1
108 #define OPCODE_P_B_reset_mode 2
109 #define OPCODE_P_B_mtu 3
110 #define OPCODE_P_B_negative_ack 4
111 #define OPCODE_P_B_type 5
112 #define OPCODE_P_B_help_timeout 6
113 #define OPCODE_P_B_longpress 7
114 #define OPCODE_P_B_count 8
115 #define OPCODE_P_B_eventmode 9
116 #define OPCODE_P_B_numpad_ownership 10
117 #define OPCODE_P_B_navigator_ownership 11
118 #define OPCODE_P_B_telephony_ownership 12
119 #define OPCODE_P_B_progkeys_ownership 13
120 #define OPCODE_P_B_alphakeys_ownership 14
121 #define OPCODE_P_B_numpad_eventmode 15
122 #define OPCODE_P_B_onoff 16
123 #define OPCODE_P_B_bpp 17
124 #define OPCODE_P_B_w 18
125 #define OPCODE_P_B_h 19
126 #define OPCODE_P_B_contrast 20
127 #define OPCODE_P_B_clearscreen 21
128 #define OPCODE_P_B_system_id 22
129 #define OPCODE_P_B_advanced_mode 23
130 #define OPCODE_P_B_year 24
131 #define OPCODE_P_B_month 25
132 #define OPCODE_P_B_day 26
133 #define OPCODE_P_B_m 27
134 #define OPCODE_P_B_s 28
135 #define OPCODE_P_B_enable 29
136 #define OPCODE_P_B_address 30
137 #define OPCODE_P_B_disable 31
138 #define OPCODE_P_B_name 33
139 #define OPCODE_P_B_anchorid 36
140 #define OPCODE_P_B_grid 37
141 #define OPCODE_P_B_x 38
142 #define OPCODE_P_B_y 39
143 #define OPCODE_P_B_visible 40
144 #define OPCODE_P_B_border 41
145 #define OPCODE_P_B_fontid 42
146 #define OPCODE_P_B_active 43
147 #define OPCODE_P_B_halign 44
148 #define OPCODE_P_B_valign 45
149 #define OPCODE_P_B_size 46
150 #define OPCODE_P_B_mode 47
151 #define OPCODE_P_B_showevent 48
152 #define OPCODE_P_B_showactive 49
153 #define OPCODE_P_B_icon 54
154 #define OPCODE_P_B_label 55
155 #define OPCODE_P_B_value 56
156 #define OPCODE_P_B_password 57
157 #define OPCODE_P_B_cursor 58
158 #define OPCODE_P_B_mask 59
159 #define OPCODE_P_B_qos_ticket 60
160 #define OPCODE_P_B_focus 61
161 #define OPCODE_P_B_state 62
162 #define OPCODE_P_B_format 63
163 #define OPCODE_P_B_incdec 64
164 #define OPCODE_P_B_value_notify 65
165 #define OPCODE_P_B_timeout 66
166 #define OPCODE_P_B_min 67
167 #define OPCODE_P_B_max 68
168 #define OPCODE_P_B_data 69
169 #define OPCODE_P_B_custversion 70
170 #define OPCODE_P_B_L10Nversion 71
171 #define OPCODE_P_B_append 72
172 #define OPCODE_P_B_shortpress 73
173 #define OPCODE_P_B_autorepeat 74
174 #define OPCODE_P_B_repetition 75
175 #define OPCODE_P_B_vsplit 76
176 #define OPCODE_P_B_accesskey 77
177 #define OPCODE_P_B_realcount 78
178 #define OPCODE_P_B_start 79
179 #define OPCODE_P_B_modal 80
180 #define OPCODE_P_B_session_timeout 81
181 #define OPCODE_P_B_softkeys_ownership 82
182 #define OPCODE_P_B_ringings_count 83
183 #define OPCODE_P_B_cod 84
184 #define OPCODE_P_B_bonded 85
185 #define OPCODE_P_B_link_key 86
186 #define OPCODE_P_B_pin 87
187 #define OPCODE_P_B_term_type 88
188 #define OPCODE_P_B_link_type 89
189 #define OPCODE_P_B_circular 90
190 #define OPCODE_P_B_autospread 91
191 #define OPCODE_P_B_backlight_timeout 92
192 #define OPCODE_P_B_screensaver_timeout 93
193 #define OPCODE_P_B_cycling 94
194 #define OPCODE_P_B_CS_idle_state 95
195 #define OPCODE_P_B_PS_idle_state 96
196 #define OPCODE_P_B_bonded_devices 97
197 #define OPCODE_P_B_serialnum 98
198 #define OPCODE_P_B_hardversion 99
199 #define OPCODE_P_B_softversion 100
200 #define OPCODE_P_B_rom_size 101
201 #define OPCODE_P_B_ram_size 102
202 #define OPCODE_P_B_reset_cause 103
203 #define OPCODE_P_B_cycling_time 104
204 #define OPCODE_P_B_inputborder 106
205 #define OPCODE_P_B_disablelongpress 107
206 #define OPCODE_P_B_all_icons_off 108
207 #define OPCODE_P_B_all_labels_off 109
208 #define OPCODE_P_B_widgets_size 110
209 #define OPCODE_P_B_list_type 111
210 #define OPCODE_P_B_frame_type 112
211 #define OPCODE_P_B_bth_ringing 113
212 #define OPCODE_P_B_URI 114
213 #define OPCODE_P_B_fetch_timeout 115
214 #define OPCODE_P_B_mask_subst 116
215 #define OPCODE_P_B_use_customisation 117
216 #define OPCODE_P_B_page_active 120
217 #define OPCODE_P_B_overwrite 121
218 #define OPCODE_P_B_ime_lock 122
219 #define OPCODE_P_B_method 123
220 #define OPCODE_P_B_login 124
221 #define OPCODE_P_B_binary_suffix 125
222 #define OPCODE_P_B_binary_count 126
223 #define OPCODE_P_B_SIPCversion 127
224 #define OPCODE_P_A_key_ownership 131
225 #define OPCODE_P_A_key_eventmode 132
226 #define OPCODE_P_A_value 133
227 #define OPCODE_P_A_mode 134
228 #define OPCODE_P_A_color 135
229 #define OPCODE_P_A_type 136
230 #define OPCODE_P_A_icon 137
231 #define OPCODE_P_A_label 138
232 #define OPCODE_P_A_ownership 139
233 #define OPCODE_P_A_enable 140
234 #define OPCODE_P_A_state 141
235 #define OPCODE_P_A_name 142
236 #define OPCODE_P_A_number 143
237 #define OPCODE_P_A_action_icon 144
238 #define OPCODE_P_A_action_label 145
239 #define OPCODE_P_A_action_value 146
240 #define OPCODE_P_A_today 147
241 #define OPCODE_P_A_tomorrow 148
242 #define OPCODE_P_A_code 150
243 #define OPCODE_P_A_data 151
244 #define OPCODE_P_A_delay_max_handset 152
245 #define OPCODE_P_A_delay_max_handsfree 153
246 #define OPCODE_P_A_delay_tx 154
247 #define OPCODE_P_A_delay_rx 155
248 #define OPCODE_P_A_pem_data 156
249 #define OPCODE_P_A_serial_number 157
250 #define OPCODE_P_A_owner_name 158
251 #define OPCODE_P_A_issuer_name 159
252 #define OPCODE_P_A_end_date 160
254 static const value_string val_str_props[] = {
255 {OPCODE_P_B_objectid , "objectid"},
256 {OPCODE_P_B_ownership , "ownership"},
257 {OPCODE_P_B_reset_mode , "reset_mode"},
258 {OPCODE_P_B_mtu , "mtu"},
259 {OPCODE_P_B_negative_ack , "negative_ack"},
260 {OPCODE_P_B_type , "type"},
261 {OPCODE_P_B_help_timeout , "help_timeout"},
262 {OPCODE_P_B_longpress , "longpress"},
263 {OPCODE_P_B_count , "count"},
264 {OPCODE_P_B_eventmode , "eventmode"},
265 {OPCODE_P_B_numpad_ownership , "numpad_ownership"},
266 {OPCODE_P_B_navigator_ownership , "navigator_ownership"},
267 {OPCODE_P_B_telephony_ownership , "telephony_ownership"},
268 {OPCODE_P_B_progkeys_ownership , "progkeys_ownership"},
269 {OPCODE_P_B_alphakeys_ownership , "alphakeys_ownership"},
270 {OPCODE_P_B_numpad_eventmode , "numpad_eventmode"},
271 {OPCODE_P_B_onoff , "onoff"},
272 {OPCODE_P_B_bpp , "bpp"},
273 {OPCODE_P_B_w , "w"},
274 {OPCODE_P_B_h , "h"},
275 {OPCODE_P_B_contrast , "contrast"},
276 {OPCODE_P_B_clearscreen , "clearscreen"},
277 {OPCODE_P_B_system_id , "system_id"},
278 {OPCODE_P_B_advanced_mode , "advanced_mode"},
279 {OPCODE_P_B_year , "year"},
280 {OPCODE_P_B_month , "month"},
281 {OPCODE_P_B_day , "day"},
282 {OPCODE_P_B_m , "m"},
283 {OPCODE_P_B_s , "s"},
284 {OPCODE_P_B_enable , "enable"},
285 {OPCODE_P_B_address , "address"},
286 {OPCODE_P_B_disable , "disable"},
287 {OPCODE_P_B_name , "name"},
288 {OPCODE_P_B_anchorid , "anchorid"},
289 {OPCODE_P_B_grid , "grid"},
290 {OPCODE_P_B_x , "x"},
291 {OPCODE_P_B_y , "y"},
292 {OPCODE_P_B_visible , "visible"},
293 {OPCODE_P_B_border , "border"},
294 {OPCODE_P_B_fontid , "fontid"},
295 {OPCODE_P_B_active , "active"},
296 {OPCODE_P_B_halign , "halign"},
297 {OPCODE_P_B_valign , "valign"},
298 {OPCODE_P_B_size , "size"},
299 {OPCODE_P_B_mode , "mode"},
300 {OPCODE_P_B_showevent , "showevent"},
301 {OPCODE_P_B_showactive , "showactive"},
302 {OPCODE_P_B_icon , "icon"},
303 {OPCODE_P_B_label , "label"},
304 {OPCODE_P_B_value , "value"},
305 {OPCODE_P_B_password , "password"},
306 {OPCODE_P_B_cursor , "cursor"},
307 {OPCODE_P_B_mask , "mask"},
308 {OPCODE_P_B_qos_ticket , "qos_ticket"},
309 {OPCODE_P_B_focus , "focus"},
310 {OPCODE_P_B_state , "state"},
311 {OPCODE_P_B_format , "format"},
312 {OPCODE_P_B_incdec , "incdec"},
313 {OPCODE_P_B_value_notify , "value_notify"},
314 {OPCODE_P_B_timeout , "timeout"},
315 {OPCODE_P_B_min , "min"},
316 {OPCODE_P_B_max , "max"},
317 {OPCODE_P_B_data , "data"},
318 {OPCODE_P_B_custversion , "custversion"},
319 {OPCODE_P_B_L10Nversion , "L10Nversion"},
320 {OPCODE_P_B_append , "append"},
321 {OPCODE_P_B_shortpress , "shortpress"},
322 {OPCODE_P_B_autorepeat , "autorepeat"},
323 {OPCODE_P_B_repetition , "repetition"},
324 {OPCODE_P_B_vsplit , "vsplit"},
325 {OPCODE_P_B_accesskey , "accesskey"},
326 {OPCODE_P_B_realcount , "realcount"},
327 {OPCODE_P_B_start , "start"},
328 {OPCODE_P_B_modal , "modal"},
329 {OPCODE_P_B_session_timeout , "session_timeout"},
330 {OPCODE_P_B_softkeys_ownership , "softkeys_ownership"},
331 {OPCODE_P_B_ringings_count , "ringings_count"},
332 {OPCODE_P_B_cod , "cod"},
333 {OPCODE_P_B_bonded , "bonded"},
334 {OPCODE_P_B_link_key , "link_key"},
335 {OPCODE_P_B_pin , "pin"},
336 {OPCODE_P_B_term_type , "term_type"},
337 {OPCODE_P_B_link_type , "link_type"},
338 {OPCODE_P_B_circular , "circular"},
339 {OPCODE_P_B_autospread , "autospread"},
340 {OPCODE_P_B_backlight_timeout , "backlight_timeout"},
341 {OPCODE_P_B_screensaver_timeout , "screensaver_timeout"},
342 {OPCODE_P_B_cycling , "cycling"},
343 {OPCODE_P_B_CS_idle_state , "CS_idle_state"},
344 {OPCODE_P_B_PS_idle_state , "PS_idle_state"},
345 {OPCODE_P_B_bonded_devices , "bonded_devices"},
346 {OPCODE_P_B_serialnum , "serialnum"},
347 {OPCODE_P_B_hardversion , "hardversion"},
348 {OPCODE_P_B_softversion , "softversion"},
349 {OPCODE_P_B_rom_size , "rom_size"},
350 {OPCODE_P_B_ram_size , "ram_size"},
351 {OPCODE_P_B_reset_cause , "reset_cause"},
352 {OPCODE_P_B_cycling_time , "cycling_time"},
353 {OPCODE_P_B_inputborder , "inputborder"},
354 {OPCODE_P_B_disablelongpress , "disablelongpress"},
355 {OPCODE_P_B_all_icons_off , "all_icons_off"},
356 {OPCODE_P_B_all_labels_off , "all_labels_off"},
357 {OPCODE_P_B_widgets_size , "widgets_size"},
358 {OPCODE_P_B_list_type , "list_type"},
359 {OPCODE_P_B_frame_type , "frame_type"},
360 {OPCODE_P_B_bth_ringing , "bth_ringing"},
361 {OPCODE_P_B_URI , "URI"},
362 {OPCODE_P_B_fetch_timeout , "fetch_timeout"},
363 {OPCODE_P_B_mask_subst , "mask_subst"},
364 {OPCODE_P_B_use_customisation , "use_customisation"},
365 {OPCODE_P_B_page_active , "page_active"},
366 {OPCODE_P_B_overwrite , "overwrite"},
367 {OPCODE_P_B_ime_lock , "ime_lock"},
368 {OPCODE_P_B_method , "method"},
369 {OPCODE_P_B_login , "login"},
370 {OPCODE_P_B_binary_suffix , "binary_suffix"},
371 {OPCODE_P_B_binary_count , "binary_count"},
372 {OPCODE_P_B_SIPCversion , "SIPCversion"},
373 {OPCODE_P_A_key_ownership , "key_ownership"},
374 {OPCODE_P_A_key_eventmode , "key_eventmode"},
375 {OPCODE_P_A_value , "value"},
376 {OPCODE_P_A_mode , "mode"},
377 {OPCODE_P_A_color , "color"},
378 {OPCODE_P_A_type , "type"},
379 {OPCODE_P_A_icon , "icon"},
380 {OPCODE_P_A_label , "label"},
381 {OPCODE_P_A_ownership , "ownership"},
382 {OPCODE_P_A_enable , "enable"},
383 {OPCODE_P_A_state , "state"},
384 {OPCODE_P_A_name , "name"},
385 {OPCODE_P_A_number , "number"},
386 {OPCODE_P_A_action_icon , "action_icon"},
387 {OPCODE_P_A_action_label , "action_label"},
388 {OPCODE_P_A_action_value , "action_value"},
389 {OPCODE_P_A_today , "today"},
390 {OPCODE_P_A_tomorrow , "tomorrow"},
391 {OPCODE_P_A_code , "code"},
392 {OPCODE_P_A_data , "data"},
393 {OPCODE_P_A_delay_max_handset , "delay_max_handset"},
394 {OPCODE_P_A_delay_max_handsfree , "delay_max_handsfree"},
395 {OPCODE_P_A_delay_tx , "delay_tx"},
396 {OPCODE_P_A_delay_rx , "delay_rx"},
397 {OPCODE_P_A_pem_data , "pem_data"},
398 {OPCODE_P_A_serial_number , "serial_number"},
399 {OPCODE_P_A_owner_name , "owner_name"},
400 {OPCODE_P_A_issuer_name , "issuer_name"},
401 {OPCODE_P_A_end_date , "end_date"},
402 {0, NULL}
404 static value_string_ext val_str_props_ext = VALUE_STRING_EXT_INIT(val_str_props);
406 #define OPCODE_EVT_CONTEXT_SWITCH 0
407 #define OPCODE_EVT_RESET 1
408 #define OPCODE_EVT_KEY_PRESS 2
409 #define OPCODE_EVT_KEY_RELEASE 3
410 #define OPCODE_EVT_KEY_SHORTPRESS 4
411 #define OPCODE_EVT_KEY_LONGPRESS 5
412 #define OPCODE_EVT_ONHOOK 6
413 #define OPCODE_EVT_OFFHOOK 7
414 #define OPCODE_EVT_HELP 8
415 #define OPCODE_EVT_WIDGETS_GC 9
416 #define OPCODE_EVT_ERROR_PROTOCOL 10
417 #define OPCODE_EVT_ERROR_CREATE 11
418 #define OPCODE_EVT_ERROR_DELETE 12
419 #define OPCODE_EVT_ERROR_SET_PROPERTY 13
420 #define OPCODE_EVT_ERROR_GET_PROPERTY 14
421 #define OPCODE_EVT_SUCCESS_CREATE 15
422 #define OPCODE_EVT_SUCCESS_DELETE 16
423 #define OPCODE_EVT_SUCCESS_SET_PROPERTY 17
424 #define OPCODE_EVT_ERROR_INSERT_ITEM 18
425 #define OPCODE_EVT_ERROR_DELETE_ITEM 19
426 #define OPCODE_EVT_SUCCESS_INSERT_ITEM 20
427 #define OPCODE_EVT_DEVICE_PRESENCE 21
428 #define OPCODE_EVT_KEY_LINE 22
429 #define OPCODE_EVT_SUCCESS_DELETE_ITEM 23
430 #define OPCODE_EVT_BT_BONDING_RESULT 24
431 #define OPCODE_EVT_BT_KEY_SHORTPRESS 25
432 #define OPCODE_EVT_BT_KEY_LONGPRESS 26
433 #define OPCODE_EVT_BT_KEY_VERYLONGPRESS 27
434 #define OPCODE_EVT_LOCAL_APPLICATION 28
435 #define OPCODE_EVT_WARNING_CREATE 29
436 #define OPCODE_EVT_WARNING_SET_PROPERTY 30
437 #define OPCODE_EVT_ARP_SPOOFING 31
438 #define OPCODE_EVT_CHAR_NOT_FOUND 32
439 #define OPCODE_EVT_QOS_TICKET 34
440 #define OPCODE_EVT_UA3_ERROR 35
441 #define OPCODE_EVT_TABBOX 128
442 #define OPCODE_EVT_LISTBOX 129
443 #define OPCODE_EVT_LISTBOX_FIRST 130
444 #define OPCODE_EVT_LISTBOX_LAST 131
445 #define OPCODE_EVT_ACTIONLISTBOX 132
446 #define OPCODE_EVT_ACTIONBOX 133
447 #define OPCODE_EVT_INPUTBOX 134
448 #define OPCODE_EVT_INPUTBOX_FOCUS_LOST 135
449 #define OPCODE_EVT_CHECKBOX 136
450 #define OPCODE_EVT_TIMERBOX 137
451 #define OPCODE_EVT_POPUPBOX_TIMEOUT 138
452 #define OPCODE_EVT_DIALOGBOX 139
453 #define OPCODE_EVT_SLIDERBAR 140
454 #define OPCODE_EVT_PROGRESSBAR 141
455 #define OPCODE_EVT_AOMVBOX 142
456 #define OPCODE_EVT_TELEPHONICBOX_FOCUS 143
457 #define OPCODE_EVT_AOM_INSERTED 144
458 #define OPCODE_EVT_AOM_REMOVED 145
459 #define OPCODE_EVT_AOM_KEY_PRESS 146
460 #define OPCODE_EVT_IDLETIMER 147
461 #define OPCODE_EVT_GET_PROPERTY_RESULT 148
462 #define OPCODE_EVT_AOM_KEY_RELEASE 149
463 #define OPCODE_EVT_POPUPBOX_DISMISSED 150
464 #define OPCODE_EVT_DIALOGBOX_TIMEOUT 151
465 #define OPCODE_EVT_DIALOGBOX_DISMISSED 152
466 #define OPCODE_EVT_BT_BONDED_DEVICE 153
467 #define OPCODE_EVT_BT_INQUIRY_RESULT 154
468 #define OPCODE_EVT_BT_NAME_DISCOVERY 155
469 #define OPCODE_EVT_IME_REMOTEOPEN 156
470 #define OPCODE_EVT_BT_BATTERY 158
471 #define OPCODE_EVT_IME_LIST 159
472 #define OPCODE_EVT_IME_CHANGE 160
473 #define OPCODE_EVT_IME_OPEN 161
474 #define OPCODE_EVT_TELEPHONICBOX_EVENT 162
475 #define OPCODE_EVT_ACTLISTBOX_TIMEOUT 163
476 #define OPCODE_EVT_ACTLISTBOX_DISMISSED 164
478 static const value_string val_str_event[] = {
479 {OPCODE_EVT_CONTEXT_SWITCH , "EVT_CONTEXT_SWITCH"},
480 {OPCODE_EVT_RESET , "EVT_RESET"},
481 {OPCODE_EVT_KEY_PRESS , "EVT_KEY_PRESS"},
482 {OPCODE_EVT_KEY_RELEASE , "EVT_KEY_RELEASE"},
483 {OPCODE_EVT_KEY_SHORTPRESS , "EVT_KEY_SHORTPRESS"},
484 {OPCODE_EVT_KEY_LONGPRESS , "EVT_KEY_LONGPRESS"},
485 {OPCODE_EVT_ONHOOK , "EVT_ONHOOK"},
486 {OPCODE_EVT_OFFHOOK , "EVT_OFFHOOK"},
487 {OPCODE_EVT_HELP , "EVT_HELP"},
488 {OPCODE_EVT_WIDGETS_GC , "EVT_WIDGETS_GC"},
489 {OPCODE_EVT_ERROR_PROTOCOL , "EVT_ERROR_PROTOCOL"},
490 {OPCODE_EVT_ERROR_CREATE , "EVT_ERROR_CREATE"},
491 {OPCODE_EVT_ERROR_DELETE , "EVT_ERROR_DELETE"},
492 {OPCODE_EVT_ERROR_SET_PROPERTY , "EVT_ERROR_SET_PROPERTY"},
493 {OPCODE_EVT_ERROR_GET_PROPERTY , "EVT_ERROR_GET_PROPERTY"},
494 {OPCODE_EVT_SUCCESS_CREATE , "EVT_SUCCESS_CREATE"},
495 {OPCODE_EVT_SUCCESS_DELETE , "EVT_SUCCESS_DELETE"},
496 {OPCODE_EVT_SUCCESS_SET_PROPERTY , "EVT_SUCCESS_SET_PROPERTY"},
497 {OPCODE_EVT_ERROR_INSERT_ITEM , "EVT_ERROR_INSERT_ITEM"},
498 {OPCODE_EVT_ERROR_DELETE_ITEM , "EVT_ERROR_DELETE_ITEM"},
499 {OPCODE_EVT_SUCCESS_INSERT_ITEM , "EVT_SUCCESS_INSERT_ITEM"},
500 {OPCODE_EVT_DEVICE_PRESENCE , "EVT_DEVICE_PRESENCE"},
501 {OPCODE_EVT_KEY_LINE , "EVT_KEY_LINE"},
502 {OPCODE_EVT_SUCCESS_DELETE_ITEM , "EVT_SUCCESS_DELETE_ITEM"},
503 {OPCODE_EVT_BT_BONDING_RESULT , "EVT_BT_BONDING_RESULT"},
504 {OPCODE_EVT_BT_KEY_SHORTPRESS , "EVT_BT_KEY_SHORTPRESS"},
505 {OPCODE_EVT_BT_KEY_LONGPRESS , "EVT_BT_KEY_LONGPRESS"},
506 {OPCODE_EVT_BT_KEY_VERYLONGPRESS , "EVT_BT_KEY_VERYLONGPRESS"},
507 {OPCODE_EVT_LOCAL_APPLICATION , "EVT_LOCAL_APPLICATION"},
508 {OPCODE_EVT_WARNING_CREATE , "EVT_WARNING_CREATE"},
509 {OPCODE_EVT_WARNING_SET_PROPERTY , "EVT_WARNING_SET_PROPERTY"},
510 {OPCODE_EVT_ARP_SPOOFING , "EVT_ARP_SPOOFING"},
511 {OPCODE_EVT_CHAR_NOT_FOUND , "EVT_CHAR_NOT_FOUND"},
512 {OPCODE_EVT_QOS_TICKET , "EVT_QOS_TICKET"},
513 {OPCODE_EVT_UA3_ERROR , "EVT_UA3_ERROR"},
514 {OPCODE_EVT_TABBOX , "EVT_TABBOX"},
515 {OPCODE_EVT_LISTBOX , "EVT_LISTBOX"},
516 {OPCODE_EVT_LISTBOX_FIRST , "EVT_LISTBOX_FIRST"},
517 {OPCODE_EVT_LISTBOX_LAST , "EVT_LISTBOX_LAST"},
518 {OPCODE_EVT_ACTIONLISTBOX , "EVT_ACTIONLISTBOX"},
519 {OPCODE_EVT_ACTIONBOX , "EVT_ACTIONBOX"},
520 {OPCODE_EVT_INPUTBOX , "EVT_INPUTBOX"},
521 {OPCODE_EVT_INPUTBOX_FOCUS_LOST , "EVT_INPUTBOX_FOCUS_LOST"},
522 {OPCODE_EVT_CHECKBOX , "EVT_CHECKBOX"},
523 {OPCODE_EVT_TIMERBOX , "EVT_TIMERBOX"},
524 {OPCODE_EVT_POPUPBOX_TIMEOUT , "EVT_POPUPBOX_TIMEOUT"},
525 {OPCODE_EVT_DIALOGBOX , "EVT_DIALOGBOX"},
526 {OPCODE_EVT_SLIDERBAR , "EVT_SLIDERBAR"},
527 {OPCODE_EVT_PROGRESSBAR , "EVT_PROGRESSBAR"},
528 {OPCODE_EVT_AOMVBOX , "EVT_AOMVBOX"},
529 {OPCODE_EVT_TELEPHONICBOX_FOCUS , "EVT_TELEPHONICBOX_FOCUS"},
530 {OPCODE_EVT_AOM_INSERTED , "EVT_AOM_INSERTED"},
531 {OPCODE_EVT_AOM_REMOVED , "EVT_AOM_REMOVED"},
532 {OPCODE_EVT_AOM_KEY_PRESS , "EVT_AOM_KEY_PRESS"},
533 {OPCODE_EVT_IDLETIMER , "EVT_IDLETIMER"},
534 {OPCODE_EVT_GET_PROPERTY_RESULT , "EVT_GET_PROPERTY_RESULT"},
535 {OPCODE_EVT_AOM_KEY_RELEASE , "EVT_AOM_KEY_RELEASE"},
536 {OPCODE_EVT_POPUPBOX_DISMISSED , "EVT_POPUPBOX_DISMISSED"},
537 {OPCODE_EVT_DIALOGBOX_TIMEOUT , "EVT_DIALOGBOX_TIMEOUT"},
538 {OPCODE_EVT_DIALOGBOX_DISMISSED , "EVT_DIALOGBOX_DISMISSED"},
539 {OPCODE_EVT_BT_BONDED_DEVICE , "EVT_BT_BONDED_DEVICE"},
540 {OPCODE_EVT_BT_INQUIRY_RESULT , "EVT_BT_INQUIRY_RESULT"},
541 {OPCODE_EVT_BT_NAME_DISCOVERY , "EVT_BT_NAME_DISCOVERY"},
542 {OPCODE_EVT_IME_REMOTEOPEN , "EVT_IME_REMOTEOPEN"},
543 {OPCODE_EVT_BT_BATTERY , "EVT_BT_BATTERY"},
544 {OPCODE_EVT_IME_LIST , "EVT_IME_LIST"},
545 {OPCODE_EVT_IME_CHANGE , "EVT_IME_CHANGE"},
546 {OPCODE_EVT_IME_OPEN , "EVT_IME_OPEN"},
547 {OPCODE_EVT_TELEPHONICBOX_EVENT , "EVT_TELEPHONICBOX_EVENT"},
548 {OPCODE_EVT_ACTLISTBOX_TIMEOUT , "EVT_ACTLISTBOX_TIMEOUT"},
549 {OPCODE_EVT_ACTLISTBOX_DISMISSED , "EVT_ACTLISTBOX_DISMISSED"},
550 {0, NULL}
552 static value_string_ext val_str_event_ext = VALUE_STRING_EXT_INIT(val_str_event);
554 #define P_BASIC 0
555 #define P_ARRAY 128
556 #define P_INVALID 255
557 #define P_INVALID_INDEX 255
558 #define C_STATIC 0
559 #define C_DYNAMIC 128
560 #define C_INVALID 255
561 #define E_INVALID 255
563 static unsigned utf8_properties[] = {
564 ((OPCODE_C_security << 8) | OPCODE_P_B_login ),
565 ((OPCODE_C_security << 8) | OPCODE_P_A_pem_data ),
566 ((OPCODE_C_security << 8) | OPCODE_P_A_serial_number),
567 ((OPCODE_C_security << 8) | OPCODE_P_A_owner_name ),
568 ((OPCODE_C_security << 8) | OPCODE_P_A_issuer_name ),
569 ((OPCODE_C_security << 8) | OPCODE_P_A_end_date ),
570 ((OPCODE_C_date << 8) | OPCODE_P_A_today ),
571 ((OPCODE_C_date << 8) | OPCODE_P_A_tomorrow ),
572 ((OPCODE_C_AOMV << 8) | OPCODE_P_A_label ),
573 ((OPCODE_C_AOMV << 8) | OPCODE_P_A_value ),
574 ((OPCODE_C_bluetooth << 8) | OPCODE_P_B_address ),
575 ((OPCODE_C_bluetooth << 8) | OPCODE_P_B_name ),
576 ((OPCODE_C_callstate << 8) | OPCODE_P_A_name ),
577 ((OPCODE_C_callstate << 8) | OPCODE_P_A_number ),
578 ((OPCODE_C_tabbox << 8) | OPCODE_P_A_label ),
579 ((OPCODE_C_tabbox << 8) | OPCODE_P_A_value ),
580 ((OPCODE_C_listbox << 8) | OPCODE_P_A_label ),
581 ((OPCODE_C_listbox << 8) | OPCODE_P_A_value ),
582 ((OPCODE_C_actionlistbox << 8) | OPCODE_P_A_label ),
583 ((OPCODE_C_actionlistbox << 8) | OPCODE_P_A_value ),
584 ((OPCODE_C_textbox << 8) | OPCODE_P_B_label ),
585 ((OPCODE_C_textbox << 8) | OPCODE_P_B_append ),
586 ((OPCODE_C_textbox << 8) | OPCODE_P_B_overwrite ),
587 ((OPCODE_C_actionbox << 8) | OPCODE_P_B_label ),
588 ((OPCODE_C_actionbox << 8) | OPCODE_P_B_value ),
589 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_label ),
590 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_value ),
591 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_mask ),
592 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_append ),
593 ((OPCODE_C_checkbox << 8) | OPCODE_P_B_label ),
594 ((OPCODE_C_datebox << 8) | OPCODE_P_B_format ),
595 ((OPCODE_C_timerbox << 8) | OPCODE_P_B_label ),
596 ((OPCODE_C_timerbox << 8) | OPCODE_P_B_format ),
597 ((OPCODE_C_dialogbox << 8) | OPCODE_P_B_label ),
598 ((OPCODE_C_dialogbox << 8) | OPCODE_P_A_action_label ),
599 ((OPCODE_C_dialogbox << 8) | OPCODE_P_A_action_value ),
600 ((OPCODE_C_sliderbar << 8) | OPCODE_P_B_label ),
601 ((OPCODE_C_progressbar << 8) | OPCODE_P_B_label ),
602 ((OPCODE_C_imagebox << 8) | OPCODE_P_B_URI ),
603 ((OPCODE_C_AOMEL << 8) | OPCODE_P_A_label ),
604 ((OPCODE_C_telephonicboxitem << 8) | OPCODE_P_B_label ),
605 ((OPCODE_C_bluetooth_device << 8) | OPCODE_P_B_address ),
606 ((OPCODE_C_bluetooth_device << 8) | OPCODE_P_B_name ),
607 ((OPCODE_C_bluetooth_device << 8) | OPCODE_P_B_pin ),
608 ((OPCODE_C_headerbox << 8) | OPCODE_P_B_label ),
609 ((OPCODE_C_ime_context << 8) | OPCODE_P_A_name )
612 #define N_UTF8_PROPERTIES array_length(utf8_properties)
613 #define UTF8_PROPERTY_SIZE (sizeof utf8_properties[0])
615 static unsigned bool_properties[] = {
616 ((OPCODE_C_terminal << 8) | OPCODE_P_B_negative_ack ),
617 ((OPCODE_C_terminal << 8) | OPCODE_P_B_CS_idle_state ),
618 ((OPCODE_C_terminal << 8) | OPCODE_P_B_PS_idle_state ),
619 ((OPCODE_C_terminal << 8) | OPCODE_P_B_use_customisation),
620 ((OPCODE_C_terminal << 8) | OPCODE_P_B_ime_lock ),
621 ((OPCODE_C_audioconfig << 8) | OPCODE_P_B_enable ),
622 ((OPCODE_C_audioconfig << 8) | OPCODE_P_B_qos_ticket ),
623 ((OPCODE_C_leds << 8) | OPCODE_P_B_onoff ),
624 ((OPCODE_C_screen << 8) | OPCODE_P_B_visible ),
625 ((OPCODE_C_screen << 8) | OPCODE_P_B_clearscreen ),
626 ((OPCODE_C_AOMV << 8) | OPCODE_P_B_all_icons_off ),
627 ((OPCODE_C_AOMV << 8) | OPCODE_P_A_enable ),
628 ((OPCODE_C_bluetooth << 8) | OPCODE_P_B_bth_ringing ),
629 ((OPCODE_C_bluetooth << 8) | OPCODE_P_B_bonded_devices ),
630 ((OPCODE_C_callstate << 8) | OPCODE_P_B_enable ),
631 ((OPCODE_C_framebox << 8) | OPCODE_P_B_visible ),
632 ((OPCODE_C_framebox << 8) | OPCODE_P_B_autospread ),
633 ((OPCODE_C_framebox << 8) | OPCODE_P_B_cycling ),
634 ((OPCODE_C_tabbox << 8) | OPCODE_P_B_visible ),
635 ((OPCODE_C_listbox << 8) | OPCODE_P_B_visible ),
636 ((OPCODE_C_listbox << 8) | OPCODE_P_B_showevent ),
637 ((OPCODE_C_listbox << 8) | OPCODE_P_B_showactive ),
638 ((OPCODE_C_listbox << 8) | OPCODE_P_B_circular ),
639 ((OPCODE_C_listbox << 8) | OPCODE_P_B_disablelongpress ),
640 ((OPCODE_C_actionlistbox << 8) | OPCODE_P_B_visible ),
641 ((OPCODE_C_textbox << 8) | OPCODE_P_B_visible ),
642 ((OPCODE_C_actionbox << 8) | OPCODE_P_B_visible ),
643 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_visible ),
644 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_enable ),
645 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_password ),
646 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_focus ),
647 ((OPCODE_C_inputbox << 8) | OPCODE_P_B_inputborder ),
648 ((OPCODE_C_checkbox << 8) | OPCODE_P_B_visible ),
649 ((OPCODE_C_checkbox << 8) | OPCODE_P_B_enable ),
650 ((OPCODE_C_checkbox << 8) | OPCODE_P_B_state ),
651 ((OPCODE_C_datebox << 8) | OPCODE_P_B_visible ),
652 ((OPCODE_C_timerbox << 8) | OPCODE_P_B_visible ),
653 ((OPCODE_C_popupbox << 8) | OPCODE_P_B_visible ),
654 ((OPCODE_C_popupbox << 8) | OPCODE_P_B_modal ),
655 ((OPCODE_C_dialogbox << 8) | OPCODE_P_B_visible ),
656 ((OPCODE_C_dialogbox << 8) | OPCODE_P_B_modal ),
657 ((OPCODE_C_sliderbar << 8) | OPCODE_P_B_visible ),
658 ((OPCODE_C_progressbar << 8) | OPCODE_P_B_visible ),
659 ((OPCODE_C_imagebox << 8) | OPCODE_P_B_visible ),
660 ((OPCODE_C_iconbox << 8) | OPCODE_P_B_visible ),
661 ((OPCODE_C_AOMVbox << 8) | OPCODE_P_B_visible ),
662 ((OPCODE_C_telephonicbox << 8) | OPCODE_P_B_visible ),
663 ((OPCODE_C_telephonicbox << 8) | OPCODE_P_B_enable ),
664 ((OPCODE_C_AOMEL << 8) | OPCODE_P_B_all_icons_off ),
665 ((OPCODE_C_AOMEL << 8) | OPCODE_P_B_all_labels_off ),
666 ((OPCODE_C_AOM10 << 8) | OPCODE_P_B_all_icons_off ),
667 ((OPCODE_C_AOM40 << 8) | OPCODE_P_B_all_icons_off ),
668 ((OPCODE_C_telephonicboxitem << 8) | OPCODE_P_B_focus ),
669 ((OPCODE_C_bluetooth_device << 8) | OPCODE_P_B_enable ),
670 ((OPCODE_C_bluetooth_device << 8) | OPCODE_P_B_bonded ),
671 ((OPCODE_C_headerbox << 8) | OPCODE_P_B_visible ),
672 ((OPCODE_C_ime_context << 8) | OPCODE_P_B_enable ),
673 ((OPCODE_C_ime_context << 8) | OPCODE_P_B_visible ),
674 ((OPCODE_C_ime_context << 8) | OPCODE_P_A_mode ),
675 ((OPCODE_C_ime_context << 8) | OPCODE_P_A_state ),
676 ((OPCODE_C_ime_context << 8) | OPCODE_P_A_enable )
679 #define N_BOOL_PROPERTIES array_length(bool_properties)
680 #define BOOL_PROPERTY_SIZE (sizeof bool_properties[0])
682 /*-----------------------------------------------------------------------------
683 globals
684 ---------------------------------------------------------------------------*/
685 static int proto_noe;
686 static int ett_noe;
687 static int ett_body;
688 static int ett_property;
689 static int ett_value;
691 static int hf_noe_length;
692 static int hf_noe_server;
693 static int hf_noe_method_ack;
694 static int hf_noe_method;
695 static int hf_noe_class;
696 static int hf_noe_event;
697 static int hf_noe_objectid;
698 static int hf_noe_method_index;
699 static int hf_noe_pcode;
700 static int hf_noe_psize;
701 static int hf_noe_aindx;
702 static int hf_noe_errcode;
703 static int hf_noe_value;
704 static int hf_noe_message;
705 static int hf_noe_key_name;
706 static int hf_noe_bonded;
707 static int hf_noe_property_item_bool;
708 static int hf_noe_property_item_u8;
709 static int hf_noe_property_item_u16;
710 static int hf_noe_property_item_u24;
711 static int hf_noe_property_item_u32;
712 static int hf_noe_property_item_bytes;
713 static int hf_noe_property_item_utf8;
714 static int hf_event_bt_key;
715 static int hf_event_context_switch;
716 static int hf_evt_locappl_enable;
717 static int hf_evt_locappl_interruptible;
718 static int hf_evt_locappl_identifier;
719 static int hf_evt_dev_presence_value;
720 static int hf_evt_dev_presence_state;
721 static int hf_event_widget_gc;
723 static const value_string servers_vals[] = {
724 {0x15, "Call Server"},
725 {0x16, "Presentation Server"},
726 {0, NULL}
728 static const value_string servers_short_vals[] = {
729 {0x15, "CS"},
730 {0x16, "PS"},
731 {0, NULL}
734 enum
736 METHOD_CREATE = 0x00,
737 METHOD_DELETE = 0x01,
738 METHOD_SET_PROPERTY = 0x02,
739 METHOD_GET_PROPERTY = 0x03,
740 METHOD_NOTIFY = 0x04,
741 METHOD_DELETE_ITEM = 0x05,
742 METHOD_INSERT_ITEM = 0x06,
743 METHOD_INVALID
745 static const value_string methods_vals[] = {
746 {METHOD_CREATE , "Create"},
747 {METHOD_DELETE , "Delete"},
748 {METHOD_SET_PROPERTY , "SetProperty"},
749 {METHOD_GET_PROPERTY , "GetProperty"},
750 {METHOD_NOTIFY , "Notify"},
751 {METHOD_DELETE_ITEM , "DeleteItem"},
752 {METHOD_INSERT_ITEM , "InsertItem"},
753 {0, NULL}
757 #define ERROR_INVALID_METHOD 0
758 #define ERROR_UNKNOWN_CLASS 1
759 #define ERROR_STATIC_CLASS 2
760 #define ERROR_DUPLICATE_OBJECTID 3
761 #define ERROR_UNKNOWN_PROPERTY_ 4
762 #define ERROR_BAD_INDEX 5
763 #define ERROR_BAD_LENGTH__ 6
764 #define ERROR_REQUIRED_MISSING 7
765 #define ERROR_BAD_VALUE 8
766 #define ERROR_READONLY_PROPERTY 9
767 #define ERROR_UNKNOWN_OBJECTID 10
768 #define ERROR_INVALID_CONTAINER 11
769 #define ERROR_PROPERTY_VMIN 12
770 #define ERROR_PROPERTY_VMAX 13
771 #define ERROR_POSITIVE_ACK 14
772 #define ERROR_NOT_IMPLEMENTED 15
773 #define ERROR_INVALID_CLASS 16
774 #define ERROR_INVALID_PROPERTY 17
775 #define ERROR_BAD_UTF8 18
777 #define ERROR_MESSAGE_DROP 128
778 #define ERROR_MAX_SET_PROPERTY 129
779 #define ERROR_INTERNAL 130
782 static const value_string errcode_vals[] = {
783 {ERROR_INVALID_METHOD , "An invalid method opcode was received"},
784 {ERROR_UNKNOWN_CLASS , "An invalid class opcode was received"},
785 {ERROR_STATIC_CLASS , "Trying to create or delete a static class"},
786 {ERROR_DUPLICATE_OBJECTID , "Trying to create an existing object"},
787 {ERROR_UNKNOWN_PROPERTY_ , "Property opcode doesn't exist in specified class"},
788 {ERROR_BAD_INDEX , "Bad property index (array overflow)"},
789 {ERROR_BAD_LENGTH__ , "Short message or bad property length"},
790 {ERROR_REQUIRED_MISSING , "A required property was not specified in create method"},
791 {ERROR_BAD_VALUE , "Bad property value"},
792 {ERROR_READONLY_PROPERTY , "Trying to set a read-only property"},
793 {ERROR_UNKNOWN_OBJECTID , "The specified object doesn't exist (delete, setProperty or getProperty methods)"},
794 {ERROR_INVALID_CONTAINER , "Invalid container"},
795 {ERROR_PROPERTY_VMIN , "Property value < property minimum value"},
796 {ERROR_PROPERTY_VMAX , "Property value > property maximum value"},
797 {ERROR_POSITIVE_ACK , "Positive ack requested with a getProperty method"},
798 {ERROR_NOT_IMPLEMENTED , "The specified property is not implemented"},
799 {ERROR_INVALID_CLASS , "Invalid class specified with insertItem and deleteItem"},
800 {ERROR_INVALID_PROPERTY , "Invalid property specified with insertItem and deleteItem"},
801 {ERROR_BAD_UTF8 , "Invalid UTF8 value in UA message"},
802 {ERROR_MESSAGE_DROP , "Decoder queue is full"},
803 {ERROR_MAX_SET_PROPERTY , "A maximum of 256 properties can be received in a setProperty method"},
804 {ERROR_INTERNAL , "Internal error"},
805 {0, NULL}
807 static value_string_ext errcode_vals_ext = VALUE_STRING_EXT_INIT(errcode_vals);
809 static const value_string str_key_name[] = {
810 {0x00 , "Null Char."},
811 {0x01 , "Start Of Header"},
812 {0x02 , "Start Of Text"},
813 {0x03 , "End Of Text"},
814 {0x04 , "End Of Transmission"},
815 {0x05 , "Enquiry"},
816 {0x06 , "Acknowledgment"},
817 {0x07 , "Bell"},
818 {0x08 , "Backspace"},
819 {0x09 , "Horizontal Tab"},
820 {0x0A , "Line Feed"},
821 {0x0B , "Vertical Tab"},
822 {0x0C , "Form Feed"},
823 {0x0D , "Enter"},
824 {0x0E , "Shift Out"},
825 {0x0F , "Shift In"},
826 {0x10 , "Data Link Escape"},
827 {0x11 , "Device Control 1"},
828 {0x12 , "Device Control 2"},
829 {0x13 , "Device Control 3"},
830 {0x14 , "Device Control 4"},
831 {0x15 , "Negative Acknowledgment"},
832 {0x16 , "Synchronous Idle"},
833 {0x17 , "End Of Trans. Block"},
834 {0x18 , "Cancel"},
835 {0x19 , "End Of Medium"},
836 {0x1A , "Substitute"},
837 {0x1B , "Escape"},
838 {0x1C , "File Separator"},
839 {0x1D , "Group Separator"},
840 {0x1E , "Request To Send"},
841 {0x1F , "Unit Separator"},
842 {0x20 , "Space"},
843 {0x7F , "Delete"},
844 {0xE0 , "a`"},
845 {0xE7 , "c,"},
846 {0xE8 , "e`"},
847 {0xE9 , "e'"},
848 {0xF9 , "u`"},
849 {0x20AC , "Euro Character"},
850 {0xE100 , "Release"},
851 {0xE101 , "Bis"},
852 {0xE102 , "Message"},
853 {0xE103 , "Handsfree"},
854 {0xE104 , "Mute"},
855 {0xE105 , "Volume Dec"},
856 {0xE106 , "Volume Inc"},
857 {0xE107 , "Hookswitch"},
858 {0xE110 , "Ok"},
859 {0xE111 , "Left"},
860 {0xE112 , "Right"},
861 {0xE113 , "Down"},
862 {0xE114 , "Up"},
863 {0xE115 , "Home"},
864 {0xE116 , "Help"},
865 {0xE117 , "Directory"},
866 {0xE120 , "ProgKey 0"},
867 {0xE121 , "ProgKey 1"},
868 {0xE122 , "ProgKey 2"},
869 {0xE123 , "ProgKey 3"},
870 {0xE124 , "ProgKey 4"},
871 {0xE125 , "ProgKey 5"},
872 {0xE130 , "SoftKey 0"},
873 {0xE131 , "SoftKey 1"},
874 {0xE132 , "SoftKey 2"},
875 {0xE133 , "SoftKey 3"},
876 {0xE134 , "SoftKey 4"},
877 {0xE135 , "SoftKey 5"},
878 {0xE136 , "SoftKey 6"},
879 {0xE137 , "SoftKey 7"},
880 {0xE138 , "SoftKey 8"},
881 {0xE139 , "SoftKey 9"},
882 {0, NULL}
884 static value_string_ext str_key_name_ext = VALUE_STRING_EXT_INIT(str_key_name);
886 static const value_string noe_evt_context_switch_str_vals[] = {
887 {1, "Call Server"},
888 {2, "Presentation Server"},
889 {0, NULL}
892 static const value_string noe_evt_devices_str_vals[] = {
893 {0, "RJ9 Plug"},
894 {1, "BT Handset Link"},
895 {2, "BT Headset Link"},
896 {3, "Jack Plug"},
897 {0, NULL}
900 static const value_string noe_true_false_str_vals[] = {
901 {0, "False"},
902 {1, "True"},
903 {0, NULL}
906 static const value_string noe_evt_locappl_identifier_str_vals[] = {
907 {1, "UserMenu"},
908 {2, "BTConfig"},
909 {3, "AudioCfg"},
910 {4, "SpkPhone"},
911 {5, "UsbSpCfg"},
912 {6, "BtSpCfg" },
913 {7, "EmnAppl" },
914 {0, NULL}
917 /*-----------------------------------------------------------------------------
918 DECODE UTF8 TO UNICODE
919 This function translates an UTF8 vale to an UNICODE one.
920 Need to have at least 48 bits value.
921 ---------------------------------------------------------------------------*/
922 static uint64_t decode_utf8(uint64_t utf8)
924 static uint64_t unicode;
926 if (utf8 <= UINT64_C(0xFF))
928 unicode =
929 utf8 & UINT64_C(0x7F);
931 else if (utf8 <= UINT64_C(0xFFFF))
933 unicode =
934 ((utf8 & UINT64_C(0x1F00) >> 2) +
935 (utf8 & UINT64_C(0x3F)));
937 else if (utf8 <= UINT64_C(0xFFFFFF))
939 unicode =
940 ((utf8 & UINT64_C(0x0F0000)) >> 4) +
941 ((utf8 & UINT64_C(0x3F00)) >> 2) +
942 (utf8 & UINT64_C(0x3F));
944 else if (utf8 <= UINT64_C(0xFFFFFFFF))
946 unicode =
947 ((utf8 & UINT64_C(0x07000000)) >> 6) +
948 ((utf8 & UINT64_C(0x3F0000)) >> 4) +
949 ((utf8 & UINT64_C(0x3F00)) >> 2) +
950 (utf8 & UINT64_C(0x3F));
952 else if (utf8 <= UINT64_C(0xFFFFFFFFFF))
954 unicode =
955 ((utf8 & UINT64_C(0x0300000000)) >> 8) +
956 ((utf8 & UINT64_C(0x3F000000)) >> 6) +
957 ((utf8 & UINT64_C(0x3F0000)) >> 4) +
958 ((utf8 & UINT64_C(0x3F00)) >> 2) +
959 (utf8 & UINT64_C(0x3F));
961 else if (utf8 <= UINT64_C(0xFFFFFFFFFFFF))
963 unicode =
964 ((utf8 & UINT64_C(0x010000000000)) >> 10) +
965 ((utf8 & UINT64_C(0x3F00000000)) >> 8) +
966 ((utf8 & UINT64_C(0x3F000000)) >> 6) +
967 ((utf8 & UINT64_C(0x3F0000)) >> 4) +
968 ((utf8 & UINT64_C(0x3F00)) >> 2) +
969 (utf8 & UINT64_C(0x3F));
971 else
973 unicode = UINT64_C(0);
975 return unicode;
979 /*-----------------------------------------------------------------------------
980 DECODE KEY NAME
981 This function translates an UNICODE to the name associated.
982 Need to have at least 48 bits value.
983 ---------------------------------------------------------------------------*/
984 static const char *decode_key_name(wmem_allocator_t *scope, int unicode)
986 const char *key_name;
988 if ((unicode <= 0x20)
989 || (unicode == 0x7F)
990 || (unicode == 0xE0)
991 || (unicode == 0xE7)
992 || (unicode == 0xE8)
993 || (unicode == 0xE9)
994 || (unicode == 0xF9))
996 key_name = val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown");
998 else if (unicode <= 0xFF)
1000 key_name = format_char(scope, unicode);
1002 else
1004 key_name = val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown");
1007 return key_name;
1011 /*-----------------------------------------------------------------------------
1012 DECODE EVT ERROR
1013 ---------------------------------------------------------------------------*/
1014 static void decode_evt_error(proto_tree *tree,
1015 tvbuff_t *tvb,
1016 unsigned offset,
1017 unsigned length)
1019 if (!tree)
1020 return;
1022 proto_tree_add_item(tree, hf_noe_errcode, tvb, offset, 2, ENC_BIG_ENDIAN);
1023 offset += 2;
1024 length -= 2;
1026 proto_tree_add_item(tree, hf_noe_method, tvb, offset, 1, ENC_BIG_ENDIAN);
1027 offset += 1;
1028 length -= 1;
1030 proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
1031 offset += 1;
1032 length -= 1;
1034 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1035 offset += 2;
1036 length -= 2;
1038 proto_tree_add_item(tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1039 offset += 1;
1040 length -= 1;
1042 proto_tree_add_item(tree, hf_noe_aindx, tvb, offset, 1, ENC_BIG_ENDIAN);
1043 offset += 1;
1044 length -= 1;
1046 proto_tree_add_item(tree, hf_noe_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1047 offset += 2;
1048 length -= 2;
1050 proto_tree_add_item(tree, hf_noe_value, tvb, offset, 4, ENC_BIG_ENDIAN);
1051 offset += 4;
1052 length -= 4;
1054 proto_tree_add_item(tree, hf_noe_message, tvb, offset, length, ENC_NA);
1057 static int compcp(const void *pcp1, const void *pcp2)
1059 unsigned cp1 = *((unsigned *)pcp1);
1060 unsigned cp2 = *((unsigned *)pcp2);
1062 return (cp1 - cp2);
1065 static bool property_is_bool(uint8_t noe_class, uint8_t property_code)
1067 unsigned key = ((noe_class << 8) | property_code);
1068 return (bsearch(&key, bool_properties, N_BOOL_PROPERTIES, BOOL_PROPERTY_SIZE, compcp) != NULL);
1071 static bool property_is_utf8(uint8_t noe_class, uint8_t property_code)
1073 unsigned key = ((noe_class << 8) | property_code);
1074 return (bsearch(&key, utf8_properties, N_UTF8_PROPERTIES, UTF8_PROPERTY_SIZE, compcp) != NULL);
1077 /*-----------------------------------------------------------------------------
1078 MESSAGE BODY DECODER
1079 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1080 ---------------------------------------------------------------------------*/
1081 static void decode_tlv(proto_tree *tree,
1082 tvbuff_t *tvb,
1083 uint8_t noe_class,
1084 unsigned offset,
1085 unsigned length)
1087 proto_tree *property_tree;
1088 uint8_t property_code;
1089 uint16_t property_length;
1090 /* uint64_t property_index;*/
1092 /* add text to the frame tree */
1093 property_tree = proto_tree_add_subtree(tree,
1094 tvb,
1095 offset,
1096 length, ett_body, NULL,
1097 "NOE Message Body");
1099 while(length > 0)
1101 property_code = tvb_get_uint8(tvb, offset);
1102 proto_tree_add_item(property_tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1103 offset += 1;
1104 length -= 1;
1106 if (property_code >= P_ARRAY)
1108 proto_tree_add_item(property_tree, hf_noe_aindx, tvb, offset, 1, ENC_BIG_ENDIAN);
1109 offset += 1;
1110 length -= 1;
1113 property_length = tvb_get_uint8(tvb, offset);
1114 if (property_length & 0x80)
1116 property_length = tvb_get_ntohs(tvb, offset);
1117 property_length &= 0x7fff;
1118 proto_tree_add_item(property_tree, hf_noe_psize, tvb, offset, 2, ENC_BIG_ENDIAN);
1119 offset += 2;
1120 length -= 2;
1122 else
1124 proto_tree_add_item(property_tree, hf_noe_psize, tvb, offset, 1, ENC_NA);
1125 offset += 1;
1126 length -= 1;
1129 if (property_is_utf8(noe_class, property_code))
1131 proto_tree_add_item(property_tree, hf_noe_property_item_utf8, tvb, offset, property_length, ENC_STRING);
1133 else
1135 switch(property_length)
1137 case 0:
1138 break;
1139 case 1:
1140 if (property_is_bool(noe_class, property_code))
1141 proto_tree_add_item(property_tree, hf_noe_property_item_bool, tvb, offset, 1, ENC_BIG_ENDIAN);
1142 else
1143 proto_tree_add_item(property_tree, hf_noe_property_item_u8, tvb, offset, 1, ENC_BIG_ENDIAN);
1144 break;
1145 case 2:
1146 proto_tree_add_item(property_tree, hf_noe_property_item_u16, tvb, offset, 2, ENC_BIG_ENDIAN);
1147 break;
1148 case 3:
1149 proto_tree_add_item(property_tree, hf_noe_property_item_u24, tvb, offset, 3, ENC_BIG_ENDIAN);
1150 break;
1151 case 4:
1152 proto_tree_add_item(property_tree, hf_noe_property_item_u32, tvb, offset, 4, ENC_BIG_ENDIAN);
1153 break;
1154 default:
1155 proto_tree_add_item(property_tree, hf_noe_property_item_bytes, tvb, offset, property_length, ENC_NA);
1156 break;
1159 offset += property_length;
1160 length -= property_length;
1166 /*-----------------------------------------------------------------------------
1167 GETPROPERTY MESSAGE BODY DECODER
1168 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1169 ---------------------------------------------------------------------------*/
1170 static void decode_getproperty_tlv(proto_tree *tree,
1171 tvbuff_t *tvb,
1172 unsigned offset,
1173 unsigned length)
1175 proto_tree *body_tree;
1176 uint8_t body_type;
1178 /* add text to the frame tree */
1179 body_tree = proto_tree_add_subtree(tree,
1180 tvb,
1181 offset,
1182 length, ett_property, NULL,
1183 "NOE Message Body");
1185 while(length > 0)
1187 body_type = tvb_get_uint8(tvb, offset);
1188 proto_tree_add_item(body_tree, hf_noe_pcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1190 offset += 1;
1191 length -= 1;
1193 if (body_type >= P_ARRAY)
1195 proto_tree_add_item(body_tree, hf_noe_aindx, tvb, offset, 1, ENC_BIG_ENDIAN);
1196 offset += 1;
1197 length -= 1;
1204 /*-----------------------------------------------------------------------------
1205 TERMINAL TO SERVER EVENT MESSAGE BODY DECODER
1206 This function decodes the message body of an 0x15 (and 0x16) UA3G message.
1207 ---------------------------------------------------------------------------*/
1208 static void decode_evt(proto_tree *tree,
1209 tvbuff_t *tvb,
1210 packet_info *pinfo,
1211 unsigned offset,
1212 unsigned length)
1214 uint8_t event = tvb_get_uint8(tvb, offset);
1216 proto_tree_add_item(tree, hf_noe_event, tvb, offset, 1, ENC_BIG_ENDIAN);
1218 /* add text to the frame "INFO" column */
1219 col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
1220 val_to_str_ext_const(event, &val_str_event_ext, "Unknown"));
1221 /* update text of the main proto item */
1222 proto_item_append_text(tree, ", %s",
1223 val_to_str_ext_const(event, &val_str_event_ext, "Unknown"));
1225 offset += 1;
1226 length -= 1;
1228 switch(event)
1230 case OPCODE_EVT_BT_KEY_SHORTPRESS:
1231 case OPCODE_EVT_BT_KEY_LONGPRESS:
1232 case OPCODE_EVT_BT_KEY_VERYLONGPRESS:
1233 proto_tree_add_item(tree, hf_event_bt_key, tvb, offset, 1, ENC_BIG_ENDIAN);
1234 break;
1235 case OPCODE_EVT_KEY_PRESS:
1236 case OPCODE_EVT_KEY_RELEASE:
1237 case OPCODE_EVT_KEY_SHORTPRESS:
1238 case OPCODE_EVT_KEY_LONGPRESS:
1239 case OPCODE_EVT_HELP:
1241 /* utf8_value is the utf8 value to translate into Unicode with the decode_uft8 function */
1242 uint64_t utf8_value = 0;
1243 uint64_t unicode_value;
1244 const char *key_name;
1245 int pt_length = length;
1246 int pt_offset = offset;
1248 while(pt_length > 0)
1250 utf8_value = (utf8_value << 8) + tvb_get_uint8(tvb, pt_offset);
1251 pt_offset += 1;
1252 pt_length -= 1;
1254 unicode_value = decode_utf8(utf8_value);
1255 key_name = decode_key_name(pinfo->pool, (int)unicode_value);
1257 /* add text to the frame "INFO" column */
1258 col_append_fstr(pinfo->cinfo, COL_INFO, ": \"%s\"", key_name);
1259 /* update text of the main proto item */
1260 proto_item_append_text(tree, ", \"%s\"", key_name);
1262 proto_tree_add_string_format_value(tree, hf_noe_key_name,
1263 tvb,
1264 offset,
1265 length, key_name,
1266 "%s (UTF-8 Value: \"%s\", Unicode Value: 0x%" PRIx64 ")",
1267 key_name,
1268 tvb_bytes_to_str(pinfo->pool, tvb, offset, length),
1269 unicode_value);
1270 break;
1272 case OPCODE_EVT_ERROR_PROTOCOL:
1273 case OPCODE_EVT_ERROR_CREATE:
1274 case OPCODE_EVT_ERROR_DELETE:
1275 case OPCODE_EVT_ERROR_SET_PROPERTY:
1276 case OPCODE_EVT_ERROR_GET_PROPERTY:
1278 decode_evt_error(tree, tvb, offset, length);
1279 break;
1281 case OPCODE_EVT_CONTEXT_SWITCH:
1282 proto_tree_add_item(tree, hf_event_context_switch, tvb, offset, 1, ENC_BIG_ENDIAN);
1283 break;
1284 case OPCODE_EVT_LOCAL_APPLICATION:
1286 proto_tree_add_item(tree, hf_evt_locappl_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
1287 offset += 1;
1288 proto_tree_add_item(tree, hf_evt_locappl_interruptible, tvb, offset, 1, ENC_BIG_ENDIAN);
1289 offset += 1;
1290 proto_tree_add_item(tree, hf_evt_locappl_identifier, tvb, offset, 1, ENC_BIG_ENDIAN);
1291 break;
1293 case OPCODE_EVT_KEY_LINE:
1294 case OPCODE_EVT_ONHOOK:
1295 case OPCODE_EVT_OFFHOOK:
1296 case OPCODE_EVT_DEVICE_PRESENCE:
1298 proto_tree_add_item(tree, hf_evt_dev_presence_value, tvb, offset, 1, ENC_BIG_ENDIAN);
1299 if (OPCODE_EVT_DEVICE_PRESENCE == event)
1301 offset += 1;
1302 proto_tree_add_item(tree, hf_evt_dev_presence_state, tvb, offset, 1, ENC_BIG_ENDIAN);
1304 break;
1306 case OPCODE_EVT_SUCCESS_CREATE:
1307 case OPCODE_EVT_SUCCESS_DELETE:
1308 case OPCODE_EVT_SUCCESS_SET_PROPERTY:
1309 case OPCODE_EVT_SUCCESS_INSERT_ITEM:
1310 case OPCODE_EVT_SUCCESS_DELETE_ITEM:
1311 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1312 break;
1313 case OPCODE_EVT_WIDGETS_GC:
1314 proto_tree_add_item(tree, hf_event_widget_gc, tvb, offset, 4, ENC_BIG_ENDIAN);
1315 break;
1316 case OPCODE_EVT_BT_BONDING_RESULT:
1318 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1319 offset += 2;
1320 /*length -= 2;*/
1322 proto_tree_add_item(tree, hf_noe_bonded, tvb, offset, 1, ENC_BIG_ENDIAN);
1323 offset += 1;
1324 /*length -= 1;*/
1326 proto_tree_add_uint_format_value(tree, hf_noe_value,
1327 tvb,
1328 offset,
1329 1, tvb_get_ntohs(tvb, offset),
1330 "%d",
1331 tvb_get_ntohs(tvb, offset));
1332 break;
1334 default:
1335 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1336 offset += 2;
1337 length -= 2;
1339 if (length > 0)
1340 decode_tlv(tree, tvb, C_INVALID, offset, length);
1341 break;
1347 /*-----------------------------------------------------------------------------
1348 METHOD DECODER
1349 This function decodes the method of an 0x15 (and 0x16) UA3G message.
1350 ---------------------------------------------------------------------------*/
1351 static void decode_mtd(proto_tree *tree,
1352 tvbuff_t *tvb,
1353 packet_info *pinfo,
1354 uint8_t method,
1355 unsigned offset,
1356 unsigned length)
1358 uint8_t noe_class = tvb_get_uint8(tvb, offset);
1360 proto_tree_add_item(tree, hf_noe_class, tvb, offset, 1, ENC_BIG_ENDIAN);
1362 /* add text to the frame "INFO" column */
1363 col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
1364 val_to_str_ext_const(noe_class, &val_str_class_ext, "Unknown"));
1365 /* update text of the main proto item */
1366 proto_item_append_text(tree, ", %s",
1367 val_to_str_ext_const(noe_class, &val_str_class_ext, "Unknown"));
1369 offset += 1;
1370 length -= 1;
1372 if (noe_class >= C_DYNAMIC)
1374 proto_tree_add_item(tree, hf_noe_objectid, tvb, offset, 2, ENC_BIG_ENDIAN);
1375 offset += 2;
1376 length -= 2;
1379 switch(method)
1381 case METHOD_INSERT_ITEM:
1383 proto_tree_add_item(tree, hf_noe_method_index, tvb, offset, 1, ENC_BIG_ENDIAN);
1384 offset += 1;
1385 length -= 1;
1386 if (length > 0)
1387 decode_tlv(tree, tvb, noe_class, offset, length);
1388 break;
1390 case METHOD_DELETE_ITEM:
1392 proto_tree_add_item(tree, hf_noe_method_index, tvb, offset, 1, ENC_BIG_ENDIAN);
1393 break;
1395 case METHOD_GET_PROPERTY:
1397 decode_getproperty_tlv(tree, tvb, offset, length);
1398 break;
1400 default:
1402 if (length > 0)
1403 decode_tlv(tree, tvb, noe_class, offset, length);
1404 break;
1410 /*-----------------------------------------------------------------------------
1411 NOE DISSECTOR
1412 ---------------------------------------------------------------------------*/
1413 static int dissect_noe(tvbuff_t *tvb,
1414 packet_info *pinfo,
1415 proto_tree *tree, void* data _U_)
1417 proto_item *noe_item;
1418 proto_tree *noe_tree;
1419 int length;
1420 uint8_t server;
1421 uint8_t method;
1422 bool methodack;
1423 int offset = 0;
1425 noe_item = proto_tree_add_item(tree, proto_noe, tvb, 0, -1, ENC_NA);
1426 noe_tree = proto_item_add_subtree(noe_item, ett_noe);
1428 length = tvb_get_letohs(tvb, offset);
1430 proto_tree_add_uint(noe_tree,
1431 hf_noe_length,
1432 tvb,
1433 offset,
1435 length);
1436 offset += 2;
1438 server = tvb_get_uint8(tvb, offset);
1440 /* add text to the frame "INFO" column */
1441 col_append_fstr(pinfo->cinfo, COL_INFO, " - NOE Protocol (%s)",
1442 val_to_str_const(server, servers_short_vals, "Unknown"));
1444 proto_tree_add_uint(noe_tree,
1445 hf_noe_server,
1446 tvb,
1447 offset,
1449 server);
1450 offset += 1;
1451 length -= 1;
1453 /* update text of the main proto item */
1454 proto_item_append_text(noe_item, ", %s",
1455 val_to_str_const(server, servers_short_vals, "Unknown"));
1457 method = tvb_get_uint8(tvb, offset);
1458 methodack = (method & 0x80) != 0;
1459 method = (method & 0x7f);
1461 proto_tree_add_uint_format_value(noe_tree,
1462 hf_noe_method,
1463 tvb,
1464 offset,
1466 method,
1467 "%s (%d)",
1468 val_to_str_const(method, methods_vals, "Unknown"),
1469 method);
1471 if (method >= METHOD_INVALID)
1472 return offset;
1474 /* add text to the frame "INFO" column */
1475 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
1476 val_to_str_const(method, methods_vals, "Unknown"));
1478 /* update text of the main proto item */
1479 proto_item_append_text(noe_item, ", %s",
1480 val_to_str_const(method, methods_vals, "Unknown"));
1482 if (method == METHOD_NOTIFY)
1484 offset += 1;
1485 length -= 1;
1486 decode_evt(noe_tree, tvb, pinfo, offset, length);
1488 else
1489 /* Create, Delete, SetProperty, GetProperty, DeleteItem, InsertItem properties */
1491 proto_tree_add_boolean(noe_tree,
1492 hf_noe_method_ack,
1493 tvb,
1494 offset,
1496 methodack);
1497 offset += 1;
1498 length -= 1;
1499 decode_mtd(noe_tree, tvb, pinfo, method, offset, length);
1501 return tvb_captured_length(tvb);
1506 /*-----------------------------------------------------------------------------
1507 DISSECTORS REGISTRATION FUNCTIONS
1508 ---------------------------------------------------------------------------*/
1509 void proto_register_noe(void)
1511 static hf_register_info hf_noe[] =
1513 { &hf_noe_length,
1515 "Length",
1516 "noe.length",
1517 FT_UINT16,
1518 BASE_DEC,
1519 NULL,
1520 0x0,
1521 "Method Length",
1522 HFILL
1525 { &hf_noe_server,
1527 "Server",
1528 "noe.server",
1529 FT_UINT8,
1530 BASE_HEX,
1531 VALS(servers_vals),
1532 0x0,
1533 "Method Opcode",
1534 HFILL
1537 { &hf_noe_method_ack,
1539 "Ack",
1540 "noe.method_ack",
1541 FT_BOOLEAN,
1542 BASE_NONE,
1543 NULL,
1544 0x0,
1545 "Method Acknowledge",
1546 HFILL
1549 { &hf_noe_method,
1551 "Method",
1552 "noe.method",
1553 FT_UINT8,
1554 BASE_DEC,
1555 VALS(methods_vals),
1556 0x0,
1557 "Method Opcode",
1558 HFILL
1561 { &hf_noe_class,
1563 "Class",
1564 "noe.class",
1565 FT_UINT8,
1566 BASE_DEC|BASE_EXT_STRING,
1567 &val_str_class_ext,
1568 0x0,
1569 "Class Opcode",
1570 HFILL
1573 { &hf_noe_event,
1575 "Event",
1576 "noe.event",
1577 FT_UINT8,
1578 BASE_DEC|BASE_EXT_STRING,
1579 &val_str_event_ext,
1580 0x0,
1581 "Event Opcode",
1582 HFILL
1585 { &hf_noe_objectid,
1587 "Objectid",
1588 "noe.objectid",
1589 FT_UINT16,
1590 BASE_HEX,
1591 NULL,
1592 0x0,
1593 "Object Identifier",
1594 HFILL
1597 { &hf_noe_method_index,
1599 "ItemIndx",
1600 "noe.item_index",
1601 FT_UINT8,
1602 BASE_DEC,
1603 NULL,
1604 0x0,
1605 "Delete/Insert Index",
1606 HFILL
1609 { &hf_noe_pcode,
1611 "Property",
1612 "noe.property",
1613 FT_UINT8,
1614 BASE_HEX|BASE_EXT_STRING,
1615 &val_str_props_ext,
1616 0x0,
1617 "Property Identifier",
1618 HFILL
1621 { &hf_noe_psize,
1623 "PropLength",
1624 "noe.prop_len",
1625 FT_UINT16,
1626 BASE_DEC,
1627 NULL,
1628 0x0,
1629 "Property Length",
1630 HFILL
1633 { &hf_noe_errcode,
1635 "ErrCode",
1636 "noe.errcode",
1637 FT_UINT16,
1638 BASE_DEC|BASE_EXT_STRING,
1639 &errcode_vals_ext,
1640 0x0,
1641 "Error Code",
1642 HFILL
1645 { &hf_noe_aindx,
1647 "ArrIndex",
1648 "noe.array_index",
1649 FT_UINT8,
1650 BASE_DEC,
1651 NULL,
1652 0x0,
1653 "Array Index",
1654 HFILL
1657 { &hf_noe_value,
1659 "Value",
1660 "noe.value",
1661 FT_UINT32,
1662 BASE_HEX,
1663 NULL,
1664 0x0,
1665 NULL,
1666 HFILL
1669 { &hf_noe_message,
1671 "Message",
1672 "noe.messages",
1673 FT_BYTES,
1674 BASE_NONE,
1675 NULL,
1676 0x0,
1677 NULL,
1678 HFILL
1681 { &hf_noe_property_item_bool,
1683 "Value",
1684 "noe.property_item.bool",
1685 FT_UINT8,
1686 BASE_DEC,
1687 VALS(noe_true_false_str_vals),
1688 0x0,
1689 NULL,
1690 HFILL
1693 { &hf_noe_property_item_u8,
1695 "Value",
1696 "noe.property_item.uint",
1697 FT_UINT8,
1698 BASE_DEC,
1699 NULL,
1700 0x0,
1701 NULL,
1702 HFILL
1705 { &hf_noe_property_item_u16,
1707 "Value",
1708 "noe.property_item.uint",
1709 FT_UINT16,
1710 BASE_DEC,
1711 NULL,
1712 0x0,
1713 NULL,
1714 HFILL
1717 { &hf_noe_property_item_u24,
1719 "Value",
1720 "noe.property_item.uint",
1721 FT_UINT24,
1722 BASE_DEC,
1723 NULL,
1724 0x0,
1725 NULL,
1726 HFILL
1729 { &hf_noe_property_item_u32,
1731 "Value",
1732 "noe.property_item.uint",
1733 FT_UINT32,
1734 BASE_DEC,
1735 NULL,
1736 0x0,
1737 NULL,
1738 HFILL
1741 { &hf_noe_property_item_bytes,
1743 "Value",
1744 "noe.property_item.bytes",
1745 FT_BYTES,
1746 BASE_NONE,
1747 NULL,
1748 0x0,
1749 NULL,
1750 HFILL
1753 { &hf_noe_property_item_utf8,
1755 "Value",
1756 "noe.property_item.utf8",
1757 FT_STRING,
1758 BASE_NONE,
1759 NULL,
1760 0x0,
1761 NULL,
1762 HFILL
1765 { &hf_event_bt_key,
1767 "Value",
1768 "noe.event_bt_key.value",
1769 FT_UINT8,
1770 BASE_DEC,
1771 NULL,
1772 0x0,
1773 NULL,
1774 HFILL
1777 { &hf_event_context_switch,
1779 "Context",
1780 "noe.event_context_switch",
1781 FT_UINT8,
1782 BASE_DEC,
1783 VALS(noe_evt_context_switch_str_vals),
1784 0x0,
1785 NULL,
1786 HFILL
1789 { &hf_evt_locappl_enable,
1791 "Enable",
1792 "noe.event_locappl.enable",
1793 FT_UINT8,
1794 BASE_DEC,
1795 VALS(noe_true_false_str_vals),
1796 0x0,
1797 NULL,
1798 HFILL
1801 { &hf_evt_locappl_interruptible,
1803 "Interruptible",
1804 "noe.event_locappl.interruptible",
1805 FT_UINT8,
1806 BASE_DEC,
1807 VALS(noe_true_false_str_vals),
1808 0x0,
1809 NULL,
1810 HFILL
1813 { &hf_evt_locappl_identifier,
1815 "Identifier",
1816 "noe.event_locappl.identifier",
1817 FT_UINT8,
1818 BASE_DEC,
1819 VALS(noe_evt_locappl_identifier_str_vals),
1820 0x0,
1821 NULL,
1822 HFILL
1825 { &hf_evt_dev_presence_value,
1827 "Value",
1828 "noe.event_device_presence.value",
1829 FT_UINT8,
1830 BASE_DEC,
1831 VALS(noe_evt_devices_str_vals),
1832 0x0,
1833 NULL,
1834 HFILL
1837 { &hf_evt_dev_presence_state,
1839 "State",
1840 "noe.event_device_presence.state",
1841 FT_UINT8,
1842 BASE_DEC,
1843 VALS(noe_true_false_str_vals),
1844 0x0,
1845 NULL,
1846 HFILL
1849 { &hf_event_widget_gc,
1851 "FreeMem (bytes)",
1852 "noe.event_widget_gc",
1853 FT_UINT32,
1854 BASE_DEC,
1855 NULL,
1856 0x0,
1857 NULL,
1858 HFILL
1861 { &hf_noe_bonded,
1863 "Bonded",
1864 "noe.bonded",
1865 FT_UINT8,
1866 BASE_DEC,
1867 NULL,
1868 0x0,
1869 NULL,
1870 HFILL
1873 { &hf_noe_key_name,
1875 "Key name",
1876 "noe.keyname",
1877 FT_STRING,
1878 BASE_NONE,
1879 NULL,
1880 0x0,
1881 NULL,
1882 HFILL
1887 static int *ett[] =
1889 &ett_noe,
1890 &ett_body,
1891 &ett_property,
1892 &ett_value,
1895 /* NOE dissector registration */
1896 proto_noe = proto_register_protocol("NOE Protocol", "NOE", "noe");
1898 proto_register_field_array(proto_noe, hf_noe, array_length(hf_noe));
1900 register_dissector("noe", dissect_noe, proto_noe);
1902 /* Common subtree array registration */
1903 proto_register_subtree_array(ett, array_length(ett));
1908 void proto_reg_handoff_noe(void)
1910 #if 0 /* Future */
1911 dissector_handle_t handle_noe = find_dissector("noe");
1913 /* hooking of NOE on UA */
1914 dissector_add_uint("ua.opcode", 0x15, handle_noe);
1915 #endif
1919 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1921 * Local variables:
1922 * c-basic-offset: 4
1923 * tab-width: 8
1924 * indent-tabs-mode: nil
1925 * End:
1927 * vi: set shiftwidth=4 tabstop=8 expandtab:
1928 * :indentSize=4:tabSize=8:noTabs=true: