Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-obex.c
blob60a888db2bb3f84da1408ff0f2ed4495c6f59038
1 /* packet-obex.c
2 * Routines for OBEX dissection
4 * Copyright 2010, Allan M. Madsen
5 * Copyright 2013, Michal Labedzki for Tieto Corporation
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "config.h"
16 #include <epan/packet.h>
17 #include <epan/prefs.h>
18 #include <epan/reassemble.h>
19 #include <epan/expert.h>
20 #include <epan/decode_as.h>
21 #include <epan/proto_data.h>
22 #include "packet-bluetooth.h"
23 #include "packet-btrfcomm.h"
24 #include "packet-btl2cap.h"
25 #include "packet-btsdp.h"
26 #include <wsutil/array.h>
28 /* Initialize the protocol and registered fields */
29 static int proto_obex;
30 static int hf_opcode;
31 static int hf_response_code;
32 static int hf_final_flag;
33 static int hf_length;
34 static int hf_version;
35 static int hf_flags;
36 static int hf_constants;
37 static int hf_max_pkt_len;
38 static int hf_set_path_flags_0;
39 static int hf_set_path_flags_1;
40 static int hf_headers;
41 static int hf_header;
42 static int hf_hdr_id;
43 static int hf_hdr_id_encoding;
44 static int hf_hdr_id_meaning;
45 static int hf_hdr_length;
46 static int hf_hdr_val_unicode;
47 static int hf_hdr_val_byte_seq;
48 static int hf_hdr_val_byte;
49 static int hf_hdr_val_long;
50 static int hf_authentication_parameter;
51 static int hf_authentication_parameter_data;
52 static int hf_authentication_challenge_tag;
53 static int hf_authentication_response_tag;
54 static int hf_authentication_key;
55 static int hf_authentication_result_key;
56 static int hf_authentication_user_id;
57 static int hf_authentication_length;
58 static int hf_authentication_info_charset;
59 static int hf_authentication_info;
60 static int hf_authentication_option_reserved;
61 static int hf_authentication_option_user_id;
62 static int hf_authentication_option_read_only;
63 static int hf_application_parameter;
64 static int hf_application_parameter_id;
65 static int hf_application_parameter_length;
66 static int hf_application_parameter_data;
67 static int hf_bpp_application_parameter_id;
68 static int hf_bpp_application_parameter_data_offset;
69 static int hf_bpp_application_parameter_data_count;
70 static int hf_bpp_application_parameter_data_job_id;
71 static int hf_bpp_application_parameter_data_file_size;
72 static int hf_bip_application_parameter_id;
73 static int hf_bip_application_parameter_data_number_of_returned_handles;
74 static int hf_bip_application_parameter_data_list_start_offset;
75 static int hf_bip_application_parameter_data_latest_captured_images;
76 static int hf_bip_application_parameter_data_partial_file_length;
77 static int hf_bip_application_parameter_data_partial_file_start_offset;
78 static int hf_bip_application_parameter_data_total_file_size;
79 static int hf_bip_application_parameter_data_end_flag;
80 static int hf_bip_application_parameter_data_remote_display;
81 static int hf_bip_application_parameter_data_service_id;
82 static int hf_bip_application_parameter_data_store_flag;
83 static int hf_pbap_application_parameter_id;
84 static int hf_pbap_application_parameter_data_order;
85 static int hf_pbap_application_parameter_data_search_value;
86 static int hf_pbap_application_parameter_data_search_attribute;
87 static int hf_pbap_application_parameter_data_max_list_count;
88 static int hf_pbap_application_parameter_data_list_start_offset;
89 static int hf_pbap_application_parameter_data_filter;
90 static int hf_pbap_application_parameter_vcard_selector;
91 static int hf_pbap_application_parameter_data_filter_version;
92 static int hf_pbap_application_parameter_data_filter_fn;
93 static int hf_pbap_application_parameter_data_filter_n;
94 static int hf_pbap_application_parameter_data_filter_photo;
95 static int hf_pbap_application_parameter_data_filter_birthday;
96 static int hf_pbap_application_parameter_data_filter_adr;
97 static int hf_pbap_application_parameter_data_filter_label;
98 static int hf_pbap_application_parameter_data_filter_tel;
99 static int hf_pbap_application_parameter_data_filter_email;
100 static int hf_pbap_application_parameter_data_filter_mailer;
101 static int hf_pbap_application_parameter_data_filter_time_zone;
102 static int hf_pbap_application_parameter_data_filter_geographic_position;
103 static int hf_pbap_application_parameter_data_filter_title;
104 static int hf_pbap_application_parameter_data_filter_role;
105 static int hf_pbap_application_parameter_data_filter_logo;
106 static int hf_pbap_application_parameter_data_filter_agent;
107 static int hf_pbap_application_parameter_data_filter_name_of_organization;
108 static int hf_pbap_application_parameter_data_filter_comments;
109 static int hf_pbap_application_parameter_data_filter_revision;
110 static int hf_pbap_application_parameter_data_filter_pronunciation_of_name;
111 static int hf_pbap_application_parameter_data_filter_url;
112 static int hf_pbap_application_parameter_data_filter_uid;
113 static int hf_pbap_application_parameter_data_filter_key;
114 static int hf_pbap_application_parameter_data_filter_nickname;
115 static int hf_pbap_application_parameter_data_filter_categories;
116 static int hf_pbap_application_parameter_data_filter_product_id;
117 static int hf_pbap_application_parameter_data_filter_class;
118 static int hf_pbap_application_parameter_data_filter_sort_string;
119 static int hf_pbap_application_parameter_data_filter_timestamp;
120 static int hf_pbap_application_parameter_data_filter_reserved_29_31;
121 static int hf_pbap_application_parameter_data_filter_reserved_32_38;
122 static int hf_pbap_application_parameter_data_filter_proprietary_filter;
123 static int hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage;
124 static int hf_pbap_application_parameter_data_format;
125 static int hf_pbap_application_parameter_data_phonebook_size;
126 static int hf_pbap_application_parameter_data_new_missed_calls;
127 static int hf_pbap_application_parameter_data_primary_version_counter;
128 static int hf_pbap_application_parameter_data_secondary_version_counter;
129 static int hf_pbap_application_parameter_data_database_identifier;
130 static int hf_pbap_application_parameter_data_vcard_selector_operator;
131 static int hf_pbap_application_parameter_data_reset_new_missed_calls;
132 static int hf_pbap_application_parameter_data_supported_features;
133 static int hf_pbap_application_parameter_data_supported_features_reserved;
134 static int hf_pbap_application_parameter_data_supported_features_download;
135 static int hf_pbap_application_parameter_data_supported_features_browsing;
136 static int hf_pbap_application_parameter_data_supported_features_database_identifier;
137 static int hf_pbap_application_parameter_data_supported_features_folder_version_counters;
138 static int hf_pbap_application_parameter_data_supported_features_vcard_selecting;
139 static int hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls;
140 static int hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property;
141 static int hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property;
142 static int hf_pbap_application_parameter_data_supported_features_contact_referencing;
143 static int hf_pbap_application_parameter_data_supported_features_default_contact_image_format;
144 static int hf_map_application_parameter_id;
145 static int hf_map_application_parameter_data_max_list_count;
146 static int hf_map_application_parameter_data_start_offset;
147 static int hf_map_application_parameter_data_filter_message_type_reserved;
148 static int hf_map_application_parameter_data_filter_message_type_mms;
149 static int hf_map_application_parameter_data_filter_message_type_email;
150 static int hf_map_application_parameter_data_filter_message_type_sms_cdma;
151 static int hf_map_application_parameter_data_filter_message_type_sms_gsm;
152 static int hf_map_application_parameter_data_filter_period_begin;
153 static int hf_map_application_parameter_data_filter_period_end;
154 static int hf_map_application_parameter_data_filter_read_status_reserved_6;
155 static int hf_map_application_parameter_data_filter_read_status_get_read;
156 static int hf_map_application_parameter_data_filter_read_status_get_unread;
157 static int hf_map_application_parameter_data_filter_recipient;
158 static int hf_map_application_parameter_data_filter_originator;
159 static int hf_map_application_parameter_data_filter_priority_reserved_6;
160 static int hf_map_application_parameter_data_filter_priority_get_high;
161 static int hf_map_application_parameter_data_filter_priority_non_high;
162 static int hf_map_application_parameter_data_reserved_7;
163 static int hf_map_application_parameter_data_attachment;
164 static int hf_map_application_parameter_data_transparent;
165 static int hf_map_application_parameter_data_retry;
166 static int hf_map_application_parameter_data_new_message;
167 static int hf_map_application_parameter_data_notification_status;
168 static int hf_map_application_parameter_data_mas_instance_id;
169 static int hf_map_application_parameter_data_parameter_mask_reserved;
170 static int hf_map_application_parameter_data_parameter_mask_reply_to_addressing;
171 static int hf_map_application_parameter_data_parameter_mask_protected;
172 static int hf_map_application_parameter_data_parameter_mask_sent;
173 static int hf_map_application_parameter_data_parameter_mask_read;
174 static int hf_map_application_parameter_data_parameter_mask_priority;
175 static int hf_map_application_parameter_data_parameter_mask_attachment_size;
176 static int hf_map_application_parameter_data_parameter_mask_text;
177 static int hf_map_application_parameter_data_parameter_mask_reception_status;
178 static int hf_map_application_parameter_data_parameter_mask_size;
179 static int hf_map_application_parameter_data_parameter_mask_type;
180 static int hf_map_application_parameter_data_parameter_mask_recipient_addressing;
181 static int hf_map_application_parameter_data_parameter_mask_recipient_name;
182 static int hf_map_application_parameter_data_parameter_mask_sender_addressing;
183 static int hf_map_application_parameter_data_parameter_mask_sender_name;
184 static int hf_map_application_parameter_data_parameter_mask_datetime;
185 static int hf_map_application_parameter_data_parameter_mask_subject;
186 static int hf_map_application_parameter_data_folder_listing_size;
187 static int hf_map_application_parameter_data_messages_listing_size;
188 static int hf_map_application_parameter_data_subject_length;
189 static int hf_map_application_parameter_data_charset;
190 static int hf_map_application_parameter_data_fraction_request;
191 static int hf_map_application_parameter_data_fraction_deliver;
192 static int hf_map_application_parameter_data_status_indicator;
193 static int hf_map_application_parameter_data_status_value;
194 static int hf_map_application_parameter_data_mse_time;
195 static int hf_gpp_application_parameter_id;
196 static int hf_gpp_application_parameter_data_max_list_count;
197 static int hf_gpp_application_parameter_data_list_start_offset;
198 static int hf_gpp_application_parameter_data_reserved_7;
199 static int hf_gpp_application_parameter_data_notification_status;
200 static int hf_gpp_application_parameter_data_instance_id;
201 static int hf_gpp_application_parameter_data_listing_size;
202 static int hf_ctn_application_parameter_id;
203 static int hf_ctn_application_parameter_data_acoustic_alarm_status;
204 static int hf_ctn_application_parameter_data_attachment;
205 static int hf_ctn_application_parameter_data_send;
206 static int hf_ctn_application_parameter_data_filter_period_begin;
207 static int hf_ctn_application_parameter_data_filter_period_end;
208 static int hf_ctn_application_parameter_data_parameter_mask;
209 static int hf_ctn_application_parameter_data_parameter_mask_reserved;
210 static int hf_ctn_application_parameter_data_parameter_mask_recurrent;
211 static int hf_ctn_application_parameter_data_parameter_mask_send_status;
212 static int hf_ctn_application_parameter_data_parameter_mask_alarm_status;
213 static int hf_ctn_application_parameter_data_parameter_mask_pstatus;
214 static int hf_ctn_application_parameter_data_parameter_mask_priority;
215 static int hf_ctn_application_parameter_data_parameter_mask_originator_address;
216 static int hf_ctn_application_parameter_data_parameter_mask_originator_name;
217 static int hf_ctn_application_parameter_data_parameter_mask_end_time;
218 static int hf_ctn_application_parameter_data_parameter_mask_summary;
219 static int hf_ctn_application_parameter_data_parameter_mask_attachment;
220 static int hf_ctn_application_parameter_data_status_indicator;
221 static int hf_ctn_application_parameter_data_status_value;
222 static int hf_ctn_application_parameter_data_postpone_val;
223 static int hf_ctn_application_parameter_data_email_uri;
224 static int hf_ctn_application_parameter_data_cse_time;
225 static int hf_ctn_application_parameter_data_recurrent;
226 static int hf_ctn_application_parameter_data_attach_id;
227 static int hf_ctn_application_parameter_data_last_update;
228 static int hf_profile;
229 static int hf_type;
230 static int hf_object_class;
231 static int hf_time_iso8601;
232 static int hf_wan_uuid;
233 static int hf_hdr_val_action;
234 static int hf_hdr_val_single_response_mode;
235 static int hf_hdr_val_single_response_mode_parameter;
236 static int hf_session_parameter;
237 static int hf_session_parameter_tag;
238 static int hf_session_parameter_length;
239 static int hf_session_parameter_data;
240 static int hf_session_parameter_nonce;
241 static int hf_session_parameter_session_id;
242 static int hf_session_parameter_next_sequence_number;
243 static int hf_session_parameter_timeout;
244 static int hf_session_parameter_opcode;
245 static int hf_sender_bd_addr;
246 static int hf_count;
247 static int hf_data_length;
248 static int hf_connection_id;
249 static int hf_name;
250 static int hf_current_path;
251 static int hf_request_in_frame;
252 static int hf_response_in_frame;
254 static int * const hfx_hdr_id[] = {
255 &hf_hdr_id_encoding,
256 &hf_hdr_id_meaning,
257 NULL
260 static int * const hfx_pbap_application_parameter_data_filter_1[] = {
261 &hf_pbap_application_parameter_data_filter_reserved_32_38,
262 &hf_pbap_application_parameter_data_filter_proprietary_filter,
263 &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage,
264 NULL
267 static int * const hfx_pbap_application_parameter_data_filter_0[] = {
268 &hf_pbap_application_parameter_data_filter_version,
269 &hf_pbap_application_parameter_data_filter_fn,
270 &hf_pbap_application_parameter_data_filter_n,
271 &hf_pbap_application_parameter_data_filter_photo,
272 &hf_pbap_application_parameter_data_filter_birthday,
273 &hf_pbap_application_parameter_data_filter_adr,
274 &hf_pbap_application_parameter_data_filter_label,
275 &hf_pbap_application_parameter_data_filter_tel,
276 &hf_pbap_application_parameter_data_filter_email,
277 &hf_pbap_application_parameter_data_filter_mailer,
278 &hf_pbap_application_parameter_data_filter_time_zone,
279 &hf_pbap_application_parameter_data_filter_geographic_position,
280 &hf_pbap_application_parameter_data_filter_title,
281 &hf_pbap_application_parameter_data_filter_role,
282 &hf_pbap_application_parameter_data_filter_logo,
283 &hf_pbap_application_parameter_data_filter_agent,
284 &hf_pbap_application_parameter_data_filter_name_of_organization,
285 &hf_pbap_application_parameter_data_filter_comments,
286 &hf_pbap_application_parameter_data_filter_revision,
287 &hf_pbap_application_parameter_data_filter_pronunciation_of_name,
288 &hf_pbap_application_parameter_data_filter_url,
289 &hf_pbap_application_parameter_data_filter_uid,
290 &hf_pbap_application_parameter_data_filter_key,
291 &hf_pbap_application_parameter_data_filter_nickname,
292 &hf_pbap_application_parameter_data_filter_categories,
293 &hf_pbap_application_parameter_data_filter_product_id,
294 &hf_pbap_application_parameter_data_filter_class,
295 &hf_pbap_application_parameter_data_filter_sort_string,
296 &hf_pbap_application_parameter_data_filter_timestamp,
297 &hf_pbap_application_parameter_data_filter_reserved_29_31,
298 NULL
301 static int * const hfx_pbap_application_parameter_data_supported_features[] = {
302 &hf_pbap_application_parameter_data_supported_features_reserved,
303 &hf_pbap_application_parameter_data_supported_features_default_contact_image_format,
304 &hf_pbap_application_parameter_data_supported_features_contact_referencing,
305 &hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property,
306 &hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property,
307 &hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls,
308 &hf_pbap_application_parameter_data_supported_features_vcard_selecting,
309 &hf_pbap_application_parameter_data_supported_features_folder_version_counters,
310 &hf_pbap_application_parameter_data_supported_features_database_identifier,
311 &hf_pbap_application_parameter_data_supported_features_browsing,
312 &hf_pbap_application_parameter_data_supported_features_download,
313 NULL
316 static int * const hfx_ctn_application_parameter_data_parameter_mask[] = {
317 &hf_ctn_application_parameter_data_parameter_mask_reserved,
318 &hf_ctn_application_parameter_data_parameter_mask_recurrent,
319 &hf_ctn_application_parameter_data_parameter_mask_send_status,
320 &hf_ctn_application_parameter_data_parameter_mask_alarm_status,
321 &hf_ctn_application_parameter_data_parameter_mask_pstatus,
322 &hf_ctn_application_parameter_data_parameter_mask_priority,
323 &hf_ctn_application_parameter_data_parameter_mask_originator_address,
324 &hf_ctn_application_parameter_data_parameter_mask_originator_name,
325 &hf_ctn_application_parameter_data_parameter_mask_end_time,
326 &hf_ctn_application_parameter_data_parameter_mask_summary,
327 &hf_ctn_application_parameter_data_parameter_mask_attachment,
328 NULL
331 static expert_field ei_unexpected_data;
332 static expert_field ei_application_parameter_length_bad;
333 static expert_field ei_decoded_as_profile;
335 static dissector_table_t obex_profile_table;
336 static dissector_table_t media_type_dissector_table;
339 /* ************************************************************************* */
340 /* Header values for reassembly */
341 /* ************************************************************************* */
342 static int hf_obex_fragments;
343 static int hf_obex_fragment;
344 static int hf_obex_fragment_overlap;
345 static int hf_obex_fragment_overlap_conflict;
346 static int hf_obex_fragment_multiple_tails;
347 static int hf_obex_fragment_too_long_fragment;
348 static int hf_obex_fragment_error;
349 static int hf_obex_fragment_count;
350 static int hf_obex_reassembled_in;
351 static int hf_obex_reassembled_length;
353 static int ett_obex_fragment;
354 static int ett_obex_fragments;
356 static dissector_handle_t obex_handle;
357 static dissector_handle_t raw_application_parameters_handle;
358 static dissector_handle_t bt_bpp_application_parameters_handle;
359 static dissector_handle_t bt_bip_application_parameters_handle;
360 static dissector_handle_t bt_gpp_application_parameters_handle;
361 static dissector_handle_t bt_ctn_application_parameters_handle;
362 static dissector_handle_t bt_map_application_parameters_handle;
363 static dissector_handle_t bt_pbap_application_parameters_handle;
365 static reassembly_table obex_reassembly_table;
367 static const fragment_items obex_frag_items = {
368 &ett_obex_fragment,
369 &ett_obex_fragments,
370 &hf_obex_fragments,
371 &hf_obex_fragment,
372 &hf_obex_fragment_overlap,
373 &hf_obex_fragment_overlap_conflict,
374 &hf_obex_fragment_multiple_tails,
375 &hf_obex_fragment_too_long_fragment,
376 &hf_obex_fragment_error,
377 &hf_obex_fragment_count,
378 &hf_obex_reassembled_in,
379 &hf_obex_reassembled_length,
380 /* Reassembled data field */
381 NULL,
382 "fragments"
385 /* Initialize the subtree pointers */
386 static int ett_obex;
387 static int ett_obex_hdrs;
388 static int ett_obex_hdr;
389 static int ett_obex_hdr_id;
390 static int ett_obex_filter;
391 static int ett_obex_parameter;
392 static int ett_obex_session_parameters;
393 static int ett_obex_application_parameters;
394 static int ett_obex_authentication_parameters;
396 static wmem_tree_t *obex_path;
397 static wmem_tree_t *obex_profile;
398 static wmem_tree_t *obex_last_opcode;
400 static dissector_handle_t http_handle;
401 static dissector_handle_t xml_handle;
402 static dissector_handle_t data_handle;
403 static dissector_handle_t data_text_lines_handle;
405 static const char *path_unknown = "?";
406 static const char *path_root = "/";
408 typedef struct _obex_proto_data_t {
409 uint32_t interface_id;
410 uint32_t adapter_id;
411 uint32_t chandle;
412 uint32_t channel;
413 } obex_proto_data_t;
415 typedef struct _ext_value_string {
416 uint8_t value[16];
417 int length;
418 const char *strptr;
419 } ext_value_string;
421 typedef struct _obex_path_data_t {
422 uint32_t interface_id;
423 uint32_t adapter_id;
424 uint32_t chandle;
425 uint32_t channel;
426 /* TODO: add OBEX ConnectionId */
428 const char *path;
429 } obex_path_data_t;
431 typedef struct _obex_profile_data_t {
432 uint32_t interface_id;
433 uint32_t adapter_id;
434 uint32_t chandle;
435 uint32_t channel;
436 /* TODO: add OBEX ConnectionId */
438 int profile;
439 } obex_profile_data_t;
441 typedef struct _obex_last_opcode_data_t {
442 uint32_t interface_id;
443 uint32_t adapter_id;
444 uint32_t chandle;
445 uint32_t channel;
446 /* TODO: add OBEX ConnectionId */
447 int code;
449 bool final_flag;
451 uint32_t request_in_frame;
452 uint32_t response_in_frame;
454 union {
455 struct {
456 const char *name;
457 bool go_up;
458 } set_data;
459 struct {
460 char *type;
461 char *name;
462 } get_put;
463 } data;
464 } obex_last_opcode_data_t;
467 #define PROFILE_UNKNOWN 0
468 #define PROFILE_OPP 1
469 #define PROFILE_FTP 2
470 #define PROFILE_SYNCML 3
471 #define PROFILE_PBAP 4
472 #define PROFILE_MAP 5
473 #define PROFILE_BIP 6
474 #define PROFILE_BPP 7
475 #define PROFILE_SYNC 8
476 #define PROFILE_CTN 9
477 #define PROFILE_GPP 10
479 #define PROTO_DATA_MEDIA_TYPE 0x00
480 #define PROTO_DATA_OBEX_PROFILE 0x01
482 static const value_string profile_vals[] = {
483 { PROFILE_UNKNOWN, "Unknown" },
484 { PROFILE_OPP, "OPP" },
485 { PROFILE_FTP, "FTP" },
486 { PROFILE_SYNCML, "SyncML" },
487 { PROFILE_PBAP, "PBAP" },
488 { PROFILE_MAP, "MAP" },
489 { PROFILE_BIP, "BIP" },
490 { PROFILE_BPP, "BPP" },
491 { PROFILE_SYNC, "SYNC" },
492 { PROFILE_CTN, "CTN" },
493 { PROFILE_GPP, "GPP" },
494 { 0, NULL }
496 static value_string_ext(profile_vals_ext) = VALUE_STRING_EXT_INIT(profile_vals);
499 static const ext_value_string target_vals[] = {
500 { { 0xF9, 0xEC, 0x7B, 0xC4, 0x95, 0x3C, 0x11, 0xD2, 0x98, 0x4E, 0x52, 0x54, 0x00, 0xDC, 0x9E, 0x09 }, 16, "Folder Browsing" },
501 { { 0x79, 0x61, 0x35, 0xf0, 0xf0, 0xc5, 0x11, 0xd8, 0x09, 0x66, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Phone Book Access Profile" },
502 { { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02 }, 16, "SyncML" },
503 { { 0xE3, 0x3D, 0x95, 0x45, 0x83, 0x74, 0x4A, 0xD7, 0x9E, 0xC5, 0xC1, 0x6B, 0xE3, 0x1E, 0xDE, 0x8E }, 16, "Basic Imaging Profile - Push" },
504 { { 0x8E, 0xE9, 0xB3, 0xD0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Pull" },
505 { { 0x92, 0x35, 0x33, 0x50, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Advanced Printing" },
506 { { 0x94, 0x01, 0x26, 0xC0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Automativ Archive" },
507 { { 0x94, 0x7E, 0x74, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Camera" },
508 { { 0x94, 0xC7, 0xCD, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Display" },
509 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile- Referenced Objects" },
510 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile - Archived Objects" },
511 { { 0xbb, 0x58, 0x2b, 0x40, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Access Service" },
512 { { 0xbb, 0x58, 0x2b, 0x41, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Notification Service" },
513 { { 0x00, 0x00, 0x11, 0x18, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Direct Printing Service" },
514 { { 0x00, 0x00, 0x11, 0x19, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reference Printing Service" },
515 { { 0x00, 0x00, 0x11, 0x20, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Direct Printing Referenced Objects Service" },
516 { { 0x00, 0x00, 0x11, 0x21, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reflected UI" },
517 { { 0x00, 0x00, 0x11, 0x22, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Basic Printing" },
518 { { 0x00, 0x00, 0x11, 0x23, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Printing Status" },
519 { { "IRMC-SYNC" }, 9, "Synchronization Profile" },
520 { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, NULL },
523 /* This table must map targets from "target_vals" to profile */
524 static const int target_to_profile[] = {
525 PROFILE_FTP,
526 PROFILE_PBAP,
527 PROFILE_SYNCML,
528 PROFILE_BIP,
529 PROFILE_BIP,
530 PROFILE_BIP,
531 PROFILE_BIP,
532 PROFILE_BIP,
533 PROFILE_BIP,
534 PROFILE_BIP,
535 PROFILE_BIP,
536 PROFILE_MAP,
537 PROFILE_MAP,
538 PROFILE_BPP,
539 PROFILE_BPP,
540 PROFILE_BPP,
541 PROFILE_BPP,
542 PROFILE_BPP,
543 PROFILE_BPP,
544 PROFILE_SYNC
547 static const value_string version_vals[] = {
548 { 0x10, "1.0" },
549 { 0x11, "1.1" },
550 { 0x12, "1.2" },
551 { 0x13, "1.3" },
552 { 0x20, "2.0" },
553 { 0x21, "2.1" },
554 { 0, NULL }
557 static const value_string header_id_encoding_vals[] = {
558 { 0x00, "Null terminated Unicode text, length prefixed with 2 byte Unsigned Integer" },
559 { 0x01, "Byte sequence, length prefixed with 2 byte Unsigned Integer" },
560 { 0x02, "1 byte quantity" },
561 { 0x03, "4 byte quantity (network order)" },
562 { 0, NULL }
565 #define OBEX_CODE_VALS_CONNECT 0x00
566 #define OBEX_CODE_VALS_DISCONNECT 0x01
567 #define OBEX_CODE_VALS_PUT 0x02
568 #define OBEX_CODE_VALS_GET 0x03
569 #define OBEX_CODE_VALS_SET_PATH 0x05
570 #define OBEX_CODE_VALS_CONTINUE 0x10
571 #define OBEX_CODE_VALS_SUCCESS 0x20
572 #define OBEX_CODE_VALS_ABORT 0x7F
573 #define OBEX_CODE_VALS_MASK 0x7F
575 static const value_string code_vals[] = {
576 { 0x00, "Connect" },
577 { 0x01, "Disconnect" },
578 { 0x02, "Put" },
579 { 0x03, "Get"},
580 { 0x05, "Set Path" },
581 { 0x06, "Action" },
582 { 0x07, "Session" },
583 { 0x10, "Continue" },
584 { 0x20, "Success" },
585 { 0x21, "Created" },
586 { 0x22, "Accepted" },
587 { 0x23, "Non-Authoritative Information" },
588 { 0x24, "No Content" },
589 { 0x25, "Reset Content" },
590 { 0x26, "Partial Content" },
591 { 0x30, "Multiple Choices" },
592 { 0x31, "Moved Permanently" },
593 { 0x32, "Moved Temporarily" },
594 { 0x33, "See Other" },
595 { 0x34, "Not Modified" },
596 { 0x35, "Use Proxy" },
597 { 0x40, "Bad Request" },
598 { 0x41, "Unauthorised" },
599 { 0x42, "Payment Required" },
600 { 0x43, "Forbidden" },
601 { 0x44, "Not Found" },
602 { 0x45, "Method Not Allowed" },
603 { 0x46, "Not Acceptable" },
604 { 0x47, "Proxy Authentication Required" },
605 { 0x48, "Request Timeout" },
606 { 0x49, "Conflict" },
607 { 0x4a, "Gone" },
608 { 0x4b, "Length Required" },
609 { 0x4c, "Precondition Failed" },
610 { 0x4d, "Requested Entity Too Large" },
611 { 0x4e, "Requested URL Too Large" },
612 { 0x4f, "Unsupported Media Type" },
613 { 0x50, "Internal Server Error" },
614 { 0x51, "Not Implemented" },
615 { 0x52, "Bad Gateway" },
616 { 0x53, "Service Unavailable" },
617 { 0x54, "Gateway Timeout" },
618 { 0x55, "HTTP Version Not Supported" },
619 { 0x60, "Database Full" },
620 { 0x61, "Database Locked" },
621 { OBEX_CODE_VALS_ABORT, "Abort" },
622 { 0, NULL }
624 static value_string_ext(code_vals_ext) = VALUE_STRING_EXT_INIT(code_vals);
626 static const value_string header_id_meaning_vals[] = {
627 { 0x00, "Count" },
628 { 0x01, "Name" },
629 { 0x02, "Type" },
630 { 0x03, "Length" },
631 { 0x04, "Time" },
632 { 0x05, "Description" },
633 { 0x06, "Target" },
634 { 0x07, "HTTP" },
635 { 0x08, "Body" },
636 { 0x09, "End Of Body" },
637 { 0x0A, "Who" },
638 { 0x0B, "Connection Id" },
639 { 0x0C, "Application Parameters" },
640 { 0x0D, "Authentication Challenge" },
641 { 0x0E, "Authentication Response" },
642 { 0x0F, "Creator" },
643 { 0x10, "WAN UUID" },
644 { 0x11, "Object Class" },
645 { 0x12, "Session Parameter" },
646 { 0x13, "Session Sequence Number" },
647 { 0x14, "Action" },
648 { 0x15, "Destination Name" },
649 { 0x16, "Permissions" },
650 { 0x17, "Single Response Mode" },
651 { 0x18, "Single Response Mode Parameter" },
652 { 0x30, "User Defined" },
653 { 0x31, "User Defined" },
654 { 0x32, "User Defined" },
655 { 0x33, "User Defined" },
656 { 0x34, "User Defined" },
657 { 0x35, "User Defined" },
658 { 0x36, "User Defined" },
659 { 0x37, "User Defined" },
660 { 0x38, "User Defined" },
661 { 0x39, "User Defined" },
662 { 0x3A, "User Defined" },
663 { 0x3B, "User Defined" },
664 { 0x3C, "User Defined" },
665 { 0x3D, "User Defined" },
666 { 0x3E, "User Defined" },
667 { 0x3F, "User Defined" },
668 { 0, NULL }
671 static const value_string header_id_vals[] = {
672 /* 0x00 - 0x3F - Null terminated Unicode text, length prefixed with 2 byte Unsigned Integer */
673 { 0x01, "Name" },
674 { 0x05, "Description" },
675 { 0x15, "Destination Name" },
676 { 0x30, "User Defined" },
677 { 0x31, "User Defined" },
678 { 0x32, "User Defined" },
679 { 0x33, "User Defined" },
680 { 0x34, "User Defined" },
681 { 0x35, "User Defined" },
682 { 0x36, "User Defined" },
683 { 0x37, "User Defined" },
684 { 0x38, "User Defined" },
685 { 0x39, "User Defined" },
686 { 0x3a, "User Defined" },
687 { 0x3b, "User Defined" },
688 { 0x3c, "User Defined" },
689 { 0x3d, "User Defined" },
690 { 0x3e, "User Defined" },
691 { 0x3f, "User Defined" },
692 /* 0x40 - 0x07F - Byte sequence, length prefixed with 2 byte Unsigned Integer */
693 { 0x42, "Type" },
694 { 0x44, "Time (ISO8601)" },
695 { 0x46, "Target" },
696 { 0x47, "HTTP" },
697 { 0x48, "Body" },
698 { 0x49, "End Of Body" },
699 { 0x4a, "Who" },
700 { 0x4c, "Application Parameters" },
701 { 0x4d, "Authentication Challenge" },
702 { 0x4e, "Authentication Response" },
703 { 0x50, "WAN UUID" },
704 { 0x51, "Object Class" },
705 { 0x52, "Session Parameter" },
706 /* 0x80 - 0xBF - 1 byte quantity */
707 { 0x93, "Session Sequence Number" },
708 { 0x94, "Action" },
709 { 0x97, "Single Response Mode" },
710 { 0x98, "Single Response Mode Parameter" },
711 /* 0xC0 - 0xFF - 4 byte quantity (network order) */
712 { 0xc0, "Count" },
713 { 0xc3, "Length" },
714 { 0xc4, "Time (UNIX)" },
715 { 0xcb, "Connection Id" },
716 { 0xcf, "Creator" },
717 { 0xd6, "Permissions" },
718 { 0, NULL }
720 static value_string_ext header_id_vals_ext = VALUE_STRING_EXT_INIT(header_id_vals);
722 static const value_string map_application_parameters_vals[] = {
723 { 0x01, "Max List Count" },
724 { 0x02, "Start Offset" },
725 { 0x03, "Filter Message Type" },
726 { 0x04, "Filter Period Begin" },
727 { 0x05, "End Filter PeriodEnd" },
728 { 0x06, "Filter Read Status" },
729 { 0x07, "Filter Recipient" },
730 { 0x08, "Filter Originator" },
731 { 0x09, "Filter Priority" },
732 { 0x0A, "Attachment" },
733 { 0x0B, "Transparent" },
734 { 0x0C, "Retry" },
735 { 0x0D, "New Message" },
736 { 0x0E, "Notification Status" },
737 { 0x0F, "MAS Instance ID" },
738 { 0x10, "Parameter Mask" },
739 { 0x11, "Folder Listing Size" },
740 { 0x12, "Messages Listing Size" },
741 { 0x13, "Subject Length" },
742 { 0x14, "Charset" },
743 { 0x15, "Fraction Request" },
744 { 0x16, "Fraction Deliver" },
745 { 0x17, "Status Indicator" },
746 { 0x18, "Status Value" },
747 { 0x19, "MSE Time" },
748 { 0, NULL }
751 static const value_string pbap_application_parameters_vals[] = {
752 { 0x01, "Order" },
753 { 0x02, "Search Value" },
754 { 0x03, "Search Attribute" },
755 { 0x04, "Max List Count" },
756 { 0x05, "List Start Offset" },
757 { 0x06, "Filter" },
758 { 0x07, "Format" },
759 { 0x08, "Phonebook Size" },
760 { 0x09, "New Missed Calls" },
761 { 0x0A, "Primary Version Counter" },
762 { 0x0B, "Secondary Version Counter" },
763 { 0x0C, "vCard Selector" },
764 { 0x0D, "Database Identifier" },
765 { 0x0E, "vCard Selector Operator" },
766 { 0x0F, "Reset New Missed Calls" },
767 { 0x10, "PBAP Supported Features" },
768 { 0, NULL }
771 static const value_string bpp_application_parameters_vals[] = {
772 { 0x01, "Offset" },
773 { 0x02, "Count" },
774 { 0x03, "Job ID" },
775 { 0x04, "File Size" },
776 { 0, NULL }
779 static const value_string bip_application_parameters_vals[] = {
780 { 0x01, "Number of Returned Handles" },
781 { 0x02, "List Start Offset" },
782 { 0x03, "Latest Captures Images" },
783 { 0x04, "Partial File Length" },
784 { 0x05, "Partial File Start Offset" },
785 { 0x06, "Total File Size" },
786 { 0x07, "End Flag" },
787 { 0x08, "Remote Display" },
788 { 0x09, "Service ID" },
789 { 0x0A, "Store Flag" },
790 { 0, NULL }
793 static const value_string gpp_application_parameters_vals[] = {
794 { 0x41, "Max List Count" },
795 { 0x42, "List Start Offset" },
796 { 0x43, "Notification Status" },
797 { 0x44, "Instance ID" },
798 { 0x46, "Listing Size" },
799 { 0, NULL }
802 static const value_string ctn_application_parameters_vals[] = {
803 { 0x01, "Acoustic Alarm Status" },
804 { 0x02, "Attachment" },
805 { 0x03, "Send" },
806 { 0x04, "Filter Period Begin" },
807 { 0x05, "Filter Period End" },
808 { 0x06, "Parameter Mask" },
809 { 0x07, "Status Indicator" },
810 { 0x08, "Status Value" },
811 { 0x09, "Postpone Val" },
812 { 0x0A, "Email URI" },
813 { 0x0B, "CSE Time" },
814 { 0x0C, "Recurrent" },
815 { 0x0D, "Attach ID" },
816 { 0x0E, "Last Update" },
817 { 0x41, "Max List Count" },
818 { 0x42, "List Start Offset" },
819 { 0x43, "Notification Status" },
820 { 0x44, "Instance ID" },
821 { 0x46, "Listing Size" },
822 { 0, NULL }
825 static const value_string bip_remote_display_vals[] = {
826 { 0x01, "Next Image" },
827 { 0x02, "Previous Image" },
828 { 0x03, "Select Image" },
829 { 0x04, "Current Image" },
830 { 0, NULL }
833 static const value_string pbap_order_vals[] = {
834 { 0x00, "Indexed" },
835 { 0x01, "Alphanumeric" },
836 { 0x02, "Phonetic" },
837 { 0, NULL }
840 static const value_string pbap_format_vals[] = {
841 { 0x00, "2.1" },
842 { 0x01, "3.0" },
843 { 0, NULL }
846 static const value_string pbap_search_attribute_vals[] = {
847 { 0x00, "Name" },
848 { 0x01, "Number" },
849 { 0x02, "Sound" },
850 { 0, NULL }
853 static const value_string map_charset_vals[] = {
854 { 0x00, "Native" },
855 { 0x01, "UTF-8" },
856 { 0, NULL }
859 static const value_string map_fraction_request_vals[] = {
860 { 0x00, "First" },
861 { 0x01, "Next" },
862 { 0, NULL }
865 static const value_string map_fraction_deliver_vals[] = {
866 { 0x00, "More" },
867 { 0x01, "Last" },
868 { 0, NULL }
871 static const value_string map_status_indicator_vals[] = {
872 { 0x00, "Read Status" },
873 { 0x01, "Deleted Status" },
874 { 0, NULL }
877 static const value_string authentication_challenge_tag_vals[] = {
878 { 0x00, "Key" },
879 { 0x01, "Options" },
880 { 0x02, "Info" },
881 { 0, NULL }
884 static const value_string authentication_response_tag_vals[] = {
885 { 0x00, "Result Key" },
886 { 0x01, "User ID" },
887 { 0x02, "Key" },
888 { 0, NULL }
891 static const value_string info_charset_vals[] = {
892 { 0x00, "ASCII" },
893 { 0xFF, "Unicode" },
894 { 0, NULL }
897 static const value_string action_vals[] = {
898 { 0x00, "Copy" },
899 { 0x01, "Move" },
900 { 0x02, "Set Permission" },
901 { 0, NULL }
904 static const value_string single_response_mode_vals[] = {
905 { 0x00, "Disable" },
906 { 0x01, "Enable" },
907 { 0x02, "Indicate" },
908 { 0, NULL }
911 static const value_string single_response_mode_parameter_vals[] = {
912 { 0x00, "Next" },
913 { 0x01, "Wait" },
914 { 0x02, "Next and Wait" },
915 { 0, NULL }
918 static const value_string session_tag_vals[] = {
919 { 0x00, "Device Address" },
920 { 0x01, "Nonce" },
921 { 0x02, "Session ID" },
922 { 0x03, "Next Sequence Number" },
923 { 0x04, "Timeout" },
924 { 0x05, "Session Opcode" },
925 { 0, NULL }
928 static const value_string session_opcode_vals[] = {
929 { 0x00, "Create Session" },
930 { 0x01, "Close Session" },
931 { 0x02, "Suspend Session" },
932 { 0x03, "Resume Session" },
933 { 0x04, "Set Timeout" },
934 { 0, NULL }
937 static const value_string pbap_application_parameter_data_vcard_selector_operator_vals[] = {
938 { 0x00, "Or" },
939 { 0x01, "And" },
940 { 0, NULL }
943 static const value_string pbap_application_parameter_data_reset_new_missed_calls_vals[] = {
944 { 0x01, "Reset" },
945 { 0, NULL }
948 static const value_string off_on_vals[] = {
949 { 0x00, "Off" },
950 { 0x01, "On" },
951 { 0, NULL }
954 static const value_string no_yes_vals[] = {
955 { 0x00, "No" },
956 { 0x01, "Yes" },
957 { 0, NULL }
960 static const value_string ctn_application_parameter_data_attachment_vals[] = {
961 { 0x00, "On" },
962 { 0x01, "Off" },
963 { 0x02, "Selected" },
964 { 0, NULL }
967 static const value_string ctn_application_parameter_data_status_indicator_vals[] = {
968 { 0x00, "pStatus" },
969 { 0x01, "Alarm Status" },
970 { 0x02, "Send Status" },
971 { 0x03, "Deleted Status" },
972 { 0, NULL }
975 static const value_string ctn_application_parameter_data_status_value_vals[] = {
976 { 0x00, "No" },
977 { 0x01, "Yes" },
978 { 0x02, "Postpone" },
979 { 0x03, "Tentative" },
980 { 0x04, "Needs-action" },
981 { 0x05, "Accepted" },
982 { 0x06, "Declined" },
983 { 0x07, "Delegated" },
984 { 0x08, "Completed" },
985 { 0x09, "In-progress" },
986 { 0, NULL }
989 static value_string_ext map_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(map_application_parameters_vals);
990 static value_string_ext pbap_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(pbap_application_parameters_vals);
991 static value_string_ext bpp_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(bpp_application_parameters_vals);
992 static value_string_ext bip_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(bip_application_parameters_vals);
994 void proto_register_obex(void);
995 void proto_reg_handoff_obex(void);
997 static void
998 save_path(packet_info *pinfo, const char *current_path, const char *name,
999 bool go_up, obex_proto_data_t *obex_proto_data)
1002 /* On Connect response sets "/"
1003 On SetPath sets what is needed
1005 if (!pinfo->fd->visited) {
1006 obex_path_data_t *obex_path_data;
1007 wmem_tree_key_t key[6];
1008 uint32_t frame_number;
1009 const char *path = path_unknown;
1011 frame_number = pinfo->num;
1013 key[0].length = 1;
1014 key[0].key = &obex_proto_data->interface_id;
1015 key[1].length = 1;
1016 key[1].key = &obex_proto_data->adapter_id;
1017 key[2].length = 1;
1018 key[2].key = &obex_proto_data->chandle;
1019 key[3].length = 1;
1020 key[3].key = &obex_proto_data->channel;
1021 key[4].length = 1;
1022 key[4].key = &frame_number;
1023 key[5].length = 0;
1024 key[5].key = NULL;
1026 obex_path_data = wmem_new(wmem_file_scope(), obex_path_data_t);
1027 obex_path_data->interface_id = obex_proto_data->interface_id;
1028 obex_path_data->adapter_id = obex_proto_data->adapter_id;
1029 obex_path_data->chandle = obex_proto_data->chandle;
1030 obex_path_data->channel = obex_proto_data->channel;
1032 if (go_up == true) {
1033 if (current_path != path_unknown && current_path != path_root) {
1034 char *i_path;
1036 i_path = g_strrstr(current_path, "/");
1037 if (!i_path) {
1038 current_path = path_unknown;
1039 } else {
1040 if (i_path == current_path)
1041 path = current_path = path_root;
1042 else
1043 path = current_path = wmem_strndup(wmem_epan_scope(), current_path, i_path - current_path - 1);
1048 if (name && *name == '\0')
1049 path = path_root;
1050 else if (name && current_path == path_root)
1051 path = wmem_strdup_printf(wmem_file_scope(), "/%s", name);
1052 else if (name)
1053 path = wmem_strdup_printf(wmem_file_scope(), "%s/%s", current_path, name);
1055 obex_path_data->path = path;
1057 wmem_tree_insert32_array(obex_path, key, obex_path_data);
1061 static void media_type_prompt(packet_info *pinfo, char* result)
1063 char *value_data;
1065 value_data = (char *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE);
1066 if (value_data)
1067 snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Media Type %s as", (char *) value_data);
1068 else
1069 snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown Media Type");
1072 static void *media_type_value(packet_info *pinfo)
1074 char *value_data;
1076 value_data = (char *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE);
1078 if (value_data)
1079 return (void *) value_data;
1081 return NULL;
1084 static void obex_profile_prompt(packet_info *pinfo, char* result)
1086 uint8_t *value_data;
1088 value_data = (uint8_t *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_OBEX_PROFILE);
1089 if (value_data)
1090 snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "OBEX Profile 0x%04x as", (unsigned) *value_data);
1091 else
1092 snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown OBEX Profile");
1095 static void *obex_profile_value(packet_info *pinfo)
1097 uint8_t *value_data;
1099 value_data = (uint8_t *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_OBEX_PROFILE);
1101 if (value_data)
1102 return GUINT_TO_POINTER((unsigned long)*value_data);
1104 return NULL;
1107 static int
1108 is_ascii_str(const uint8_t *str, int length)
1110 int i;
1112 if ((length < 1) || (str[length-1] != '\0'))
1113 return 0;
1115 for(i=0; i<length-1; i++) {
1116 if ((str[i] < 0x20) && (str[i] != 0x0a)) /* not strict ascii */
1117 break;
1120 if (i < (length-1))
1121 return 0;
1123 return 1;
1126 static int
1127 dissect_obex_application_parameter_raw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
1129 proto_item *parameter_item;
1130 proto_tree *parameter_tree;
1131 uint8_t parameter_id;
1132 int offset = 0;
1133 int parameters_length;
1134 int parameter_length;
1136 parameters_length = tvb_reported_length(tvb);
1138 while (parameters_length > 0) {
1139 parameter_id = tvb_get_uint8(tvb, offset);
1140 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset,
1141 tvb_captured_length_remaining(tvb, offset), "Parameter: 0x%02x", parameter_id);
1142 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1144 proto_tree_add_item(parameter_tree, hf_application_parameter_id, tvb, offset,
1145 1, ENC_BIG_ENDIAN);
1146 offset += 1;
1148 proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset,
1149 1, ENC_BIG_ENDIAN);
1150 parameter_length = tvb_get_uint8(tvb, offset);
1151 proto_item_set_len(parameter_item, parameter_length + 2);
1152 offset += 1;
1154 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset,
1155 parameter_length, ENC_NA);
1157 parameters_length -= 2 + parameter_length;
1158 offset += parameter_length;
1161 return offset;
1164 static int
1165 dissect_obex_application_parameter_bt_bpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1167 proto_item *item;
1168 proto_item *parameter_item;
1169 proto_tree *parameter_tree;
1170 uint8_t parameter_id;
1171 int offset = 0;
1172 int parameters_length;
1173 int parameter_length;
1175 parameters_length = tvb_reported_length(tvb);
1177 while (parameters_length > 0) {
1178 parameter_id = tvb_get_uint8(tvb, offset);
1179 parameter_length = tvb_get_uint8(tvb, offset + 1);
1181 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1182 "Parameter: %s", val_to_str_const(parameter_id,
1183 bpp_application_parameters_vals, "Unknown"));
1184 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1186 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1187 offset += 1;
1189 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1190 offset += 1;
1192 if (parameter_length != 4) {
1193 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1194 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1195 "According to the specification this parameter length should be 4, but there is %i", parameter_length);
1196 } else switch (parameter_id) {
1197 case 0x01:
1198 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_offset, tvb, offset, 4, ENC_BIG_ENDIAN);
1199 break;
1200 case 0x02:
1201 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_count, tvb, offset, 4, ENC_BIG_ENDIAN);
1202 break;
1203 case 0x03:
1204 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_job_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1205 break;
1206 case 0x04:
1207 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_file_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1208 break;
1209 default:
1210 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1213 parameters_length -= 2 + parameter_length;
1214 offset += parameter_length;
1217 return offset;
1220 static int
1221 dissect_obex_application_parameter_bt_bip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1223 proto_item *item;
1224 proto_item *parameter_item;
1225 proto_tree *parameter_tree;
1226 uint8_t parameter_id;
1227 int offset = 0;
1228 int parameters_length;
1229 int parameter_length;
1230 static int required_length_map[] = {0, 2, 2, 1, 4, 4, 4, 1, 1, 16, 1};
1232 parameters_length = tvb_reported_length(tvb);
1234 while (parameters_length > 0) {
1235 parameter_id = tvb_get_uint8(tvb, offset);
1236 parameter_length = tvb_get_uint8(tvb, offset + 1);
1238 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1239 "Parameter: %s", val_to_str_const(parameter_id,
1240 bip_application_parameters_vals, "Unknown"));
1241 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1243 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1244 offset += 1;
1246 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1247 offset += 1;
1249 if (parameter_id < array_length(required_length_map) &&
1250 required_length_map[parameter_id] != parameter_length) {
1251 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1252 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1253 "According to the specification this parameter length should be %i, but there is %i",
1254 required_length_map[parameter_id], parameter_length);
1255 } else switch (parameter_id) {
1256 case 0x01:
1257 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_number_of_returned_handles, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1258 break;
1259 case 0x02:
1260 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_list_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1261 break;
1262 case 0x03:
1263 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_latest_captured_images, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1264 break;
1265 case 0x04:
1266 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_partial_file_length, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1267 break;
1268 case 0x05:
1269 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_partial_file_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1270 break;
1271 case 0x06:
1272 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_total_file_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1273 break;
1274 case 0x07:
1275 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_end_flag, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1276 break;
1277 case 0x08:
1278 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_remote_display, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1279 break;
1280 case 0x09:
1281 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_service_id, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1282 break;
1283 case 0x0A:
1284 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_store_flag, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1285 break;
1286 default:
1287 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1290 parameters_length -= 2 + parameter_length;
1291 offset += parameter_length;
1294 return offset;
1297 static int
1298 dissect_obex_application_parameter_bt_pbap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1300 proto_item *item;
1301 proto_item *parameter_item;
1302 proto_tree *parameter_tree;
1303 uint8_t parameter_id;
1304 int offset = 0;
1305 int parameters_length;
1306 int parameter_length;
1307 static int required_length_map[] = {0, 1, -1, 1, 2, 2, 8, 1, 2, 1, 16, 16, 8, 16, 1, 1};
1309 parameters_length = tvb_reported_length(tvb);
1311 while (parameters_length > 0) {
1312 parameter_id = tvb_get_uint8(tvb, offset);
1313 parameter_length = tvb_get_uint8(tvb, offset + 1);
1315 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1316 "Parameter: %s", val_to_str_const(parameter_id,
1317 pbap_application_parameters_vals, "Unknown"));
1318 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1320 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1321 offset += 1;
1323 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1324 offset += 1;
1326 if (parameter_id < array_length(required_length_map) &&
1327 required_length_map[parameter_id] != -1 &&
1328 required_length_map[parameter_id] != parameter_length) {
1329 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1330 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1331 "According to the specification this parameter length should be %i, but there is %i",
1332 required_length_map[parameter_id], parameter_length);
1333 } else switch (parameter_id) {
1334 case 0x01: /* Order */
1335 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_order, tvb, offset, 1, ENC_BIG_ENDIAN);
1336 break;
1337 case 0x02: /* Search Value */
1338 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_search_value, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1339 break;
1340 case 0x03: /* Search Attribute */
1341 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_search_attribute, tvb, offset, 1, ENC_BIG_ENDIAN);
1342 break;
1343 case 0x04: /* Max List Count */
1344 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_max_list_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1345 break;
1346 case 0x05: /* List Start Offset */
1347 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_list_start_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1348 break;
1349 case 0x06: /* Filter */
1350 proto_tree_add_bitmask(parameter_tree, tvb, offset + 0, hf_pbap_application_parameter_data_filter, ett_obex_filter, hfx_pbap_application_parameter_data_filter_1, ENC_BIG_ENDIAN);
1351 proto_tree_add_bitmask(parameter_tree, tvb, offset + 4, hf_pbap_application_parameter_data_filter, ett_obex_filter, hfx_pbap_application_parameter_data_filter_0, ENC_BIG_ENDIAN);
1352 break;
1353 case 0x07: /* Format */
1354 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_format, tvb, offset, 1, ENC_NA);
1355 break;
1356 case 0x08: /* Phonebook Size */
1357 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_phonebook_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1358 break;
1359 case 0x09: /* New Missed Calls */
1360 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_new_missed_calls, tvb, offset, 1, ENC_NA);
1361 break;
1362 case 0x0A: /* Primary Version Counter */
1363 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_primary_version_counter, tvb, offset, 16, ENC_NA);
1364 break;
1365 case 0x0B: /* Secondary Version Counter */
1366 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_secondary_version_counter, tvb, offset, 16, ENC_NA);
1367 break;
1368 case 0x0C: /* vCard Selector */
1369 proto_tree_add_bitmask(parameter_tree, tvb, offset + 0, hf_pbap_application_parameter_vcard_selector, ett_obex_filter, hfx_pbap_application_parameter_data_filter_1, ENC_BIG_ENDIAN);
1370 proto_tree_add_bitmask(parameter_tree, tvb, offset + 4, hf_pbap_application_parameter_vcard_selector, ett_obex_filter, hfx_pbap_application_parameter_data_filter_0, ENC_BIG_ENDIAN);
1371 break;
1372 case 0x0D: /* Database Identifier */
1373 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_database_identifier, tvb, offset, 16, ENC_NA);
1374 break;
1375 case 0x0E: /* vCard Selector Operator */
1376 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_vcard_selector_operator, tvb, offset, 1, ENC_NA);
1377 break;
1378 case 0x0F: /* Reset New Missed Calls */
1379 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_reset_new_missed_calls, tvb, offset, 1, ENC_NA);
1380 break;
1381 case 0x10: /* PBAP Supported Features */
1382 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_pbap_application_parameter_data_supported_features, ett_obex_parameter, hfx_pbap_application_parameter_data_supported_features, ENC_BIG_ENDIAN);
1383 break;
1384 default:
1385 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1388 parameters_length -= 2 + parameter_length;
1389 offset += parameter_length;
1392 return offset;
1395 static int
1396 dissect_obex_application_parameter_bt_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1398 proto_item *item;
1399 proto_item *parameter_item;
1400 proto_tree *parameter_tree;
1401 uint8_t parameter_id;
1402 int offset = 0;
1403 int parameters_length;
1404 int parameter_length;
1405 static int required_length_map[] = {0, 2, 2, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 4, 2, 2, 1, 1, 1, 1, 1, 1, -1};
1407 parameters_length = tvb_reported_length(tvb);
1409 while (parameters_length > 0) {
1410 parameter_id = tvb_get_uint8(tvb, offset);
1411 parameter_length = tvb_get_uint8(tvb, offset + 1);
1413 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1414 "Parameter: %s", val_to_str_const(parameter_id,
1415 map_application_parameters_vals, "Unknown"));
1416 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1418 proto_tree_add_item(parameter_tree, hf_map_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1419 offset += 1;
1421 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1422 offset += 1;
1424 if (parameter_id < array_length(required_length_map) &&
1425 required_length_map[parameter_id] != -1 &&
1426 required_length_map[parameter_id] != parameter_length) {
1427 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1428 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1429 "According to the specification this parameter length should be %i, but there is %i",
1430 required_length_map[parameter_id], parameter_length);
1431 } else switch (parameter_id) {
1432 case 0x01:
1433 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_max_list_count, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1434 break;
1435 case 0x02:
1436 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1437 break;
1438 case 0x03:
1439 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_message_type_reserved, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1440 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_message_type_mms, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1441 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_message_type_email, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1442 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_message_type_sms_cdma, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1443 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_message_type_sms_gsm, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1444 break;
1445 case 0x04:
1446 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_period_begin, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1447 break;
1448 case 0x05:
1449 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_period_end, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1450 break;
1451 case 0x06:
1452 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_read_status_reserved_6, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1453 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_read_status_get_read, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1454 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_read_status_get_unread, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1455 break;
1456 case 0x07:
1457 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_recipient, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1458 break;
1459 case 0x08:
1460 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_originator, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1461 break;
1462 case 0x09:
1463 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_priority_reserved_6, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1464 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_priority_get_high, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1465 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_priority_non_high, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1466 break;
1467 case 0x0A:
1468 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1469 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_attachment, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1470 break;
1471 case 0x0B:
1472 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1473 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_transparent, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1474 break;
1475 case 0x0C:
1476 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1477 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_retry, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1478 break;
1479 case 0x0D:
1480 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1481 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_new_message, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1482 break;
1483 case 0x0E:
1484 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1485 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_notification_status, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1486 break;
1487 case 0x0F:
1488 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_mas_instance_id, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1489 break;
1490 case 0x10:
1491 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_reserved, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1492 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_reply_to_addressing, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1493 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_protected, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1494 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_sent, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1495 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_read, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1496 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_priority, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1497 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_attachment_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1498 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_text, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1499 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_reception_status, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1500 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1501 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_type, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1502 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_recipient_addressing, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1503 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_recipient_name, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1504 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_sender_addressing, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1505 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_sender_name, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1506 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_datetime, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1507 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_subject, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1509 break;
1510 case 0x11:
1511 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_folder_listing_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1512 break;
1513 case 0x12:
1514 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_messages_listing_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1515 break;
1516 case 0x13:
1517 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_subject_length, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1518 break;
1519 case 0x14:
1520 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1521 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_charset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1522 break;
1523 case 0x15:
1524 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1525 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_fraction_request, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1526 break;
1527 case 0x16:
1528 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1529 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_fraction_deliver, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1530 break;
1531 case 0x17:
1532 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1533 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_status_indicator, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1534 break;
1535 case 0x18:
1536 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1537 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_status_value, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1538 break;
1539 case 0x19:
1540 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_mse_time, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1541 break;
1542 default:
1543 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1546 parameters_length -= 2 + parameter_length;
1547 offset += parameter_length;
1550 return offset;
1553 static int
1554 dissect_obex_application_parameter_bt_gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1556 proto_item *item;
1557 proto_item *parameter_item;
1558 proto_tree *parameter_tree;
1559 uint8_t parameter_id;
1560 int offset = 0;
1561 int parameters_length;
1562 int parameter_length;
1563 static int required_length_map[] = {2, 2, 1, 1, 0, 2};
1565 parameters_length = tvb_reported_length(tvb);
1567 while (parameters_length > 0) {
1568 parameter_id = tvb_get_uint8(tvb, offset);
1569 parameter_length = tvb_get_uint8(tvb, offset + 1);
1571 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1572 "Parameter: %s", val_to_str_const(parameter_id,
1573 gpp_application_parameters_vals, "Unknown"));
1574 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1576 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1577 offset += 1;
1579 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1580 offset += 1;
1582 if (parameter_id >= 0x41 && (uint8_t)(parameter_id - 0x41) < array_length(required_length_map) &&
1583 required_length_map[parameter_id - 0x41] != -1 &&
1584 required_length_map[parameter_id - 0x41] != parameter_length) {
1585 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1586 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1587 "According to the specification this parameter length should be %i, but there is %i",
1588 required_length_map[parameter_id - 0x41], parameter_length);
1589 } else switch (parameter_id) {
1590 case 0x41: /* Max List Count */
1591 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_max_list_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1592 break;
1593 case 0x42: /* List Start Offset */
1594 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_list_start_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1595 break;
1596 case 0x43: /* Notification Status */
1597 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_reserved_7, tvb, offset, 1, ENC_NA);
1598 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_notification_status, tvb, offset, 1, ENC_NA);
1599 break;
1600 case 0x44: /* Instance ID */
1601 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_instance_id, tvb, offset, 1, ENC_NA);
1602 break;
1603 case 0x46: /* Listing Size */
1604 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_listing_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1605 break;
1606 default:
1607 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1610 parameters_length -= 2 + parameter_length;
1611 offset += parameter_length;
1614 return offset;
1617 static int
1618 dissect_obex_application_parameter_bt_ctn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1620 proto_item *item;
1621 proto_item *parameter_item;
1622 proto_tree *parameter_tree;
1623 uint8_t parameter_id;
1624 int offset = 0;
1625 int parameters_length;
1626 int parameter_length;
1627 static int required_length_map[] = {0, 1, 1, 1, -1, -1, 4, 1, 1, 4, -1, -1, 1, 1, -1};
1628 static int required_length_map_gpp[] = {2, 2, 1, 1, -1, 2};
1630 parameters_length = tvb_reported_length(tvb);
1632 while (parameters_length > 0) {
1633 parameter_id = tvb_get_uint8(tvb, offset);
1634 parameter_length = tvb_get_uint8(tvb, offset + 1);
1636 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1637 "Parameter: %s", val_to_str_const(parameter_id,
1638 ctn_application_parameters_vals, "Unknown"));
1639 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_application_parameters);
1641 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1642 offset += 1;
1644 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1645 offset += 1;
1647 if ((parameter_id < 0x41) && (parameter_id < array_length(required_length_map)) &&
1648 required_length_map[parameter_id] != -1 &&
1649 required_length_map[parameter_id] != parameter_length) {
1651 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1652 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1653 "According to the specification this parameter length should be %i, but there is %i",
1654 required_length_map[parameter_id], parameter_length);
1655 } else if ((parameter_id >= 0x41) && ((uint8_t)(parameter_id - 0x41) < array_length(required_length_map_gpp)) &&
1656 required_length_map[parameter_id - 0x41] != -1 &&
1657 required_length_map[parameter_id - 0x41] != parameter_length) {
1659 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1660 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1661 "According to the specification this parameter length should be %i, but there is %i",
1662 required_length_map_gpp[parameter_id - 0x41], parameter_length);
1663 } else switch (parameter_id) {
1664 case 0x41: /* Max List Count */
1665 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_max_list_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1666 break;
1667 case 0x42: /* List Start Offset */
1668 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_list_start_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1669 break;
1670 case 0x43: /* Notification Status */
1671 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_reserved_7, tvb, offset, 1, ENC_NA);
1672 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_notification_status, tvb, offset, 1, ENC_NA);
1673 break;
1674 case 0x44: /* Instance ID */
1675 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_instance_id, tvb, offset, 1, ENC_NA);
1676 break;
1677 case 0x46: /* Listing Size */
1678 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_listing_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1679 break;
1680 case 0x01: /* Acoustic Alarm Status */
1681 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_acoustic_alarm_status, tvb, offset, 1, ENC_NA);
1682 break;
1683 case 0x02: /* Attachment */
1684 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_attachment, tvb, offset, 1, ENC_NA);
1685 break;
1686 case 0x03: /* Send */
1687 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_send, tvb, offset, 1, ENC_NA);
1688 break;
1689 case 0x04: /* Filter Period Begin */
1690 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_filter_period_begin, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1691 break;
1692 case 0x05: /* Filter Period End */
1693 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_filter_period_end, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1694 break;
1695 case 0x06: /* Parameter Mask */
1696 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_ctn_application_parameter_data_parameter_mask, ett_obex_filter, hfx_ctn_application_parameter_data_parameter_mask, ENC_BIG_ENDIAN);
1697 break;
1698 case 0x07: /* Status Indicator */
1699 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_status_indicator, tvb, offset, 1, ENC_NA);
1700 break;
1701 case 0x08: /* Status Value */
1702 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_status_value, tvb, offset, 1, ENC_NA);
1703 break;
1704 case 0x09: /* Postpone Val */
1705 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_postpone_val, tvb, offset, 4, ENC_BIG_ENDIAN);
1706 break;
1707 case 0x0A: /* Email URI */
1708 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_email_uri, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1709 break;
1710 case 0x0B: /* CSE Time */
1711 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_cse_time, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1712 break;
1713 case 0x0C: /* Recurrent */
1714 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_recurrent, tvb, offset, 1, ENC_NA);
1715 break;
1716 case 0x0D: /* Attach ID */
1717 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_attach_id, tvb, offset, 1, ENC_NA);
1718 break;
1719 case 0x0E: /* Last Update */
1720 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_last_update, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1721 break;
1722 default:
1723 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1726 parameters_length -= 2 + parameter_length;
1727 offset += parameter_length;
1730 return offset;
1733 static int
1734 dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
1735 int profile, obex_last_opcode_data_t *obex_last_opcode_data,
1736 obex_proto_data_t *obex_proto_data)
1738 proto_tree *hdrs_tree = NULL;
1739 proto_tree *hdr_tree = NULL;
1740 proto_item *hdr = NULL;
1741 proto_item *handle_item;
1742 tvbuff_t *next_tvb;
1743 int new_offset;
1744 int item_length = 0;
1745 int value_length = 0;
1746 uint8_t hdr_id, i;
1747 uint32_t value;
1748 uint32_t frame_number;
1749 uint8_t tag;
1750 char *str = NULL;
1752 if (tvb_reported_length_remaining(tvb, offset) > 0) {
1753 proto_item *hdrs;
1754 hdrs = proto_tree_add_item(tree, hf_headers, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
1755 hdrs_tree = proto_item_add_subtree(hdrs, ett_obex_hdrs);
1757 else {
1758 return offset;
1761 while (tvb_reported_length_remaining(tvb, offset) > 0) {
1762 hdr_id = tvb_get_uint8(tvb, offset);
1764 switch(0xC0 & hdr_id)
1766 case 0x00: /* null terminated unicode */
1767 item_length = tvb_get_ntohs(tvb, offset + 1);
1768 value_length = item_length - 3;
1769 break;
1770 case 0x40: /* byte sequence */
1771 item_length = tvb_get_ntohs(tvb, offset + 1);
1772 value_length = item_length - 3;
1773 break;
1774 case 0x80: /* 1 byte */
1775 item_length = 1 + 1;
1776 value_length = 1;
1777 break;
1778 case 0xc0: /* 4 bytes */
1779 item_length = 1 + 4;
1780 value_length = 4;
1781 break;
1784 hdr = proto_tree_add_none_format(hdrs_tree, hf_header, tvb, offset, item_length, "%s",
1785 val_to_str_ext_const(hdr_id, &header_id_vals_ext, "Unknown"));
1786 hdr_tree = proto_item_add_subtree(hdr, ett_obex_hdr);
1788 proto_tree_add_bitmask_with_flags(hdr_tree, tvb, offset, hf_hdr_id, ett_obex_hdr_id, hfx_hdr_id, ENC_NA, BMT_NO_APPEND);
1790 offset++;
1792 switch(0xC0 & hdr_id)
1794 case 0x00: /* null terminated unicode */
1795 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1796 offset += 2;
1798 switch (hdr_id) {
1799 case 0x01: /* Name */
1800 proto_tree_add_item(hdr_tree, hf_name, tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1801 if (!pinfo->fd->visited && obex_last_opcode_data) {
1802 if (obex_last_opcode_data->code == OBEX_CODE_VALS_SET_PATH)
1803 obex_last_opcode_data->data.set_data.name = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1804 else if (obex_last_opcode_data->code == OBEX_CODE_VALS_GET || obex_last_opcode_data->code == OBEX_CODE_VALS_PUT)
1805 obex_last_opcode_data->data.get_put.name = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1807 break;
1808 default:
1809 proto_tree_add_item(hdr_tree, hf_hdr_val_unicode, tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1811 str = tvb_get_string_enc(pinfo->pool, tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1812 proto_item_append_text(hdr_tree, ": \"%s\"", str);
1814 col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", str);
1815 offset += value_length;
1817 break;
1818 case 0x40: /* byte sequence */
1819 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1820 offset += 2;
1822 switch (hdr_id) {
1823 case 0x4c: /* Application Parameters */
1824 next_tvb = tvb_new_subset_length(tvb, offset, value_length);
1825 if (!(new_offset = dissector_try_uint_with_data(obex_profile_table, profile, next_tvb, pinfo, hdr_tree, true, NULL))) {
1826 new_offset = call_dissector(raw_application_parameters_handle, next_tvb, pinfo, hdr_tree);
1828 offset += new_offset;
1830 break;
1831 case 0x4d: /* Authentication Challenge */
1832 while (value_length) {
1833 uint8_t parameter_id;
1834 uint8_t sub_parameter_length;
1835 proto_item *parameter_item;
1836 proto_tree *parameter_tree;
1838 parameter_id = tvb_get_uint8(tvb, offset);
1839 sub_parameter_length = tvb_get_uint8(tvb, offset + 1);
1841 parameter_item = proto_tree_add_none_format(hdr_tree, hf_authentication_parameter, tvb, offset,
1842 2 + sub_parameter_length, "Tag: %s", val_to_str_const(parameter_id,
1843 authentication_challenge_tag_vals, "Unknown"));
1844 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_authentication_parameters);
1846 proto_tree_add_item(parameter_tree, hf_authentication_challenge_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
1847 tag = tvb_get_uint8(tvb, offset);
1848 offset += 1;
1850 proto_tree_add_item(parameter_tree, hf_authentication_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1851 offset += 1;
1853 switch (tag) {
1854 case 0x00:
1855 proto_tree_add_item(parameter_tree, hf_authentication_key, tvb, offset, 16, ENC_NA);
1856 offset += 16;
1857 break;
1858 case 0x01:
1859 proto_tree_add_item(parameter_tree, hf_authentication_option_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1860 proto_tree_add_item(parameter_tree, hf_authentication_option_read_only, tvb, offset, 1, ENC_BIG_ENDIAN);
1861 proto_tree_add_item(parameter_tree, hf_authentication_option_user_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1862 offset += 1;
1863 break;
1864 case 0x02:
1865 proto_tree_add_item(parameter_tree, hf_authentication_info_charset, tvb, offset, 1, ENC_BIG_ENDIAN);
1866 offset += 1;
1867 proto_tree_add_item(parameter_tree, hf_authentication_info, tvb, offset, sub_parameter_length - 1, ENC_ASCII);
1868 offset += sub_parameter_length - 1;
1869 break;
1870 default:
1871 proto_tree_add_item(parameter_tree, hf_authentication_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
1872 offset += sub_parameter_length;
1875 value_length -= 2 + sub_parameter_length;
1877 break;
1878 case 0x4e: /* Authentication Response */
1879 while (value_length) {
1880 uint8_t parameter_id;
1881 uint8_t sub_parameter_length;
1882 proto_item *parameter_item;
1883 proto_tree *parameter_tree;
1885 parameter_id = tvb_get_uint8(tvb, offset);
1886 sub_parameter_length = tvb_get_uint8(tvb, offset + 1);
1888 parameter_item = proto_tree_add_none_format(hdr_tree, hf_authentication_parameter, tvb, offset,
1889 2 + sub_parameter_length, "Tag: %s", val_to_str_const(parameter_id,
1890 authentication_response_tag_vals, "Unknown"));
1891 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_authentication_parameters);
1893 proto_tree_add_item(parameter_tree, hf_authentication_response_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
1894 tag = tvb_get_uint8(tvb, offset);
1895 offset += 1;
1897 proto_tree_add_item(parameter_tree, hf_authentication_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1898 sub_parameter_length = tvb_get_uint8(tvb, offset);
1899 offset += 1;
1901 switch (tag) {
1902 case 0x00:
1903 proto_tree_add_item(parameter_tree, hf_authentication_result_key, tvb, offset, 16, ENC_NA);
1904 offset += 16;
1905 break;
1906 case 0x01:
1907 proto_tree_add_item(parameter_tree, hf_authentication_user_id, tvb, offset, sub_parameter_length, ENC_NA);
1908 offset += sub_parameter_length;
1909 break;
1910 case 0x02:
1911 proto_tree_add_item(parameter_tree, hf_authentication_key, tvb, offset, 16, ENC_NA);
1912 offset += 16;
1913 break;
1914 default:
1915 proto_tree_add_item(parameter_tree, hf_authentication_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
1916 offset += sub_parameter_length;
1917 break;
1921 value_length -= 2 + sub_parameter_length;
1923 break;
1924 case 0x42: /* Type */
1925 proto_tree_add_item(hdr_tree, hf_type, tvb, offset, value_length, ENC_ASCII | ENC_NA);
1926 proto_item_append_text(hdr_tree, ": \"%s\"", tvb_get_string_enc(pinfo->pool, tvb, offset, value_length, ENC_ASCII));
1927 if (!pinfo->fd->visited && obex_last_opcode_data && (obex_last_opcode_data->code == OBEX_CODE_VALS_GET || obex_last_opcode_data->code == OBEX_CODE_VALS_PUT)) {
1928 obex_last_opcode_data->data.get_put.type = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_ASCII | ENC_NA);
1930 if (p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE) == NULL) {
1931 uint8_t *value_data;
1933 value_data = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_ASCII | ENC_NA);
1935 p_add_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE, value_data);
1937 offset += value_length;
1939 break;
1940 case 0x44: /* Time (ISO8601) */
1942 const uint8_t* time_str;
1943 proto_tree_add_item_ret_string(hdr_tree, hf_time_iso8601, tvb, offset, value_length, ENC_ASCII | ENC_NA, pinfo->pool, &time_str);
1944 proto_item_append_text(hdr_tree, ": \"%s\"", time_str);
1946 offset += value_length;
1948 break;
1949 case 0x48: /* Body */
1950 case 0x49: /* End Of Body */
1951 proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
1952 next_tvb = tvb_new_subset_length(tvb, offset, value_length);
1954 if (value_length > 0 && obex_last_opcode_data &&
1955 (obex_last_opcode_data->code == OBEX_CODE_VALS_GET || obex_last_opcode_data->code == OBEX_CODE_VALS_PUT) &&
1956 p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE) == NULL) {
1957 uint8_t *value_data;
1959 value_data = obex_last_opcode_data->data.get_put.type;
1961 p_add_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE, value_data);
1963 if (value_length > 0 && obex_last_opcode_data &&
1964 (obex_last_opcode_data->code == OBEX_CODE_VALS_GET || obex_last_opcode_data->code == OBEX_CODE_VALS_PUT) &&
1965 obex_last_opcode_data->data.get_put.type &&
1966 dissector_try_string_with_data(media_type_dissector_table, obex_last_opcode_data->data.get_put.type, next_tvb, pinfo, tree, true, NULL) > 0) {
1967 offset += value_length;
1968 } else {
1969 if (!tvb_strneql(tvb, offset, "<?xml", 5))
1971 call_dissector(xml_handle, next_tvb, pinfo, tree);
1972 } else if (is_ascii_str(tvb_get_ptr(tvb, offset, value_length), value_length)) {
1973 proto_item_append_text(hdr_tree, ": \"%s\"", tvb_get_string_enc(pinfo->pool, tvb, offset, value_length, ENC_ASCII));
1974 col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_string_enc(pinfo->pool, tvb, offset, value_length, ENC_ASCII));
1976 offset += value_length;
1979 break;
1980 case 0x46: /* Target */
1981 case 0x4a: /* Who */
1982 handle_item = proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
1984 if (value_length == 16) for (i = 0; target_vals[i].strptr != NULL; i++) {
1985 if (tvb_memeql(tvb, offset, target_vals[i].value, target_vals[i].length) == 0) {
1986 proto_item_append_text(handle_item, ": %s", target_vals[i].strptr);
1987 proto_item_append_text(hdr_tree, ": %s", target_vals[i].strptr);
1989 col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", target_vals[i].strptr);
1990 if (!pinfo->fd->visited) {
1991 obex_profile_data_t *obex_profile_data;
1993 wmem_tree_key_t key[6];
1994 frame_number = pinfo->num;
1996 key[0].length = 1;
1997 key[0].key = &obex_proto_data->interface_id;
1998 key[1].length = 1;
1999 key[1].key = &obex_proto_data->adapter_id;
2000 key[2].length = 1;
2001 key[2].key = &obex_proto_data->chandle;
2002 key[3].length = 1;
2003 key[3].key = &obex_proto_data->channel;
2004 key[4].length = 1;
2005 key[4].key = &frame_number;
2006 key[5].length = 0;
2007 key[5].key = NULL;
2009 obex_profile_data = wmem_new(wmem_file_scope(), obex_profile_data_t);
2010 obex_profile_data->interface_id = obex_proto_data->interface_id;
2011 obex_profile_data->adapter_id = obex_proto_data->adapter_id;
2012 obex_profile_data->chandle = obex_proto_data->chandle;
2013 obex_profile_data->channel = obex_proto_data->channel;
2014 obex_profile_data->profile = target_to_profile[i];
2016 wmem_tree_insert32_array(obex_profile, key, obex_profile_data);
2020 offset += value_length;
2022 break;
2023 case 0x47: /* HTTP */ {
2024 next_tvb = tvb_new_subset_remaining(tvb, offset);
2026 call_dissector(http_handle, next_tvb, pinfo, hdr_tree);
2029 break;
2030 case 0x50: /* WAN UUID */
2031 if (value_length == 2) {
2032 proto_tree_add_item(hdr_tree, hf_wan_uuid, tvb, offset, 2, ENC_BIG_ENDIAN);
2033 offset += 2;
2034 } else {
2035 proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
2036 offset += value_length;
2039 break;
2040 case 0x51: /* Object Class */
2042 const uint8_t* obj_str;
2043 proto_tree_add_item_ret_string(hdr_tree, hf_object_class, tvb, offset, value_length, ENC_ASCII | ENC_NA, pinfo->pool, &obj_str);
2044 proto_item_append_text(hdr_tree, ": \"%s\"", obj_str);
2046 offset += value_length;
2048 break;
2049 case 0x52: /* Session Parameter */
2050 while (value_length) {
2051 uint8_t parameter_id;
2052 uint8_t sub_parameter_length;
2053 proto_item *parameter_item;
2054 proto_tree *parameter_tree;
2056 parameter_id = tvb_get_uint8(tvb, offset);
2057 sub_parameter_length = tvb_get_uint8(tvb, offset + 1);
2059 parameter_item = proto_tree_add_none_format(hdr_tree, hf_session_parameter, tvb, offset,
2060 2 + sub_parameter_length, "Tag: %s", val_to_str_const(parameter_id,
2061 session_tag_vals, "Unknown"));
2062 parameter_tree = proto_item_add_subtree(parameter_item, ett_obex_session_parameters);
2064 proto_tree_add_item(parameter_tree, hf_session_parameter_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
2065 tag = tvb_get_uint8(tvb, offset);
2066 offset += 1;
2068 proto_tree_add_item(parameter_tree, hf_session_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2069 sub_parameter_length = tvb_get_uint8(tvb, offset);
2070 offset += 1;
2072 switch (tag) {
2073 case 0x00: /* Device Address */
2074 if (sub_parameter_length == 6) {
2075 offset = dissect_bd_addr(hf_sender_bd_addr, pinfo, parameter_tree, tvb, offset, false, obex_proto_data->interface_id, obex_proto_data->adapter_id, NULL);
2076 } else {
2077 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2079 offset += sub_parameter_length;
2082 break;
2083 case 0x01: /* Nonce */
2084 if (sub_parameter_length >= 4 && sub_parameter_length <= 16) {
2085 proto_tree_add_item(parameter_tree, hf_session_parameter_nonce, tvb, offset, sub_parameter_length, ENC_NA);
2087 offset += sub_parameter_length;
2088 } else {
2089 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2091 offset += sub_parameter_length;
2094 break;
2095 case 0x02: /* Session ID */
2096 if (sub_parameter_length == 16) {
2097 proto_tree_add_item(parameter_tree, hf_session_parameter_session_id, tvb, offset, 16, ENC_NA);
2099 offset += 16;
2100 } else {
2101 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2103 offset += sub_parameter_length;
2106 break;
2107 case 0x03: /* Next Sequence Number */
2108 if (sub_parameter_length == 1) {
2109 proto_tree_add_item(parameter_tree, hf_session_parameter_next_sequence_number, tvb, offset, 1, ENC_NA);
2111 offset += 1;
2112 } else {
2113 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2115 offset += sub_parameter_length;
2118 break;
2119 case 0x04: /* Timeout */
2120 if (sub_parameter_length == 4) {
2121 proto_tree_add_item(parameter_tree, hf_session_parameter_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
2123 offset += 4;
2124 } else {
2125 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2127 offset += sub_parameter_length;
2130 break;
2131 case 0x05: /* Session Opcode */
2132 if (sub_parameter_length == 1) {
2133 proto_tree_add_item(parameter_tree, hf_session_parameter_opcode, tvb, offset, 1, ENC_NA);
2135 offset += 1;
2136 } else {
2137 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2139 offset += sub_parameter_length;
2142 break;
2143 default:
2144 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2145 offset += sub_parameter_length;
2146 break;
2150 value_length -= 2 + sub_parameter_length;
2152 break;
2153 default:
2154 proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
2155 offset += value_length;
2158 break;
2159 case 0x80: /* 1 byte */
2160 value = tvb_get_uint8(tvb, offset);
2162 switch (hdr_id) {
2163 case 0x94: /* Action */
2164 proto_tree_add_item(hdr_tree, hf_hdr_val_action, tvb, offset, 1, ENC_NA);
2165 proto_item_append_text(hdr_tree, ": %s", val_to_str_const(value, action_vals, "Unknown"));
2167 break;
2168 case 0x97: /* Single Response Mode */
2169 proto_tree_add_item(hdr_tree, hf_hdr_val_single_response_mode, tvb, offset, 1, ENC_NA);
2170 proto_item_append_text(hdr_tree, ": %s", val_to_str_const(value, single_response_mode_vals, "Unknown"));
2172 break;
2173 case 0x98: /* Single Response Mode Parameter */
2174 proto_tree_add_item(hdr_tree, hf_hdr_val_single_response_mode_parameter, tvb, offset, 1, ENC_NA);
2175 proto_item_append_text(hdr_tree, ": %s", val_to_str_const(value, single_response_mode_parameter_vals, "Unknown"));
2177 break;
2178 case 0x93: /* Session Sequence Number */
2179 default:
2180 proto_tree_add_item(hdr_tree, hf_hdr_val_byte, tvb, offset, 1, ENC_NA);
2181 proto_item_append_text(hdr_tree, ": %i", value);
2184 offset += 1;
2186 break;
2187 case 0xC0: /* 4 bytes */
2188 switch (hdr_id) {
2189 case 0xC0: /* Count */
2190 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2191 proto_tree_add_item(hdr_tree, hf_count, tvb, offset, 4, ENC_BIG_ENDIAN);
2193 break;
2194 case 0xC3: /* Length */
2195 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2196 proto_tree_add_item(hdr_tree, hf_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
2198 break;
2199 case 0xCB: /* Connection Id */
2200 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2201 proto_tree_add_item(hdr_tree, hf_connection_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2203 break;
2204 case 0xC4: /* Time */
2205 case 0xCF: /* Creator */
2206 case 0xD6: /* Permissions */
2207 default:
2208 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2209 proto_tree_add_item(hdr_tree, hf_hdr_val_long, tvb, offset, 4, ENC_BIG_ENDIAN);
2212 offset += 4;
2214 break;
2215 default:
2216 break;
2220 return offset;
2223 static int
2224 dissect_obex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2226 proto_item *main_item;
2227 proto_tree *main_tree;
2228 proto_item *sub_item;
2229 fragment_head *frag_msg = NULL;
2230 fragment_item *frag = NULL;
2231 bool save_fragmented;
2232 bool complete;
2233 tvbuff_t* new_tvb = NULL;
2234 tvbuff_t* next_tvb = NULL;
2235 int offset = 0;
2236 int profile = PROFILE_UNKNOWN;
2237 const char *path = path_unknown;
2238 obex_profile_data_t *obex_profile_data;
2239 wmem_tree_key_t key[6];
2240 uint32_t frame_number;
2241 obex_last_opcode_data_t *obex_last_opcode_data;
2242 obex_path_data_t *obex_path_data;
2243 uint32_t length;
2244 uint8_t *profile_data;
2245 dissector_handle_t current_handle;
2246 dissector_handle_t default_handle;
2247 int previous_proto;
2248 obex_proto_data_t obex_proto_data;
2250 previous_proto = (GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_frame_prev(wmem_list_tail(pinfo->layers)))));
2251 if (previous_proto == proto_btl2cap) {
2252 btl2cap_data_t *l2cap_data;
2254 l2cap_data = (btl2cap_data_t *) data;
2256 obex_proto_data.interface_id = l2cap_data->interface_id;
2257 obex_proto_data.adapter_id = l2cap_data->adapter_id;
2258 obex_proto_data.chandle = l2cap_data->chandle;
2259 obex_proto_data.channel = l2cap_data->cid;
2260 } else if (previous_proto == proto_btrfcomm) {
2261 btrfcomm_data_t *rfcomm_data;
2263 rfcomm_data = (btrfcomm_data_t *) data;
2265 obex_proto_data.interface_id = rfcomm_data->interface_id;
2266 obex_proto_data.adapter_id = rfcomm_data->adapter_id;
2267 obex_proto_data.chandle = rfcomm_data->chandle;
2268 obex_proto_data.channel = rfcomm_data->dlci >> 1;
2269 } else {
2270 obex_proto_data.interface_id = HCI_INTERFACE_DEFAULT;
2271 obex_proto_data.adapter_id = HCI_ADAPTER_DEFAULT;
2272 obex_proto_data.chandle = 0;
2273 obex_proto_data.channel = 0;
2276 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OBEX");
2278 main_item = proto_tree_add_item(tree, proto_obex, tvb, 0, tvb_captured_length(tvb), ENC_NA);
2279 main_tree = proto_item_add_subtree(main_item, ett_obex);
2281 save_fragmented = pinfo->fragmented;
2283 frame_number = pinfo->num;
2285 key[0].length = 1;
2286 key[0].key = &obex_proto_data.interface_id;
2287 key[1].length = 1;
2288 key[1].key = &obex_proto_data.adapter_id;
2289 key[2].length = 1;
2290 key[2].key = &obex_proto_data.chandle;
2291 key[3].length = 1;
2292 key[3].key = &obex_proto_data.channel;
2293 key[4].length = 1;
2294 key[4].key = &frame_number;
2295 key[5].length = 0;
2296 key[5].key = NULL;
2298 profile_data = (uint8_t *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_OBEX_PROFILE);
2299 if (profile_data == NULL) {
2300 obex_profile_data = (obex_profile_data_t *)wmem_tree_lookup32_array_le(obex_profile, key);
2301 if (obex_profile_data && obex_profile_data->interface_id == obex_proto_data.interface_id &&
2302 obex_profile_data->adapter_id == obex_proto_data.adapter_id &&
2303 obex_profile_data->chandle == obex_proto_data.chandle &&
2304 obex_profile_data->channel == obex_proto_data.channel) {
2305 profile = obex_profile_data->profile;
2308 profile_data = wmem_new(wmem_file_scope(), uint8_t);
2309 *profile_data = profile;
2311 p_add_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_OBEX_PROFILE, profile_data);
2314 obex_path_data = (obex_path_data_t *)wmem_tree_lookup32_array_le(obex_path, key);
2315 if (obex_path_data && obex_path_data->interface_id == obex_proto_data.interface_id &&
2316 obex_path_data->adapter_id == obex_proto_data.adapter_id &&
2317 obex_path_data->chandle == obex_proto_data.chandle &&
2318 obex_path_data->channel == obex_proto_data.channel) {
2319 path = obex_path_data->path;
2322 sub_item = proto_tree_add_uint(main_tree, hf_profile, tvb, 0, 0, profile);
2323 proto_item_set_generated(sub_item);
2325 if (path) {
2326 sub_item = proto_tree_add_string(main_tree, hf_current_path, tvb, 0, 0, path);
2327 proto_item_set_generated(sub_item);
2330 current_handle = dissector_get_uint_handle(obex_profile_table, profile);
2331 default_handle = dissector_get_default_uint_handle("obex.profile", profile);
2332 if (current_handle != default_handle) {
2333 expert_add_info_format(pinfo, main_item, &ei_decoded_as_profile, "Decoded As %s", dissector_handle_get_protocol_long_name(current_handle));
2336 complete = false;
2338 if (tvb_captured_length(tvb) == tvb_reported_length(tvb)) {
2339 frag_msg = fragment_get_reassembled_id(&obex_reassembly_table, pinfo, pinfo->p2p_dir);
2340 if (frag_msg && pinfo->num != frag_msg->reassembled_in) {
2341 /* reassembled but not last */
2343 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2344 "Reassembled Obex packet", frag_msg, &obex_frag_items, NULL, main_tree);
2345 } else if (frag_msg && pinfo->num == frag_msg->reassembled_in) {
2346 /* reassembled and last, so dissect reassembled packet here */
2348 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2349 "Reassembled Obex packet", frag_msg, &obex_frag_items, NULL, main_tree);
2350 } else {
2351 frag_msg = fragment_get(&obex_reassembly_table, pinfo, pinfo->p2p_dir, NULL);
2353 if (frag_msg) {
2354 /* not the first fragment */
2356 /* packet stream is guaranted to be sequence of fragments, one by one,
2357 so find last fragment for its offset and length */
2358 for (frag = frag_msg->next; frag->next; frag = frag->next) {}
2360 frag_msg = fragment_add_check(&obex_reassembly_table,
2361 tvb, 0, pinfo, pinfo->p2p_dir, NULL,
2362 frag->offset + frag->len, tvb_reported_length(tvb),
2363 ((frag->offset + frag->len + tvb_reported_length(tvb)) <
2364 fragment_get_tot_len(&obex_reassembly_table, pinfo, pinfo->p2p_dir, NULL)) ? true : false);
2366 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2367 "Reassembled Obex packet", frag_msg, &obex_frag_items, NULL, main_tree);
2369 pinfo->fragmented = true;
2370 } else {
2371 if (tvb_reported_length(tvb) < 3) {
2372 /* Packet length is in the second and the third bye of packet, anything shorter than 3 is bad */
2373 col_add_fstr(pinfo->cinfo, COL_INFO, "%s OBEX packet too short",
2374 (pinfo->p2p_dir==P2P_DIR_SENT) ? "Sent" : "Rcvd");
2375 call_dissector(data_handle, tvb, pinfo, main_tree);
2376 return tvb_reported_length(tvb);
2377 } else if (tvb_reported_length(tvb) >= 3 && tvb_reported_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
2378 /* first fragment in a sequence */
2379 frag_msg = fragment_add_check(&obex_reassembly_table,
2380 tvb, 0, pinfo, pinfo->p2p_dir, NULL,
2381 0, tvb_reported_length(tvb), true);
2383 fragment_set_tot_len(&obex_reassembly_table,
2384 pinfo, pinfo->p2p_dir, NULL,
2385 tvb_get_ntohs(tvb, offset + 1));
2387 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2388 "Reassembled Obex packet", frag_msg, &obex_frag_items, NULL, main_tree);
2389 pinfo->fragmented = true;
2390 } else if (tvb_reported_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
2391 /* non-fragmented */
2392 complete = true;
2393 pinfo->fragmented = false;
2399 if (new_tvb) { /* take it all */
2400 next_tvb = new_tvb;
2401 complete = true;
2402 } else { /* make a new subset */
2403 next_tvb = tvb_new_subset_remaining(tvb, offset);
2406 if (complete) {
2407 uint8_t code;
2408 uint8_t final_flag;
2410 /* fully dissectable packet ready */
2412 /* op/response code */
2413 code = tvb_get_uint8(next_tvb, offset) & OBEX_CODE_VALS_MASK;
2414 final_flag = tvb_get_uint8(next_tvb, offset) & 0x80;
2416 switch (pinfo->p2p_dir) {
2417 case P2P_DIR_SENT:
2418 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
2419 break;
2420 case P2P_DIR_RECV:
2421 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
2422 break;
2423 default:
2424 col_set_str(pinfo->cinfo, COL_INFO, "UnknownDirection ");
2425 break;
2428 col_append_str(pinfo->cinfo, COL_INFO,
2429 val_to_str_ext_const(code, &code_vals_ext, "Unknown"));
2431 if (code < OBEX_CODE_VALS_CONTINUE || code == OBEX_CODE_VALS_ABORT) {
2432 proto_tree_add_item(main_tree, hf_opcode, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2433 if (!pinfo->fd->visited &&
2434 (pinfo->p2p_dir == P2P_DIR_SENT ||
2435 pinfo->p2p_dir == P2P_DIR_RECV)) {
2436 frame_number = pinfo->num;
2438 key[0].length = 1;
2439 key[0].key = &obex_proto_data.interface_id;
2440 key[1].length = 1;
2441 key[1].key = &obex_proto_data.adapter_id;
2442 key[2].length = 1;
2443 key[2].key = &obex_proto_data.chandle;
2444 key[3].length = 1;
2445 key[3].key = &obex_proto_data.channel;
2446 key[4].length = 1;
2447 key[4].key = &frame_number;
2448 key[5].length = 0;
2449 key[5].key = NULL;
2451 obex_last_opcode_data = wmem_new0(wmem_file_scope(), obex_last_opcode_data_t);
2452 obex_last_opcode_data->interface_id = obex_proto_data.interface_id;
2453 obex_last_opcode_data->adapter_id = obex_proto_data.adapter_id;
2454 obex_last_opcode_data->chandle = obex_proto_data.chandle;
2455 obex_last_opcode_data->channel = obex_proto_data.channel;
2456 obex_last_opcode_data->code = code;
2457 obex_last_opcode_data->final_flag = final_flag;
2458 obex_last_opcode_data->request_in_frame = frame_number;
2459 obex_last_opcode_data->response_in_frame = 0;
2461 wmem_tree_insert32_array(obex_last_opcode, key, obex_last_opcode_data);
2463 } else {
2464 proto_tree_add_item(main_tree, hf_response_code, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2467 proto_tree_add_item(main_tree, hf_final_flag, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2468 offset++;
2470 /* length */
2471 proto_tree_add_item(main_tree, hf_length, next_tvb, offset, 2, ENC_BIG_ENDIAN);
2472 length = tvb_get_ntohs(tvb, offset) - 3;
2473 offset += 2;
2475 frame_number = pinfo->num;
2477 key[0].length = 1;
2478 key[0].key = &obex_proto_data.interface_id;
2479 key[1].length = 1;
2480 key[1].key = &obex_proto_data.adapter_id;
2481 key[2].length = 1;
2482 key[2].key = &obex_proto_data.chandle;
2483 key[3].length = 1;
2484 key[3].key = &obex_proto_data.channel;
2485 key[4].length = 1;
2486 key[4].key = &frame_number;
2487 key[5].length = 0;
2488 key[5].key = NULL;
2490 obex_last_opcode_data = (obex_last_opcode_data_t *)wmem_tree_lookup32_array_le(obex_last_opcode, key);
2491 if (obex_last_opcode_data && obex_last_opcode_data->interface_id == obex_proto_data.interface_id &&
2492 obex_last_opcode_data->adapter_id == obex_proto_data.adapter_id &&
2493 obex_last_opcode_data->chandle == obex_proto_data.chandle &&
2494 obex_last_opcode_data->channel == obex_proto_data.channel) {
2495 if (obex_last_opcode_data->request_in_frame > 0 && obex_last_opcode_data->request_in_frame != pinfo->num) {
2496 sub_item = proto_tree_add_uint(main_tree, hf_request_in_frame, next_tvb, 0, 0, obex_last_opcode_data->request_in_frame);
2497 proto_item_set_generated(sub_item);
2500 if (!pinfo->fd->visited && obex_last_opcode_data->response_in_frame == 0 && obex_last_opcode_data->request_in_frame < pinfo->num) {
2501 obex_last_opcode_data->response_in_frame = pinfo->num;
2504 if (obex_last_opcode_data->response_in_frame > 0 && obex_last_opcode_data->response_in_frame != pinfo->num) {
2505 sub_item = proto_tree_add_uint(main_tree, hf_response_in_frame, next_tvb, 0, 0, obex_last_opcode_data->response_in_frame);
2506 proto_item_set_generated(sub_item);
2510 switch(code)
2512 case OBEX_CODE_VALS_CONNECT:
2513 proto_tree_add_item(main_tree, hf_version, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2514 offset++;
2516 proto_tree_add_item(main_tree, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2517 offset++;
2519 proto_tree_add_item(main_tree, hf_max_pkt_len, next_tvb, offset, 2, ENC_BIG_ENDIAN);
2520 offset += 2;
2521 break;
2523 case OBEX_CODE_VALS_PUT:
2524 case OBEX_CODE_VALS_GET:
2525 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", (final_flag == 0x80) ? "final" : "continue");
2526 break;
2528 case OBEX_CODE_VALS_SET_PATH:
2529 proto_tree_add_item(main_tree, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2530 proto_tree_add_item(main_tree, hf_set_path_flags_0, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2531 proto_tree_add_item(main_tree, hf_set_path_flags_1, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2533 if (!pinfo->fd->visited && obex_last_opcode_data) {
2534 obex_last_opcode_data->data.set_data.go_up = tvb_get_uint8(tvb, offset) & 0x01;
2535 obex_last_opcode_data->data.set_data.name = NULL;
2538 offset++;
2540 proto_tree_add_item(main_tree, hf_constants, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2541 offset++;
2542 break;
2544 case OBEX_CODE_VALS_DISCONNECT:
2545 case OBEX_CODE_VALS_ABORT:
2546 break;
2548 default:
2549 if (length == 0 && tvb_reported_length_remaining(tvb, offset) > 0) {
2550 proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_reported_length_remaining(tvb, offset));
2551 offset += tvb_reported_length_remaining(tvb, offset);
2552 break;
2553 } else if (length == 0) break;
2555 if (obex_last_opcode_data && obex_last_opcode_data->code == OBEX_CODE_VALS_CONNECT) {
2556 proto_tree_add_item(main_tree, hf_version, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2557 offset++;
2559 proto_tree_add_item(main_tree, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2560 offset++;
2562 proto_tree_add_item(main_tree, hf_max_pkt_len, next_tvb, offset, 2, ENC_BIG_ENDIAN);
2563 offset += 2;
2565 if (!pinfo->fd->visited)
2566 save_path(pinfo, path, "", false, &obex_proto_data);
2568 break;
2571 dissect_headers(main_tree, next_tvb, offset, pinfo, profile, obex_last_opcode_data, &obex_proto_data);
2572 if (!pinfo->fd->visited &&
2573 obex_last_opcode_data &&
2574 obex_last_opcode_data->data.set_data.name &&
2575 obex_last_opcode_data->code == OBEX_CODE_VALS_SET_PATH &&
2576 code == OBEX_CODE_VALS_SUCCESS) {
2577 save_path(pinfo, path, obex_last_opcode_data->data.set_data.name, obex_last_opcode_data->data.set_data.go_up, &obex_proto_data);
2579 } else {
2580 /* packet fragment */
2581 col_add_fstr(pinfo->cinfo, COL_INFO, "%s OBEX fragment",
2582 (pinfo->p2p_dir==P2P_DIR_SENT) ? "Sent" : "Rcvd");
2583 call_dissector(data_handle, next_tvb, pinfo, main_tree);
2585 offset = tvb_reported_length(tvb);
2588 pinfo->fragmented = save_fragmented;
2590 return offset;
2594 void
2595 proto_register_obex(void)
2597 module_t *module;
2598 expert_module_t *expert_obex;
2599 int proto_raw;
2600 int proto_bpp;
2601 int proto_bip;
2602 int proto_map;
2603 int proto_bt_gpp;
2604 int proto_bt_ctn;
2605 int proto_bt_pbap;
2607 static hf_register_info hf[] = {
2608 { &hf_opcode,
2609 { "Opcode", "obex.opcode",
2610 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &code_vals_ext, OBEX_CODE_VALS_MASK,
2611 "Request Opcode", HFILL}
2613 { &hf_response_code,
2614 { "Response Code", "obex.resp_code",
2615 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &code_vals_ext, OBEX_CODE_VALS_MASK,
2616 NULL, HFILL}
2618 { &hf_final_flag,
2619 { "Final Flag", "obex.final_flag",
2620 FT_BOOLEAN, 8, NULL, 0x80,
2621 NULL, HFILL}
2623 { &hf_length,
2624 { "Packet Length", "obex.pkt_len",
2625 FT_UINT16, BASE_DEC, NULL, 0,
2626 NULL, HFILL}
2628 { &hf_version,
2629 { "Version", "obex.version",
2630 FT_UINT8, BASE_HEX, VALS(version_vals), 0x00,
2631 "Obex Protocol Version", HFILL}
2633 { &hf_flags,
2634 { "Flags", "obex.flags",
2635 FT_UINT8, BASE_HEX, NULL, 0x00,
2636 NULL, HFILL}
2638 { &hf_constants,
2639 { "Constants", "obex.constants",
2640 FT_UINT8, BASE_HEX, NULL, 0x00,
2641 NULL, HFILL}
2643 { &hf_max_pkt_len,
2644 { "Max. Packet Length", "obex.max_pkt_len",
2645 FT_UINT16, BASE_DEC, NULL, 0,
2646 NULL, HFILL}
2648 { &hf_set_path_flags_0,
2649 { "Go back one folder (../) first", "obex.set_path_flags_0",
2650 FT_BOOLEAN, 8, NULL, 0x01,
2651 NULL, HFILL}
2653 { &hf_set_path_flags_1,
2654 { "Do not create folder, if not existing", "obex.set_path_flags_1",
2655 FT_BOOLEAN, 8, NULL, 0x02,
2656 NULL, HFILL}
2658 { &hf_headers,
2659 { "Headers", "obex.headers",
2660 FT_NONE, BASE_NONE, NULL, 0x00,
2661 NULL, HFILL}
2663 { &hf_header,
2664 { "Header", "obex.header",
2665 FT_NONE, BASE_NONE, NULL, 0x00,
2666 NULL, HFILL}
2668 { &hf_hdr_id,
2669 { "Header Id", "obex.header.id",
2670 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &header_id_vals_ext, 0x00,
2671 NULL, HFILL}
2673 { &hf_hdr_id_encoding,
2674 { "Encoding", "obex.header.id.encoding",
2675 FT_UINT8, BASE_HEX, VALS(header_id_encoding_vals), 0xC0,
2676 NULL, HFILL}
2678 { &hf_hdr_id_meaning,
2679 { "Meaning", "obex.header.id.meaning",
2680 FT_UINT8, BASE_HEX, VALS(header_id_meaning_vals), 0x3F,
2681 NULL, HFILL}
2683 { &hf_hdr_length,
2684 { "Length", "obex.header.length",
2685 FT_UINT16, BASE_DEC, NULL, 0,
2686 "Header Length", HFILL}
2688 { &hf_hdr_val_unicode,
2689 { "Value", "obex.header.value.unicode",
2690 FT_STRING, BASE_NONE, NULL, 0,
2691 "Unicode Value", HFILL }
2693 { &hf_hdr_val_byte_seq,
2694 { "Value", "obex.header.value.byte_sequence",
2695 FT_BYTES, BASE_NONE, NULL, 0,
2696 "Byte Sequence Value", HFILL}
2698 { &hf_hdr_val_byte,
2699 { "Value", "obex.header.value.byte",
2700 FT_UINT8, BASE_DEC_HEX, NULL, 0,
2701 "Byte Value", HFILL}
2703 { &hf_hdr_val_long,
2704 { "Value", "obex.header.value.long",
2705 FT_UINT32, BASE_DEC, NULL, 0,
2706 "4-byte Value", HFILL}
2708 { &hf_count,
2709 { "Count", "obex.count",
2710 FT_UINT32, BASE_DEC, NULL, 0,
2711 NULL, HFILL}
2713 { &hf_data_length,
2714 { "Length", "obex.length",
2715 FT_UINT32, BASE_DEC, NULL, 0,
2716 NULL, HFILL}
2718 { &hf_connection_id,
2719 { "Connection ID", "obex.connection_id",
2720 FT_UINT32, BASE_DEC, NULL, 0,
2721 NULL, HFILL}
2723 { &hf_session_parameter,
2724 { "Session Parameter", "obex.session",
2725 FT_NONE, BASE_NONE, NULL, 0x00,
2726 NULL, HFILL}
2728 { &hf_session_parameter_data,
2729 { "Parameter Value", "obex.session.value",
2730 FT_BYTES, BASE_NONE, NULL, 0,
2731 NULL, HFILL}
2733 { &hf_session_parameter_tag,
2734 { "Tag", "obex.session.tag",
2735 FT_UINT8, BASE_HEX, VALS(session_tag_vals), 0x00,
2736 NULL, HFILL}
2738 { &hf_session_parameter_length,
2739 { "Length", "obex.session.length",
2740 FT_UINT8, BASE_DEC, NULL, 0,
2741 NULL, HFILL}
2743 { &hf_session_parameter_nonce,
2744 { "Nonce", "obex.session.nonce",
2745 FT_BYTES, BASE_NONE, NULL, 0,
2746 NULL, HFILL}
2748 { &hf_session_parameter_session_id,
2749 { "Session ID", "obex.session.session_id",
2750 FT_BYTES, BASE_NONE, NULL, 0,
2751 NULL, HFILL}
2753 { &hf_session_parameter_next_sequence_number,
2754 { "Next Sequence Number", "obex.session.next_sequence_number",
2755 FT_UINT8, BASE_DEC, NULL, 0,
2756 NULL, HFILL}
2758 { &hf_session_parameter_timeout,
2759 { "Timeout", "obex.session.timeout",
2760 FT_UINT32, BASE_DEC, NULL, 0,
2761 NULL, HFILL}
2763 { &hf_session_parameter_opcode,
2764 { "Opcode", "obex.session.opcode",
2765 FT_UINT8, BASE_HEX, VALS(session_opcode_vals), 0,
2766 NULL, HFILL}
2768 { &hf_authentication_parameter,
2769 { "Authentication Parameter", "obex.authentication",
2770 FT_NONE, BASE_NONE, NULL, 0x00,
2771 NULL, HFILL}
2773 { &hf_authentication_parameter_data,
2774 { "Parameter Value", "obex.authentication.value",
2775 FT_BYTES, BASE_NONE, NULL, 0,
2776 NULL, HFILL}
2778 { &hf_authentication_challenge_tag,
2779 { "Tag", "obex.authentication.challenge_tag",
2780 FT_UINT8, BASE_HEX, VALS(authentication_challenge_tag_vals), 0x00,
2781 NULL, HFILL}
2783 { &hf_authentication_response_tag,
2784 { "Tag", "obex.authentication.response_tag",
2785 FT_UINT8, BASE_HEX, VALS(authentication_response_tag_vals), 0x00,
2786 NULL, HFILL}
2788 { &hf_authentication_length,
2789 { "Length", "obex.authentication.length",
2790 FT_UINT8, BASE_DEC, NULL, 0,
2791 NULL, HFILL}
2793 { &hf_authentication_key,
2794 { "Key", "obex.authentication.key",
2795 FT_BYTES, BASE_NONE, NULL, 0,
2796 NULL, HFILL}
2798 { &hf_authentication_result_key,
2799 { "Result Key", "obex.authentication.result_key",
2800 FT_BYTES, BASE_NONE, NULL, 0,
2801 NULL, HFILL}
2803 { &hf_authentication_user_id,
2804 { "User Id", "obex.authentication.user_id",
2805 FT_BYTES, BASE_NONE, NULL, 0,
2806 NULL, HFILL}
2808 { &hf_authentication_option_reserved,
2809 { "Reserved", "obex.authentication.option.reserved",
2810 FT_UINT8, BASE_HEX, NULL, 0xFC,
2811 NULL, HFILL}
2813 { &hf_authentication_option_read_only,
2814 { "Read Only", "obex.authentication.option.read_only",
2815 FT_BOOLEAN, 8, NULL, 0x02,
2816 NULL, HFILL}
2818 { &hf_authentication_option_user_id,
2819 { "User ID", "obex.authentication.option.user_id",
2820 FT_BOOLEAN, 8, NULL, 0x01,
2821 NULL, HFILL}
2823 { &hf_authentication_info_charset,
2824 { "Charset", "obex.authentication.info.charset",
2825 FT_UINT8, BASE_HEX, VALS(info_charset_vals), 0,
2826 NULL, HFILL}
2828 { &hf_authentication_info,
2829 { "Info", "obex.authentication.info",
2830 FT_STRING, BASE_NONE, NULL, 0,
2831 NULL, HFILL}
2833 { &hf_application_parameter,
2834 { "Parameter", "obex.parameter",
2835 FT_NONE, BASE_NONE, NULL, 0x00,
2836 NULL, HFILL}
2838 { &hf_application_parameter_id,
2839 { "Parameter Id", "obex.parameter.id",
2840 FT_UINT8, BASE_HEX, NULL, 0x00,
2841 NULL, HFILL}
2843 { &hf_application_parameter_length,
2844 { "Parameter Length", "obex.parameter.length",
2845 FT_UINT8, BASE_DEC, NULL, 0,
2846 NULL, HFILL}
2848 { &hf_application_parameter_data,
2849 { "Parameter Value", "obex.parameter.value",
2850 FT_BYTES, BASE_NONE, NULL, 0,
2851 NULL, HFILL}
2853 /* application parameters for BPP */
2854 { &hf_bpp_application_parameter_id,
2855 { "Parameter Id", "obex.parameter.id",
2856 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bpp_application_parameters_vals_ext, 0x00,
2857 NULL, HFILL}
2859 { &hf_bpp_application_parameter_data_offset,
2860 { "Offset", "obex.parameter.value.offset",
2861 FT_UINT32, BASE_DEC_HEX, NULL, 0,
2862 "The byte offset into the image or file.", HFILL}
2864 { &hf_bpp_application_parameter_data_count,
2865 { "Count", "obex.parameter.value.count",
2866 FT_INT32, BASE_DEC, NULL, 0,
2867 "The number of bytes of the image or file to be sent.", HFILL}
2869 { &hf_bpp_application_parameter_data_job_id,
2870 { "Job ID", "obex.parameter.value.job_id",
2871 FT_UINT32, BASE_DEC_HEX, NULL, 0,
2872 "The job identifier of the print job.", HFILL}
2874 { &hf_bpp_application_parameter_data_file_size,
2875 { "File Size", "obex.parameter.value.file_size",
2876 FT_INT32, BASE_DEC, NULL, 0,
2877 "The size (in bytes) of object or file.", HFILL}
2879 /* application parameters for BIP */
2880 { &hf_bip_application_parameter_id,
2881 { "Parameter Id", "obex.parameter.id",
2882 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bip_application_parameters_vals_ext, 0x00,
2883 NULL, HFILL}
2885 { &hf_bip_application_parameter_data_number_of_returned_handles,
2886 { "Number of Returned Handles", "obex.parameter.value.number_of_returned_handles",
2887 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
2888 NULL, HFILL }
2890 { &hf_bip_application_parameter_data_list_start_offset,
2891 { "List Start Offset", "obex.parameter.value.list_start_offset",
2892 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
2893 NULL, HFILL }
2895 { &hf_bip_application_parameter_data_latest_captured_images,
2896 { "Latest Captured Images", "obex.parameter.value.latest_captured_images",
2897 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
2898 NULL, HFILL }
2900 { &hf_bip_application_parameter_data_partial_file_length,
2901 { "Partial File Length", "obex.parameter.value.partial_file_length",
2902 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
2903 NULL, HFILL }
2905 { &hf_bip_application_parameter_data_partial_file_start_offset,
2906 { "Partial File Start Offset", "obex.parameter.value.partial_file_start_offset",
2907 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
2908 NULL, HFILL }
2910 { &hf_bip_application_parameter_data_total_file_size,
2911 { "Total File Size", "obex.parameter.value.total_file_size",
2912 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
2913 NULL, HFILL }
2915 { &hf_bip_application_parameter_data_end_flag,
2916 { "End Flag", "obex.parameter.value.end_flag",
2917 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
2918 NULL, HFILL }
2920 { &hf_bip_application_parameter_data_remote_display,
2921 { "Remote Display", "obex.parameter.value.remote_display",
2922 FT_UINT8, BASE_HEX, VALS(bip_remote_display_vals), 0x00,
2923 NULL, HFILL }
2925 { &hf_bip_application_parameter_data_service_id,
2926 { "Service ID", "obex.parameter.value.service_id",
2927 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bluetooth_uuid_vals_ext, 0x00,
2928 NULL, HFILL }
2930 { &hf_bip_application_parameter_data_store_flag,
2931 { "Store Flag", "obex.parameter.value.store_flag",
2932 FT_BOOLEAN, BASE_NONE, NULL, 0x00,
2933 NULL, HFILL }
2935 /* application parameters for PBAP */
2936 { &hf_pbap_application_parameter_id,
2937 { "Parameter Id", "obex.parameter.id",
2938 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &pbap_application_parameters_vals_ext, 0x00,
2939 NULL, HFILL}
2941 { &hf_pbap_application_parameter_data_order,
2942 { "Max List Count", "obex.parameter.value.order",
2943 FT_UINT8, BASE_HEX, VALS(pbap_order_vals), 0x00,
2944 NULL, HFILL}
2946 { &hf_pbap_application_parameter_data_search_value,
2947 { "Search Value", "obex.parameter.value.search_value",
2948 FT_STRING, BASE_NONE, NULL, 0x00,
2949 NULL, HFILL}
2951 { &hf_pbap_application_parameter_data_search_attribute,
2952 { "Search Attribute", "obex.parameter.value.search_attribute",
2953 FT_UINT8, BASE_HEX, VALS(pbap_search_attribute_vals), 0x00,
2954 NULL, HFILL}
2956 { &hf_pbap_application_parameter_data_max_list_count,
2957 { "Max List Count", "obex.parameter.value.max_list_count",
2958 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
2959 NULL, HFILL}
2961 { &hf_pbap_application_parameter_data_list_start_offset,
2962 { "List Start Offset", "obex.parameter.value.list_start_offset",
2963 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
2964 NULL, HFILL}
2966 { &hf_pbap_application_parameter_data_filter,
2967 { "Filter", "obex.parameter.value.filter",
2968 FT_UINT32, BASE_HEX, NULL, 0x0,
2969 NULL, HFILL}
2971 { &hf_pbap_application_parameter_vcard_selector,
2972 { "vCard Selector", "obex.parameter.value.vcard_selector",
2973 FT_UINT32, BASE_HEX, NULL, 0x0,
2974 NULL, HFILL}
2976 { &hf_pbap_application_parameter_data_filter_version,
2977 { "vCard Version", "obex.parameter.value.filter.version",
2978 FT_BOOLEAN, 32, NULL, 0x00000001,
2979 NULL, HFILL}
2981 { &hf_pbap_application_parameter_data_filter_fn,
2982 { "Formatted Name", "obex.parameter.value.filter.fn",
2983 FT_BOOLEAN, 32, NULL, 0x00000002,
2984 NULL, HFILL}
2986 { &hf_pbap_application_parameter_data_filter_n,
2987 { "Structured Presentation of Name", "obex.parameter.value.filter.n",
2988 FT_BOOLEAN, 32, NULL, 0x00000004,
2989 NULL, HFILL}
2991 { &hf_pbap_application_parameter_data_filter_photo,
2992 { "Associated Image or Photo", "obex.parameter.value.filter.photo",
2993 FT_BOOLEAN, 32, NULL, 0x00000008,
2994 NULL, HFILL}
2996 { &hf_pbap_application_parameter_data_filter_birthday,
2997 { "Birthday", "obex.parameter.value.filter.birthday",
2998 FT_BOOLEAN, 32, NULL, 0x00000010,
2999 NULL, HFILL}
3001 { &hf_pbap_application_parameter_data_filter_adr,
3002 { "Delivery Address", "obex.parameter.value.filter.adr",
3003 FT_BOOLEAN, 32, NULL, 0x00000020,
3004 NULL, HFILL}
3006 { &hf_pbap_application_parameter_data_filter_label,
3007 { "Delivery", "obex.parameter.value.filter.label",
3008 FT_BOOLEAN, 32, NULL, 0x00000040,
3009 NULL, HFILL}
3011 { &hf_pbap_application_parameter_data_filter_tel,
3012 { "Telephone Number", "obex.parameter.value.filter.tel",
3013 FT_BOOLEAN, 32, NULL, 0x00000080,
3014 NULL, HFILL}
3016 { &hf_pbap_application_parameter_data_filter_email,
3017 { "Electronic Mail Address", "obex.parameter.value.filter.email",
3018 FT_BOOLEAN, 32, NULL, 0x00000100,
3019 NULL, HFILL}
3021 { &hf_pbap_application_parameter_data_filter_mailer,
3022 { "Electronic Mail", "obex.parameter.value.filter.mailer",
3023 FT_BOOLEAN, 32, NULL, 0x00000200,
3024 NULL, HFILL}
3026 { &hf_pbap_application_parameter_data_filter_time_zone,
3027 { "Time Zone", "obex.parameter.value.filter.time_zone",
3028 FT_BOOLEAN, 32, NULL, 0x00000400,
3029 NULL, HFILL}
3031 { &hf_pbap_application_parameter_data_filter_geographic_position,
3032 { "Geographic Position", "obex.parameter.value.filter.geographic_position",
3033 FT_BOOLEAN, 32, NULL, 0x00000800,
3034 NULL, HFILL}
3036 { &hf_pbap_application_parameter_data_filter_title,
3037 { "Job", "obex.parameter.value.filter.title",
3038 FT_BOOLEAN, 32, NULL, 0x00001000,
3039 NULL, HFILL}
3041 { &hf_pbap_application_parameter_data_filter_role,
3042 { "Role within the Organization", "obex.parameter.value.filter.role",
3043 FT_BOOLEAN, 32, NULL, 0x00002000,
3044 NULL, HFILL}
3046 { &hf_pbap_application_parameter_data_filter_logo,
3047 { "Organization Logo", "obex.parameter.value.filter.logo",
3048 FT_BOOLEAN, 32, NULL, 0x00004000,
3049 NULL, HFILL}
3051 { &hf_pbap_application_parameter_data_filter_agent,
3052 { "vCard of Person Representing", "obex.parameter.value.filter.agent",
3053 FT_BOOLEAN, 32, NULL, 0x00008000,
3054 NULL, HFILL}
3056 { &hf_pbap_application_parameter_data_filter_name_of_organization,
3057 { "Name of Organization", "obex.parameter.value.filter.name_of_organization",
3058 FT_BOOLEAN, 32, NULL, 0x00010000,
3059 NULL, HFILL}
3061 { &hf_pbap_application_parameter_data_filter_comments,
3062 { "Comments", "obex.parameter.value.filter.comments",
3063 FT_BOOLEAN, 32, NULL, 0x00020000,
3064 NULL, HFILL}
3066 { &hf_pbap_application_parameter_data_filter_revision,
3067 { "Revision", "obex.parameter.value.filter.revision",
3068 FT_BOOLEAN, 32, NULL, 0x00040000,
3069 NULL, HFILL}
3071 { &hf_pbap_application_parameter_data_filter_pronunciation_of_name,
3072 { "Pronunciation of Name", "obex.parameter.value.filter.pronunciation_of_name",
3073 FT_BOOLEAN, 32, NULL, 0x00080000,
3074 NULL, HFILL}
3076 { &hf_pbap_application_parameter_data_filter_url,
3077 { "Uniform Resource Locator", "obex.parameter.value.filter.url",
3078 FT_BOOLEAN, 32, NULL, 0x00100000,
3079 NULL, HFILL}
3081 { &hf_pbap_application_parameter_data_filter_uid,
3082 { "Unique ID", "obex.parameter.value.filter.uid",
3083 FT_BOOLEAN, 32, NULL, 0x00200000,
3084 NULL, HFILL}
3086 { &hf_pbap_application_parameter_data_filter_key,
3087 { "Public Encryption Key", "obex.parameter.value.filter.key",
3088 FT_BOOLEAN, 32, NULL, 0x00400000,
3089 NULL, HFILL}
3091 { &hf_pbap_application_parameter_data_filter_nickname,
3092 { "Nickname", "obex.parameter.value.filter.nickname",
3093 FT_BOOLEAN, 32, NULL, 0x00800000,
3094 NULL, HFILL}
3096 { &hf_pbap_application_parameter_data_filter_categories,
3097 { "Categories", "obex.parameter.value.filter.categories",
3098 FT_BOOLEAN, 32, NULL, 0x01000000,
3099 NULL, HFILL}
3101 { &hf_pbap_application_parameter_data_filter_product_id,
3102 { "Product ID", "obex.parameter.value.filter.product_id",
3103 FT_BOOLEAN, 32, NULL, 0x02000000,
3104 NULL, HFILL}
3106 { &hf_pbap_application_parameter_data_filter_class,
3107 { "Class Information", "obex.parameter.value.filter.class",
3108 FT_BOOLEAN, 32, NULL, 0x04000000,
3109 NULL, HFILL}
3111 { &hf_pbap_application_parameter_data_filter_sort_string,
3112 { "String Used For Sorting Operations", "obex.parameter.value.filter.sort_string",
3113 FT_BOOLEAN, 32, NULL, 0x08000000,
3114 NULL, HFILL}
3116 { &hf_pbap_application_parameter_data_filter_timestamp,
3117 { "Timestamp", "obex.parameter.value.filter.timestamp",
3118 FT_BOOLEAN, 32, NULL, 0x10000000,
3119 NULL, HFILL}
3121 { &hf_pbap_application_parameter_data_filter_reserved_29_31,
3122 { "Reserved", "obex.parameter.value.filter.reserved_29_31",
3123 FT_UINT32, BASE_HEX, NULL, 0xE0000000,
3124 NULL, HFILL}
3126 { &hf_pbap_application_parameter_data_filter_reserved_32_38,
3127 { "Reserved", "obex.parameter.value.filter.reserved_32_38",
3128 FT_UINT32, BASE_HEX, NULL, 0x0000007F,
3129 NULL, HFILL}
3131 { &hf_pbap_application_parameter_data_filter_proprietary_filter,
3132 { "Proprietary Filter", "obex.parameter.value.filter.proprietary_filter",
3133 FT_BOOLEAN, 32, NULL, 0x00000080,
3134 NULL, HFILL}
3136 { &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage,
3137 { "Reserved for Proprietary Filter Usage", "obex.parameter.value.filter.reserved_for_proprietary_filter_usage",
3138 FT_UINT32, BASE_HEX, NULL, 0xFFFFFF00,
3139 NULL, HFILL}
3141 { &hf_pbap_application_parameter_data_format,
3142 { "Format", "obex.parameter.value.format",
3143 FT_UINT8, BASE_HEX, VALS(pbap_format_vals), 0x00,
3144 NULL, HFILL}
3146 { &hf_pbap_application_parameter_data_phonebook_size,
3147 { "Phonebook Size", "obex.parameter.value.phonebook_size",
3148 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3149 NULL, HFILL}
3151 { &hf_pbap_application_parameter_data_new_missed_calls,
3152 { "New Missed Calls", "obex.parameter.value.new_missed_calls",
3153 FT_UINT8, BASE_DEC, NULL, 0x00,
3154 NULL, HFILL}
3156 { &hf_pbap_application_parameter_data_primary_version_counter,
3157 { "Primary Version Counter", "obex.parameter.value.primary_version_counter",
3158 FT_BYTES, BASE_NONE, NULL, 0x00,
3159 NULL, HFILL}
3161 { &hf_pbap_application_parameter_data_secondary_version_counter,
3162 { "Secondary Version Counter", "obex.parameter.value.secondary_version_counter",
3163 FT_BYTES, BASE_NONE, NULL, 0x00,
3164 NULL, HFILL}
3166 { &hf_pbap_application_parameter_data_database_identifier,
3167 { "Database Identifier", "obex.parameter.value.database_identifier",
3168 FT_BYTES, BASE_NONE, NULL, 0x00,
3169 NULL, HFILL}
3171 { &hf_pbap_application_parameter_data_vcard_selector_operator,
3172 { "vCard Selector Operator", "obex.parameter.value.vcard_selector_operator",
3173 FT_UINT8, BASE_HEX, VALS(pbap_application_parameter_data_vcard_selector_operator_vals), 0x00,
3174 NULL, HFILL}
3176 { &hf_pbap_application_parameter_data_reset_new_missed_calls,
3177 { "vCard Selector Operator", "obex.parameter.value.reset_new_missed_calls",
3178 FT_UINT8, BASE_HEX, VALS(pbap_application_parameter_data_reset_new_missed_calls_vals), 0x00,
3179 NULL, HFILL}
3181 { &hf_pbap_application_parameter_data_supported_features,
3182 { "Supported Features", "obex.parameter.supported_features",
3183 FT_UINT32, BASE_HEX, NULL, 0x0,
3184 NULL, HFILL }
3186 { &hf_pbap_application_parameter_data_supported_features_reserved,
3187 { "Reserved", "obex.parameter.supported_features.reserved",
3188 FT_UINT32, BASE_HEX, NULL, 0xFFFFFC00,
3189 NULL, HFILL }
3191 { &hf_pbap_application_parameter_data_supported_features_default_contact_image_format,
3192 { "Default Contact Image Format", "obex.parameter.supported_features.default_contact_image_format",
3193 FT_BOOLEAN, 32, NULL, 0x00000200,
3194 NULL, HFILL }
3196 { &hf_pbap_application_parameter_data_supported_features_contact_referencing,
3197 { "Contact Referencing", "obex.parameter.supported_features.contact_referencing",
3198 FT_BOOLEAN, 32, NULL, 0x00000100,
3199 NULL, HFILL }
3201 { &hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property,
3202 { "X-BT-UID vCard Property", "obex.parameter.supported_features.x_bt_uid_vcard_property",
3203 FT_BOOLEAN, 32, NULL, 0x00000080,
3204 NULL, HFILL }
3206 { &hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property,
3207 { "X-BT-UCI vCard Property", "obex.parameter.supported_features.x_bt_uci_vcard_property",
3208 FT_BOOLEAN, 32, NULL, 0x00000040,
3209 NULL, HFILL }
3211 { &hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls,
3212 { "Enhanced Missed Calls", "obex.parameter.supported_features.enhanced_missed_calls",
3213 FT_BOOLEAN, 32, NULL, 0x00000020,
3214 NULL, HFILL }
3216 { &hf_pbap_application_parameter_data_supported_features_vcard_selecting,
3217 { "vCard Selecting", "obex.parameter.supported_features.vcard_selecting",
3218 FT_BOOLEAN, 32, NULL, 0x00000010,
3219 NULL, HFILL }
3221 { &hf_pbap_application_parameter_data_supported_features_folder_version_counters,
3222 { "Folder Version Counters", "obex.parameter.supported_features.folder_version_counters",
3223 FT_BOOLEAN, 32, NULL, 0x00000008,
3224 NULL, HFILL }
3226 { &hf_pbap_application_parameter_data_supported_features_database_identifier,
3227 { "Database Identifier", "obex.parameter.supported_features.database_identifier",
3228 FT_BOOLEAN, 32, NULL, 0x00000004,
3229 NULL, HFILL }
3231 { &hf_pbap_application_parameter_data_supported_features_browsing,
3232 { "Browsing", "obex.parameter.supported_features.browsing",
3233 FT_BOOLEAN, 32, NULL, 0x00000002,
3234 NULL, HFILL }
3236 { &hf_pbap_application_parameter_data_supported_features_download,
3237 { "Download", "obex.parameter.supported_features.download",
3238 FT_BOOLEAN, 32, NULL, 0x00000001,
3239 NULL, HFILL }
3241 /* application parameters for MAP */
3242 { &hf_map_application_parameter_id,
3243 { "Parameter Id", "obex.parameter.id",
3244 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &map_application_parameters_vals_ext, 0x00,
3245 NULL, HFILL}
3247 { &hf_map_application_parameter_data_max_list_count,
3248 { "Max List Count", "obex.parameter.value.max_list_count",
3249 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3250 NULL, HFILL}
3252 { &hf_map_application_parameter_data_start_offset,
3253 { "Start Offset", "obex.parameter.value.start_offset",
3254 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3255 NULL, HFILL}
3257 { &hf_map_application_parameter_data_filter_message_type_reserved,
3258 { "Reserved", "obex.parameter.value.filter_message_type.reserved",
3259 FT_UINT8, BASE_HEX, NULL, 0xF0,
3260 NULL, HFILL}
3262 { &hf_map_application_parameter_data_filter_message_type_mms,
3263 { "MMS", "obex.parameter.value.filter_message_type.mms",
3264 FT_BOOLEAN, 8, NULL, 0x08,
3265 "True to filter out, False to listing this type", HFILL}
3267 { &hf_map_application_parameter_data_filter_message_type_email,
3268 { "EMAIL", "obex.parameter.value.filter_message_type.sms_email",
3269 FT_BOOLEAN, 8, NULL, 0x04,
3270 "True to filter out, False to listing this type", HFILL}
3272 { &hf_map_application_parameter_data_filter_message_type_sms_cdma,
3273 { "SMS_CDMA", "obex.parameter.value.filter_message_type.sms_cdma",
3274 FT_BOOLEAN, 8, NULL, 0x02,
3275 "True to filter out, False to listing this type", HFILL}
3277 { &hf_map_application_parameter_data_filter_message_type_sms_gsm,
3278 { "SMS_GSM", "obex.parameter.value.filter_message_type.sms_gsm",
3279 FT_BOOLEAN, 8, NULL, 0x01,
3280 NULL, HFILL}
3282 { &hf_map_application_parameter_data_filter_period_begin,
3283 { "Filter Period Begin", "obex.parameter.value.filter_period_begin",
3284 FT_STRING, BASE_NONE, NULL, 0,
3285 NULL, HFILL}
3287 { &hf_map_application_parameter_data_filter_period_end,
3288 { "Filter Period End", "obex.parameter.value.filter_period_end",
3289 FT_STRING, BASE_NONE, NULL, 0,
3290 NULL, HFILL}
3292 { &hf_map_application_parameter_data_filter_read_status_reserved_6,
3293 { "Filter Read Status: Reserved", "obex.parameter.value.filter_read_status.reserved",
3294 FT_UINT8, BASE_HEX, NULL, 0xFC,
3295 NULL, HFILL}
3297 { &hf_map_application_parameter_data_filter_read_status_get_read,
3298 { "Filter Read Status: Get Read", "obex.parameter.value.filter_read_status.get_read",
3299 FT_BOOLEAN, 8, NULL, 0x02,
3300 NULL, HFILL}
3302 { &hf_map_application_parameter_data_filter_read_status_get_unread,
3303 { "Filter Read Status: Get Unread", "obex.parameter.value.filter_read_status.get_unread",
3304 FT_BOOLEAN, 8, NULL, 0x01,
3305 NULL, HFILL}
3307 { &hf_map_application_parameter_data_filter_recipient,
3308 { "Filter Recipient", "obex.parameter.value.filter_recipient",
3309 FT_STRING, BASE_NONE, NULL, 0,
3310 NULL, HFILL}
3312 { &hf_map_application_parameter_data_filter_originator,
3313 { "Filter Originator", "obex.parameter.value.filter_originator",
3314 FT_STRING, BASE_NONE, NULL, 0,
3315 NULL, HFILL}
3317 { &hf_map_application_parameter_data_filter_priority_reserved_6,
3318 { "Filter Priority: Reserved", "obex.parameter.value.filter_priority.reserved",
3319 FT_UINT8, BASE_HEX, NULL, 0xFC,
3320 NULL, HFILL}
3322 { &hf_map_application_parameter_data_filter_priority_get_high,
3323 { "Filter Priority: Get Read", "obex.parameter.value.filter_priority.get_high",
3324 FT_BOOLEAN, 8, NULL, 0x02,
3325 NULL, HFILL}
3327 { &hf_map_application_parameter_data_filter_priority_non_high,
3328 { "Filter Priority: Get Non High", "obex.parameter.value.filter_priority.non_high",
3329 FT_BOOLEAN, 8, NULL, 0x01,
3330 NULL, HFILL}
3332 { &hf_map_application_parameter_data_reserved_7,
3333 { "Reserved", "obex.parameter.value.reserved",
3334 FT_UINT8, BASE_HEX, NULL, 0xFE,
3335 NULL, HFILL}
3337 { &hf_map_application_parameter_data_attachment,
3338 { "Attachment", "obex.parameter.value.attachment",
3339 FT_BOOLEAN, 8, NULL, 0x01,
3340 NULL, HFILL}
3342 { &hf_map_application_parameter_data_transparent,
3343 { "Transparent", "obex.parameter.value.transparent",
3344 FT_BOOLEAN, 8, NULL, 0x01,
3345 NULL, HFILL}
3347 { &hf_map_application_parameter_data_retry,
3348 { "Retry", "obex.parameter.value.retry",
3349 FT_BOOLEAN, 8, NULL, 0x01,
3350 NULL, HFILL}
3352 { &hf_map_application_parameter_data_new_message,
3353 { "New Message", "obex.parameter.value.new_message",
3354 FT_BOOLEAN, 8, NULL, 0x01,
3355 NULL, HFILL}
3357 { &hf_map_application_parameter_data_notification_status,
3358 { "Notification Status", "obex.parameter.value.notification_status",
3359 FT_BOOLEAN, 8, NULL, 0x01,
3360 NULL, HFILL}
3362 { &hf_map_application_parameter_data_mas_instance_id,
3363 { "MAS Instance ID", "obex.parameter.value.mas_instance_id",
3364 FT_UINT8, BASE_DEC_HEX, NULL, 0,
3365 NULL, HFILL}
3367 { &hf_map_application_parameter_data_parameter_mask_reserved,
3368 { "Parameter Mask: Reserved", "obex.parameter.value.parameter_mask.reserved",
3369 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
3370 NULL, HFILL}
3372 { &hf_map_application_parameter_data_parameter_mask_reply_to_addressing,
3373 { "Parameter Mask: Reply to Addressing", "obex.parameter.value.parameter_mask.reply_to_addressing",
3374 FT_BOOLEAN, 32, NULL, 0x00008000,
3375 NULL, HFILL}
3377 { &hf_map_application_parameter_data_parameter_mask_protected,
3378 { "Parameter Mask: Protected", "obex.parameter.value.parameter_mask.protected",
3379 FT_BOOLEAN, 32, NULL, 0x00004000,
3380 NULL, HFILL}
3382 { &hf_map_application_parameter_data_parameter_mask_sent,
3383 { "Parameter Mask: Sent", "obex.parameter.value.parameter_mask.sent",
3384 FT_BOOLEAN, 32, NULL, 0x00002000,
3385 NULL, HFILL}
3387 { &hf_map_application_parameter_data_parameter_mask_read,
3388 { "Parameter Mask: Read", "obex.parameter.value.parameter_mask.read",
3389 FT_BOOLEAN, 32, NULL, 0x00001000,
3390 NULL, HFILL}
3392 { &hf_map_application_parameter_data_parameter_mask_priority,
3393 { "Parameter Mask: Priority", "obex.parameter.value.parameter_mask.priority",
3394 FT_BOOLEAN, 32, NULL, 0x00000800,
3395 NULL, HFILL}
3397 { &hf_map_application_parameter_data_parameter_mask_attachment_size,
3398 { "Parameter Mask: Attachment Size", "obex.parameter.value.parameter_mask.attachment_size",
3399 FT_BOOLEAN, 32, NULL, 0x00000400,
3400 NULL, HFILL}
3402 { &hf_map_application_parameter_data_parameter_mask_text,
3403 { "Parameter Mask: Text", "obex.parameter.value.parameter_mask.text",
3404 FT_BOOLEAN, 32, NULL, 0x00000200,
3405 NULL, HFILL}
3407 { &hf_map_application_parameter_data_parameter_mask_reception_status,
3408 { "Parameter Mask: Reception Status", "obex.parameter.value.parameter_mask.reception_status",
3409 FT_BOOLEAN, 32, NULL, 0x00000100,
3410 NULL, HFILL}
3412 { &hf_map_application_parameter_data_parameter_mask_size,
3413 { "Parameter Mask: Size", "obex.parameter.value.parameter_mask.size",
3414 FT_BOOLEAN, 32, NULL, 0x00000080,
3415 NULL, HFILL}
3417 { &hf_map_application_parameter_data_parameter_mask_type,
3418 { "Parameter Mask: Type", "obex.parameter.value.parameter_mask.type",
3419 FT_BOOLEAN, 32, NULL, 0x00000040,
3420 NULL, HFILL}
3422 { &hf_map_application_parameter_data_parameter_mask_recipient_addressing,
3423 { "Parameter Mask: Recipient Addressing", "obex.parameter.value.parameter_mask.recipient_addressing",
3424 FT_BOOLEAN, 32, NULL, 0x00000020,
3425 NULL, HFILL}
3427 { &hf_map_application_parameter_data_parameter_mask_recipient_name,
3428 { "Parameter Mask: Recipient Name", "obex.parameter.value.parameter_mask.recipient_name",
3429 FT_BOOLEAN, 32, NULL, 0x00000010,
3430 NULL, HFILL}
3432 { &hf_map_application_parameter_data_parameter_mask_sender_addressing,
3433 { "Parameter Mask: Sender Addressing", "obex.parameter.value.parameter_mask.sender_addressing",
3434 FT_BOOLEAN, 32, NULL, 0x00000008,
3435 NULL, HFILL}
3437 { &hf_map_application_parameter_data_parameter_mask_sender_name,
3438 { "Parameter Mask: Sender Name", "obex.parameter.value.parameter_mask.sender_name",
3439 FT_BOOLEAN, 32, NULL, 0x00000004,
3440 NULL, HFILL}
3442 { &hf_map_application_parameter_data_parameter_mask_datetime,
3443 { "Parameter Mask: Datetime", "obex.parameter.value.parameter_mask.datetime",
3444 FT_BOOLEAN, 32, NULL, 0x00000002,
3445 NULL, HFILL}
3447 { &hf_map_application_parameter_data_parameter_mask_subject,
3448 { "Parameter Mask: Subject", "obex.parameter.value.parameter_mask.subject",
3449 FT_BOOLEAN, 32, NULL, 0x00000001,
3450 NULL, HFILL}
3452 { &hf_map_application_parameter_data_folder_listing_size,
3453 { "Folder Listing Size", "obex.parameter.value.folder_listing_size",
3454 FT_UINT16, BASE_DEC_HEX, NULL, 0,
3455 NULL, HFILL}
3457 { &hf_map_application_parameter_data_messages_listing_size,
3458 { "Messages Listing Size", "obex.parameter.value.messages_listing_size",
3459 FT_UINT16, BASE_DEC_HEX, NULL, 0,
3460 NULL, HFILL}
3462 { &hf_map_application_parameter_data_subject_length,
3463 { "Subject Length", "obex.parameter.value.subject_length",
3464 FT_UINT8, BASE_DEC_HEX, NULL, 0,
3465 NULL, HFILL}
3467 { &hf_map_application_parameter_data_charset,
3468 { "Charset", "obex.parameter.value.charset",
3469 FT_UINT8, BASE_HEX, VALS(map_charset_vals), 0x01,
3470 NULL, HFILL}
3472 { &hf_map_application_parameter_data_fraction_request,
3473 { "Fraction Request", "obex.parameter.value.fraction_request",
3474 FT_UINT8, BASE_HEX, VALS(map_fraction_request_vals), 0x01,
3475 NULL, HFILL}
3477 { &hf_map_application_parameter_data_fraction_deliver,
3478 { "Fraction Deliver", "obex.parameter.value.fraction_deliver",
3479 FT_UINT8, BASE_HEX, VALS(map_fraction_deliver_vals), 0x01,
3480 NULL, HFILL}
3482 { &hf_map_application_parameter_data_status_indicator,
3483 { "Status Indicator", "obex.parameter.value.status_indicator",
3484 FT_UINT8, BASE_HEX, VALS(map_status_indicator_vals), 0x01,
3485 NULL, HFILL}
3487 { &hf_map_application_parameter_data_status_value,
3488 { "Status Value", "obex.parameter.value.status_value",
3489 FT_BOOLEAN, 8, NULL, 0x01,
3490 NULL, HFILL}
3492 { &hf_map_application_parameter_data_mse_time,
3493 { "MSE Time", "obex.parameter.value.mse_time",
3494 FT_STRING, BASE_NONE, NULL, 0,
3495 NULL, HFILL}
3497 /* application parameters for GPP */
3498 { &hf_gpp_application_parameter_id,
3499 { "Parameter Id", "obex.parameter.gpp.id",
3500 FT_UINT8, BASE_HEX, VALS(gpp_application_parameters_vals), 0x00,
3501 NULL, HFILL}
3503 { &hf_gpp_application_parameter_data_max_list_count,
3504 { "Max List Count", "obex.parameter.gpp.value.max_list_count",
3505 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3506 NULL, HFILL}
3508 { &hf_gpp_application_parameter_data_list_start_offset,
3509 { "List Start Offset", "obex.parameter.gpp.value.list_start_offset",
3510 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3511 NULL, HFILL}
3513 { &hf_gpp_application_parameter_data_reserved_7,
3514 { "Reserved", "obex.parameter.gpp.value.reserved",
3515 FT_UINT8, BASE_HEX, NULL, 0xFE,
3516 NULL, HFILL}
3518 { &hf_gpp_application_parameter_data_notification_status,
3519 { "Notification Status", "obex.parameter.gpp.value.notification_status",
3520 FT_BOOLEAN, 8, NULL, 0x01,
3521 NULL, HFILL}
3523 { &hf_gpp_application_parameter_data_instance_id,
3524 { "Instance ID", "obex.parameter.gpp.value.instance_id",
3525 FT_UINT8, BASE_DEC_HEX, NULL, 0,
3526 NULL, HFILL}
3528 { &hf_gpp_application_parameter_data_listing_size,
3529 { "Listing Size", "obex.parameter.gpp.value.listing_size",
3530 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3531 NULL, HFILL}
3533 /* application parameters for CTN */
3534 { &hf_ctn_application_parameter_id,
3535 { "Parameter Id", "obex.parameter.ctn.id",
3536 FT_UINT8, BASE_HEX, VALS(ctn_application_parameters_vals), 0x00,
3537 NULL, HFILL}
3539 { &hf_ctn_application_parameter_data_acoustic_alarm_status,
3540 { "Acoustic Alarm Status", "obex.parameter.ctn.acoustic_alarm_status",
3541 FT_UINT8, BASE_HEX, VALS(off_on_vals), 0x00,
3542 NULL, HFILL}
3544 { &hf_ctn_application_parameter_data_attachment,
3545 { "Attachment", "obex.parameter.ctn.attachment",
3546 FT_UINT8, BASE_HEX, VALS(ctn_application_parameter_data_attachment_vals), 0x00,
3547 NULL, HFILL}
3549 { &hf_ctn_application_parameter_data_send,
3550 { "Attachment", "obex.parameter.ctn.attachment",
3551 FT_UINT8, BASE_HEX, VALS(no_yes_vals), 0x00,
3552 NULL, HFILL}
3554 { &hf_ctn_application_parameter_data_filter_period_begin,
3555 { "Filter Period Begin", "obex.parameter.ctn.filter_period_begin",
3556 FT_STRING, BASE_NONE, NULL, 0x00,
3557 NULL, HFILL}
3559 { &hf_ctn_application_parameter_data_filter_period_end,
3560 { "Filter Period End", "obex.parameter.ctn.filter_period_end",
3561 FT_STRING, BASE_NONE, NULL, 0x00,
3562 NULL, HFILL}
3564 { &hf_ctn_application_parameter_data_parameter_mask,
3565 { "Parameter Mask", "obex.parameter.ctn.parameter_mask",
3566 FT_UINT32, BASE_HEX, NULL, 0x00,
3567 NULL, HFILL}
3569 { &hf_ctn_application_parameter_data_parameter_mask_reserved,
3570 { "Reserved", "obex.parameter.ctn.parameter_mask.reserved",
3571 FT_UINT32, BASE_HEX, NULL, 0xFFFFFC00,
3572 NULL, HFILL}
3574 { &hf_ctn_application_parameter_data_parameter_mask_recurrent,
3575 { "Recurrent", "obex.parameter.ctn.parameter_mask.recurrent",
3576 FT_UINT32, BASE_HEX, NULL, 0x00000200,
3577 NULL, HFILL}
3579 { &hf_ctn_application_parameter_data_parameter_mask_send_status,
3580 { "Send Status", "obex.parameter.ctn.parameter_mask.send_status",
3581 FT_UINT32, BASE_HEX, NULL, 0x00000100,
3582 NULL, HFILL}
3584 { &hf_ctn_application_parameter_data_parameter_mask_alarm_status,
3585 { "Alarm Status", "obex.parameter.ctn.parameter_mask.alarm_status",
3586 FT_UINT32, BASE_HEX, NULL, 0x00000080,
3587 NULL, HFILL}
3589 { &hf_ctn_application_parameter_data_parameter_mask_pstatus,
3590 { "pStatus", "obex.parameter.ctn.parameter_mask.pstatus",
3591 FT_UINT32, BASE_HEX, NULL, 0x00000040,
3592 NULL, HFILL}
3594 { &hf_ctn_application_parameter_data_parameter_mask_priority,
3595 { "Priority", "obex.parameter.ctn.parameter_mask.priority",
3596 FT_UINT32, BASE_HEX, NULL, 0x00000020,
3597 NULL, HFILL}
3599 { &hf_ctn_application_parameter_data_parameter_mask_originator_address,
3600 { "Originator Address", "obex.parameter.ctn.parameter_mask.originator_address",
3601 FT_UINT32, BASE_HEX, NULL, 0x00000010,
3602 NULL, HFILL}
3604 { &hf_ctn_application_parameter_data_parameter_mask_originator_name,
3605 { "Originator Name", "obex.parameter.ctn.parameter_mask.originator_name",
3606 FT_UINT32, BASE_HEX, NULL, 0x00000008,
3607 NULL, HFILL}
3609 { &hf_ctn_application_parameter_data_parameter_mask_end_time,
3610 { "End Time", "obex.parameter.ctn.parameter_mask.end_time",
3611 FT_UINT32, BASE_HEX, NULL, 0x00000004,
3612 NULL, HFILL}
3614 { &hf_ctn_application_parameter_data_parameter_mask_summary,
3615 { "Summary", "obex.parameter.ctn.parameter_mask.summary",
3616 FT_UINT32, BASE_HEX, NULL, 0x00000002,
3617 NULL, HFILL}
3619 { &hf_ctn_application_parameter_data_parameter_mask_attachment,
3620 { "Attachment", "obex.parameter.ctn.parameter_mask.attachment",
3621 FT_UINT32, BASE_HEX, NULL, 0x00000001,
3622 NULL, HFILL}
3624 { &hf_ctn_application_parameter_data_status_indicator,
3625 { "Status Indicator", "obex.parameter.ctn.status_indicator",
3626 FT_UINT8, BASE_HEX, VALS(ctn_application_parameter_data_status_indicator_vals), 0x00,
3627 NULL, HFILL}
3629 { &hf_ctn_application_parameter_data_status_value,
3630 { "Status Value", "obex.parameter.ctn.status_value",
3631 FT_UINT8, BASE_HEX, VALS(ctn_application_parameter_data_status_value_vals), 0x00,
3632 NULL, HFILL}
3634 { &hf_ctn_application_parameter_data_postpone_val,
3635 { "Postpone Val", "obex.parameter.ctn.postpone_val",
3636 FT_UINT32, BASE_DEC, NULL, 0x00,
3637 NULL, HFILL}
3639 { &hf_ctn_application_parameter_data_email_uri,
3640 { "Email URI", "obex.parameter.ctn.email_uri",
3641 FT_STRING, BASE_NONE, NULL, 0x00,
3642 NULL, HFILL}
3644 { &hf_ctn_application_parameter_data_cse_time,
3645 { "CSE Time", "obex.parameter.ctn.cse_time",
3646 FT_STRING, BASE_NONE, NULL, 0x00,
3647 NULL, HFILL}
3649 { &hf_ctn_application_parameter_data_recurrent,
3650 { "Recurrent", "obex.parameter.ctn.recurrent",
3651 FT_UINT8, BASE_HEX, VALS(no_yes_vals), 0x00,
3652 NULL, HFILL}
3654 { &hf_ctn_application_parameter_data_attach_id,
3655 { "Attach ID", "obex.parameter.ctn.attach_id",
3656 FT_UINT8, BASE_DEC, NULL, 0x00,
3657 NULL, HFILL}
3659 { &hf_ctn_application_parameter_data_last_update,
3660 { "Last Update", "obex.parameter.ctn.last_update",
3661 FT_STRING, BASE_NONE, NULL, 0x00,
3662 NULL, HFILL}
3664 /* for fragmentation */
3665 { &hf_obex_fragment_overlap,
3666 { "Fragment overlap", "obex.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3667 "Fragment overlaps with other fragments", HFILL }
3669 { &hf_obex_fragment_overlap_conflict,
3670 { "Conflicting data in fragment overlap", "obex.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3671 "Overlapping fragments contained conflicting data", HFILL }
3673 { &hf_obex_fragment_multiple_tails,
3674 { "Multiple tail fragments found", "obex.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3675 "Several tails were found when defragmenting the packet", HFILL }
3677 { &hf_obex_fragment_too_long_fragment,
3678 { "Fragment too long", "obex.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3679 "Fragment contained data past end of packet", HFILL }
3681 { &hf_obex_fragment_error,
3682 { "Defragmentation error", "obex.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
3683 "Defragmentation error due to illegal fragments", HFILL }
3685 { &hf_obex_fragment_count,
3686 { "Fragment count", "obex.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
3687 NULL, HFILL }
3689 { &hf_obex_fragment,
3690 { "OBEX Fragment", "obex.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
3691 NULL, HFILL }
3693 { &hf_obex_fragments,
3694 { "OBEX Fragments", "obex.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
3695 NULL, HFILL }
3697 { &hf_obex_reassembled_in,
3698 { "Reassembled OBEX in frame", "obex.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
3699 "This OBEX frame is reassembled in this frame", HFILL }
3701 { &hf_obex_reassembled_length,
3702 { "Reassembled OBEX length", "obex.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
3703 "The total length of the reassembled payload", HFILL }
3705 { &hf_profile,
3706 { "Profile", "obex.profile", FT_UINT32, BASE_DEC | BASE_EXT_STRING, &profile_vals_ext, 0x0,
3707 "Bluetooth Profile used in this OBEX session", HFILL }
3709 { &hf_type,
3710 { "Type", "obex.type", FT_STRINGZ, BASE_NONE, NULL, 0x0,
3711 NULL, HFILL }
3713 { &hf_object_class,
3714 { "Object Class", "obex.object_class", FT_STRINGZ, BASE_NONE, NULL, 0x0,
3715 NULL, HFILL }
3717 { &hf_time_iso8601,
3718 { "Time", "obex.time", FT_STRINGZ, BASE_NONE, NULL, 0x0,
3719 NULL, HFILL }
3721 { &hf_hdr_val_action,
3722 { "Action", "obex.action", FT_UINT8, BASE_DEC, VALS(action_vals), 0x0,
3723 NULL, HFILL }
3725 { &hf_hdr_val_single_response_mode,
3726 { "Single Response Mode", "obex.single_response_mode", FT_UINT8, BASE_DEC, VALS(single_response_mode_vals), 0x0,
3727 NULL, HFILL }
3729 { &hf_hdr_val_single_response_mode_parameter,
3730 { "Single Response Mode Parameter", "obex.single_response_mode_parameter", FT_UINT8, BASE_DEC, VALS(single_response_mode_parameter_vals), 0x0,
3731 NULL, HFILL }
3733 { &hf_wan_uuid,
3734 { "WAN UUID", "obex.wan_uuid",
3735 FT_UINT16, BASE_HEX, NULL, 0x00,
3736 NULL, HFILL }
3738 { &hf_sender_bd_addr,
3739 { "Sender Address", "obex.sender_bd_addr",
3740 FT_ETHER, BASE_NONE, NULL, 0x0,
3741 NULL, HFILL }
3743 { &hf_name,
3744 { "Name", "obex.name",
3745 FT_STRING, BASE_NONE, NULL, 0,
3746 NULL, HFILL }
3748 { &hf_current_path,
3749 { "Current Path", "obex.current_path",
3750 FT_STRINGZ, BASE_NONE, NULL, 0,
3751 NULL, HFILL }
3753 { &hf_request_in_frame,
3754 { "Request in Frame", "obex.request_in_frame", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
3755 NULL, HFILL}
3757 { &hf_response_in_frame,
3758 { "Response in Frame", "obex.response_in_frame", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
3759 NULL, HFILL}
3763 /* Setup protocol subtree array */
3764 static int *ett[] = {
3765 &ett_obex,
3766 &ett_obex_hdrs,
3767 &ett_obex_hdr,
3768 &ett_obex_hdr_id,
3769 &ett_obex_filter,
3770 &ett_obex_parameter,
3771 &ett_obex_fragment,
3772 &ett_obex_fragments,
3773 &ett_obex_session_parameters,
3774 &ett_obex_application_parameters,
3775 &ett_obex_authentication_parameters
3778 static ei_register_info ei[] = {
3779 { &ei_application_parameter_length_bad, { "obex.parameter.length.bad", PI_PROTOCOL, PI_WARN, "Parameter length bad", EXPFILL }},
3780 { &ei_unexpected_data, { "obex.expert.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }},
3781 { &ei_decoded_as_profile, { "obex.expert.decoded_as.profile", PI_PROTOCOL, PI_NOTE, "Decoded As", EXPFILL }},
3784 /* Decode As handling */
3785 static build_valid_func obex_profile_da_build_value[1] = {obex_profile_value};
3786 static decode_as_value_t obex_profile_da_values = {obex_profile_prompt, 1, obex_profile_da_build_value};
3787 static decode_as_t obex_profile_da = {"obex", "obex.profile", 1, 0, &obex_profile_da_values, NULL, NULL,
3788 decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
3790 static build_valid_func media_type_da_build_value[1] = {media_type_value};
3791 static decode_as_value_t media_type_da_values = {media_type_prompt, 1, media_type_da_build_value};
3792 static decode_as_t media_type_da = {"obex", "media_type",
3793 1, 0, &media_type_da_values, NULL, NULL,
3794 decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
3797 obex_path = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3798 obex_profile = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3799 obex_last_opcode = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3801 proto_obex = proto_register_protocol("OBEX Protocol", "OBEX", "obex");
3803 obex_handle = register_dissector("obex", dissect_obex, proto_obex);
3805 obex_profile_table = register_dissector_table("obex.profile", "OBEX Profile", proto_obex, FT_UINT8, BASE_DEC);
3807 /* Required function calls to register the header fields and subtrees used */
3808 proto_register_field_array(proto_obex, hf, array_length(hf));
3809 proto_register_subtree_array(ett, array_length(ett));
3810 expert_obex = expert_register_protocol(proto_obex);
3811 expert_register_field_array(expert_obex, ei, array_length(ei));
3813 reassembly_table_register(&obex_reassembly_table,
3814 &addresses_reassembly_table_functions);
3816 register_decode_as(&obex_profile_da);
3818 proto_raw = proto_register_protocol("OBEX Raw Application Parameters", "Raw Application Parameters", "obex.parameter.raw");
3819 raw_application_parameters_handle = register_dissector("obex.parameter.raw", dissect_obex_application_parameter_raw, proto_raw);
3821 proto_bpp = proto_register_protocol("Bluetooth OBEX BPP Application Parameters", "BT BPP Application Parameters", "obex.parameter.bt.bpp");
3822 bt_bpp_application_parameters_handle = register_dissector("obex.parameter.bt.bpp", dissect_obex_application_parameter_bt_bpp, proto_bpp);
3824 proto_bip = proto_register_protocol("Bluetooth OBEX BIP Application Parameters", "BT BIP Application Parameters", "obex.parameter.bt.bip");
3825 bt_bip_application_parameters_handle = register_dissector("obex.parameter.bt.bip", dissect_obex_application_parameter_bt_bip, proto_bip);
3827 proto_map = proto_register_protocol("Bluetooth OBEX MAP Application Parameters", "BT MAP Application Parameters", "obex.parameter.bt.map");
3828 bt_map_application_parameters_handle = register_dissector("obex.parameter.bt.map", dissect_obex_application_parameter_bt_map, proto_map);
3830 proto_bt_gpp = proto_register_protocol("Bluetooth OBEX GPP Application Parameters", "BT GPP Application Parameters", "obex.parameter.bt.gpp");
3831 bt_gpp_application_parameters_handle = register_dissector("obex.parameter.bt.gpp", dissect_obex_application_parameter_bt_gpp, proto_bt_gpp);
3833 proto_bt_ctn = proto_register_protocol("Bluetooth OBEX CTN Application Parameters", "BT CTN Application Parameters", "obex.parameter.bt.ctn");
3834 bt_ctn_application_parameters_handle = register_dissector("obex.parameter.bt.ctn", dissect_obex_application_parameter_bt_ctn, proto_bt_ctn);
3836 proto_bt_pbap = proto_register_protocol("Bluetooth OBEX PBAP Application Parameters", "BT PBAP Application Parameters", "obex.parameter.bt.pbap");
3837 bt_pbap_application_parameters_handle = register_dissector("obex.parameter.bt.pbap", dissect_obex_application_parameter_bt_pbap, proto_bt_pbap);
3839 register_decode_as(&media_type_da);
3841 module = prefs_register_protocol(proto_obex, NULL);
3842 prefs_register_static_text_preference(module, "supported_bluetooth_profiles",
3843 "Protocol OBEX support Bluetooth profiles: BIP 1.2, BPP 1.2, CTN 1.0, FTP 1.3, GOEP 1.3, GPP 1.0, MAP 1.2, OPP 1.2, PBAP 1.2, SYNCH 1.2",
3844 "Versions of Bluetooth profiles supported by this dissector.");
3847 void
3848 proto_reg_handoff_obex(void)
3850 dissector_add_string("bluetooth.uuid", "1104", obex_handle);
3851 dissector_add_string("bluetooth.uuid", "1105", obex_handle);
3852 dissector_add_string("bluetooth.uuid", "1106", obex_handle);
3853 dissector_add_string("bluetooth.uuid", "1107", obex_handle);
3854 dissector_add_string("bluetooth.uuid", "1118", obex_handle);
3855 dissector_add_string("bluetooth.uuid", "1119", obex_handle);
3856 dissector_add_string("bluetooth.uuid", "111a", obex_handle);
3857 dissector_add_string("bluetooth.uuid", "111b", obex_handle);
3858 dissector_add_string("bluetooth.uuid", "111c", obex_handle);
3859 dissector_add_string("bluetooth.uuid", "111d", obex_handle);
3860 dissector_add_string("bluetooth.uuid", "1120", obex_handle);
3861 dissector_add_string("bluetooth.uuid", "1121", obex_handle);
3862 dissector_add_string("bluetooth.uuid", "1122", obex_handle);
3863 dissector_add_string("bluetooth.uuid", "1123", obex_handle);
3864 dissector_add_string("bluetooth.uuid", "112e", obex_handle);
3865 dissector_add_string("bluetooth.uuid", "112f", obex_handle);
3866 dissector_add_string("bluetooth.uuid", "1130", obex_handle);
3867 dissector_add_string("bluetooth.uuid", "1132", obex_handle);
3868 dissector_add_string("bluetooth.uuid", "1133", obex_handle);
3869 dissector_add_string("bluetooth.uuid", "1134", obex_handle);
3871 http_handle = find_dissector_add_dependency("http", proto_obex);
3872 xml_handle = find_dissector_add_dependency("xml", proto_obex);
3873 data_handle = find_dissector("data");
3874 data_text_lines_handle = find_dissector("data-text-lines");
3876 dissector_add_uint("obex.profile", PROFILE_UNKNOWN, raw_application_parameters_handle);
3877 dissector_add_uint("obex.profile", PROFILE_BPP, bt_bpp_application_parameters_handle);
3878 dissector_add_uint("obex.profile", PROFILE_BIP, bt_bip_application_parameters_handle);
3879 dissector_add_uint("obex.profile", PROFILE_CTN, bt_ctn_application_parameters_handle);
3880 dissector_add_uint("obex.profile", PROFILE_GPP, bt_gpp_application_parameters_handle);
3881 dissector_add_uint("obex.profile", PROFILE_MAP, bt_map_application_parameters_handle);
3882 dissector_add_uint("obex.profile", PROFILE_PBAP, bt_pbap_application_parameters_handle);
3884 dissector_add_uint("obex.profile", PROFILE_OPP, raw_application_parameters_handle);
3885 dissector_add_uint("obex.profile", PROFILE_FTP, raw_application_parameters_handle);
3886 dissector_add_uint("obex.profile", PROFILE_SYNCML, raw_application_parameters_handle);
3887 dissector_add_uint("obex.profile", PROFILE_SYNC, raw_application_parameters_handle);
3889 dissector_add_for_decode_as("btrfcomm.dlci", obex_handle);
3890 dissector_add_for_decode_as("btl2cap.psm", obex_handle);
3891 dissector_add_for_decode_as("btl2cap.cid", obex_handle);
3893 /* PBAP */
3894 dissector_add_string("media_type", "x-bt/phonebook", data_text_lines_handle);
3895 dissector_add_string("media_type", "x-bt/vcard", data_text_lines_handle);
3896 dissector_add_string("media_type", "x-bt/vcard-listing", xml_handle);
3897 /* MAP */
3898 dissector_add_string("media_type", "x-bt/message", data_text_lines_handle);
3899 dissector_add_string("media_type", "x-bt/messageStatus", data_text_lines_handle);
3900 dissector_add_string("media_type", "x-bt/MAP-messageUpdate", data_text_lines_handle);
3901 dissector_add_string("media_type", "x-bt/MAP-NotificationRegistration", data_text_lines_handle);
3902 dissector_add_string("media_type", "x-bt/MASInstanceInformation", data_text_lines_handle);
3903 dissector_add_string("media_type", "x-bt/MAP-msg-listing", xml_handle);
3904 dissector_add_string("media_type", "x-bt/MAP-event-report", xml_handle);
3905 dissector_add_string("media_type", "x-obex/folder-listing", xml_handle);
3906 /* CTN */
3907 dissector_add_string("media_type", "x-bt/CTN-EventReport", xml_handle);
3908 dissector_add_string("media_type", "x-bt/CTN-Listing", xml_handle);
3909 dissector_add_string("media_type", "x-bt/CTN-NotificationRegistration", data_text_lines_handle);
3910 dissector_add_string("media_type", "x-bt/Calendar", data_text_lines_handle);
3911 dissector_add_string("media_type", "x-bt/CalendarStatus", data_text_lines_handle);
3912 dissector_add_string("media_type", "x-bt/CTN-forward", data_text_lines_handle);
3913 dissector_add_string("media_type", "x-bt/InstanceDescription", data_text_lines_handle);
3914 dissector_add_string("media_type", "x-bt/Update", data_text_lines_handle);
3915 /* BPP */
3916 dissector_add_string("media_type", "text/x-ref-simple", data_text_lines_handle);
3917 dissector_add_string("media_type", "text/x-ref-list", data_text_lines_handle);
3918 dissector_add_string("media_type", "x-obex/RUI", data_text_lines_handle);
3919 dissector_add_string("media_type", "x-obex/bt-SOAP", xml_handle);
3920 /* BIP */
3921 dissector_add_string("media_type", "x-bt/img-listing", xml_handle);
3922 dissector_add_string("media_type", "x-bt/img-properties", xml_handle);
3923 dissector_add_string("media_type", "x-bt/img-capabilities", xml_handle);
3924 dissector_add_string("media_type", "x-bt/img-print", data_text_lines_handle);
3925 dissector_add_string("media_type", "x-bt/img-img", data_handle);
3926 dissector_add_string("media_type", "x-bt/img-thm", data_handle);
3927 dissector_add_string("media_type", "x-bt/img-attachment", data_handle);
3928 dissector_add_string("media_type", "x-bt/img-display", data_handle);
3929 dissector_add_string("media_type", "x-bt/img-partial", data_handle);
3930 dissector_add_string("media_type", "x-bt/img-archive", data_handle);
3931 dissector_add_string("media_type", "x-bt/img-status", data_handle);
3932 dissector_add_string("media_type", "x-bt/img-monitoring", data_handle);
3934 media_type_dissector_table = find_dissector_table("media_type");
3936 dissector_add_for_decode_as("usb.product", obex_handle);
3937 dissector_add_for_decode_as("usb.device", obex_handle);
3938 dissector_add_for_decode_as("usb.protocol", obex_handle);
3939 dissector_add_for_decode_as_with_preference("tcp.port", obex_handle);
3940 dissector_add_for_decode_as_with_preference("udp.port", obex_handle);
3944 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3946 * Local variables:
3947 * c-basic-offset: 4
3948 * tab-width: 8
3949 * indent-tabs-mode: nil
3950 * End:
3952 * vi: set shiftwidth=4 tabstop=8 expandtab:
3953 * :indentSize=4:tabSize=8:noTabs=true: