MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-btobex.c
blob0e019d7410ab25867306619d931884b8f094d051
1 /* packet-btobex.c
2 * Routines for Bluetooth OBEX dissection
4 * Copyright 2010, Allan M. Madsen
5 * Copyright 2013, Michal Labedzki for Tieto Corporation
7 * $Id$
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "config.h"
30 #include <epan/packet.h>
31 #include <epan/reassemble.h>
32 #include <epan/tap.h>
33 #include <epan/expert.h>
34 #include <epan/wmem/wmem.h>
36 #include "packet-btrfcomm.h"
37 #include "packet-btl2cap.h"
38 #include "packet-btsdp.h"
40 /* Initialize the protocol and registered fields */
41 static int proto_btobex = -1;
42 static int hf_opcode = -1;
43 static int hf_response_code = -1;
44 static int hf_final_flag = -1;
45 static int hf_length = -1;
46 static int hf_version = -1;
47 static int hf_flags = -1;
48 static int hf_constants = -1;
49 static int hf_max_pkt_len = -1;
50 static int hf_set_path_flags_0 = -1;
51 static int hf_set_path_flags_1 = -1;
52 static int hf_headers = -1;
53 static int hf_header = -1;
54 static int hf_hdr_id = -1;
55 static int hf_hdr_length = -1;
56 static int hf_hdr_val_unicode = -1;
57 static int hf_hdr_val_byte_seq = -1;
58 static int hf_hdr_val_byte = -1;
59 static int hf_hdr_val_long = -1;
60 static int hf_application_parameter = -1;
61 static int hf_application_parameter_id = -1;
62 static int hf_application_parameter_length = -1;
63 static int hf_application_parameter_data = -1;
64 static int hf_bpp_application_parameter_id = -1;
65 static int hf_bpp_application_parameter_data_offset = -1;
66 static int hf_bpp_application_parameter_data_count = -1;
67 static int hf_bpp_application_parameter_data_job_id = -1;
68 static int hf_bpp_application_parameter_data_file_size = -1;
69 static int hf_bip_application_parameter_id = -1;
70 static int hf_bip_application_parameter_data_number_of_returned_handles = -1;
71 static int hf_bip_application_parameter_data_list_start_offset = -1;
72 static int hf_bip_application_parameter_data_latest_captured_images = -1;
73 static int hf_bip_application_parameter_data_partial_file_length = -1;
74 static int hf_bip_application_parameter_data_partial_file_start_offset = -1;
75 static int hf_bip_application_parameter_data_total_file_size = -1;
76 static int hf_bip_application_parameter_data_end_flag = -1;
77 static int hf_bip_application_parameter_data_remote_display = -1;
78 static int hf_bip_application_parameter_data_service_id = -1;
79 static int hf_bip_application_parameter_data_store_flag = -1;
80 static int hf_pbap_application_parameter_id = -1;
81 static int hf_pbap_application_parameter_data_order = -1;
82 static int hf_pbap_application_parameter_data_search_value = -1;
83 static int hf_pbap_application_parameter_data_search_attribute = -1;
84 static int hf_pbap_application_parameter_data_max_list_count = -1;
85 static int hf_pbap_application_parameter_data_list_start_offset = -1;
86 static int hf_pbap_application_parameter_data_filter_version = -1;
87 static int hf_pbap_application_parameter_data_filter_fn = -1;
88 static int hf_pbap_application_parameter_data_filter_n = -1;
89 static int hf_pbap_application_parameter_data_filter_photo = -1;
90 static int hf_pbap_application_parameter_data_filter_birthday = -1;
91 static int hf_pbap_application_parameter_data_filter_adr = -1;
92 static int hf_pbap_application_parameter_data_filter_label = -1;
93 static int hf_pbap_application_parameter_data_filter_tel = -1;
94 static int hf_pbap_application_parameter_data_filter_email = -1;
95 static int hf_pbap_application_parameter_data_filter_mailer = -1;
96 static int hf_pbap_application_parameter_data_filter_time_zone = -1;
97 static int hf_pbap_application_parameter_data_filter_geographic_position = -1;
98 static int hf_pbap_application_parameter_data_filter_title = -1;
99 static int hf_pbap_application_parameter_data_filter_role = -1;
100 static int hf_pbap_application_parameter_data_filter_logo = -1;
101 static int hf_pbap_application_parameter_data_filter_agent = -1;
102 static int hf_pbap_application_parameter_data_filter_name_of_organization = -1;
103 static int hf_pbap_application_parameter_data_filter_comments = -1;
104 static int hf_pbap_application_parameter_data_filter_revision = -1;
105 static int hf_pbap_application_parameter_data_filter_pronunciation_of_name = -1;
106 static int hf_pbap_application_parameter_data_filter_url = -1;
107 static int hf_pbap_application_parameter_data_filter_uid = -1;
108 static int hf_pbap_application_parameter_data_filter_key = -1;
109 static int hf_pbap_application_parameter_data_filter_nickname = -1;
110 static int hf_pbap_application_parameter_data_filter_categories = -1;
111 static int hf_pbap_application_parameter_data_filter_product_id = -1;
112 static int hf_pbap_application_parameter_data_filter_class = -1;
113 static int hf_pbap_application_parameter_data_filter_sort_string = -1;
114 static int hf_pbap_application_parameter_data_filter_timestamp = -1;
115 static int hf_pbap_application_parameter_data_filter_reserved_29_31 = -1;
116 static int hf_pbap_application_parameter_data_filter_reserved_32_38 = -1;
117 static int hf_pbap_application_parameter_data_filter_proprietary_filter = -1;
118 static int hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage = -1;
119 static int hf_pbap_application_parameter_data_format = -1;
120 static int hf_pbap_application_parameter_data_phonebook_size = -1;
121 static int hf_pbap_application_parameter_data_new_missed_calls = -1;
122 static int hf_map_application_parameter_id = -1;
123 static int hf_map_application_parameter_data_max_list_count = -1;
124 static int hf_map_application_parameter_data_start_offset = -1;
125 static int hf_map_application_parameter_data_filter_message_type_reserved = -1;
126 static int hf_map_application_parameter_data_filter_message_type_mms = -1;
127 static int hf_map_application_parameter_data_filter_message_type_email = -1;
128 static int hf_map_application_parameter_data_filter_message_type_sms_cdma = -1;
129 static int hf_map_application_parameter_data_filter_message_type_sms_gsm = -1;
130 static int hf_map_application_parameter_data_filter_period_begin = -1;
131 static int hf_map_application_parameter_data_filter_period_end = -1;
132 static int hf_map_application_parameter_data_filter_read_status_reserved_6 = -1;
133 static int hf_map_application_parameter_data_filter_read_status_get_read = -1;
134 static int hf_map_application_parameter_data_filter_read_status_get_unread = -1;
135 static int hf_map_application_parameter_data_filter_recipient = -1;
136 static int hf_map_application_parameter_data_filter_originator = -1;
137 static int hf_map_application_parameter_data_filter_priority_reserved_6 = -1;
138 static int hf_map_application_parameter_data_filter_priority_get_high = -1;
139 static int hf_map_application_parameter_data_filter_priority_non_high = -1;
140 static int hf_map_application_parameter_data_reserved_7 = -1;
141 static int hf_map_application_parameter_data_attachment = -1;
142 static int hf_map_application_parameter_data_transparent = -1;
143 static int hf_map_application_parameter_data_retry = -1;
144 static int hf_map_application_parameter_data_new_message = -1;
145 static int hf_map_application_parameter_data_notification_status = -1;
146 static int hf_map_application_parameter_data_mas_instance_id = -1;
147 static int hf_map_application_parameter_data_parameter_mask_reserved = -1;
148 static int hf_map_application_parameter_data_parameter_mask_reply_to_addressing = -1;
149 static int hf_map_application_parameter_data_parameter_mask_protected = -1;
150 static int hf_map_application_parameter_data_parameter_mask_sent = -1;
151 static int hf_map_application_parameter_data_parameter_mask_read = -1;
152 static int hf_map_application_parameter_data_parameter_mask_priority = -1;
153 static int hf_map_application_parameter_data_parameter_mask_attachment_size = -1;
154 static int hf_map_application_parameter_data_parameter_mask_text = -1;
155 static int hf_map_application_parameter_data_parameter_mask_reception_status = -1;
156 static int hf_map_application_parameter_data_parameter_mask_size = -1;
157 static int hf_map_application_parameter_data_parameter_mask_type = -1;
158 static int hf_map_application_parameter_data_parameter_mask_recipient_addressing = -1;
159 static int hf_map_application_parameter_data_parameter_mask_recipient_name = -1;
160 static int hf_map_application_parameter_data_parameter_mask_sender_addressing = -1;
161 static int hf_map_application_parameter_data_parameter_mask_sender_name = -1;
162 static int hf_map_application_parameter_data_parameter_mask_datetime = -1;
163 static int hf_map_application_parameter_data_parameter_mask_subject = -1;
164 static int hf_map_application_parameter_data_folder_listing_size = -1;
165 static int hf_map_application_parameter_data_messages_listing_size = -1;
166 static int hf_map_application_parameter_data_subject_length = -1;
167 static int hf_map_application_parameter_data_charset = -1;
168 static int hf_map_application_parameter_data_fraction_request = -1;
169 static int hf_map_application_parameter_data_fraction_deliver = -1;
170 static int hf_map_application_parameter_data_status_indicator = -1;
171 static int hf_map_application_parameter_data_status_value = -1;
172 static int hf_map_application_parameter_data_mse_time = -1;
174 static int hf_profile = -1;
177 /* ************************************************************************* */
178 /* Header values for reassembly */
179 /* ************************************************************************* */
180 static int hf_btobex_fragments = -1;
181 static int hf_btobex_fragment = -1;
182 static int hf_btobex_fragment_overlap = -1;
183 static int hf_btobex_fragment_overlap_conflict = -1;
184 static int hf_btobex_fragment_multiple_tails = -1;
185 static int hf_btobex_fragment_too_long_fragment = -1;
186 static int hf_btobex_fragment_error = -1;
187 static int hf_btobex_fragment_count = -1;
188 static int hf_btobex_reassembled_in = -1;
189 static int hf_btobex_reassembled_length = -1;
191 static gint ett_btobex_fragment = -1;
192 static gint ett_btobex_fragments = -1;
194 static expert_field ei_application_parameter_length_bad = EI_INIT;
196 static reassembly_table btobex_reassembly_table;
198 static const fragment_items btobex_frag_items = {
199 &ett_btobex_fragment,
200 &ett_btobex_fragments,
201 &hf_btobex_fragments,
202 &hf_btobex_fragment,
203 &hf_btobex_fragment_overlap,
204 &hf_btobex_fragment_overlap_conflict,
205 &hf_btobex_fragment_multiple_tails,
206 &hf_btobex_fragment_too_long_fragment,
207 &hf_btobex_fragment_error,
208 &hf_btobex_fragment_count,
209 &hf_btobex_reassembled_in,
210 &hf_btobex_reassembled_length,
211 /* Reassembled data field */
212 NULL,
213 "fragments"
216 /* Initialize the subtree pointers */
217 static gint ett_btobex = -1;
218 static gint ett_btobex_hdrs = -1;
219 static gint ett_btobex_hdr = -1;
220 static gint ett_btobex_application_parameters = -1;
222 static wmem_tree_t *obex_profile = NULL;
223 static wmem_tree_t *obex_last_opcode = NULL;
225 static dissector_handle_t xml_handle;
226 static dissector_handle_t data_handle;
228 typedef struct _ext_value_string {
229 guint8 value[16];
230 gint length;
231 const gchar *strptr;
232 } ext_value_string;
234 typedef struct _obex_profile_data_t {
235 guint32 interface_id;
236 guint32 adapter_id;
237 guint16 chandle;
238 guint8 channel;
239 gint profile;
240 } obex_profile_data_t;
242 typedef struct _obex_last_opcode_data_t {
243 guint32 interface_id;
244 guint32 adapter_id;
245 guint16 chandle;
246 guint8 channel;
247 gint direction;
248 gint code;
249 } obex_last_opcode_data_t;
251 #define PROFILE_UNKNOWN 0
252 #define PROFILE_OPP 1
253 #define PROFILE_FTP 2
254 #define PROFILE_SYNCML 3
255 #define PROFILE_PBAP 4
256 #define PROFILE_MAP 5
257 #define PROFILE_BIP 6
258 #define PROFILE_BPP 7
259 #define PROFILE_SYNC 8
261 static const value_string profile_vals[] = {
262 { PROFILE_UNKNOWN, "Unknown" },
263 { PROFILE_OPP, "OPP" },
264 { PROFILE_FTP, "FTP" },
265 { PROFILE_SYNCML, "SyncML" },
266 { PROFILE_PBAP, "PBAP" },
267 { PROFILE_MAP, "MAP" },
268 { PROFILE_BIP, "BIP" },
269 { PROFILE_BPP, "BPP" },
270 { PROFILE_SYNC, "SYNC" },
271 { 0, NULL }
273 static value_string_ext(profile_vals_ext) = VALUE_STRING_EXT_INIT(profile_vals);
276 static const ext_value_string target_vals[] = {
277 { { 0xF9, 0xEC, 0x7B, 0xC4, 0x95, 0x3C, 0x11, 0xD2, 0x98, 0x4E, 0x52, 0x54, 0x00, 0xDC, 0x9E, 0x09 }, 16, "Folder Browsing" },
278 { { 0x79, 0x61, 0x35, 0xf0, 0xf0, 0xc5, 0x11, 0xd8, 0x09, 0x66, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Phone Book Access Profile" },
279 { { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02 }, 16, "SyncML" },
280 { { 0xE3, 0x3D, 0x95, 0x45, 0x83, 0x74, 0x4A, 0xD7, 0x9E, 0xC5, 0xC1, 0x6B, 0xE3, 0x1E, 0xDE, 0x8E }, 16, "Basic Imaging Profile - Push" },
281 { { 0x8E, 0xE9, 0xB3, 0xD0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Pull" },
282 { { 0x92, 0x35, 0x33, 0x50, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Advanced Printing" },
283 { { 0x94, 0x01, 0x26, 0xC0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Automativ Archive" },
284 { { 0x94, 0x7E, 0x74, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Camera" },
285 { { 0x94, 0xC7, 0xCD, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Display" },
286 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile- Referenced Objects" },
287 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile - Archived Objects" },
288 { { 0xbb, 0x58, 0x2b, 0x40, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Access Service" },
289 { { 0xbb, 0x58, 0x2b, 0x41, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Notification Service" },
290 { { 0x00, 0x00, 0x11, 0x18, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Direct Printing Service" },
291 { { 0x00, 0x00, 0x11, 0x19, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reference Printing Service" },
292 { { 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" },
293 { { 0x00, 0x00, 0x11, 0x21, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reflected UI" },
294 { { 0x00, 0x00, 0x11, 0x22, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Basic Printing" },
295 { { 0x00, 0x00, 0x11, 0x23, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Printing Status" },
296 { { "IRMC-SYNC" }, 9, "Synchronization Profile" },
297 { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, NULL },
300 /* This table must map tagets from "target_vals" to profile */
301 static const gint target_to_profile[] = {
302 PROFILE_FTP,
303 PROFILE_PBAP,
304 PROFILE_SYNCML,
305 PROFILE_BIP,
306 PROFILE_BIP,
307 PROFILE_BIP,
308 PROFILE_BIP,
309 PROFILE_BIP,
310 PROFILE_BIP,
311 PROFILE_BIP,
312 PROFILE_BIP,
313 PROFILE_MAP,
314 PROFILE_MAP,
315 PROFILE_BPP,
316 PROFILE_BPP,
317 PROFILE_BPP,
318 PROFILE_BPP,
319 PROFILE_BPP,
320 PROFILE_BPP,
321 PROFILE_SYNC
324 static const value_string version_vals[] = {
325 { 0x10, "1.0" },
326 { 0x11, "1.1" },
327 { 0x12, "1.2" },
328 { 0x13, "1.3" },
329 { 0x20, "2.0" },
330 { 0x21, "2.1" },
331 { 0, NULL }
334 #define BTOBEX_CODE_VALS_CONNECT 0x00
335 #define BTOBEX_CODE_VALS_DISCONNECT 0x01
336 #define BTOBEX_CODE_VALS_PUT 0x02
337 #define BTOBEX_CODE_VALS_GET 0x03
338 #define BTOBEX_CODE_VALS_SET_PATH 0x05
339 #define BTOBEX_CODE_VALS_CONTINUE 0x10
340 #define BTOBEX_CODE_VALS_ABORT 0x7F
341 #define BTOBEX_CODE_VALS_MASK 0x7F
343 static const value_string code_vals[] = {
344 { BTOBEX_CODE_VALS_CONNECT, "Connect" },
345 { BTOBEX_CODE_VALS_DISCONNECT, "Disconnect" },
346 { BTOBEX_CODE_VALS_PUT, "Put" },
347 { BTOBEX_CODE_VALS_GET, "Get"},
348 { BTOBEX_CODE_VALS_SET_PATH, "Set Path" },
349 { BTOBEX_CODE_VALS_CONTINUE, "Continue" },
350 { 0x20, "Success" },
351 { 0x21, "Created" },
352 { 0x22, "Accepted" },
353 { 0x23, "Non-Authoritative Information" },
354 { 0x24, "No Content" },
355 { 0x25, "Reset Content" },
356 { 0x26, "Partial Content" },
357 { 0x30, "Multiple Choices" },
358 { 0x31, "Moved Permanently" },
359 { 0x32, "Moved Temporarily" },
360 { 0x33, "See Other" },
361 { 0x34, "Not Modified" },
362 { 0x35, "Use Proxy" },
363 { 0x40, "Bad Request" },
364 { 0x41, "Unauthorised" },
365 { 0x42, "Payment Required" },
366 { 0x43, "Forbidden" },
367 { 0x44, "Not Found" },
368 { 0x45, "Method Not Allowed" },
369 { 0x46, "Not Acceptable" },
370 { 0x47, "Proxy Authentication Required" },
371 { 0x48, "Request Timeout" },
372 { 0x49, "Conflict" },
373 { 0x4a, "Gone" },
374 { 0x4b, "Length Required" },
375 { 0x4c, "Precondition Failed" },
376 { 0x4d, "Requested Entity Too Large" },
377 { 0x4e, "Requested URL Too Large" },
378 { 0x4f, "Unsupported Media Type" },
379 { 0x50, "Internal Server Error" },
380 { 0x51, "Not Implemented" },
381 { 0x52, "Bad Gateway" },
382 { 0x53, "Service Unavailable" },
383 { 0x54, "Gateway Timeout" },
384 { 0x55, "HTTP Version Not Supported" },
385 { 0x60, "Database Full" },
386 { 0x61, "Database Locked" },
387 { BTOBEX_CODE_VALS_ABORT, "Abort" },
388 { 0, NULL }
390 static value_string_ext(code_vals_ext) = VALUE_STRING_EXT_INIT(code_vals);
392 static const value_string header_id_vals[] = {
393 { 0x01, "Name" },
394 { 0x05, "Description" },
395 { 0x30, "User Defined" },
396 { 0x31, "User Defined" },
397 { 0x32, "User Defined" },
398 { 0x33, "User Defined" },
399 { 0x34, "User Defined" },
400 { 0x35, "User Defined" },
401 { 0x36, "User Defined" },
402 { 0x37, "User Defined" },
403 { 0x38, "User Defined" },
404 { 0x39, "User Defined" },
405 { 0x3a, "User Defined" },
406 { 0x3b, "User Defined" },
407 { 0x3c, "User Defined" },
408 { 0x3d, "User Defined" },
409 { 0x3e, "User Defined" },
410 { 0x3f, "User Defined" },
411 { 0x42, "Type" },
412 { 0x44, "Time (ISO8601)" },
413 { 0x46, "Target" },
414 { 0x47, "HTTP" },
415 { 0x48, "Body" },
416 { 0x49, "End Of Body" },
417 { 0x4a, "Who" },
418 { 0x4c, "Application Parameters" },
419 { 0x4d, "Auth. Challenge" },
420 { 0x4e, "Auth. Response" },
421 { 0x4f, "Object Class" },
422 { 0xc0, "Count" },
423 { 0xc3, "Length" },
424 { 0xc4, "Time" },
425 { 0xcb, "Connection Id" },
426 { 0, NULL }
428 static value_string_ext header_id_vals_ext = VALUE_STRING_EXT_INIT(header_id_vals);
430 static const value_string map_application_parameters_vals[] = {
431 { 0x01, "Max List Count" },
432 { 0x02, "Start Offset" },
433 { 0x03, "Filter Message Type" },
434 { 0x04, "Filter Period Begin" },
435 { 0x05, "End Filter PeriodEnd" },
436 { 0x06, "Filter Read Status" },
437 { 0x07, "Filter Recipient" },
438 { 0x08, "Filter Originator" },
439 { 0x09, "Filter Priority" },
440 { 0x0A, "Attachment" },
441 { 0x0B, "Transparent" },
442 { 0x0C, "Retry" },
443 { 0x0D, "New Message" },
444 { 0x0E, "Notification Status" },
445 { 0x0F, "MAS Instance ID" },
446 { 0x10, "Parameter Mask" },
447 { 0x11, "Folder Listing Size" },
448 { 0x12, "Messages Listing Size" },
449 { 0x13, "Subject Length" },
450 { 0x14, "Charset" },
451 { 0x15, "Fraction Request" },
452 { 0x16, "Fraction Deliver" },
453 { 0x17, "Status Indicator" },
454 { 0x18, "Status Value" },
455 { 0x19, "MSE Time" },
456 { 0, NULL }
459 static const value_string pbap_application_parameters_vals[] = {
460 { 0x01, "Order" },
461 { 0x02, "Search Value" },
462 { 0x03, "Search Attribute" },
463 { 0x04, "Max List Count" },
464 { 0x05, "List Start Offset" },
465 { 0x06, "Filter" },
466 { 0x07, "Format" },
467 { 0x08, "Phonebook Size" },
468 { 0x09, "New Missed Calls" },
469 { 0, NULL }
472 static const value_string bpp_application_parameters_vals[] = {
473 { 0x01, "Offset" },
474 { 0x02, "Count" },
475 { 0x03, "Job ID" },
476 { 0x04, "File Size" },
477 { 0, NULL }
480 static const value_string bip_application_parameters_vals[] = {
481 { 0x01, "Number of Returned Handles" },
482 { 0x02, "List Start Offset" },
483 { 0x03, "Latest Captures Images" },
484 { 0x04, "Partial File Length" },
485 { 0x05, "Partial File Start Offset" },
486 { 0x06, "Total File Size" },
487 { 0x07, "End Flag" },
488 { 0x08, "Remote Display" },
489 { 0x09, "Service ID" },
490 { 0x0A, "Store Flag" },
491 { 0, NULL }
494 static const value_string bip_remote_display_vals[] = {
495 { 0x01, "Next Image" },
496 { 0x02, "Previous Image" },
497 { 0x03, "Select Image" },
498 { 0x04, "Current Image" },
499 { 0, NULL }
502 static const value_string pbap_order_vals[] = {
503 { 0x00, "Indexed" },
504 { 0x01, "Alphanumeric" },
505 { 0x02, "Phonetic" },
506 { 0, NULL }
509 static const value_string pbap_format_vals[] = {
510 { 0x00, "2.1" },
511 { 0x01, "3.0" },
512 { 0, NULL }
515 static const value_string pbap_search_attribute_vals[] = {
516 { 0x00, "Name" },
517 { 0x01, "Number" },
518 { 0x02, "Sound" },
519 { 0, NULL }
522 static const value_string map_charset_vals[] = {
523 { 0x00, "Native" },
524 { 0x01, "UTF-8" },
525 { 0, NULL }
528 static const value_string map_fraction_request_vals[] = {
529 { 0x00, "First" },
530 { 0x01, "Next" },
531 { 0, NULL }
534 static const value_string map_fraction_deliver_vals[] = {
535 { 0x00, "More" },
536 { 0x01, "Last" },
537 { 0, NULL }
540 static const value_string map_status_indicator_vals[] = {
541 { 0x00, "Read Status" },
542 { 0x01, "Deleted Status" },
543 { 0, NULL }
546 static value_string_ext map_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(map_application_parameters_vals);
547 static value_string_ext pbap_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(pbap_application_parameters_vals);
548 static value_string_ext bpp_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(bpp_application_parameters_vals);
549 static value_string_ext bip_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(bip_application_parameters_vals);
551 void proto_register_btobex(void);
552 void proto_reg_handoff_btobex(void);
554 static void
555 defragment_init(void)
557 reassembly_table_init(&btobex_reassembly_table,
558 &addresses_reassembly_table_functions);
561 static int
562 is_ascii_str(const guint8 *str, int length)
564 int i;
566 if ((length < 1) || (str[length-1] != '\0'))
567 return 0;
569 for(i=0; i<length-1; i++) {
570 if ((str[i] < 0x20) && (str[i] != 0x0a)) /* not strict ascii */
571 break;
574 if (i < (length-1))
575 return 0;
577 return 1;
580 static int
581 display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, char **data)
583 char *str, *p;
584 int len;
585 int charoffset;
586 guint16 character;
588 /* display a unicode string from the tree and return new offset */
590 * Get the length of the string.
592 len = 0;
593 while (tvb_get_ntohs(tvb, offset + len) != '\0')
594 len += 2;
596 len += 2; /* count the '\0' too */
599 * Allocate a buffer for the string; "len" is the length in
600 * bytes, not the length in characters.
602 str = (char *) wmem_alloc(wmem_packet_scope(), len / 2);
604 /* - this assumes the string is just ISO 8859-1 */
605 charoffset = offset;
606 p = str;
607 while ((character = tvb_get_ntohs(tvb, charoffset)) != '\0') {
608 *p++ = (char) character;
609 charoffset += 2;
611 *p = '\0';
613 if (!is_ascii_str((const guint8 *) str, len / 2)) {
614 *str = '\0';
617 proto_tree_add_string(tree, hf_hdr_val_unicode, tvb, offset, len, str);
619 if (data)
620 *data = str;
622 return offset+len;
625 static gint
626 dissect_raw_application_parameters(tvbuff_t *tvb, proto_tree *tree, gint offset,
627 gint parameters_length)
629 proto_item *parameter_item;
630 proto_tree *parameter_tree;
631 guint8 parameter_id;
632 gint parameter_length;
634 while (parameters_length > 0) {
635 parameter_id = tvb_get_guint8(tvb, offset);
636 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset,
637 -1, "Parameter: 0x%02x", parameter_id);
638 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
640 proto_tree_add_item(parameter_tree, hf_application_parameter_id, tvb, offset,
641 1, ENC_BIG_ENDIAN);
642 offset += 1;
644 proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset,
645 1, ENC_BIG_ENDIAN);
646 parameter_length = tvb_get_guint8(tvb, offset);
647 proto_item_set_len(parameter_item, parameter_length + 2);
648 offset += 1;
650 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset,
651 parameter_length, ENC_NA);
653 parameters_length -= 2 + parameter_length;
654 offset += parameter_length;
657 return offset;
660 static gint
661 dissect_bpp_application_parameters(tvbuff_t *tvb, packet_info *pinfo,
662 proto_tree *tree, gint offset, gint parameters_length)
664 proto_item *item;
665 proto_item *parameter_item;
666 proto_tree *parameter_tree;
667 guint8 parameter_id;
668 gint parameter_length;
670 while (parameters_length > 0) {
671 parameter_id = tvb_get_guint8(tvb, offset);
672 parameter_length = tvb_get_guint8(tvb, offset + 1);
674 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
675 "Parameter: %s", val_to_str_const(parameter_id,
676 bpp_application_parameters_vals, "Unknown"));
677 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
679 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
680 offset += 1;
682 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
683 offset += 1;
685 if (parameter_length != 4) {
686 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
687 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
688 "According to the specification this parameter length should be 4, but there is %i", parameter_length);
689 } else switch (parameter_id) {
690 case 0x01:
691 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_offset, tvb, offset, 4, ENC_BIG_ENDIAN);
692 break;
693 case 0x02:
694 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_count, tvb, offset, 4, ENC_BIG_ENDIAN);
695 break;
696 case 0x03:
697 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_job_id, tvb, offset, 4, ENC_BIG_ENDIAN);
698 break;
699 case 0x04:
700 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_file_size, tvb, offset, 4, ENC_BIG_ENDIAN);
701 break;
702 default:
703 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
706 parameters_length -= 2 + parameter_length;
707 offset += parameter_length;
710 return offset;
713 static gint
714 dissect_bip_application_parameters(tvbuff_t *tvb, packet_info *pinfo,
715 proto_tree *tree, gint offset, gint parameters_length)
717 proto_item *item;
718 proto_item *parameter_item;
719 proto_tree *parameter_tree;
720 gint parameter_length;
721 guint8 parameter_id;
722 static gint required_length_map[] = {0, 2, 2, 1, 4, 4, 4, 1, 1, 16, 1};
724 while (parameters_length > 0) {
725 parameter_id = tvb_get_guint8(tvb, offset);
726 parameter_length = tvb_get_guint8(tvb, offset + 1);
728 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
729 "Parameter: %s", val_to_str_const(parameter_id,
730 bip_application_parameters_vals, "Unknown"));
731 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
733 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
734 offset += 1;
736 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
737 offset += 1;
739 if (parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
740 required_length_map[parameter_id] != parameter_length) {
741 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
742 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
743 "According to the specification this parameter length should be %i, but there is %i",
744 required_length_map[parameter_id], parameter_length);
745 } else switch (parameter_id) {
746 case 0x01:
747 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);
748 break;
749 case 0x02:
750 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_list_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
751 break;
752 case 0x03:
753 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_latest_captured_images, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
754 break;
755 case 0x04:
756 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_partial_file_length, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
757 break;
758 case 0x05:
759 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);
760 break;
761 case 0x06:
762 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_total_file_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
763 break;
764 case 0x07:
765 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_end_flag, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
766 break;
767 case 0x08:
768 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_remote_display, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
769 break;
770 case 0x09:
771 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_service_id, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
772 break;
773 case 0x0A:
774 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_store_flag, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
775 break;
776 default:
777 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
780 parameters_length -= 2 + parameter_length;
781 offset += parameter_length;
784 return offset;
787 static gint
788 dissect_pbap_application_parameters(tvbuff_t *tvb, packet_info *pinfo,
789 proto_tree *tree, gint offset, gint parameters_length)
791 proto_item *item;
792 proto_item *parameter_item;
793 proto_tree *parameter_tree;
794 gint parameter_length;
795 guint8 parameter_id;
796 static gint required_length_map[] = {0, 1, -1, 1, 2, 2, 8, 1, 2, 1};
798 while (parameters_length > 0) {
799 parameter_id = tvb_get_guint8(tvb, offset);
800 parameter_length = tvb_get_guint8(tvb, offset + 1);
802 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
803 "Parameter: %s", val_to_str_const(parameter_id,
804 pbap_application_parameters_vals, "Unknown"));
805 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
807 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
808 offset += 1;
810 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
811 offset += 1;
813 if (parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
814 required_length_map[parameter_id] != -1 &&
815 required_length_map[parameter_id] != parameter_length) {
816 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
817 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
818 "According to the specification this parameter length should be %i, but there is %i",
819 required_length_map[parameter_id], parameter_length);
820 } else switch (parameter_id) {
821 case 0x01:
822 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_order, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
823 break;
824 case 0x02:
825 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_search_value, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
826 break;
827 case 0x03:
828 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_search_attribute, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
829 break;
830 case 0x04:
831 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_max_list_count, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
832 break;
833 case 0x05:
834 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_list_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
835 break;
836 case 0x06:
837 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_32_38, tvb, offset, 4, ENC_BIG_ENDIAN);
838 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_proprietary_filter, tvb, offset, 4, ENC_BIG_ENDIAN);
839 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage, tvb, offset, 4, ENC_BIG_ENDIAN);
841 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_version, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
842 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_fn, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
843 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_n, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
844 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_photo, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
845 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_birthday, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
846 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_adr, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
847 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_label, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
848 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_tel, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
849 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_email, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
850 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_mailer, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
851 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_time_zone, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
852 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_geographic_position, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
853 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_title, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
854 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_role, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
855 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_logo, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
856 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_agent, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
857 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_name_of_organization, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
858 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_comments, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
859 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_revision, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
860 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_pronunciation_of_name, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
861 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_url, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
862 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_uid, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
863 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_key, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
864 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_nickname, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
865 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_categories, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
866 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_product_id, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
867 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_class, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
868 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_sort_string, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
869 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_timestamp, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
870 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_filter_reserved_29_31, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
871 break;
872 case 0x07:
873 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_format, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
874 break;
875 case 0x08:
876 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_phonebook_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
877 break;
878 case 0x09:
879 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_new_missed_calls, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
880 break;
881 default:
882 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
885 parameters_length -= 2 + parameter_length;
886 offset += parameter_length;
889 return offset;
892 static int
893 dissect_map_application_parameters(tvbuff_t *tvb, packet_info *pinfo,
894 proto_tree *tree, gint offset, gint parameters_length)
896 proto_item *item;
897 proto_item *parameter_item;
898 proto_tree *parameter_tree;
899 gint parameter_length;
900 guint8 parameter_id;
901 static gint 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};
903 while (parameters_length > 0) {
904 parameter_id = tvb_get_guint8(tvb, offset);
905 parameter_length = tvb_get_guint8(tvb, offset + 1);
907 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
908 "Parameter: %s", val_to_str_const(parameter_id,
909 map_application_parameters_vals, "Unknown"));
910 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
912 proto_tree_add_item(parameter_tree, hf_map_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
913 offset += 1;
915 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
916 offset += 1;
918 if (parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
919 required_length_map[parameter_id] != -1 &&
920 required_length_map[parameter_id] != parameter_length) {
921 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
922 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
923 "According to the specification this parameter length should be %i, but there is %i",
924 required_length_map[parameter_id], parameter_length);
925 } else switch (parameter_id) {
926 case 0x01:
927 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_max_list_count, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
928 break;
929 case 0x02:
930 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
931 break;
932 case 0x03:
933 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);
934 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);
935 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);
936 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);
937 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);
938 break;
939 case 0x04:
940 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_period_begin, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
941 break;
942 case 0x05:
943 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_period_end, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
944 break;
945 case 0x06:
946 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);
947 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);
948 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);
949 break;
950 case 0x07:
951 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_recipient, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
952 break;
953 case 0x08:
954 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_originator, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
955 break;
956 case 0x09:
957 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);
958 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);
959 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);
960 break;
961 case 0x0A:
962 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
963 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_attachment, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
964 break;
965 case 0x0B:
966 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
967 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_transparent, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
968 break;
969 case 0x0C:
970 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
971 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_retry, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
972 break;
973 case 0x0D:
974 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
975 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_new_message, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
976 break;
977 case 0x0E:
978 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
979 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_notification_status, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
980 break;
981 case 0x0F:
982 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_mas_instance_id, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
983 break;
984 case 0x10:
985 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_reserved, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
986 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);
987 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_protected, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
988 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_sent, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
989 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_read, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
990 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_priority, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
991 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);
992 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_text, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
993 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);
994 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
995 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_type, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
996 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);
997 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);
998 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);
999 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);
1000 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_datetime, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1001 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_subject, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1003 break;
1004 case 0x11:
1005 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_folder_listing_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1006 break;
1007 case 0x12:
1008 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_messages_listing_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1009 break;
1010 case 0x13:
1011 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_subject_length, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1012 break;
1013 case 0x14:
1014 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1015 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_charset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1016 break;
1017 case 0x15:
1018 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1019 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_fraction_request, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1020 break;
1021 case 0x16:
1022 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1023 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_fraction_deliver, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1024 break;
1025 case 0x17:
1026 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1027 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_status_indicator, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1028 break;
1029 case 0x18:
1030 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1031 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_status_value, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1032 break;
1033 case 0x19:
1034 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_mse_time, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1035 break;
1036 default:
1037 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1040 parameters_length -= 2 + parameter_length;
1041 offset += parameter_length;
1044 return offset;
1047 static int
1048 dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
1049 gint profile, gboolean is_obex_over_l2cap, void *data)
1051 proto_tree *hdrs_tree = NULL;
1052 proto_tree *hdr_tree = NULL;
1053 proto_item *hdr = NULL;
1054 proto_item *handle_item;
1055 gint item_length = -1;
1056 gint parameters_length;
1057 guint8 hdr_id, i;
1059 if (tvb_length_remaining(tvb, offset) > 0) {
1060 proto_item *hdrs;
1061 hdrs = proto_tree_add_item(tree, hf_headers, tvb, offset, item_length, ENC_NA);
1062 hdrs_tree = proto_item_add_subtree(hdrs, ett_btobex_hdrs);
1064 else {
1065 return offset;
1068 while (tvb_length_remaining(tvb, offset) > 0) {
1069 hdr_id = tvb_get_guint8(tvb, offset);
1071 switch(0xC0 & hdr_id)
1073 case 0x00: /* null terminated unicode */
1074 item_length = tvb_get_ntohs(tvb, offset+1);
1075 break;
1076 case 0x40: /* byte sequence */
1077 item_length = tvb_get_ntohs(tvb, offset+1);
1078 break;
1079 case 0x80: /* 1 byte */
1080 item_length = 2;
1081 break;
1082 case 0xc0: /* 4 bytes */
1083 item_length = 5;
1084 break;
1087 hdr = proto_tree_add_none_format(hdrs_tree, hf_header, tvb, offset, item_length, "%s",
1088 val_to_str_ext_const(hdr_id, &header_id_vals_ext, "Unknown"));
1089 hdr_tree = proto_item_add_subtree(hdr, ett_btobex_hdr);
1091 proto_tree_add_item(hdr_tree, hf_hdr_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1093 offset++;
1095 switch(0xC0 & hdr_id)
1097 case 0x00: /* null terminated unicode */
1099 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1100 offset += 2;
1102 if (item_length > 3) {
1103 char *str;
1105 display_unicode_string(tvb, hdr_tree, offset, &str);
1106 proto_item_append_text(hdr_tree, " (\"%s\")", str);
1108 col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", str);
1109 offset += item_length - 3;
1111 else {
1112 col_append_str(pinfo->cinfo, COL_INFO, " \"\"");
1115 break;
1116 case 0x40: /* byte sequence */
1117 if (hdr_id == 0x4C) { /* Application Parameters */
1119 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1120 parameters_length = tvb_get_ntohs(tvb, offset) - 3;
1121 offset += 2;
1123 switch (profile) {
1124 case PROFILE_BPP:
1125 offset = dissect_bpp_application_parameters(tvb, pinfo, hdr_tree, offset, parameters_length);
1126 break;
1127 case PROFILE_BIP:
1128 offset = dissect_bip_application_parameters(tvb, pinfo, hdr_tree, offset, parameters_length);
1129 break;
1130 case PROFILE_PBAP:
1131 offset = dissect_pbap_application_parameters(tvb, pinfo, hdr_tree, offset, parameters_length);
1132 break;
1133 case PROFILE_MAP:
1134 offset = dissect_map_application_parameters(tvb, pinfo, hdr_tree, offset, parameters_length);
1135 break;
1136 default:
1137 offset = dissect_raw_application_parameters(tvb, hdr_tree, offset, parameters_length);
1138 break;
1140 break;
1143 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1144 offset += 2;
1146 handle_item = proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, item_length - 3, ENC_NA);
1148 if (((hdr_id == 0x46) || (hdr_id == 0x4a)) && (item_length == 19)) { /* target or who */
1149 for(i=0; target_vals[i].strptr != NULL; i++) {
1150 if (tvb_memeql(tvb, offset, target_vals[i].value, target_vals[i].length) == 0) {
1151 proto_item_append_text(handle_item, ": %s", target_vals[i].strptr);
1152 proto_item_append_text(hdr_tree, " (%s)", target_vals[i].strptr);
1154 col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", target_vals[i].strptr);
1155 if (!pinfo->fd->flags.visited) {
1156 obex_profile_data_t *obex_profile_data;
1157 guint32 interface_id;
1158 guint32 adapter_id;
1159 guint32 chandle;
1160 guint32 channel;
1161 wmem_tree_key_t key[6];
1162 guint32 k_interface_id;
1163 guint32 k_adapter_id;
1164 guint32 k_frame_number;
1165 guint32 k_chandle;
1166 guint32 k_channel;
1168 if (is_obex_over_l2cap) {
1169 btl2cap_data_t *l2cap_data;
1171 l2cap_data = (btl2cap_data_t *) data;
1172 interface_id = l2cap_data->interface_id;
1173 adapter_id = l2cap_data->adapter_id;
1174 chandle = l2cap_data->chandle;
1175 channel = l2cap_data->cid;
1176 } else {
1177 btrfcomm_data_t *rfcomm_data;
1179 rfcomm_data = (btrfcomm_data_t *) data;
1180 interface_id = rfcomm_data->interface_id;
1181 adapter_id = rfcomm_data->adapter_id;
1182 chandle = rfcomm_data->chandle;
1183 channel = rfcomm_data->dlci >> 1;
1186 k_interface_id = interface_id;
1187 k_adapter_id = adapter_id;
1188 k_chandle = chandle;
1189 k_channel = channel;
1190 k_frame_number = pinfo->fd->num;
1192 key[0].length = 1;
1193 key[0].key = &k_interface_id;
1194 key[1].length = 1;
1195 key[1].key = &k_adapter_id;
1196 key[2].length = 1;
1197 key[2].key = &k_chandle;
1198 key[3].length = 1;
1199 key[3].key = &k_channel;
1200 key[4].length = 1;
1201 key[4].key = &k_frame_number;
1202 key[5].length = 0;
1203 key[5].key = NULL;
1205 obex_profile_data = wmem_new(wmem_file_scope(), obex_profile_data_t);
1206 obex_profile_data->interface_id = interface_id;
1207 obex_profile_data->adapter_id = adapter_id;
1208 obex_profile_data->chandle = chandle;
1209 obex_profile_data->channel = channel;
1210 obex_profile_data->profile = target_to_profile[i];
1212 wmem_tree_insert32_array(obex_profile, key, obex_profile_data);
1218 if (!tvb_strneql(tvb, offset, "<?xml", 5))
1220 tvbuff_t* next_tvb = tvb_new_subset_remaining(tvb, offset);
1222 call_dissector(xml_handle, next_tvb, pinfo, tree);
1224 else if (is_ascii_str(tvb_get_ptr(tvb, offset,item_length - 3), item_length - 3))
1226 proto_item_append_text(hdr_tree, " (\"%s\")", tvb_get_string(wmem_packet_scope(), tvb, offset,item_length - 3));
1227 col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_string(wmem_packet_scope(), tvb, offset,item_length - 3));
1230 if (item_length >= 3) /* prevent infinite loops */
1231 offset += item_length - 3;
1232 break;
1233 case 0x80: /* 1 byte */
1234 proto_item_append_text(hdr_tree, " (%i)", tvb_get_ntohl(tvb, offset));
1235 proto_tree_add_item(hdr_tree, hf_hdr_val_byte, tvb, offset, 1, ENC_BIG_ENDIAN);
1236 offset++;
1237 break;
1238 case 0xc0: /* 4 bytes */
1239 proto_item_append_text(hdr_tree, " (%i)", tvb_get_ntohl(tvb, offset));
1240 proto_tree_add_item(hdr_tree, hf_hdr_val_long, tvb, offset, 4, ENC_BIG_ENDIAN);
1241 offset += 4;
1242 break;
1243 default:
1244 break;
1248 return offset;
1251 static gint
1252 dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
1254 fragment_head *frag_msg = NULL;
1255 gboolean save_fragmented, complete;
1256 tvbuff_t* new_tvb = NULL;
1257 tvbuff_t* next_tvb = NULL;
1258 guint32 no_of_segments = 0;
1259 gint offset = 0;
1260 gint profile = PROFILE_UNKNOWN;
1261 gint response_opcode = -1;
1262 gboolean is_obex_over_l2cap = FALSE;
1263 obex_profile_data_t *obex_profile_data;
1264 guint32 interface_id;
1265 guint32 adapter_id;
1266 guint32 chandle;
1267 guint32 channel;
1268 wmem_tree_key_t key[7];
1269 guint32 k_interface_id;
1270 guint32 k_adapter_id;
1271 guint32 k_frame_number;
1272 guint32 k_chandle;
1273 guint32 k_channel;
1274 obex_last_opcode_data_t *obex_last_opcode_data;
1275 guint32 k_direction;
1277 save_fragmented = pinfo->fragmented;
1279 is_obex_over_l2cap = (proto_btrfcomm == (gint) GPOINTER_TO_UINT(wmem_list_frame_data(
1280 wmem_list_frame_prev(wmem_list_tail(pinfo->layers)))));
1282 if (is_obex_over_l2cap) {
1283 btl2cap_data_t *l2cap_data;
1285 l2cap_data = (btl2cap_data_t *) data;
1286 DISSECTOR_ASSERT(l2cap_data);
1288 interface_id = l2cap_data->interface_id;
1289 adapter_id = l2cap_data->adapter_id;
1290 chandle = l2cap_data->chandle;
1291 channel = l2cap_data->cid;
1292 } else {
1293 btrfcomm_data_t *rfcomm_data;
1295 rfcomm_data = (btrfcomm_data_t *) data;
1296 DISSECTOR_ASSERT(rfcomm_data);
1298 interface_id = rfcomm_data->interface_id;
1299 adapter_id = rfcomm_data->adapter_id;
1300 chandle = rfcomm_data->chandle;
1301 channel = rfcomm_data->dlci >> 1;
1304 k_interface_id = interface_id;
1305 k_adapter_id = adapter_id;
1306 k_chandle = chandle;
1307 k_channel = channel;
1308 k_frame_number = pinfo->fd->num;
1310 key[0].length = 1;
1311 key[0].key = &k_interface_id;
1312 key[1].length = 1;
1313 key[1].key = &k_adapter_id;
1314 key[2].length = 1;
1315 key[2].key = &k_chandle;
1316 key[3].length = 1;
1317 key[3].key = &k_channel;
1318 key[4].length = 1;
1319 key[4].key = &k_frame_number;
1320 key[5].length = 0;
1321 key[5].key = NULL;
1323 obex_profile_data = (obex_profile_data_t *)wmem_tree_lookup32_array_le(obex_profile, key);
1324 if (obex_profile_data && obex_profile_data->interface_id == interface_id &&
1325 obex_profile_data->adapter_id == adapter_id &&
1326 obex_profile_data->chandle == chandle &&
1327 obex_profile_data->channel == channel) {
1328 profile = obex_profile_data->profile;
1331 complete = FALSE;
1333 if (fragment_get(&btobex_reassembly_table, pinfo, pinfo->p2p_dir, NULL)) {
1334 /* not the first fragment */
1335 frag_msg = fragment_add_seq_next(&btobex_reassembly_table,
1336 tvb, 0, pinfo, pinfo->p2p_dir, NULL,
1337 tvb_length(tvb), TRUE);
1339 new_tvb = process_reassembled_data(tvb, 0, pinfo,
1340 "Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, tree);
1342 pinfo->fragmented = TRUE;
1343 } else {
1344 if (tvb_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
1345 /* first fragment in a sequence */
1346 no_of_segments = tvb_get_ntohs(tvb, offset+1)/tvb_length(tvb);
1347 if (tvb_get_ntohs(tvb, offset+1) > (no_of_segments * tvb_length(tvb)))
1348 no_of_segments++;
1350 frag_msg = fragment_add_seq_next(&btobex_reassembly_table,
1351 tvb, 0, pinfo, pinfo->p2p_dir, NULL,
1352 tvb_length(tvb), TRUE);
1354 fragment_set_tot_len(&btobex_reassembly_table,
1355 pinfo, pinfo->p2p_dir, NULL,
1356 no_of_segments-1);
1358 new_tvb = process_reassembled_data(tvb, 0, pinfo,
1359 "Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, tree);
1361 pinfo->fragmented = TRUE;
1363 else if (tvb_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
1364 /* non-fragmented */
1365 complete = TRUE;
1366 pinfo->fragmented = FALSE;
1370 if (new_tvb) { /* take it all */
1371 next_tvb = new_tvb;
1372 complete = TRUE;
1373 } else { /* make a new subset */
1374 next_tvb = tvb_new_subset_remaining(tvb, offset);
1377 if (complete) {
1378 proto_item *ti;
1379 proto_tree *st;
1380 proto_item *sub_item;
1381 guint8 code;
1382 guint8 final_flag;
1384 /* fully dissectable packet ready */
1385 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OBEX");
1387 ti = proto_tree_add_item(tree, proto_btobex, next_tvb, 0, -1, ENC_NA);
1388 st = proto_item_add_subtree(ti, ett_btobex);
1390 sub_item = proto_tree_add_uint(st, hf_profile, next_tvb, 0, 0, profile);
1391 PROTO_ITEM_SET_GENERATED(sub_item);
1393 /* op/response code */
1394 code = tvb_get_guint8(next_tvb, offset) & BTOBEX_CODE_VALS_MASK;
1395 final_flag = tvb_get_guint8(next_tvb, offset) & 0x80;
1397 switch (pinfo->p2p_dir) {
1398 case P2P_DIR_SENT:
1399 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
1400 break;
1401 case P2P_DIR_RECV:
1402 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
1403 break;
1404 default:
1405 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ",
1406 pinfo->p2p_dir);
1407 break;
1410 col_append_str(pinfo->cinfo, COL_INFO,
1411 val_to_str_ext_const(code, &code_vals_ext, "Unknown"));
1413 if (code < BTOBEX_CODE_VALS_CONTINUE || code == BTOBEX_CODE_VALS_ABORT) {
1414 proto_tree_add_item(st, hf_opcode, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1415 if (!pinfo->fd->flags.visited &&
1416 (pinfo->p2p_dir == P2P_DIR_SENT ||
1417 pinfo->p2p_dir == P2P_DIR_RECV)) {
1419 if (is_obex_over_l2cap) {
1420 btl2cap_data_t *l2cap_data;
1422 l2cap_data = (btl2cap_data_t *) data;
1423 interface_id = l2cap_data->interface_id;
1424 adapter_id = l2cap_data->adapter_id;
1425 chandle = l2cap_data->chandle;
1426 channel = l2cap_data->cid;
1427 } else {
1428 btrfcomm_data_t *rfcomm_data;
1430 rfcomm_data = (btrfcomm_data_t *) data;
1431 interface_id = rfcomm_data->interface_id;
1432 adapter_id = rfcomm_data->adapter_id;
1433 chandle = rfcomm_data->chandle;
1434 channel = rfcomm_data->dlci >> 1;
1437 k_interface_id = interface_id;
1438 k_adapter_id = adapter_id;
1439 k_chandle = chandle;
1440 k_channel = channel;
1441 k_direction = pinfo->p2p_dir;
1442 k_frame_number = pinfo->fd->num;
1444 key[0].length = 1;
1445 key[0].key = &k_interface_id;
1446 key[1].length = 1;
1447 key[1].key = &k_adapter_id;
1448 key[2].length = 1;
1449 key[2].key = &k_chandle;
1450 key[3].length = 1;
1451 key[3].key = &k_channel;
1452 key[4].length = 1;
1453 key[4].key = &k_direction;
1454 key[5].length = 1;
1455 key[5].key = &k_frame_number;
1456 key[6].length = 0;
1457 key[6].key = NULL;
1459 obex_last_opcode_data = wmem_new(wmem_file_scope(), obex_last_opcode_data_t);
1460 obex_last_opcode_data->interface_id = interface_id;
1461 obex_last_opcode_data->adapter_id = adapter_id;
1462 obex_last_opcode_data->chandle = chandle;
1463 obex_last_opcode_data->channel = channel;
1464 obex_last_opcode_data->direction = pinfo->p2p_dir;
1465 obex_last_opcode_data->code = code;
1467 wmem_tree_insert32_array(obex_last_opcode, key, obex_last_opcode_data);
1469 } else {
1470 proto_tree_add_item(st, hf_response_code, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1473 proto_tree_add_item(st, hf_final_flag, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1474 offset++;
1476 /* length */
1477 proto_tree_add_item(st, hf_length, next_tvb, offset, 2, ENC_BIG_ENDIAN);
1478 offset += 2;
1480 switch(code)
1482 case BTOBEX_CODE_VALS_CONNECT:
1483 proto_tree_add_item(st, hf_version, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1484 offset++;
1486 proto_tree_add_item(st, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1487 offset++;
1489 proto_tree_add_item(st, hf_max_pkt_len, next_tvb, offset, 2, ENC_BIG_ENDIAN);
1490 offset += 2;
1491 break;
1493 case BTOBEX_CODE_VALS_PUT:
1494 case BTOBEX_CODE_VALS_GET:
1495 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", (final_flag == 0x80) ? "final" : "continue");
1496 break;
1498 case BTOBEX_CODE_VALS_SET_PATH:
1499 proto_tree_add_item(st, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1500 proto_tree_add_item(st, hf_set_path_flags_0, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1501 proto_tree_add_item(st, hf_set_path_flags_1, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1502 offset++;
1504 proto_tree_add_item(st, hf_constants, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1505 offset++;
1506 break;
1508 case BTOBEX_CODE_VALS_DISCONNECT:
1509 case BTOBEX_CODE_VALS_ABORT:
1510 break;
1512 default:
1513 if (is_obex_over_l2cap) {
1514 btl2cap_data_t *l2cap_data;
1516 l2cap_data = (btl2cap_data_t *) data;
1517 interface_id = l2cap_data->interface_id;
1518 adapter_id = l2cap_data->adapter_id;
1519 chandle = l2cap_data->chandle;
1520 channel = l2cap_data->cid;
1521 } else {
1522 btrfcomm_data_t *rfcomm_data;
1524 rfcomm_data = (btrfcomm_data_t *) data;
1525 interface_id = rfcomm_data->interface_id;
1526 adapter_id = rfcomm_data->adapter_id;
1527 chandle = rfcomm_data->chandle;
1528 channel = rfcomm_data->dlci >> 1;
1531 k_interface_id = interface_id;
1532 k_adapter_id = adapter_id;
1533 k_chandle = chandle;
1534 k_channel = channel;
1535 k_direction = (pinfo->p2p_dir + 1) & 0x01;
1536 k_frame_number = pinfo->fd->num;
1538 key[0].length = 1;
1539 key[0].key = &k_interface_id;
1540 key[1].length = 1;
1541 key[1].key = &k_adapter_id;
1542 key[2].length = 1;
1543 key[2].key = &k_chandle;
1544 key[3].length = 1;
1545 key[3].key = &k_channel;
1546 key[4].length = 1;
1547 key[4].key = &k_direction;
1548 key[5].length = 1;
1549 key[5].key = &k_frame_number;
1550 key[6].length = 0;
1551 key[6].key = NULL;
1553 obex_last_opcode_data = (obex_last_opcode_data_t *)wmem_tree_lookup32_array_le(obex_last_opcode, key);
1554 if (obex_last_opcode_data && obex_last_opcode_data->interface_id == interface_id &&
1555 obex_last_opcode_data->adapter_id == adapter_id &&
1556 obex_last_opcode_data->chandle == chandle &&
1557 obex_last_opcode_data->channel == channel &&
1558 obex_last_opcode_data->direction == ((pinfo->p2p_dir + 1) & 0x01)) {
1559 response_opcode = obex_last_opcode_data->code;
1562 if (response_opcode == BTOBEX_CODE_VALS_CONNECT) {
1563 proto_tree_add_item(st, hf_version, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1564 offset++;
1566 proto_tree_add_item(st, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
1567 offset++;
1569 proto_tree_add_item(st, hf_max_pkt_len, next_tvb, offset, 2, ENC_BIG_ENDIAN);
1570 offset += 2;
1572 break;
1575 dissect_headers(st, next_tvb, offset, pinfo, profile, is_obex_over_l2cap, data);
1576 } else {
1577 /* packet fragment */
1578 col_add_fstr(pinfo->cinfo, COL_INFO, "%s Obex fragment",
1579 (pinfo->p2p_dir==P2P_DIR_SENT) ? "Sent" : "Rcvd");
1581 call_dissector(data_handle, next_tvb, pinfo, tree);
1584 pinfo->fragmented = save_fragmented;
1586 return offset;
1590 void
1591 proto_register_btobex(void)
1593 expert_module_t *expert_btobex;
1595 static hf_register_info hf[] = {
1596 { &hf_opcode,
1597 { "Opcode", "btobex.opcode",
1598 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &code_vals_ext, BTOBEX_CODE_VALS_MASK,
1599 "Request Opcode", HFILL}
1601 { &hf_response_code,
1602 { "Response Code", "btobex.resp_code",
1603 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &code_vals_ext, BTOBEX_CODE_VALS_MASK,
1604 NULL, HFILL}
1606 { &hf_final_flag,
1607 { "Final Flag", "btobex.final_flag",
1608 FT_BOOLEAN, 8, NULL, 0x80,
1609 NULL, HFILL}
1611 { &hf_length,
1612 { "Packet Length", "btobex.pkt_len",
1613 FT_UINT16, BASE_DEC, NULL, 0,
1614 NULL, HFILL}
1616 { &hf_version,
1617 { "Version", "btobex.version",
1618 FT_UINT8, BASE_HEX, VALS(version_vals), 0x00,
1619 "Obex Protocol Version", HFILL}
1621 { &hf_flags,
1622 { "Flags", "btobex.flags",
1623 FT_UINT8, BASE_HEX, NULL, 0x00,
1624 NULL, HFILL}
1626 { &hf_constants,
1627 { "Constants", "btobex.constants",
1628 FT_UINT8, BASE_HEX, NULL, 0x00,
1629 NULL, HFILL}
1631 { &hf_max_pkt_len,
1632 { "Max. Packet Length", "btobex.max_pkt_len",
1633 FT_UINT16, BASE_DEC, NULL, 0,
1634 NULL, HFILL}
1636 { &hf_set_path_flags_0,
1637 { "Go back one folder (../) first", "btobex.set_path_flags_0",
1638 FT_BOOLEAN, 8, NULL, 0x01,
1639 NULL, HFILL}
1641 { &hf_set_path_flags_1,
1642 { "Do not create folder, if not existing", "btobex.set_path_flags_1",
1643 FT_BOOLEAN, 8, NULL, 0x02,
1644 NULL, HFILL}
1646 { &hf_headers,
1647 { "Headers", "btobex.headers",
1648 FT_NONE, BASE_NONE, NULL, 0x00,
1649 NULL, HFILL}
1651 { &hf_header,
1652 { "Header", "btobex.header",
1653 FT_NONE, BASE_NONE, NULL, 0x00,
1654 NULL, HFILL}
1656 { &hf_hdr_id,
1657 { "Header Id", "btobex.header.id",
1658 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &header_id_vals_ext, 0x00,
1659 NULL, HFILL}
1661 { &hf_hdr_length,
1662 { "Length", "btobex.header.length",
1663 FT_UINT16, BASE_DEC, NULL, 0,
1664 "Header Length", HFILL}
1666 { &hf_hdr_val_unicode,
1667 { "Value", "btobex.header.value.unicode",
1668 FT_STRING, BASE_NONE, NULL, 0,
1669 "Unicode Value", HFILL }
1671 { &hf_hdr_val_byte_seq,
1672 { "Value", "btobex.header.value.byte_sequence",
1673 FT_BYTES, BASE_NONE, NULL, 0,
1674 "Byte Value", HFILL}
1676 { &hf_hdr_val_byte,
1677 { "Value", "btobex.header.value.byte",
1678 FT_UINT8, BASE_HEX, NULL, 0,
1679 "Byte Sequence Value", HFILL}
1681 { &hf_hdr_val_long,
1682 { "Value", "btobex.header.value.long",
1683 FT_UINT32, BASE_DEC, NULL, 0,
1684 "4-byte Value", HFILL}
1686 { &hf_application_parameter,
1687 { "Parameter", "btobex.parameter",
1688 FT_NONE, BASE_NONE, NULL, 0x00,
1689 NULL, HFILL}
1691 { &hf_application_parameter_id,
1692 { "Parameter Id", "btobex.parameter.id",
1693 FT_UINT8, BASE_HEX, NULL, 0x00,
1694 NULL, HFILL}
1696 { &hf_application_parameter_length,
1697 { "Parameter Length", "btobex.parameter.length",
1698 FT_UINT8, BASE_DEC, NULL, 0,
1699 NULL, HFILL}
1701 { &hf_application_parameter_data,
1702 { "Parameter Value", "btobex.parameter.value",
1703 FT_BYTES, BASE_NONE, NULL, 0,
1704 NULL, HFILL}
1706 /* application parameters for BPP */
1707 { &hf_bpp_application_parameter_id,
1708 { "Parameter Id", "btobex.parameter.id",
1709 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bpp_application_parameters_vals_ext, 0x00,
1710 NULL, HFILL}
1712 { &hf_bpp_application_parameter_data_offset,
1713 { "Offset", "btobex.parameter.value.offset",
1714 FT_UINT32, BASE_DEC_HEX, NULL, 0,
1715 "The byte offset into the image or file.", HFILL}
1717 { &hf_bpp_application_parameter_data_count,
1718 { "Count", "btobex.parameter.value.count",
1719 FT_INT32, BASE_DEC, NULL, 0,
1720 "The number of bytes of the image or file to be sent.", HFILL}
1722 { &hf_bpp_application_parameter_data_job_id,
1723 { "Job ID", "btobex.parameter.value.job_id",
1724 FT_UINT32, BASE_DEC_HEX, NULL, 0,
1725 "The job identifier of the print job.", HFILL}
1727 { &hf_bpp_application_parameter_data_file_size,
1728 { "File Size", "btobex.parameter.value.file_size",
1729 FT_INT32, BASE_DEC, NULL, 0,
1730 "The size (in bytes) of object or file.", HFILL}
1732 /* application parameters for BIP */
1733 { &hf_bip_application_parameter_id,
1734 { "Parameter Id", "btobex.parameter.id",
1735 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bip_application_parameters_vals_ext, 0x00,
1736 NULL, HFILL}
1738 { &hf_bip_application_parameter_data_number_of_returned_handles,
1739 { "Number of Returned Handles", "btobex.parameter.value.number_of_returned_handles",
1740 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
1741 NULL, HFILL }
1743 { &hf_bip_application_parameter_data_list_start_offset,
1744 { "List Start Offset", "btobex.parameter.value.list_start_offset",
1745 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
1746 NULL, HFILL }
1748 { &hf_bip_application_parameter_data_latest_captured_images,
1749 { "Latest Captured Images", "btobex.parameter.value.latest_captured_images",
1750 FT_BOOLEAN, 8, NULL, 0x00,
1751 NULL, HFILL }
1753 { &hf_bip_application_parameter_data_partial_file_length,
1754 { "Partial File Length", "btobex.parameter.value.partial_file_length",
1755 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
1756 NULL, HFILL }
1758 { &hf_bip_application_parameter_data_partial_file_start_offset,
1759 { "Partial File Start Offset", "btobex.parameter.value.partial_file_start_offset",
1760 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
1761 NULL, HFILL }
1763 { &hf_bip_application_parameter_data_total_file_size,
1764 { "Total File Size", "btobex.parameter.value.total_file_size",
1765 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
1766 NULL, HFILL }
1768 { &hf_bip_application_parameter_data_end_flag,
1769 { "End Flag", "btobex.parameter.value.end_flag",
1770 FT_BOOLEAN, 8, NULL, 0x00,
1771 NULL, HFILL }
1773 { &hf_bip_application_parameter_data_remote_display,
1774 { "Remote Display", "btobex.parameter.value.remote_display",
1775 FT_UINT8, BASE_HEX, VALS(bip_remote_display_vals), 0x00,
1776 NULL, HFILL }
1778 { &hf_bip_application_parameter_data_service_id,
1779 { "Service ID", "btobex.parameter.value.service_id",
1780 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &vs_service_classes_ext, 0x00,
1781 NULL, HFILL }
1783 { &hf_bip_application_parameter_data_store_flag,
1784 { "Store Flag", "btobex.parameter.value.store_flag",
1785 FT_BOOLEAN, 8, NULL, 0x00,
1786 NULL, HFILL }
1788 /* application parameters for PBAP */
1789 { &hf_pbap_application_parameter_id,
1790 { "Parameter Id", "btobex.parameter.id",
1791 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &pbap_application_parameters_vals_ext, 0x00,
1792 NULL, HFILL}
1794 { &hf_pbap_application_parameter_data_order,
1795 { "Max List Count", "btobex.parameter.value.order",
1796 FT_UINT8, BASE_HEX, VALS(pbap_order_vals), 0x00,
1797 NULL, HFILL}
1799 { &hf_pbap_application_parameter_data_search_value,
1800 { "Search Value", "btobex.parameter.value.order",
1801 FT_STRING, BASE_NONE, NULL, 0x00,
1802 NULL, HFILL}
1804 { &hf_pbap_application_parameter_data_search_attribute,
1805 { "Search Attribute", "btobex.parameter.value.search_attribute",
1806 FT_UINT8, BASE_HEX, VALS(pbap_search_attribute_vals), 0x00,
1807 NULL, HFILL}
1809 { &hf_pbap_application_parameter_data_max_list_count,
1810 { "Max List Count", "btobex.parameter.value.max_list_count",
1811 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
1812 NULL, HFILL}
1814 { &hf_pbap_application_parameter_data_list_start_offset,
1815 { "List Start Offset", "btobex.parameter.value.list_start_offset",
1816 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
1817 NULL, HFILL}
1819 { &hf_pbap_application_parameter_data_filter_version,
1820 { "vCard Version", "btobex.parameter.value.filter.version",
1821 FT_BOOLEAN, 32, NULL, 0x00000001,
1822 NULL, HFILL}
1824 { &hf_pbap_application_parameter_data_filter_fn,
1825 { "Formatted Name", "btobex.parameter.value.filter.fn",
1826 FT_BOOLEAN, 32, NULL, 0x00000002,
1827 NULL, HFILL}
1829 { &hf_pbap_application_parameter_data_filter_n,
1830 { "Structured Presentation of Name", "btobex.parameter.value.filter.n",
1831 FT_BOOLEAN, 32, NULL, 0x00000004,
1832 NULL, HFILL}
1834 { &hf_pbap_application_parameter_data_filter_photo,
1835 { "Associated Image or Photo", "btobex.parameter.value.filter.photo",
1836 FT_BOOLEAN, 32, NULL, 0x00000008,
1837 NULL, HFILL}
1839 { &hf_pbap_application_parameter_data_filter_birthday,
1840 { "Birthday", "btobex.parameter.value.filter.birthday",
1841 FT_BOOLEAN, 32, NULL, 0x00000010,
1842 NULL, HFILL}
1844 { &hf_pbap_application_parameter_data_filter_adr,
1845 { "Delivery Address", "btobex.parameter.value.filter.adr",
1846 FT_BOOLEAN, 32, NULL, 0x00000020,
1847 NULL, HFILL}
1849 { &hf_pbap_application_parameter_data_filter_label,
1850 { "Delivery", "btobex.parameter.value.filter.label",
1851 FT_BOOLEAN, 32, NULL, 0x00000040,
1852 NULL, HFILL}
1854 { &hf_pbap_application_parameter_data_filter_tel,
1855 { "Telephone Number", "btobex.parameter.value.filter.tel",
1856 FT_BOOLEAN, 32, NULL, 0x00000080,
1857 NULL, HFILL}
1859 { &hf_pbap_application_parameter_data_filter_email,
1860 { "Electronic Mail Address", "btobex.parameter.value.filter.email",
1861 FT_BOOLEAN, 32, NULL, 0x00000100,
1862 NULL, HFILL}
1864 { &hf_pbap_application_parameter_data_filter_mailer,
1865 { "Electronic Mail", "btobex.parameter.value.filter.mailer",
1866 FT_BOOLEAN, 32, NULL, 0x00000200,
1867 NULL, HFILL}
1869 { &hf_pbap_application_parameter_data_filter_time_zone,
1870 { "Time Zone", "btobex.parameter.value.filter.time_zone",
1871 FT_BOOLEAN, 32, NULL, 0x00000400,
1872 NULL, HFILL}
1874 { &hf_pbap_application_parameter_data_filter_geographic_position,
1875 { "Geographic Position", "btobex.parameter.value.filter.geographic_position",
1876 FT_BOOLEAN, 32, NULL, 0x00000800,
1877 NULL, HFILL}
1879 { &hf_pbap_application_parameter_data_filter_title,
1880 { "Job", "btobex.parameter.value.filter.title",
1881 FT_BOOLEAN, 32, NULL, 0x00001000,
1882 NULL, HFILL}
1884 { &hf_pbap_application_parameter_data_filter_role,
1885 { "Role within the Organization", "btobex.parameter.value.filter.role",
1886 FT_BOOLEAN, 32, NULL, 0x00002000,
1887 NULL, HFILL}
1889 { &hf_pbap_application_parameter_data_filter_logo,
1890 { "Organization Logo", "btobex.parameter.value.filter.logo",
1891 FT_BOOLEAN, 32, NULL, 0x00004000,
1892 NULL, HFILL}
1894 { &hf_pbap_application_parameter_data_filter_agent,
1895 { "vCard of Person Representing", "btobex.parameter.value.filter.agent",
1896 FT_BOOLEAN, 32, NULL, 0x00008000,
1897 NULL, HFILL}
1899 { &hf_pbap_application_parameter_data_filter_name_of_organization,
1900 { "Name of Organization", "btobex.parameter.value.filter.name_of_organization",
1901 FT_BOOLEAN, 32, NULL, 0x00010000,
1902 NULL, HFILL}
1904 { &hf_pbap_application_parameter_data_filter_comments,
1905 { "Comments", "btobex.parameter.value.filter.comments",
1906 FT_BOOLEAN, 32, NULL, 0x00020000,
1907 NULL, HFILL}
1909 { &hf_pbap_application_parameter_data_filter_revision,
1910 { "Revision", "btobex.parameter.value.filter.revision",
1911 FT_BOOLEAN, 32, NULL, 0x00040000,
1912 NULL, HFILL}
1914 { &hf_pbap_application_parameter_data_filter_pronunciation_of_name,
1915 { "Pronunciation of Name", "btobex.parameter.value.filter.pronunciation_of_name",
1916 FT_BOOLEAN, 32, NULL, 0x00080000,
1917 NULL, HFILL}
1919 { &hf_pbap_application_parameter_data_filter_url,
1920 { "Uniform Resource Locator", "btobex.parameter.value.filter.url",
1921 FT_BOOLEAN, 32, NULL, 0x00100000,
1922 NULL, HFILL}
1924 { &hf_pbap_application_parameter_data_filter_uid,
1925 { "Unique ID", "btobex.parameter.value.filter.uid",
1926 FT_BOOLEAN, 32, NULL, 0x00200000,
1927 NULL, HFILL}
1929 { &hf_pbap_application_parameter_data_filter_key,
1930 { "Public Encryption Key", "btobex.parameter.value.filter.key",
1931 FT_BOOLEAN, 32, NULL, 0x00400000,
1932 NULL, HFILL}
1934 { &hf_pbap_application_parameter_data_filter_nickname,
1935 { "Nickname", "btobex.parameter.value.filter.nickname",
1936 FT_BOOLEAN, 32, NULL, 0x00800000,
1937 NULL, HFILL}
1939 { &hf_pbap_application_parameter_data_filter_categories,
1940 { "Categories", "btobex.parameter.value.filter.categories",
1941 FT_BOOLEAN, 32, NULL, 0x01000000,
1942 NULL, HFILL}
1944 { &hf_pbap_application_parameter_data_filter_product_id,
1945 { "Product ID", "btobex.parameter.value.filter.product_id",
1946 FT_BOOLEAN, 32, NULL, 0x02000000,
1947 NULL, HFILL}
1949 { &hf_pbap_application_parameter_data_filter_class,
1950 { "Class Information", "btobex.parameter.value.filter.class",
1951 FT_BOOLEAN, 32, NULL, 0x04000000,
1952 NULL, HFILL}
1954 { &hf_pbap_application_parameter_data_filter_sort_string,
1955 { "String Used For Sorting Operations", "btobex.parameter.value.filter.sort_string",
1956 FT_BOOLEAN, 32, NULL, 0x08000000,
1957 NULL, HFILL}
1959 { &hf_pbap_application_parameter_data_filter_timestamp,
1960 { "Timestamp", "btobex.parameter.value.filter.timestamp",
1961 FT_BOOLEAN, 32, NULL, 0x10000000,
1962 NULL, HFILL}
1964 { &hf_pbap_application_parameter_data_filter_reserved_29_31,
1965 { "Reserved", "btobex.parameter.value.filter.reserved_29_31",
1966 FT_UINT32, BASE_HEX, NULL, 0xE0000000,
1967 NULL, HFILL}
1969 { &hf_pbap_application_parameter_data_filter_reserved_32_38,
1970 { "Reserved", "btobex.parameter.value.filter.reserved_32_38",
1971 FT_UINT32, BASE_HEX, NULL, 0x0000007F,
1972 NULL, HFILL}
1974 { &hf_pbap_application_parameter_data_filter_proprietary_filter,
1975 { "Proprietary Filter", "btobex.parameter.value.filter.proprietary_filter",
1976 FT_BOOLEAN, 32, NULL, 0x00000080,
1977 NULL, HFILL}
1979 { &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage,
1980 { "Reserved for Proprietary Filter Usage", "btobex.parameter.value.filter.reserved_for_proprietary_filter_usage",
1981 FT_UINT32, BASE_HEX, NULL, 0xFFFFFF00,
1982 NULL, HFILL}
1984 { &hf_pbap_application_parameter_data_format,
1985 { "Format", "btobex.parameter.value.format",
1986 FT_UINT8, BASE_HEX, VALS(pbap_format_vals), 0x00,
1987 NULL, HFILL}
1989 { &hf_pbap_application_parameter_data_phonebook_size,
1990 { "Phonebook Size", "btobex.parameter.value.phonebook_size",
1991 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
1992 NULL, HFILL}
1994 { &hf_pbap_application_parameter_data_new_missed_calls,
1995 { "New Missed Calls", "btobex.parameter.value.new_missed_calls",
1996 FT_UINT8, BASE_DEC, NULL, 0x00,
1997 NULL, HFILL}
1999 /* application parameters for MAP */
2000 { &hf_map_application_parameter_id,
2001 { "Parameter Id", "btobex.parameter.id",
2002 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &map_application_parameters_vals_ext, 0x00,
2003 NULL, HFILL}
2005 { &hf_map_application_parameter_data_max_list_count,
2006 { "Max List Count", "btobex.parameter.value.max_list_count",
2007 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
2008 NULL, HFILL}
2010 { &hf_map_application_parameter_data_start_offset,
2011 { "Start Offset", "btobex.parameter.value.start_offset",
2012 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
2013 NULL, HFILL}
2015 { &hf_map_application_parameter_data_filter_message_type_reserved,
2016 { "Reserved", "btobex.parameter.value.filter_message_type.reserved",
2017 FT_UINT8, BASE_HEX, NULL, 0xF0,
2018 NULL, HFILL}
2020 { &hf_map_application_parameter_data_filter_message_type_mms,
2021 { "MMS", "btobex.parameter.value.filter_message_type.mms",
2022 FT_BOOLEAN, 8, NULL, 0x08,
2023 "True to filter out, False to listing this type", HFILL}
2025 { &hf_map_application_parameter_data_filter_message_type_email,
2026 { "EMAIL", "btobex.parameter.value.filter_message_type.sms_email",
2027 FT_BOOLEAN, 8, NULL, 0x04,
2028 "True to filter out, False to listing this type", HFILL}
2030 { &hf_map_application_parameter_data_filter_message_type_sms_cdma,
2031 { "SMS_CDMA", "btobex.parameter.value.filter_message_type.sms_cdma",
2032 FT_BOOLEAN, 8, NULL, 0x02,
2033 "True to filter out, False to listing this type", HFILL}
2035 { &hf_map_application_parameter_data_filter_message_type_sms_gsm,
2036 { "SMS_GSM", "btobex.parameter.value.filter_message_type.sms_gsm",
2037 FT_BOOLEAN, 8, NULL, 0x01,
2038 NULL, HFILL}
2040 { &hf_map_application_parameter_data_filter_period_begin,
2041 { "Filter Period Begin", "btobex.parameter.value.filter_period_begin",
2042 FT_STRING, BASE_NONE, NULL, 0,
2043 NULL, HFILL}
2045 { &hf_map_application_parameter_data_filter_period_end,
2046 { "Filter Period End", "btobex.parameter.value.filter_period_end",
2047 FT_STRING, BASE_NONE, NULL, 0,
2048 NULL, HFILL}
2050 { &hf_map_application_parameter_data_filter_read_status_reserved_6,
2051 { "Filter Read Status: Reserved", "btobex.parameter.value.filter_read_status.reserved",
2052 FT_UINT8, BASE_HEX, NULL, 0xFC,
2053 NULL, HFILL}
2055 { &hf_map_application_parameter_data_filter_read_status_get_read,
2056 { "Filter Read Status: Get Read", "btobex.parameter.value.filter_read_status.get_read",
2057 FT_BOOLEAN, 8, NULL, 0x02,
2058 NULL, HFILL}
2060 { &hf_map_application_parameter_data_filter_read_status_get_unread,
2061 { "Filter Read Status: Get Unread", "btobex.parameter.value.filter_read_status.get_unread",
2062 FT_BOOLEAN, 8, NULL, 0x01,
2063 NULL, HFILL}
2065 { &hf_map_application_parameter_data_filter_recipient,
2066 { "Filter Recipient", "btobex.parameter.value.filter_recipient",
2067 FT_STRING, BASE_NONE, NULL, 0,
2068 NULL, HFILL}
2070 { &hf_map_application_parameter_data_filter_originator,
2071 { "Filter Originator", "btobex.parameter.value.filter_originator",
2072 FT_STRING, BASE_NONE, NULL, 0,
2073 NULL, HFILL}
2075 { &hf_map_application_parameter_data_filter_priority_reserved_6,
2076 { "Filter Priority: Reserved", "btobex.parameter.value.filter_priority.reserved",
2077 FT_UINT8, BASE_HEX, NULL, 0xFC,
2078 NULL, HFILL}
2080 { &hf_map_application_parameter_data_filter_priority_get_high,
2081 { "Filter Priority: Get Read", "btobex.parameter.value.filter_priority.get_high",
2082 FT_BOOLEAN, 8, NULL, 0x02,
2083 NULL, HFILL}
2085 { &hf_map_application_parameter_data_filter_priority_non_high,
2086 { "Filter Priority: Get Non High", "btobex.parameter.value.filter_priority.non_high",
2087 FT_BOOLEAN, 8, NULL, 0x01,
2088 NULL, HFILL}
2090 { &hf_map_application_parameter_data_reserved_7,
2091 { "Reserved", "btobex.parameter.value.reserved",
2092 FT_UINT8, BASE_HEX, NULL, 0xFE,
2093 NULL, HFILL}
2095 { &hf_map_application_parameter_data_attachment,
2096 { "Attachment", "btobex.parameter.value.attachment",
2097 FT_BOOLEAN, 8, NULL, 0x01,
2098 NULL, HFILL}
2100 { &hf_map_application_parameter_data_transparent,
2101 { "Transparent", "btobex.parameter.value.transparent",
2102 FT_BOOLEAN, 8, NULL, 0x01,
2103 NULL, HFILL}
2105 { &hf_map_application_parameter_data_retry,
2106 { "Retry", "btobex.parameter.value.retry",
2107 FT_BOOLEAN, 8, NULL, 0x01,
2108 NULL, HFILL}
2110 { &hf_map_application_parameter_data_new_message,
2111 { "New Message", "btobex.parameter.value.new_message",
2112 FT_BOOLEAN, 8, NULL, 0x01,
2113 NULL, HFILL}
2115 { &hf_map_application_parameter_data_notification_status,
2116 { "Notification Status", "btobex.parameter.value.notification_status",
2117 FT_BOOLEAN, 8, NULL, 0x01,
2118 NULL, HFILL}
2120 { &hf_map_application_parameter_data_mas_instance_id,
2121 { "MAS Instance ID", "btobex.parameter.value.mas_instance_id",
2122 FT_UINT8, BASE_DEC_HEX, NULL, 0,
2123 NULL, HFILL}
2125 { &hf_map_application_parameter_data_parameter_mask_reserved,
2126 { "Parameter Mask: Reserved", "btobex.parameter.value.parameter_mask.reserved",
2127 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
2128 NULL, HFILL}
2130 { &hf_map_application_parameter_data_parameter_mask_reply_to_addressing,
2131 { "Parameter Mask: Reply to Addressing", "btobex.parameter.value.parameter_mask.reply_to_addressing",
2132 FT_BOOLEAN, 32, NULL, 0x8000,
2133 NULL, HFILL}
2135 { &hf_map_application_parameter_data_parameter_mask_protected,
2136 { "Parameter Mask: Protected", "btobex.parameter.value.parameter_mask.protected",
2137 FT_BOOLEAN, 32, NULL, 0x4000,
2138 NULL, HFILL}
2140 { &hf_map_application_parameter_data_parameter_mask_sent,
2141 { "Parameter Mask: Sent", "btobex.parameter.value.parameter_mask.sent",
2142 FT_BOOLEAN, 32, NULL, 0x2000,
2143 NULL, HFILL}
2145 { &hf_map_application_parameter_data_parameter_mask_read,
2146 { "Parameter Mask: Read", "btobex.parameter.value.parameter_mask.read",
2147 FT_BOOLEAN, 32, NULL, 0x1000,
2148 NULL, HFILL}
2150 { &hf_map_application_parameter_data_parameter_mask_priority,
2151 { "Parameter Mask: Priority", "btobex.parameter.value.parameter_mask.priority",
2152 FT_BOOLEAN, 32, NULL, 0x0800,
2153 NULL, HFILL}
2155 { &hf_map_application_parameter_data_parameter_mask_attachment_size,
2156 { "Parameter Mask: Attachment Size", "btobex.parameter.value.parameter_mask.attachment_size",
2157 FT_BOOLEAN, 32, NULL, 0x0400,
2158 NULL, HFILL}
2160 { &hf_map_application_parameter_data_parameter_mask_text,
2161 { "Parameter Mask: Text", "btobex.parameter.value.parameter_mask.text",
2162 FT_BOOLEAN, 32, NULL, 0x0200,
2163 NULL, HFILL}
2165 { &hf_map_application_parameter_data_parameter_mask_reception_status,
2166 { "Parameter Mask: Reception Status", "btobex.parameter.value.parameter_mask.reception_status",
2167 FT_BOOLEAN, 32, NULL, 0x0100,
2168 NULL, HFILL}
2170 { &hf_map_application_parameter_data_parameter_mask_size,
2171 { "Parameter Mask: Size", "btobex.parameter.value.parameter_mask.size",
2172 FT_BOOLEAN, 32, NULL, 0x0080,
2173 NULL, HFILL}
2175 { &hf_map_application_parameter_data_parameter_mask_type,
2176 { "Parameter Mask: Type", "btobex.parameter.value.parameter_mask.type",
2177 FT_BOOLEAN, 32, NULL, 0x0040,
2178 NULL, HFILL}
2180 { &hf_map_application_parameter_data_parameter_mask_recipient_addressing,
2181 { "Parameter Mask: Recipient Addressing", "btobex.parameter.value.parameter_mask.recipient_addressing",
2182 FT_BOOLEAN, 32, NULL, 0x0020,
2183 NULL, HFILL}
2185 { &hf_map_application_parameter_data_parameter_mask_recipient_name,
2186 { "Parameter Mask: Recipient Name", "btobex.parameter.value.parameter_mask.recipient_name",
2187 FT_BOOLEAN, 32, NULL, 0x0010,
2188 NULL, HFILL}
2190 { &hf_map_application_parameter_data_parameter_mask_sender_addressing,
2191 { "Parameter Mask: Sender Addressing", "btobex.parameter.value.parameter_mask.sender_addressing",
2192 FT_BOOLEAN, 32, NULL, 0x0008,
2193 NULL, HFILL}
2195 { &hf_map_application_parameter_data_parameter_mask_sender_name,
2196 { "Parameter Mask: Sender Name", "btobex.parameter.value.parameter_mask.sender_name",
2197 FT_BOOLEAN, 32, NULL, 0x0004,
2198 NULL, HFILL}
2200 { &hf_map_application_parameter_data_parameter_mask_datetime,
2201 { "Parameter Mask: Datetime", "btobex.parameter.value.parameter_mask.datetime",
2202 FT_BOOLEAN, 32, NULL, 0x0002,
2203 NULL, HFILL}
2205 { &hf_map_application_parameter_data_parameter_mask_subject,
2206 { "Parameter Mask: Subject", "btobex.parameter.value.parameter_mask.subject",
2207 FT_BOOLEAN, 32, NULL, 0x0001,
2208 NULL, HFILL}
2210 { &hf_map_application_parameter_data_folder_listing_size,
2211 { "Folder Listing Size", "btobex.parameter.value.folder_listing_size",
2212 FT_UINT16, BASE_DEC_HEX, NULL, 0,
2213 NULL, HFILL}
2215 { &hf_map_application_parameter_data_messages_listing_size,
2216 { "Messages Listing Size", "btobex.parameter.value.messages_listing_size",
2217 FT_UINT16, BASE_DEC_HEX, NULL, 0,
2218 NULL, HFILL}
2220 { &hf_map_application_parameter_data_subject_length,
2221 { "Subject Length", "btobex.parameter.value.subject_length",
2222 FT_UINT8, BASE_DEC_HEX, NULL, 0,
2223 NULL, HFILL}
2225 { &hf_map_application_parameter_data_charset,
2226 { "Charset", "btobex.parameter.value.charset",
2227 FT_UINT8, BASE_HEX, VALS(map_charset_vals), 0x01,
2228 NULL, HFILL}
2230 { &hf_map_application_parameter_data_fraction_request,
2231 { "Fraction Request", "btobex.parameter.value.fraction_request",
2232 FT_UINT8, BASE_HEX, VALS(map_fraction_request_vals), 0x01,
2233 NULL, HFILL}
2235 { &hf_map_application_parameter_data_fraction_deliver,
2236 { "Fraction Deliver", "btobex.parameter.value.fraction_deliver",
2237 FT_UINT8, BASE_HEX, VALS(map_fraction_deliver_vals), 0x01,
2238 NULL, HFILL}
2240 { &hf_map_application_parameter_data_status_indicator,
2241 { "Status Indicator", "btobex.parameter.value.status_indicator",
2242 FT_UINT8, BASE_HEX, VALS(map_status_indicator_vals), 0x01,
2243 NULL, HFILL}
2245 { &hf_map_application_parameter_data_status_value,
2246 { "Status Value", "btobex.parameter.value.status_value",
2247 FT_BOOLEAN, 8, NULL, 0x01,
2248 NULL, HFILL}
2250 { &hf_map_application_parameter_data_mse_time,
2251 { "MSE Time", "btobex.parameter.value.mse_time",
2252 FT_STRING, BASE_NONE, NULL, 0,
2253 NULL, HFILL}
2255 /* for fragmentation */
2256 { &hf_btobex_fragment_overlap,
2257 { "Fragment overlap", "btobex.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
2258 "Fragment overlaps with other fragments", HFILL }
2260 { &hf_btobex_fragment_overlap_conflict,
2261 { "Conflicting data in fragment overlap", "btobex.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
2262 "Overlapping fragments contained conflicting data", HFILL }
2264 { &hf_btobex_fragment_multiple_tails,
2265 { "Multiple tail fragments found", "btobex.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
2266 "Several tails were found when defragmenting the packet", HFILL }
2268 { &hf_btobex_fragment_too_long_fragment,
2269 { "Fragment too long", "btobex.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
2270 "Fragment contained data past end of packet", HFILL }
2272 { &hf_btobex_fragment_error,
2273 { "Defragmentation error", "btobex.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
2274 "Defragmentation error due to illegal fragments", HFILL }
2276 { &hf_btobex_fragment_count,
2277 { "Fragment count", "btobex.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
2278 NULL, HFILL }
2280 { &hf_btobex_fragment,
2281 { "OBEX Fragment", "btobex.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
2282 "btobex Fragment", HFILL }
2284 { &hf_btobex_fragments,
2285 { "OBEX Fragments", "btobex.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
2286 "btobex Fragments", HFILL }
2288 { &hf_btobex_reassembled_in,
2289 { "Reassembled OBEX in frame", "btobex.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
2290 "This OBEX frame is reassembled in this frame", HFILL }
2292 { &hf_btobex_reassembled_length,
2293 { "Reassembled OBEX length", "btobex.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
2294 "The total length of the reassembled payload", HFILL }
2296 { &hf_profile,
2297 { "Profile", "btobex.profile", FT_UINT32, BASE_DEC | BASE_EXT_STRING, &profile_vals_ext, 0x0,
2298 "Blutooth Profile used in this OBEX session", HFILL }
2302 /* Setup protocol subtree array */
2303 static gint *ett[] = {
2304 &ett_btobex,
2305 &ett_btobex_hdrs,
2306 &ett_btobex_hdr,
2307 &ett_btobex_fragment,
2308 &ett_btobex_fragments,
2309 &ett_btobex_application_parameters
2312 static ei_register_info ei[] = {
2313 { &ei_application_parameter_length_bad, { "btobex.parameter.length.bad", PI_PROTOCOL, PI_WARN, "Parameter length bad", EXPFILL }},
2316 obex_profile = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
2317 obex_last_opcode = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
2319 proto_btobex = proto_register_protocol("Bluetooth OBEX Protocol", "BT OBEX", "btobex");
2321 new_register_dissector("btobex", dissect_btobex, proto_btobex);
2323 /* Required function calls to register the header fields and subtrees used */
2324 proto_register_field_array(proto_btobex, hf, array_length(hf));
2325 proto_register_subtree_array(ett, array_length(ett));
2326 expert_btobex = expert_register_protocol(proto_btobex);
2327 expert_register_field_array(expert_btobex, ei, array_length(ei));
2329 register_init_routine(&defragment_init);
2332 void
2333 proto_reg_handoff_btobex(void)
2335 dissector_handle_t btobex_handle;
2337 btobex_handle = find_dissector("btobex");
2339 /* register in rfcomm and l2cap the profiles/services this dissector should handle */
2340 dissector_add_uint("btrfcomm.service", BTSDP_OPP_SERVICE_UUID, btobex_handle);
2341 dissector_add_uint("btrfcomm.service", BTSDP_FTP_SERVICE_UUID, btobex_handle);
2342 dissector_add_uint("btrfcomm.service", BTSDP_BPP_DIRECT_PRINTING_SERVICE_UUID, btobex_handle);
2343 dissector_add_uint("btrfcomm.service", BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID, btobex_handle);
2344 dissector_add_uint("btrfcomm.service", BTSDP_BPP_DIRECT_PRINTING_REF_OBJ_SERVICE_UUID, btobex_handle);
2345 dissector_add_uint("btrfcomm.service", BTSDP_BPP_REFLECTED_UI_SERVICE_UUID, btobex_handle);
2346 dissector_add_uint("btrfcomm.service", BTSDP_BPP_SERVICE_UUID, btobex_handle);
2347 dissector_add_uint("btrfcomm.service", BTSDP_BPP_STATUS_SERVICE_UUID, btobex_handle);
2348 dissector_add_uint("btrfcomm.service", BTSDP_BIP_SERVICE_UUID, btobex_handle);
2349 dissector_add_uint("btrfcomm.service", BTSDP_BIP_RESPONDER_SERVICE_UUID, btobex_handle);
2350 dissector_add_uint("btrfcomm.service", BTSDP_BIP_AUTO_ARCH_SERVICE_UUID, btobex_handle);
2351 dissector_add_uint("btrfcomm.service", BTSDP_BIP_REF_OBJ_SERVICE_UUID, btobex_handle);
2352 dissector_add_uint("btrfcomm.service", BTSDP_PBAP_PCE_SERVICE_UUID, btobex_handle);
2353 dissector_add_uint("btrfcomm.service", BTSDP_PBAP_PSE_SERVICE_UUID, btobex_handle);
2354 dissector_add_uint("btrfcomm.service", BTSDP_PBAP_SERVICE_UUID, btobex_handle);
2355 dissector_add_uint("btrfcomm.service", BTSDP_MAP_SERVICE_UUID, btobex_handle);
2356 dissector_add_uint("btrfcomm.service", BTSDP_MAP_ACCESS_SRV_SERVICE_UUID, btobex_handle);
2357 dissector_add_uint("btrfcomm.service", BTSDP_MAP_NOTIFICATION_SRV_SERVICE_UUID, btobex_handle);
2358 dissector_add_uint("btrfcomm.service", BTSDP_SYNC_SERVICE_UUID, btobex_handle);
2359 dissector_add_uint("btrfcomm.service", BTSDP_SYNC_COMMAND_SERVICE_UUID, btobex_handle);
2361 dissector_add_uint("btl2cap.service", BTSDP_OPP_SERVICE_UUID, btobex_handle);
2362 dissector_add_uint("btl2cap.service", BTSDP_FTP_SERVICE_UUID, btobex_handle);
2363 dissector_add_uint("btl2cap.service", BTSDP_BPP_DIRECT_PRINTING_SERVICE_UUID, btobex_handle);
2364 dissector_add_uint("btl2cap.service", BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID, btobex_handle);
2365 dissector_add_uint("btl2cap.service", BTSDP_BPP_DIRECT_PRINTING_REF_OBJ_SERVICE_UUID, btobex_handle);
2366 dissector_add_uint("btl2cap.service", BTSDP_BPP_REFLECTED_UI_SERVICE_UUID, btobex_handle);
2367 dissector_add_uint("btl2cap.service", BTSDP_BPP_SERVICE_UUID, btobex_handle);
2368 dissector_add_uint("btl2cap.service", BTSDP_BPP_STATUS_SERVICE_UUID, btobex_handle);
2369 dissector_add_uint("btl2cap.service", BTSDP_BIP_SERVICE_UUID, btobex_handle);
2370 dissector_add_uint("btl2cap.service", BTSDP_BIP_RESPONDER_SERVICE_UUID, btobex_handle);
2371 dissector_add_uint("btl2cap.service", BTSDP_BIP_AUTO_ARCH_SERVICE_UUID, btobex_handle);
2372 dissector_add_uint("btl2cap.service", BTSDP_BIP_REF_OBJ_SERVICE_UUID, btobex_handle);
2373 dissector_add_uint("btl2cap.service", BTSDP_PBAP_PCE_SERVICE_UUID, btobex_handle);
2374 dissector_add_uint("btl2cap.service", BTSDP_PBAP_PSE_SERVICE_UUID, btobex_handle);
2375 dissector_add_uint("btl2cap.service", BTSDP_PBAP_SERVICE_UUID, btobex_handle);
2376 dissector_add_uint("btl2cap.service", BTSDP_MAP_SERVICE_UUID, btobex_handle);
2377 dissector_add_uint("btl2cap.service", BTSDP_MAP_ACCESS_SRV_SERVICE_UUID, btobex_handle);
2378 dissector_add_uint("btl2cap.service", BTSDP_MAP_NOTIFICATION_SRV_SERVICE_UUID, btobex_handle);
2379 dissector_add_uint("btl2cap.service", BTSDP_SYNC_SERVICE_UUID, btobex_handle);
2380 dissector_add_uint("btl2cap.service", BTSDP_SYNC_COMMAND_SERVICE_UUID, btobex_handle);
2382 xml_handle = find_dissector("xml");
2383 data_handle = find_dissector("data");
2385 dissector_add_handle("btrfcomm.channel", btobex_handle);
2386 dissector_add_handle("btl2cap.psm", btobex_handle);
2387 dissector_add_handle("btl2cap.cid", btobex_handle);
2391 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2393 * Local variables:
2394 * c-basic-offset: 4
2395 * tab-width: 8
2396 * indent-tabs-mode: nil
2397 * End:
2399 * vi: set shiftwidth=4 tabstop=8 expandtab:
2400 * :indentSize=4:tabSize=8:noTabs=true: