2 * Routines for Bluetooth OBEX dissection
4 * Copyright 2010, Allan M. Madsen
5 * Copyright 2013, Michal Labedzki for Tieto Corporation
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <epan/packet.h>
29 #include <epan/prefs.h>
30 #include <epan/reassemble.h>
31 #include <epan/expert.h>
32 #include <epan/decode_as.h>
33 #include "packet-bluetooth.h"
34 #include "packet-btrfcomm.h"
35 #include "packet-btl2cap.h"
36 #include "packet-btsdp.h"
38 /* Initialize the protocol and registered fields */
39 static int proto_btobex = -1;
40 static int hf_opcode = -1;
41 static int hf_response_code = -1;
42 static int hf_final_flag = -1;
43 static int hf_length = -1;
44 static int hf_version = -1;
45 static int hf_flags = -1;
46 static int hf_constants = -1;
47 static int hf_max_pkt_len = -1;
48 static int hf_set_path_flags_0 = -1;
49 static int hf_set_path_flags_1 = -1;
50 static int hf_headers = -1;
51 static int hf_header = -1;
52 static int hf_hdr_id = -1;
53 static int hf_hdr_id_encoding = -1;
54 static int hf_hdr_id_meaning = -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_authentication_parameter = -1;
61 static int hf_authentication_parameter_data = -1;
62 static int hf_authentication_challenge_tag = -1;
63 static int hf_authentication_response_tag = -1;
64 static int hf_authentication_key = -1;
65 static int hf_authentication_result_key = -1;
66 static int hf_authentication_user_id = -1;
67 static int hf_authentication_length = -1;
68 static int hf_authentication_info_charset = -1;
69 static int hf_authentication_info = -1;
70 static int hf_authentication_option_reserved = -1;
71 static int hf_authentication_option_user_id = -1;
72 static int hf_authentication_option_read_only = -1;
73 static int hf_application_parameter = -1;
74 static int hf_application_parameter_id = -1;
75 static int hf_application_parameter_length = -1;
76 static int hf_application_parameter_data = -1;
77 static int hf_bpp_application_parameter_id = -1;
78 static int hf_bpp_application_parameter_data_offset = -1;
79 static int hf_bpp_application_parameter_data_count = -1;
80 static int hf_bpp_application_parameter_data_job_id = -1;
81 static int hf_bpp_application_parameter_data_file_size = -1;
82 static int hf_bip_application_parameter_id = -1;
83 static int hf_bip_application_parameter_data_number_of_returned_handles = -1;
84 static int hf_bip_application_parameter_data_list_start_offset = -1;
85 static int hf_bip_application_parameter_data_latest_captured_images = -1;
86 static int hf_bip_application_parameter_data_partial_file_length = -1;
87 static int hf_bip_application_parameter_data_partial_file_start_offset = -1;
88 static int hf_bip_application_parameter_data_total_file_size = -1;
89 static int hf_bip_application_parameter_data_end_flag = -1;
90 static int hf_bip_application_parameter_data_remote_display = -1;
91 static int hf_bip_application_parameter_data_service_id = -1;
92 static int hf_bip_application_parameter_data_store_flag = -1;
93 static int hf_pbap_application_parameter_id = -1;
94 static int hf_pbap_application_parameter_data_order = -1;
95 static int hf_pbap_application_parameter_data_search_value = -1;
96 static int hf_pbap_application_parameter_data_search_attribute = -1;
97 static int hf_pbap_application_parameter_data_max_list_count = -1;
98 static int hf_pbap_application_parameter_data_list_start_offset = -1;
99 static int hf_pbap_application_parameter_data_filter = -1;
100 static int hf_pbap_application_parameter_vcard_selector = -1;
101 static int hf_pbap_application_parameter_data_filter_version = -1;
102 static int hf_pbap_application_parameter_data_filter_fn = -1;
103 static int hf_pbap_application_parameter_data_filter_n = -1;
104 static int hf_pbap_application_parameter_data_filter_photo = -1;
105 static int hf_pbap_application_parameter_data_filter_birthday = -1;
106 static int hf_pbap_application_parameter_data_filter_adr = -1;
107 static int hf_pbap_application_parameter_data_filter_label = -1;
108 static int hf_pbap_application_parameter_data_filter_tel = -1;
109 static int hf_pbap_application_parameter_data_filter_email = -1;
110 static int hf_pbap_application_parameter_data_filter_mailer = -1;
111 static int hf_pbap_application_parameter_data_filter_time_zone = -1;
112 static int hf_pbap_application_parameter_data_filter_geographic_position = -1;
113 static int hf_pbap_application_parameter_data_filter_title = -1;
114 static int hf_pbap_application_parameter_data_filter_role = -1;
115 static int hf_pbap_application_parameter_data_filter_logo = -1;
116 static int hf_pbap_application_parameter_data_filter_agent = -1;
117 static int hf_pbap_application_parameter_data_filter_name_of_organization = -1;
118 static int hf_pbap_application_parameter_data_filter_comments = -1;
119 static int hf_pbap_application_parameter_data_filter_revision = -1;
120 static int hf_pbap_application_parameter_data_filter_pronunciation_of_name = -1;
121 static int hf_pbap_application_parameter_data_filter_url = -1;
122 static int hf_pbap_application_parameter_data_filter_uid = -1;
123 static int hf_pbap_application_parameter_data_filter_key = -1;
124 static int hf_pbap_application_parameter_data_filter_nickname = -1;
125 static int hf_pbap_application_parameter_data_filter_categories = -1;
126 static int hf_pbap_application_parameter_data_filter_product_id = -1;
127 static int hf_pbap_application_parameter_data_filter_class = -1;
128 static int hf_pbap_application_parameter_data_filter_sort_string = -1;
129 static int hf_pbap_application_parameter_data_filter_timestamp = -1;
130 static int hf_pbap_application_parameter_data_filter_reserved_29_31 = -1;
131 static int hf_pbap_application_parameter_data_filter_reserved_32_38 = -1;
132 static int hf_pbap_application_parameter_data_filter_proprietary_filter = -1;
133 static int hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage = -1;
134 static int hf_pbap_application_parameter_data_format = -1;
135 static int hf_pbap_application_parameter_data_phonebook_size = -1;
136 static int hf_pbap_application_parameter_data_new_missed_calls = -1;
137 static int hf_pbap_application_parameter_data_primary_version_counter = -1;
138 static int hf_pbap_application_parameter_data_secondary_version_counter = -1;
139 static int hf_pbap_application_parameter_data_database_identifier = -1;
140 static int hf_pbap_application_parameter_data_vcard_selector_operator = -1;
141 static int hf_pbap_application_parameter_data_reset_new_missed_calls = -1;
142 static int hf_pbap_application_parameter_data_supported_features = -1;
143 static int hf_pbap_application_parameter_data_supported_features_reserved = -1;
144 static int hf_pbap_application_parameter_data_supported_features_download = -1;
145 static int hf_pbap_application_parameter_data_supported_features_browsing = -1;
146 static int hf_pbap_application_parameter_data_supported_features_database_identifier = -1;
147 static int hf_pbap_application_parameter_data_supported_features_folder_version_counters = -1;
148 static int hf_pbap_application_parameter_data_supported_features_vcard_selecting = -1;
149 static int hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls = -1;
150 static int hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property = -1;
151 static int hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property = -1;
152 static int hf_pbap_application_parameter_data_supported_features_contact_referencing = -1;
153 static int hf_pbap_application_parameter_data_supported_features_default_contact_image_format = -1;
154 static int hf_map_application_parameter_id = -1;
155 static int hf_map_application_parameter_data_max_list_count = -1;
156 static int hf_map_application_parameter_data_start_offset = -1;
157 static int hf_map_application_parameter_data_filter_message_type_reserved = -1;
158 static int hf_map_application_parameter_data_filter_message_type_mms = -1;
159 static int hf_map_application_parameter_data_filter_message_type_email = -1;
160 static int hf_map_application_parameter_data_filter_message_type_sms_cdma = -1;
161 static int hf_map_application_parameter_data_filter_message_type_sms_gsm = -1;
162 static int hf_map_application_parameter_data_filter_period_begin = -1;
163 static int hf_map_application_parameter_data_filter_period_end = -1;
164 static int hf_map_application_parameter_data_filter_read_status_reserved_6 = -1;
165 static int hf_map_application_parameter_data_filter_read_status_get_read = -1;
166 static int hf_map_application_parameter_data_filter_read_status_get_unread = -1;
167 static int hf_map_application_parameter_data_filter_recipient = -1;
168 static int hf_map_application_parameter_data_filter_originator = -1;
169 static int hf_map_application_parameter_data_filter_priority_reserved_6 = -1;
170 static int hf_map_application_parameter_data_filter_priority_get_high = -1;
171 static int hf_map_application_parameter_data_filter_priority_non_high = -1;
172 static int hf_map_application_parameter_data_reserved_7 = -1;
173 static int hf_map_application_parameter_data_attachment = -1;
174 static int hf_map_application_parameter_data_transparent = -1;
175 static int hf_map_application_parameter_data_retry = -1;
176 static int hf_map_application_parameter_data_new_message = -1;
177 static int hf_map_application_parameter_data_notification_status = -1;
178 static int hf_map_application_parameter_data_mas_instance_id = -1;
179 static int hf_map_application_parameter_data_parameter_mask_reserved = -1;
180 static int hf_map_application_parameter_data_parameter_mask_reply_to_addressing = -1;
181 static int hf_map_application_parameter_data_parameter_mask_protected = -1;
182 static int hf_map_application_parameter_data_parameter_mask_sent = -1;
183 static int hf_map_application_parameter_data_parameter_mask_read = -1;
184 static int hf_map_application_parameter_data_parameter_mask_priority = -1;
185 static int hf_map_application_parameter_data_parameter_mask_attachment_size = -1;
186 static int hf_map_application_parameter_data_parameter_mask_text = -1;
187 static int hf_map_application_parameter_data_parameter_mask_reception_status = -1;
188 static int hf_map_application_parameter_data_parameter_mask_size = -1;
189 static int hf_map_application_parameter_data_parameter_mask_type = -1;
190 static int hf_map_application_parameter_data_parameter_mask_recipient_addressing = -1;
191 static int hf_map_application_parameter_data_parameter_mask_recipient_name = -1;
192 static int hf_map_application_parameter_data_parameter_mask_sender_addressing = -1;
193 static int hf_map_application_parameter_data_parameter_mask_sender_name = -1;
194 static int hf_map_application_parameter_data_parameter_mask_datetime = -1;
195 static int hf_map_application_parameter_data_parameter_mask_subject = -1;
196 static int hf_map_application_parameter_data_folder_listing_size = -1;
197 static int hf_map_application_parameter_data_messages_listing_size = -1;
198 static int hf_map_application_parameter_data_subject_length = -1;
199 static int hf_map_application_parameter_data_charset = -1;
200 static int hf_map_application_parameter_data_fraction_request = -1;
201 static int hf_map_application_parameter_data_fraction_deliver = -1;
202 static int hf_map_application_parameter_data_status_indicator = -1;
203 static int hf_map_application_parameter_data_status_value = -1;
204 static int hf_map_application_parameter_data_mse_time = -1;
205 static int hf_gpp_application_parameter_id = -1;
206 static int hf_gpp_application_parameter_data_max_list_count = -1;
207 static int hf_gpp_application_parameter_data_list_start_offset = -1;
208 static int hf_gpp_application_parameter_data_reserved_7 = -1;
209 static int hf_gpp_application_parameter_data_notification_status = -1;
210 static int hf_gpp_application_parameter_data_instance_id = -1;
211 static int hf_gpp_application_parameter_data_listing_size = -1;
212 static int hf_ctn_application_parameter_id = -1;
213 static int hf_ctn_application_parameter_data_acoustic_alarm_status = -1;
214 static int hf_ctn_application_parameter_data_attachment = -1;
215 static int hf_ctn_application_parameter_data_send = -1;
216 static int hf_ctn_application_parameter_data_filter_period_begin = -1;
217 static int hf_ctn_application_parameter_data_filter_period_end = -1;
218 static int hf_ctn_application_parameter_data_parameter_mask = -1;
219 static int hf_ctn_application_parameter_data_parameter_mask_reserved = -1;
220 static int hf_ctn_application_parameter_data_parameter_mask_recurrent = -1;
221 static int hf_ctn_application_parameter_data_parameter_mask_send_status = -1;
222 static int hf_ctn_application_parameter_data_parameter_mask_alarm_status = -1;
223 static int hf_ctn_application_parameter_data_parameter_mask_pstatus = -1;
224 static int hf_ctn_application_parameter_data_parameter_mask_priority = -1;
225 static int hf_ctn_application_parameter_data_parameter_mask_originator_address = -1;
226 static int hf_ctn_application_parameter_data_parameter_mask_originator_name = -1;
227 static int hf_ctn_application_parameter_data_parameter_mask_end_time = -1;
228 static int hf_ctn_application_parameter_data_parameter_mask_summary = -1;
229 static int hf_ctn_application_parameter_data_parameter_mask_attachment = -1;
230 static int hf_ctn_application_parameter_data_status_indicator = -1;
231 static int hf_ctn_application_parameter_data_status_value = -1;
232 static int hf_ctn_application_parameter_data_postpone_val = -1;
233 static int hf_ctn_application_parameter_data_email_uri = -1;
234 static int hf_ctn_application_parameter_data_cse_time = -1;
235 static int hf_ctn_application_parameter_data_recurrent = -1;
236 static int hf_ctn_application_parameter_data_attach_id = -1;
237 static int hf_ctn_application_parameter_data_last_update = -1;
238 static int hf_profile = -1;
239 static int hf_type = -1;
240 static int hf_object_class = -1;
241 static int hf_time_iso8601 = -1;
242 static int hf_wan_uuid = -1;
243 static int hf_hdr_val_action = -1;
244 static int hf_hdr_val_single_response_mode = -1;
245 static int hf_hdr_val_single_response_mode_parameter = -1;
246 static int hf_session_parameter = -1;
247 static int hf_session_parameter_tag = -1;
248 static int hf_session_parameter_length = -1;
249 static int hf_session_parameter_data = -1;
250 static int hf_session_parameter_nonce = -1;
251 static int hf_session_parameter_session_id = -1;
252 static int hf_session_parameter_next_sequence_number = -1;
253 static int hf_session_parameter_timeout = -1;
254 static int hf_session_parameter_opcode = -1;
255 static int hf_sender_bd_addr = -1;
256 static int hf_count = -1;
257 static int hf_data_length = -1;
258 static int hf_connection_id = -1;
259 static int hf_name = -1;
260 static int hf_current_path = -1;
261 static int hf_request_in_frame = -1;
262 static int hf_response_in_frame = -1;
264 static const int *hfx_hdr_id[] = {
270 static const int *hfx_pbap_application_parameter_data_filter_1[] = {
271 &hf_pbap_application_parameter_data_filter_reserved_32_38,
272 &hf_pbap_application_parameter_data_filter_proprietary_filter,
273 &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage,
277 static const int *hfx_pbap_application_parameter_data_filter_0[] = {
278 &hf_pbap_application_parameter_data_filter_version,
279 &hf_pbap_application_parameter_data_filter_fn,
280 &hf_pbap_application_parameter_data_filter_n,
281 &hf_pbap_application_parameter_data_filter_photo,
282 &hf_pbap_application_parameter_data_filter_birthday,
283 &hf_pbap_application_parameter_data_filter_adr,
284 &hf_pbap_application_parameter_data_filter_label,
285 &hf_pbap_application_parameter_data_filter_tel,
286 &hf_pbap_application_parameter_data_filter_email,
287 &hf_pbap_application_parameter_data_filter_mailer,
288 &hf_pbap_application_parameter_data_filter_time_zone,
289 &hf_pbap_application_parameter_data_filter_geographic_position,
290 &hf_pbap_application_parameter_data_filter_title,
291 &hf_pbap_application_parameter_data_filter_role,
292 &hf_pbap_application_parameter_data_filter_logo,
293 &hf_pbap_application_parameter_data_filter_agent,
294 &hf_pbap_application_parameter_data_filter_name_of_organization,
295 &hf_pbap_application_parameter_data_filter_comments,
296 &hf_pbap_application_parameter_data_filter_revision,
297 &hf_pbap_application_parameter_data_filter_pronunciation_of_name,
298 &hf_pbap_application_parameter_data_filter_url,
299 &hf_pbap_application_parameter_data_filter_uid,
300 &hf_pbap_application_parameter_data_filter_key,
301 &hf_pbap_application_parameter_data_filter_nickname,
302 &hf_pbap_application_parameter_data_filter_categories,
303 &hf_pbap_application_parameter_data_filter_product_id,
304 &hf_pbap_application_parameter_data_filter_class,
305 &hf_pbap_application_parameter_data_filter_sort_string,
306 &hf_pbap_application_parameter_data_filter_timestamp,
307 &hf_pbap_application_parameter_data_filter_reserved_29_31,
311 static const int *hfx_pbap_application_parameter_data_supported_features[] = {
312 &hf_pbap_application_parameter_data_supported_features_reserved,
313 &hf_pbap_application_parameter_data_supported_features_default_contact_image_format,
314 &hf_pbap_application_parameter_data_supported_features_contact_referencing,
315 &hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property,
316 &hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property,
317 &hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls,
318 &hf_pbap_application_parameter_data_supported_features_vcard_selecting,
319 &hf_pbap_application_parameter_data_supported_features_folder_version_counters,
320 &hf_pbap_application_parameter_data_supported_features_database_identifier,
321 &hf_pbap_application_parameter_data_supported_features_browsing,
322 &hf_pbap_application_parameter_data_supported_features_download,
326 static const int *hfx_ctn_application_parameter_data_parameter_mask[] = {
327 &hf_ctn_application_parameter_data_parameter_mask_reserved,
328 &hf_ctn_application_parameter_data_parameter_mask_recurrent,
329 &hf_ctn_application_parameter_data_parameter_mask_send_status,
330 &hf_ctn_application_parameter_data_parameter_mask_alarm_status,
331 &hf_ctn_application_parameter_data_parameter_mask_pstatus,
332 &hf_ctn_application_parameter_data_parameter_mask_priority,
333 &hf_ctn_application_parameter_data_parameter_mask_originator_address,
334 &hf_ctn_application_parameter_data_parameter_mask_originator_name,
335 &hf_ctn_application_parameter_data_parameter_mask_end_time,
336 &hf_ctn_application_parameter_data_parameter_mask_summary,
337 &hf_ctn_application_parameter_data_parameter_mask_attachment,
341 static expert_field ei_unexpected_data = EI_INIT;
342 static expert_field ei_application_parameter_length_bad = EI_INIT;
343 static expert_field ei_decoded_as_profile = EI_INIT;
345 static dissector_table_t btobex_profile;
346 static dissector_table_t media_type_dissector_table;
349 /* ************************************************************************* */
350 /* Header values for reassembly */
351 /* ************************************************************************* */
352 static int hf_btobex_fragments = -1;
353 static int hf_btobex_fragment = -1;
354 static int hf_btobex_fragment_overlap = -1;
355 static int hf_btobex_fragment_overlap_conflict = -1;
356 static int hf_btobex_fragment_multiple_tails = -1;
357 static int hf_btobex_fragment_too_long_fragment = -1;
358 static int hf_btobex_fragment_error = -1;
359 static int hf_btobex_fragment_count = -1;
360 static int hf_btobex_reassembled_in = -1;
361 static int hf_btobex_reassembled_length = -1;
363 static gint ett_btobex_fragment = -1;
364 static gint ett_btobex_fragments = -1;
366 static dissector_handle_t btobex_handle;
367 static dissector_handle_t raw_application_parameters_handle;
368 static dissector_handle_t bpp_application_parameters_handle;
369 static dissector_handle_t bip_application_parameters_handle;
370 static dissector_handle_t gpp_application_parameters_handle;
371 static dissector_handle_t ctn_application_parameters_handle;
372 static dissector_handle_t map_application_parameters_handle;
373 static dissector_handle_t pbap_application_parameters_handle;
375 static reassembly_table btobex_reassembly_table;
377 static const fragment_items btobex_frag_items = {
378 &ett_btobex_fragment,
379 &ett_btobex_fragments,
380 &hf_btobex_fragments,
382 &hf_btobex_fragment_overlap,
383 &hf_btobex_fragment_overlap_conflict,
384 &hf_btobex_fragment_multiple_tails,
385 &hf_btobex_fragment_too_long_fragment,
386 &hf_btobex_fragment_error,
387 &hf_btobex_fragment_count,
388 &hf_btobex_reassembled_in,
389 &hf_btobex_reassembled_length,
390 /* Reassembled data field */
395 /* Initialize the subtree pointers */
396 static gint ett_btobex = -1;
397 static gint ett_btobex_hdrs = -1;
398 static gint ett_btobex_hdr = -1;
399 static gint ett_btobex_hdr_id = -1;
400 static gint ett_btobex_filter = -1;
401 static gint ett_btobex_parameter = -1;
402 static gint ett_btobex_session_parameters = -1;
403 static gint ett_btobex_application_parameters = -1;
404 static gint ett_btobex_authentication_parameters = -1;
406 static wmem_tree_t *obex_path = NULL;
407 static wmem_tree_t *obex_profile = NULL;
408 static wmem_tree_t *obex_last_opcode = NULL;
410 static dissector_handle_t http_handle;
411 static dissector_handle_t xml_handle;
412 static dissector_handle_t data_handle;
413 static dissector_handle_t data_text_lines_handle;
415 static const gchar *path_unknown = "?";
416 static const gchar *path_root = "/";
418 typedef struct _ext_value_string {
424 typedef struct _obex_path_data_t {
425 guint32 interface_id;
429 /* TODO: add OBEX ConnectionId */
434 typedef struct _obex_profile_data_t {
435 guint32 interface_id;
439 /* TODO: add OBEX ConnectionId */
442 } obex_profile_data_t;
444 typedef struct _obex_last_opcode_data_t {
445 guint32 interface_id;
449 /* TODO: add OBEX ConnectionId */
454 guint32 request_in_frame;
455 guint32 response_in_frame;
467 } obex_last_opcode_data_t;
470 #define PROFILE_UNKNOWN 0
471 #define PROFILE_OPP 1
472 #define PROFILE_FTP 2
473 #define PROFILE_SYNCML 3
474 #define PROFILE_PBAP 4
475 #define PROFILE_MAP 5
476 #define PROFILE_BIP 6
477 #define PROFILE_BPP 7
478 #define PROFILE_SYNC 8
479 #define PROFILE_CTN 9
480 #define PROFILE_GPP 10
482 #define PROTO_DATA_MEDIA_TYPE 0x00
483 #define PROTO_DATA_BTOBEX_PROFILE 0x01
485 static const value_string profile_vals[] = {
486 { PROFILE_UNKNOWN, "Unknown" },
487 { PROFILE_OPP, "OPP" },
488 { PROFILE_FTP, "FTP" },
489 { PROFILE_SYNCML, "SyncML" },
490 { PROFILE_PBAP, "PBAP" },
491 { PROFILE_MAP, "MAP" },
492 { PROFILE_BIP, "BIP" },
493 { PROFILE_BPP, "BPP" },
494 { PROFILE_SYNC, "SYNC" },
495 { PROFILE_CTN, "CTN" },
496 { PROFILE_GPP, "GPP" },
499 static value_string_ext(profile_vals_ext) = VALUE_STRING_EXT_INIT(profile_vals);
502 static const ext_value_string target_vals[] = {
503 { { 0xF9, 0xEC, 0x7B, 0xC4, 0x95, 0x3C, 0x11, 0xD2, 0x98, 0x4E, 0x52, 0x54, 0x00, 0xDC, 0x9E, 0x09 }, 16, "Folder Browsing" },
504 { { 0x79, 0x61, 0x35, 0xf0, 0xf0, 0xc5, 0x11, 0xd8, 0x09, 0x66, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Phone Book Access Profile" },
505 { { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02 }, 16, "SyncML" },
506 { { 0xE3, 0x3D, 0x95, 0x45, 0x83, 0x74, 0x4A, 0xD7, 0x9E, 0xC5, 0xC1, 0x6B, 0xE3, 0x1E, 0xDE, 0x8E }, 16, "Basic Imaging Profile - Push" },
507 { { 0x8E, 0xE9, 0xB3, 0xD0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Pull" },
508 { { 0x92, 0x35, 0x33, 0x50, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Advanced Printing" },
509 { { 0x94, 0x01, 0x26, 0xC0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Automativ Archive" },
510 { { 0x94, 0x7E, 0x74, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Camera" },
511 { { 0x94, 0xC7, 0xCD, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Display" },
512 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile- Referenced Objects" },
513 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile - Archived Objects" },
514 { { 0xbb, 0x58, 0x2b, 0x40, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Access Service" },
515 { { 0xbb, 0x58, 0x2b, 0x41, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Notification Service" },
516 { { 0x00, 0x00, 0x11, 0x18, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Direct Printing Service" },
517 { { 0x00, 0x00, 0x11, 0x19, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reference Printing Service" },
518 { { 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" },
519 { { 0x00, 0x00, 0x11, 0x21, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reflected UI" },
520 { { 0x00, 0x00, 0x11, 0x22, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Basic Printing" },
521 { { 0x00, 0x00, 0x11, 0x23, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Printing Status" },
522 { { "IRMC-SYNC" }, 9, "Synchronization Profile" },
523 { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, NULL },
526 /* This table must map tagets from "target_vals" to profile */
527 static const gint target_to_profile[] = {
550 static const value_string version_vals[] = {
560 static const value_string header_id_encoding_vals[] = {
561 { 0x00, "Null terminated Unicode text, length prefixed with 2 byte Unsigned Integer" },
562 { 0x01, "Byte sequence, length prefixed with 2 byte Unsigned Integer" },
563 { 0x02, "1 byte quantity" },
564 { 0x03, "4 byte quantity (network order)" },
568 #define BTOBEX_CODE_VALS_CONNECT 0x00
569 #define BTOBEX_CODE_VALS_DISCONNECT 0x01
570 #define BTOBEX_CODE_VALS_PUT 0x02
571 #define BTOBEX_CODE_VALS_GET 0x03
572 #define BTOBEX_CODE_VALS_SET_PATH 0x05
573 #define BTOBEX_CODE_VALS_CONTINUE 0x10
574 #define BTOBEX_CODE_VALS_SUCCESS 0x20
575 #define BTOBEX_CODE_VALS_ABORT 0x7F
576 #define BTOBEX_CODE_VALS_MASK 0x7F
578 static const value_string code_vals[] = {
580 { 0x01, "Disconnect" },
583 { 0x05, "Set Path" },
586 { 0x10, "Continue" },
589 { 0x22, "Accepted" },
590 { 0x23, "Non-Authoritative Information" },
591 { 0x24, "No Content" },
592 { 0x25, "Reset Content" },
593 { 0x26, "Partial Content" },
594 { 0x30, "Multiple Choices" },
595 { 0x31, "Moved Permanently" },
596 { 0x32, "Moved Temporarily" },
597 { 0x33, "See Other" },
598 { 0x34, "Not Modified" },
599 { 0x35, "Use Proxy" },
600 { 0x40, "Bad Request" },
601 { 0x41, "Unauthorised" },
602 { 0x42, "Payment Required" },
603 { 0x43, "Forbidden" },
604 { 0x44, "Not Found" },
605 { 0x45, "Method Not Allowed" },
606 { 0x46, "Not Acceptable" },
607 { 0x47, "Proxy Authentication Required" },
608 { 0x48, "Request Timeout" },
609 { 0x49, "Conflict" },
611 { 0x4b, "Length Required" },
612 { 0x4c, "Precondition Failed" },
613 { 0x4d, "Requested Entity Too Large" },
614 { 0x4e, "Requested URL Too Large" },
615 { 0x4f, "Unsupported Media Type" },
616 { 0x50, "Internal Server Error" },
617 { 0x51, "Not Implemented" },
618 { 0x52, "Bad Gateway" },
619 { 0x53, "Service Unavailable" },
620 { 0x54, "Gateway Timeout" },
621 { 0x55, "HTTP Version Not Supported" },
622 { 0x60, "Database Full" },
623 { 0x61, "Database Locked" },
624 { BTOBEX_CODE_VALS_ABORT, "Abort" },
627 static value_string_ext(code_vals_ext) = VALUE_STRING_EXT_INIT(code_vals);
629 static const value_string header_id_meaning_vals[] = {
635 { 0x05, "Description" },
639 { 0x09, "End Of Body" },
641 { 0x0B, "Connection Id" },
642 { 0x0C, "Application Parameters" },
643 { 0x0D, "Authentication Challenge" },
644 { 0x0E, "Authentication Response" },
646 { 0x10, "WAN UUID" },
647 { 0x11, "Object Class" },
648 { 0x12, "Session Parameter" },
649 { 0x13, "Session Sequence Number" },
651 { 0x15, "Destination Name" },
652 { 0x16, "Permissions" },
653 { 0x17, "Single Response Mode" },
654 { 0x18, "Single Response Mode Parameter" },
655 { 0x30, "User Defined" },
656 { 0x31, "User Defined" },
657 { 0x32, "User Defined" },
658 { 0x33, "User Defined" },
659 { 0x34, "User Defined" },
660 { 0x35, "User Defined" },
661 { 0x36, "User Defined" },
662 { 0x37, "User Defined" },
663 { 0x38, "User Defined" },
664 { 0x39, "User Defined" },
665 { 0x3A, "User Defined" },
666 { 0x3B, "User Defined" },
667 { 0x3C, "User Defined" },
668 { 0x3D, "User Defined" },
669 { 0x3E, "User Defined" },
670 { 0x3F, "User Defined" },
674 static const value_string header_id_vals[] = {
675 /* 0x00 - 0x3F - Null terminated Unicode text, length prefixed with 2 byte Unsigned Integer */
677 { 0x05, "Description" },
678 { 0x15, "Destination Name" },
679 { 0x30, "User Defined" },
680 { 0x31, "User Defined" },
681 { 0x32, "User Defined" },
682 { 0x33, "User Defined" },
683 { 0x34, "User Defined" },
684 { 0x35, "User Defined" },
685 { 0x36, "User Defined" },
686 { 0x37, "User Defined" },
687 { 0x38, "User Defined" },
688 { 0x39, "User Defined" },
689 { 0x3a, "User Defined" },
690 { 0x3b, "User Defined" },
691 { 0x3c, "User Defined" },
692 { 0x3d, "User Defined" },
693 { 0x3e, "User Defined" },
694 { 0x3f, "User Defined" },
695 /* 0x40 - 0x07F - Byte sequence, length prefixed with 2 byte Unsigned Integer */
697 { 0x44, "Time (ISO8601)" },
701 { 0x49, "End Of Body" },
703 { 0x4c, "Application Parameters" },
704 { 0x4d, "Authentication Challenge" },
705 { 0x4e, "Authentication Response" },
706 { 0x50, "WAN UUID" },
707 { 0x51, "Object Class" },
708 { 0x52, "Session Parameter" },
709 /* 0x80 - 0xBF - 1 byte quantity */
710 { 0x93, "Session Sequence Number" },
712 { 0x97, "Single Response Mode" },
713 { 0x98, "Single Response Mode Parameter" },
714 /* 0xC0 - 0xFF - 4 byte quantity (network order) */
717 { 0xc4, "Time (UNIX)" },
718 { 0xcb, "Connection Id" },
720 { 0xd6, "Permissions" },
723 static value_string_ext header_id_vals_ext = VALUE_STRING_EXT_INIT(header_id_vals);
725 static const value_string map_application_parameters_vals[] = {
726 { 0x01, "Max List Count" },
727 { 0x02, "Start Offset" },
728 { 0x03, "Filter Message Type" },
729 { 0x04, "Filter Period Begin" },
730 { 0x05, "End Filter PeriodEnd" },
731 { 0x06, "Filter Read Status" },
732 { 0x07, "Filter Recipient" },
733 { 0x08, "Filter Originator" },
734 { 0x09, "Filter Priority" },
735 { 0x0A, "Attachment" },
736 { 0x0B, "Transparent" },
738 { 0x0D, "New Message" },
739 { 0x0E, "Notification Status" },
740 { 0x0F, "MAS Instance ID" },
741 { 0x10, "Parameter Mask" },
742 { 0x11, "Folder Listing Size" },
743 { 0x12, "Messages Listing Size" },
744 { 0x13, "Subject Length" },
746 { 0x15, "Fraction Request" },
747 { 0x16, "Fraction Deliver" },
748 { 0x17, "Status Indicator" },
749 { 0x18, "Status Value" },
750 { 0x19, "MSE Time" },
754 static const value_string pbap_application_parameters_vals[] = {
756 { 0x02, "Search Value" },
757 { 0x03, "Search Attribute" },
758 { 0x04, "Max List Count" },
759 { 0x05, "List Start Offset" },
762 { 0x08, "Phonebook Size" },
763 { 0x09, "New Missed Calls" },
764 { 0x0A, "Primary Version Counter" },
765 { 0x0B, "Secondary Version Counter" },
766 { 0x0C, "vCard Selector" },
767 { 0x0D, "Database Identifier" },
768 { 0x0E, "vCard Selector Operator" },
769 { 0x0F, "Reset New Missed Calls" },
770 { 0x10, "PBAP Supported Features" },
774 static const value_string bpp_application_parameters_vals[] = {
778 { 0x04, "File Size" },
782 static const value_string bip_application_parameters_vals[] = {
783 { 0x01, "Number of Returned Handles" },
784 { 0x02, "List Start Offset" },
785 { 0x03, "Latest Captures Images" },
786 { 0x04, "Partial File Length" },
787 { 0x05, "Partial File Start Offset" },
788 { 0x06, "Total File Size" },
789 { 0x07, "End Flag" },
790 { 0x08, "Remote Display" },
791 { 0x09, "Service ID" },
792 { 0x0A, "Store Flag" },
796 static const value_string gpp_application_parameters_vals[] = {
797 { 0x41, "Max List Count" },
798 { 0x42, "List Start Offset" },
799 { 0x43, "Notification Status" },
800 { 0x44, "Instance ID" },
801 { 0x46, "Listing Size" },
805 static const value_string ctn_application_parameters_vals[] = {
806 { 0x01, "Acoustic Alarm Status" },
807 { 0x02, "Attachment" },
809 { 0x04, "Filter Period Begin" },
810 { 0x05, "Filter Period End" },
811 { 0x06, "Parameter Mask" },
812 { 0x07, "Status Indicator" },
813 { 0x08, "Status Value" },
814 { 0x09, "Postpone Val" },
815 { 0x0A, "Email URI" },
816 { 0x0B, "CSE Time" },
817 { 0x0C, "Recurrent" },
818 { 0x0D, "Attach ID" },
819 { 0x0E, "Last Update" },
820 { 0x41, "Max List Count" },
821 { 0x42, "List Start Offset" },
822 { 0x43, "Notification Status" },
823 { 0x44, "Instance ID" },
824 { 0x46, "Listing Size" },
828 static const value_string bip_remote_display_vals[] = {
829 { 0x01, "Next Image" },
830 { 0x02, "Previous Image" },
831 { 0x03, "Select Image" },
832 { 0x04, "Current Image" },
836 static const value_string pbap_order_vals[] = {
838 { 0x01, "Alphanumeric" },
839 { 0x02, "Phonetic" },
843 static const value_string pbap_format_vals[] = {
849 static const value_string pbap_search_attribute_vals[] = {
856 static const value_string map_charset_vals[] = {
862 static const value_string map_fraction_request_vals[] = {
868 static const value_string map_fraction_deliver_vals[] = {
874 static const value_string map_status_indicator_vals[] = {
875 { 0x00, "Read Status" },
876 { 0x01, "Deleted Status" },
880 static const value_string authentication_challenge_tag_vals[] = {
887 static const value_string authentication_response_tag_vals[] = {
888 { 0x00, "Result Key" },
894 static const value_string info_charset_vals[] = {
900 static const value_string action_vals[] = {
903 { 0x02, "Set Permission" },
907 static const value_string single_response_mode_vals[] = {
910 { 0x02, "Indicate" },
914 static const value_string single_response_mode_parameter_vals[] = {
917 { 0x02, "Next and Wait" },
921 static const value_string session_tag_vals[] = {
922 { 0x00, "Device Address" },
924 { 0x02, "Session ID" },
925 { 0x03, "Next Sequence Number" },
927 { 0x05, "Session Opcode" },
931 static const value_string session_opcode_vals[] = {
932 { 0x00, "Create Session" },
933 { 0x01, "Close Session" },
934 { 0x02, "Suspend Session" },
935 { 0x03, "Resume Session" },
936 { 0x04, "Set Timeout" },
940 static const value_string pbap_application_parameter_data_vcard_selector_operator_vals[] = {
946 static const value_string pbap_application_parameter_data_reset_new_missed_calls_vals[] = {
951 static const value_string off_on_vals[] = {
957 static const value_string no_yes_vals[] = {
963 static const value_string ctn_application_parameter_data_attachment_vals[] = {
966 { 0x02, "Selected" },
970 static const value_string ctn_application_parameter_data_status_indicator_vals[] = {
972 { 0x01, "Alarm Status" },
973 { 0x02, "Send Status" },
974 { 0x03, "Deleted Status" },
978 static const value_string ctn_application_parameter_data_status_value_vals[] = {
981 { 0x02, "Postpone" },
982 { 0x03, "Tentative" },
983 { 0x04, "Needs-action" },
984 { 0x05, "Accepted" },
985 { 0x06, "Declined" },
986 { 0x07, "Delegated" },
987 { 0x08, "Completed" },
988 { 0x09, "In-progress" },
992 static value_string_ext map_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(map_application_parameters_vals);
993 static value_string_ext pbap_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(pbap_application_parameters_vals);
994 static value_string_ext bpp_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(bpp_application_parameters_vals);
995 static value_string_ext bip_application_parameters_vals_ext = VALUE_STRING_EXT_INIT(bip_application_parameters_vals);
997 void proto_register_btobex(void);
998 void proto_reg_handoff_btobex(void);
1001 save_path(packet_info *pinfo, const gchar *current_path, const gchar *name, gboolean go_up, int is_obex_over_l2cap, void *data)
1004 /* On Connect response sets "/"
1005 On SetPath sets what is needed
1007 if (!pinfo->fd->flags.visited && data) {
1008 obex_path_data_t *obex_path_data;
1009 guint32 interface_id;
1013 wmem_tree_key_t key[6];
1014 guint32 k_interface_id;
1015 guint32 k_adapter_id;
1016 guint32 k_frame_number;
1019 const gchar *path = path_unknown;
1021 if (is_obex_over_l2cap) {
1022 btl2cap_data_t *l2cap_data;
1024 l2cap_data = (btl2cap_data_t *) data;
1025 interface_id = l2cap_data->interface_id;
1026 adapter_id = l2cap_data->adapter_id;
1027 chandle = l2cap_data->chandle;
1028 channel = l2cap_data->cid;
1030 btrfcomm_data_t *rfcomm_data;
1032 rfcomm_data = (btrfcomm_data_t *) data;
1033 interface_id = rfcomm_data->interface_id;
1034 adapter_id = rfcomm_data->adapter_id;
1035 chandle = rfcomm_data->chandle;
1036 channel = rfcomm_data->dlci >> 1;
1039 k_interface_id = interface_id;
1040 k_adapter_id = adapter_id;
1041 k_chandle = chandle;
1042 k_channel = channel;
1043 k_frame_number = pinfo->fd->num;
1046 key[0].key = &k_interface_id;
1048 key[1].key = &k_adapter_id;
1050 key[2].key = &k_chandle;
1052 key[3].key = &k_channel;
1054 key[4].key = &k_frame_number;
1058 obex_path_data = wmem_new(wmem_file_scope(), obex_path_data_t);
1059 obex_path_data->interface_id = interface_id;
1060 obex_path_data->adapter_id = adapter_id;
1061 obex_path_data->chandle = chandle;
1062 obex_path_data->channel = channel;
1064 if (go_up == TRUE) {
1065 if (current_path != path_unknown && current_path != path_root) {
1068 i_path = g_strrstr(current_path, "/");
1070 current_path = path_unknown;
1072 if (i_path == current_path)
1073 path = current_path = path_root;
1075 path = current_path = wmem_strndup(wmem_epan_scope(), current_path, i_path - current_path - 1);
1080 if (name && *name == '\0')
1082 else if (name && current_path == path_root)
1083 path = wmem_strdup_printf(wmem_file_scope(), "/%s", name);
1085 path = wmem_strdup_printf(wmem_file_scope(), "%s/%s", current_path, name);
1087 obex_path_data->path = path;
1089 wmem_tree_insert32_array(obex_path, key, obex_path_data);
1093 static void media_type_prompt(packet_info *pinfo, gchar* result)
1097 value_data = (gchar *) p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_MEDIA_TYPE);
1099 g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Media Type %s as", (gchar *) value_data);
1101 g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown Media Type");
1104 static gpointer media_type_value(packet_info *pinfo)
1108 value_data = (gchar *) p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_MEDIA_TYPE);
1111 return (gpointer) value_data;
1116 static void btobex_profile_prompt(packet_info *pinfo _U_, gchar* result)
1120 value_data = (gulong *) p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_BTOBEX_PROFILE);
1122 g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "OBEX Profile 0x%04x as", (guint) *value_data);
1124 g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown OBEX Profile");
1127 static gpointer btobex_profile_value(packet_info *pinfo _U_)
1131 value_data = (gulong *) p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_BTOBEX_PROFILE);
1134 return (gpointer) *value_data;
1140 defragment_init(void)
1142 reassembly_table_init(&btobex_reassembly_table,
1143 &addresses_reassembly_table_functions);
1147 defragment_cleanup(void)
1149 reassembly_table_destroy(&btobex_reassembly_table);
1153 is_ascii_str(const guint8 *str, int length)
1157 if ((length < 1) || (str[length-1] != '\0'))
1160 for(i=0; i<length-1; i++) {
1161 if ((str[i] < 0x20) && (str[i] != 0x0a)) /* not strict ascii */
1172 dissect_btobex_application_parameter_raw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
1174 proto_item *parameter_item;
1175 proto_tree *parameter_tree;
1176 guint8 parameter_id;
1178 gint parameters_length;
1179 gint parameter_length;
1181 parameters_length = tvb_reported_length(tvb);
1183 while (parameters_length > 0) {
1184 parameter_id = tvb_get_guint8(tvb, offset);
1185 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset,
1186 tvb_captured_length_remaining(tvb, offset), "Parameter: 0x%02x", parameter_id);
1187 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1189 proto_tree_add_item(parameter_tree, hf_application_parameter_id, tvb, offset,
1193 proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset,
1195 parameter_length = tvb_get_guint8(tvb, offset);
1196 proto_item_set_len(parameter_item, parameter_length + 2);
1199 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset,
1200 parameter_length, ENC_NA);
1202 parameters_length -= 2 + parameter_length;
1203 offset += parameter_length;
1210 dissect_btobex_application_parameter_bpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1213 proto_item *parameter_item;
1214 proto_tree *parameter_tree;
1215 guint8 parameter_id;
1217 gint parameters_length;
1218 gint parameter_length;
1220 parameters_length = tvb_reported_length(tvb);
1222 while (parameters_length > 0) {
1223 parameter_id = tvb_get_guint8(tvb, offset);
1224 parameter_length = tvb_get_guint8(tvb, offset + 1);
1226 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1227 "Parameter: %s", val_to_str_const(parameter_id,
1228 bpp_application_parameters_vals, "Unknown"));
1229 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1231 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1234 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1237 if (parameter_length != 4) {
1238 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1239 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1240 "According to the specification this parameter length should be 4, but there is %i", parameter_length);
1241 } else switch (parameter_id) {
1243 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_offset, tvb, offset, 4, ENC_BIG_ENDIAN);
1246 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_count, tvb, offset, 4, ENC_BIG_ENDIAN);
1249 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_job_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1252 proto_tree_add_item(parameter_tree, hf_bpp_application_parameter_data_file_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1255 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1258 parameters_length -= 2 + parameter_length;
1259 offset += parameter_length;
1266 dissect_btobex_application_parameter_bip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1269 proto_item *parameter_item;
1270 proto_tree *parameter_tree;
1271 guint8 parameter_id;
1273 gint parameters_length;
1274 gint parameter_length;
1275 static gint required_length_map[] = {0, 2, 2, 1, 4, 4, 4, 1, 1, 16, 1};
1277 parameters_length = tvb_reported_length(tvb);
1279 while (parameters_length > 0) {
1280 parameter_id = tvb_get_guint8(tvb, offset);
1281 parameter_length = tvb_get_guint8(tvb, offset + 1);
1283 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1284 "Parameter: %s", val_to_str_const(parameter_id,
1285 bip_application_parameters_vals, "Unknown"));
1286 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1288 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1291 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1294 if (parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
1295 required_length_map[parameter_id] != parameter_length) {
1296 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1297 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1298 "According to the specification this parameter length should be %i, but there is %i",
1299 required_length_map[parameter_id], parameter_length);
1300 } else switch (parameter_id) {
1302 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);
1305 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_list_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1308 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_latest_captured_images, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1311 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_partial_file_length, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1314 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);
1317 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_total_file_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1320 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_end_flag, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1323 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_remote_display, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1326 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_service_id, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1329 proto_tree_add_item(parameter_tree, hf_bip_application_parameter_data_store_flag, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1332 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1335 parameters_length -= 2 + parameter_length;
1336 offset += parameter_length;
1343 dissect_btobex_application_parameter_pbap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1346 proto_item *parameter_item;
1347 proto_tree *parameter_tree;
1348 guint8 parameter_id;
1350 gint parameters_length;
1351 gint parameter_length;
1352 static gint required_length_map[] = {0, 1, -1, 1, 2, 2, 8, 1, 2, 1, 16, 16, 8, 16, 1, 1};
1354 parameters_length = tvb_reported_length(tvb);
1356 while (parameters_length > 0) {
1357 parameter_id = tvb_get_guint8(tvb, offset);
1358 parameter_length = tvb_get_guint8(tvb, offset + 1);
1360 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1361 "Parameter: %s", val_to_str_const(parameter_id,
1362 pbap_application_parameters_vals, "Unknown"));
1363 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1365 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1368 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1371 if (parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
1372 required_length_map[parameter_id] != -1 &&
1373 required_length_map[parameter_id] != parameter_length) {
1374 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1375 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1376 "According to the specification this parameter length should be %i, but there is %i",
1377 required_length_map[parameter_id], parameter_length);
1378 } else switch (parameter_id) {
1379 case 0x01: /* Order */
1380 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_order, tvb, offset, 1, ENC_BIG_ENDIAN);
1382 case 0x02: /* Search Value */
1383 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_search_value, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1385 case 0x03: /* Search Attribute */
1386 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_search_attribute, tvb, offset, 1, ENC_BIG_ENDIAN);
1388 case 0x04: /* Max List Count */
1389 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_max_list_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1391 case 0x05: /* List Start Offset */
1392 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_list_start_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1394 case 0x06: /* Filter */
1395 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_pbap_application_parameter_data_filter, ett_btobex_filter, hfx_pbap_application_parameter_data_filter_1, ENC_BIG_ENDIAN);
1396 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_pbap_application_parameter_data_filter, ett_btobex_filter, hfx_pbap_application_parameter_data_filter_0, ENC_BIG_ENDIAN);
1398 case 0x07: /* Format */
1399 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_format, tvb, offset, 1, ENC_NA);
1401 case 0x08: /* Phonebook Size */
1402 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_phonebook_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1404 case 0x09: /* New Missed Calls */
1405 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_new_missed_calls, tvb, offset, 1, ENC_NA);
1407 case 0x0A: /* Primary Version Counter */
1408 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_primary_version_counter, tvb, offset, 16, ENC_NA);
1410 case 0x0B: /* Secondary Version Counter */
1411 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_secondary_version_counter, tvb, offset, 16, ENC_NA);
1413 case 0x0C: /* vCard Selector */
1414 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_pbap_application_parameter_vcard_selector, ett_btobex_filter, hfx_pbap_application_parameter_data_filter_1, ENC_BIG_ENDIAN);
1415 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_pbap_application_parameter_vcard_selector, ett_btobex_filter, hfx_pbap_application_parameter_data_filter_0, ENC_BIG_ENDIAN);
1417 case 0x0D: /* Database Identifier */
1418 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_database_identifier, tvb, offset, 16, ENC_NA);
1420 case 0x0E: /* vCard Selector Operator */
1421 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_vcard_selector_operator, tvb, offset, 1, ENC_NA);
1423 case 0x0F: /* Reset New Missed Calls */
1424 proto_tree_add_item(parameter_tree, hf_pbap_application_parameter_data_reset_new_missed_calls, tvb, offset, 1, ENC_NA);
1426 case 0x10: /* PBAP Supported Features */
1427 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_pbap_application_parameter_data_supported_features, ett_btobex_parameter, hfx_pbap_application_parameter_data_supported_features, ENC_BIG_ENDIAN);
1430 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1433 parameters_length -= 2 + parameter_length;
1434 offset += parameter_length;
1441 dissect_btobex_application_parameter_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1444 proto_item *parameter_item;
1445 proto_tree *parameter_tree;
1446 guint8 parameter_id;
1448 gint parameters_length;
1449 gint parameter_length;
1450 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};
1452 parameters_length = tvb_reported_length(tvb);
1454 while (parameters_length > 0) {
1455 parameter_id = tvb_get_guint8(tvb, offset);
1456 parameter_length = tvb_get_guint8(tvb, offset + 1);
1458 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1459 "Parameter: %s", val_to_str_const(parameter_id,
1460 map_application_parameters_vals, "Unknown"));
1461 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1463 proto_tree_add_item(parameter_tree, hf_map_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1466 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1469 if (parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
1470 required_length_map[parameter_id] != -1 &&
1471 required_length_map[parameter_id] != parameter_length) {
1472 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1473 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1474 "According to the specification this parameter length should be %i, but there is %i",
1475 required_length_map[parameter_id], parameter_length);
1476 } else switch (parameter_id) {
1478 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_max_list_count, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1481 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_start_offset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1484 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);
1485 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);
1486 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);
1487 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);
1488 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);
1491 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_period_begin, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1494 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_period_end, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1497 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);
1498 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);
1499 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);
1502 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_recipient, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1505 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_filter_originator, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1508 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);
1509 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);
1510 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);
1513 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1514 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_attachment, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1517 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1518 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_transparent, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1521 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1522 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_retry, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1525 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1526 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_new_message, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1529 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1530 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_notification_status, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1533 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_mas_instance_id, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1536 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_reserved, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1537 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);
1538 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_protected, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1539 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_sent, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1540 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_read, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1541 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_priority, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1542 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);
1543 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_text, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1544 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);
1545 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1546 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_type, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1547 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);
1548 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);
1549 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);
1550 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);
1551 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_datetime, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1552 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_parameter_mask_subject, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1556 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_folder_listing_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1559 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_messages_listing_size, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1562 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_subject_length, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1565 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1566 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_charset, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1569 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1570 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_fraction_request, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1573 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1574 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_fraction_deliver, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1577 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1578 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_status_indicator, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1581 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_reserved_7, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1582 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_status_value, tvb, offset, required_length_map[parameter_id], ENC_BIG_ENDIAN);
1585 proto_tree_add_item(parameter_tree, hf_map_application_parameter_data_mse_time, tvb, offset, parameter_length, ENC_ASCII | ENC_NA);
1588 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1591 parameters_length -= 2 + parameter_length;
1592 offset += parameter_length;
1599 dissect_btobex_application_parameter_gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1602 proto_item *parameter_item;
1603 proto_tree *parameter_tree;
1604 guint8 parameter_id;
1606 gint parameters_length;
1607 gint parameter_length;
1608 static gint required_length_map[] = {2, 2, 1, 1, 0, 2};
1610 parameters_length = tvb_reported_length(tvb);
1612 while (parameters_length > 0) {
1613 parameter_id = tvb_get_guint8(tvb, offset);
1614 parameter_length = tvb_get_guint8(tvb, offset + 1);
1616 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1617 "Parameter: %s", val_to_str_const(parameter_id,
1618 gpp_application_parameters_vals, "Unknown"));
1619 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1621 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1624 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1627 if (parameter_id >= 0x41 && (guint8)(parameter_id - 0x41) < (sizeof(required_length_map)/sizeof(gint)) &&
1628 required_length_map[parameter_id - 0x41] != -1 &&
1629 required_length_map[parameter_id - 0x41] != parameter_length) {
1630 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1631 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1632 "According to the specification this parameter length should be %i, but there is %i",
1633 required_length_map[parameter_id - 0x41], parameter_length);
1634 } else switch (parameter_id) {
1635 case 0x41: /* Max List Count */
1636 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_max_list_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1638 case 0x42: /* List Start Offset */
1639 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_list_start_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1641 case 0x43: /* Notification Status */
1642 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_reserved_7, tvb, offset, 1, ENC_NA);
1643 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_notification_status, tvb, offset, 1, ENC_NA);
1645 case 0x44: /* Instance ID */
1646 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_instance_id, tvb, offset, 1, ENC_NA);
1648 case 0x46: /* Listing Size */
1649 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_listing_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1652 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1655 parameters_length -= 2 + parameter_length;
1656 offset += parameter_length;
1663 dissect_btobex_application_parameter_ctn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1666 proto_item *parameter_item;
1667 proto_tree *parameter_tree;
1668 guint8 parameter_id;
1670 gint parameters_length;
1671 gint parameter_length;
1672 static gint required_length_map[] = {0, 1, 1, 1, -1, -1, 4, 1, 1, 4, -1, -1, 1, 1, -1};
1673 static gint required_length_map_gpp[] = {2, 2, 1, 1, -1, 2};
1675 parameters_length = tvb_reported_length(tvb);
1677 while (parameters_length > 0) {
1678 parameter_id = tvb_get_guint8(tvb, offset);
1679 parameter_length = tvb_get_guint8(tvb, offset + 1);
1681 parameter_item = proto_tree_add_none_format(tree, hf_application_parameter, tvb, offset, parameter_length + 2,
1682 "Parameter: %s", val_to_str_const(parameter_id,
1683 ctn_application_parameters_vals, "Unknown"));
1684 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_application_parameters);
1686 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1689 item = proto_tree_add_item(parameter_tree, hf_application_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1692 if (parameter_id < 0x41 && parameter_id < (sizeof(required_length_map)/sizeof(gint)) &&
1693 required_length_map[parameter_id] != -1 &&
1694 required_length_map[parameter_id] != parameter_length) {
1695 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1696 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1697 "According to the specification this parameter length should be %i, but there is %i",
1698 required_length_map[parameter_id], parameter_length);
1699 } else if (parameter_id >= 0x41 && (guint8)(parameter_id - 0x41) < (sizeof(required_length_map_gpp)/sizeof(gint)) &&
1700 required_length_map[parameter_id - 0x41] != -1 &&
1701 required_length_map[parameter_id - 0x41] != parameter_length) {
1702 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1703 expert_add_info_format(pinfo, item, &ei_application_parameter_length_bad,
1704 "According to the specification this parameter length should be %i, but there is %i",
1705 required_length_map_gpp[parameter_id - 0x41], parameter_length);
1706 } else switch (parameter_id) {
1707 case 0x41: /* Max List Count */
1708 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_max_list_count, tvb, offset, 2, ENC_BIG_ENDIAN);
1710 case 0x42: /* List Start Offset */
1711 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_list_start_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
1713 case 0x43: /* Notification Status */
1714 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_reserved_7, tvb, offset, 1, ENC_NA);
1715 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_notification_status, tvb, offset, 1, ENC_NA);
1717 case 0x44: /* Instance ID */
1718 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_instance_id, tvb, offset, 1, ENC_NA);
1720 case 0x46: /* Listing Size */
1721 proto_tree_add_item(parameter_tree, hf_gpp_application_parameter_data_listing_size, tvb, offset, 2, ENC_BIG_ENDIAN);
1723 case 0x01: /* Acoustic Alarm Status */
1724 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_acoustic_alarm_status, tvb, offset, 1, ENC_NA);
1726 case 0x02: /* Attachment */
1727 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_attachment, tvb, offset, 1, ENC_NA);
1729 case 0x03: /* Send */
1730 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_send, tvb, offset, 1, ENC_NA);
1732 case 0x04: /* Filter Period Begin */
1733 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_filter_period_begin, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1735 case 0x05: /* Filter Period End */
1736 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_filter_period_end, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1738 case 0x06: /* Parameter Mask */
1739 proto_tree_add_bitmask(parameter_tree, tvb, offset, hf_ctn_application_parameter_data_parameter_mask, ett_btobex_filter, hfx_ctn_application_parameter_data_parameter_mask, ENC_BIG_ENDIAN);
1741 case 0x07: /* Status Indicator */
1742 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_status_indicator, tvb, offset, 1, ENC_NA);
1744 case 0x08: /* Status Value */
1745 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_status_value, tvb, offset, 1, ENC_NA);
1747 case 0x09: /* Postpone Val */
1748 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_postpone_val, tvb, offset, 4, ENC_BIG_ENDIAN);
1750 case 0x0A: /* Email URI */
1751 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_email_uri, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1753 case 0x0B: /* CSE Time */
1754 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_cse_time, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1756 case 0x0C: /* Recurrent */
1757 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_recurrent, tvb, offset, 1, ENC_NA);
1759 case 0x0D: /* Attach ID */
1760 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_attach_id, tvb, offset, 1, ENC_NA);
1762 case 0x0E: /* Last Update */
1763 proto_tree_add_item(parameter_tree, hf_ctn_application_parameter_data_last_update, tvb, offset, parameter_length, ENC_NA | ENC_ASCII);
1766 proto_tree_add_item(parameter_tree, hf_application_parameter_data, tvb, offset, parameter_length, ENC_NA);
1769 parameters_length -= 2 + parameter_length;
1770 offset += parameter_length;
1777 dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
1778 gint profile, gboolean is_obex_over_l2cap, obex_last_opcode_data_t *obex_last_opcode_data, void *data)
1780 proto_tree *hdrs_tree = NULL;
1781 proto_tree *hdr_tree = NULL;
1782 proto_item *hdr = NULL;
1783 proto_item *handle_item;
1786 gint item_length = 0;
1787 gint value_length = 0;
1792 guint32 interface_id;
1797 if (is_obex_over_l2cap) {
1798 btl2cap_data_t *l2cap_data;
1800 l2cap_data = (btl2cap_data_t *) data;
1801 interface_id = l2cap_data->interface_id;
1802 adapter_id = l2cap_data->adapter_id;
1803 chandle = l2cap_data->chandle;
1804 channel = l2cap_data->cid;
1806 btrfcomm_data_t *rfcomm_data;
1808 rfcomm_data = (btrfcomm_data_t *) data;
1809 interface_id = rfcomm_data->interface_id;
1810 adapter_id = rfcomm_data->adapter_id;
1811 chandle = rfcomm_data->chandle;
1812 channel = rfcomm_data->dlci >> 1;
1815 if (tvb_reported_length_remaining(tvb, offset) > 0) {
1817 hdrs = proto_tree_add_item(tree, hf_headers, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
1818 hdrs_tree = proto_item_add_subtree(hdrs, ett_btobex_hdrs);
1824 while (tvb_reported_length_remaining(tvb, offset) > 0) {
1825 hdr_id = tvb_get_guint8(tvb, offset);
1827 switch(0xC0 & hdr_id)
1829 case 0x00: /* null terminated unicode */
1830 item_length = tvb_get_ntohs(tvb, offset + 1);
1831 value_length = item_length - 3;
1833 case 0x40: /* byte sequence */
1834 item_length = tvb_get_ntohs(tvb, offset + 1);
1835 value_length = item_length - 3;
1837 case 0x80: /* 1 byte */
1838 item_length = 1 + 1;
1841 case 0xc0: /* 4 bytes */
1842 item_length = 1 + 4;
1847 hdr = proto_tree_add_none_format(hdrs_tree, hf_header, tvb, offset, item_length, "%s",
1848 val_to_str_ext_const(hdr_id, &header_id_vals_ext, "Unknown"));
1849 hdr_tree = proto_item_add_subtree(hdr, ett_btobex_hdr);
1851 proto_tree_add_bitmask_with_flags(hdr_tree, tvb, offset, hf_hdr_id, ett_btobex_hdr_id, hfx_hdr_id, ENC_NA, BMT_NO_APPEND);
1855 switch(0xC0 & hdr_id)
1857 case 0x00: /* null terminated unicode */
1858 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1862 case 0x01: /* Name */
1863 proto_tree_add_item(hdr_tree, hf_name, tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1864 if (!pinfo->fd->flags.visited && obex_last_opcode_data) {
1865 if (obex_last_opcode_data->code == BTOBEX_CODE_VALS_SET_PATH)
1866 obex_last_opcode_data->data.set_data.name = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1867 else if (obex_last_opcode_data->code == BTOBEX_CODE_VALS_GET || obex_last_opcode_data->code == BTOBEX_CODE_VALS_PUT)
1868 obex_last_opcode_data->data.get_put.name = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1872 proto_tree_add_item(hdr_tree, hf_hdr_val_unicode, tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1874 str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_length, ENC_UCS_2 | ENC_BIG_ENDIAN);
1875 proto_item_append_text(hdr_tree, ": \"%s\"", str);
1877 col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", str);
1878 offset += value_length;
1881 case 0x40: /* byte sequence */
1882 proto_tree_add_item(hdr_tree, hf_hdr_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1886 case 0x4c: /* Application Parameters */
1887 next_tvb = tvb_new_subset_length(tvb, offset, value_length);
1888 if (!(new_offset = dissector_try_uint_new(btobex_profile, profile, next_tvb, pinfo, hdr_tree, TRUE, data))) {
1889 new_offset = call_dissector(raw_application_parameters_handle, next_tvb, pinfo, hdr_tree);
1891 offset += new_offset;
1894 case 0x4d: /* Authentication Challenge */
1895 while (value_length) {
1896 guint8 parameter_id;
1897 guint8 sub_parameter_length;
1898 proto_item *parameter_item;
1899 proto_tree *parameter_tree;
1901 parameter_id = tvb_get_guint8(tvb, offset);
1902 sub_parameter_length = tvb_get_guint8(tvb, offset + 1);
1904 parameter_item = proto_tree_add_none_format(hdr_tree, hf_authentication_parameter, tvb, offset,
1905 2 + sub_parameter_length, "Tag: %s", val_to_str_const(parameter_id,
1906 authentication_challenge_tag_vals, "Unknown"));
1907 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_authentication_parameters);
1909 proto_tree_add_item(parameter_tree, hf_authentication_challenge_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
1910 tag = tvb_get_guint8(tvb, offset);
1913 proto_tree_add_item(parameter_tree, hf_authentication_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1918 proto_tree_add_item(parameter_tree, hf_authentication_key, tvb, offset, 16, ENC_NA);
1922 proto_tree_add_item(parameter_tree, hf_authentication_option_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
1923 proto_tree_add_item(parameter_tree, hf_authentication_option_read_only, tvb, offset, 1, ENC_BIG_ENDIAN);
1924 proto_tree_add_item(parameter_tree, hf_authentication_option_user_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1928 proto_tree_add_item(parameter_tree, hf_authentication_info_charset, tvb, offset, 1, ENC_BIG_ENDIAN);
1930 proto_tree_add_item(parameter_tree, hf_authentication_info, tvb, offset, sub_parameter_length - 1, ENC_ASCII|ENC_NA);
1931 offset += sub_parameter_length - 1;
1934 proto_tree_add_item(parameter_tree, hf_authentication_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
1935 offset += sub_parameter_length;
1938 value_length -= 2 + sub_parameter_length;
1941 case 0x4e: /* Authentication Response */
1942 while (value_length) {
1943 guint8 parameter_id;
1944 guint8 sub_parameter_length;
1945 proto_item *parameter_item;
1946 proto_tree *parameter_tree;
1948 parameter_id = tvb_get_guint8(tvb, offset);
1949 sub_parameter_length = tvb_get_guint8(tvb, offset + 1);
1951 parameter_item = proto_tree_add_none_format(hdr_tree, hf_authentication_parameter, tvb, offset,
1952 2 + sub_parameter_length, "Tag: %s", val_to_str_const(parameter_id,
1953 authentication_response_tag_vals, "Unknown"));
1954 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_authentication_parameters);
1956 proto_tree_add_item(parameter_tree, hf_authentication_response_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
1957 tag = tvb_get_guint8(tvb, offset);
1960 proto_tree_add_item(parameter_tree, hf_authentication_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1961 sub_parameter_length = tvb_get_guint8(tvb, offset);
1966 proto_tree_add_item(parameter_tree, hf_authentication_result_key, tvb, offset, 16, ENC_NA);
1970 proto_tree_add_item(parameter_tree, hf_authentication_user_id, tvb, offset, sub_parameter_length, ENC_NA);
1971 offset += sub_parameter_length;
1974 proto_tree_add_item(parameter_tree, hf_authentication_key, tvb, offset, 16, ENC_NA);
1978 proto_tree_add_item(parameter_tree, hf_authentication_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
1979 offset += sub_parameter_length;
1984 value_length -= 2 + sub_parameter_length;
1987 case 0x42: /* Type */
1988 proto_tree_add_item(hdr_tree, hf_type, tvb, offset, value_length, ENC_ASCII | ENC_NA);
1989 proto_item_append_text(hdr_tree, ": \"%s\"", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_length, ENC_ASCII));
1990 if (!pinfo->fd->flags.visited && obex_last_opcode_data && (obex_last_opcode_data->code == BTOBEX_CODE_VALS_GET || obex_last_opcode_data->code == BTOBEX_CODE_VALS_PUT)) {
1991 obex_last_opcode_data->data.get_put.type = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_ASCII | ENC_NA);
1993 if (p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_MEDIA_TYPE) == NULL) {
1996 value_data = tvb_get_string_enc(wmem_file_scope(), tvb, offset, value_length, ENC_ASCII | ENC_NA);
1998 p_add_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_MEDIA_TYPE, value_data);
2000 offset += value_length;
2003 case 0x44: /* Time (ISO8601) */
2004 proto_tree_add_item(hdr_tree, hf_time_iso8601, tvb, offset, value_length, ENC_ASCII | ENC_NA);
2005 proto_item_append_text(hdr_tree, ": \"%s\"", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_length, ENC_ASCII));
2007 offset += value_length;
2010 case 0x48: /* Body */
2011 case 0x49: /* End Of Body */
2012 proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
2013 next_tvb = tvb_new_subset_length(tvb, offset, value_length);
2015 if (value_length > 0 && obex_last_opcode_data &&
2016 (obex_last_opcode_data->code == BTOBEX_CODE_VALS_GET || obex_last_opcode_data->code == BTOBEX_CODE_VALS_PUT) &&
2017 p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_MEDIA_TYPE) == NULL) {
2020 value_data = obex_last_opcode_data->data.get_put.type;
2022 p_add_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_MEDIA_TYPE, value_data);
2024 if (value_length > 0 && obex_last_opcode_data &&
2025 (obex_last_opcode_data->code == BTOBEX_CODE_VALS_GET || obex_last_opcode_data->code == BTOBEX_CODE_VALS_PUT) &&
2026 obex_last_opcode_data->data.get_put.type &&
2027 dissector_try_string(media_type_dissector_table, obex_last_opcode_data->data.get_put.type, next_tvb, pinfo, tree, data) > 0) {
2028 offset += value_length;
2030 if (!tvb_strneql(tvb, offset, "<?xml", 5))
2032 call_dissector(xml_handle, next_tvb, pinfo, tree);
2033 } else if (is_ascii_str(tvb_get_ptr(tvb, offset, value_length), value_length)) {
2034 proto_item_append_text(hdr_tree, ": \"%s\"", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_length, ENC_ASCII));
2035 col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_length, ENC_ASCII));
2037 offset += value_length;
2041 case 0x46: /* Target */
2042 case 0x4a: /* Who */
2043 handle_item = proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
2045 if (value_length == 16) for (i = 0; target_vals[i].strptr != NULL; i++) {
2046 if (tvb_memeql(tvb, offset, target_vals[i].value, target_vals[i].length) == 0) {
2047 proto_item_append_text(handle_item, ": %s", target_vals[i].strptr);
2048 proto_item_append_text(hdr_tree, ": %s", target_vals[i].strptr);
2050 col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", target_vals[i].strptr);
2051 if (!pinfo->fd->flags.visited) {
2052 obex_profile_data_t *obex_profile_data;
2054 wmem_tree_key_t key[6];
2055 guint32 k_interface_id;
2056 guint32 k_adapter_id;
2057 guint32 k_frame_number;
2061 k_interface_id = interface_id;
2062 k_adapter_id = adapter_id;
2063 k_chandle = chandle;
2064 k_channel = channel;
2065 k_frame_number = pinfo->fd->num;
2068 key[0].key = &k_interface_id;
2070 key[1].key = &k_adapter_id;
2072 key[2].key = &k_chandle;
2074 key[3].key = &k_channel;
2076 key[4].key = &k_frame_number;
2080 obex_profile_data = wmem_new(wmem_file_scope(), obex_profile_data_t);
2081 obex_profile_data->interface_id = interface_id;
2082 obex_profile_data->adapter_id = adapter_id;
2083 obex_profile_data->chandle = chandle;
2084 obex_profile_data->channel = channel;
2085 obex_profile_data->profile = target_to_profile[i];
2087 wmem_tree_insert32_array(obex_profile, key, obex_profile_data);
2091 offset += value_length;
2094 case 0x47: /* HTTP */ {
2095 next_tvb = tvb_new_subset_remaining(tvb, offset);
2097 call_dissector(http_handle, next_tvb, pinfo, hdr_tree);
2101 case 0x50: /* WAN UUID */
2102 if (value_length == 2) {
2103 proto_tree_add_item(hdr_tree, hf_wan_uuid, tvb, offset, 2, ENC_BIG_ENDIAN);
2106 proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
2107 offset += value_length;
2111 case 0x51: /* Object Class */
2112 proto_tree_add_item(hdr_tree, hf_object_class, tvb, offset, value_length, ENC_ASCII | ENC_NA);
2113 proto_item_append_text(hdr_tree, ": \"%s\"", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_length, ENC_ASCII));
2115 offset += value_length;
2118 case 0x52: /* Session Parameter */
2119 while (value_length) {
2120 guint8 parameter_id;
2121 guint8 sub_parameter_length;
2122 proto_item *parameter_item;
2123 proto_tree *parameter_tree;
2125 parameter_id = tvb_get_guint8(tvb, offset);
2126 sub_parameter_length = tvb_get_guint8(tvb, offset + 1);
2128 parameter_item = proto_tree_add_none_format(hdr_tree, hf_session_parameter, tvb, offset,
2129 2 + sub_parameter_length, "Tag: %s", val_to_str_const(parameter_id,
2130 session_tag_vals, "Unknown"));
2131 parameter_tree = proto_item_add_subtree(parameter_item, ett_btobex_session_parameters);
2133 proto_tree_add_item(parameter_tree, hf_session_parameter_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
2134 tag = tvb_get_guint8(tvb, offset);
2137 proto_tree_add_item(parameter_tree, hf_session_parameter_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2138 sub_parameter_length = tvb_get_guint8(tvb, offset);
2142 case 0x00: /* Device Address */
2143 if (sub_parameter_length == 6) {
2144 offset = dissect_bd_addr(hf_sender_bd_addr, pinfo, parameter_tree, tvb, offset, FALSE, interface_id, adapter_id, NULL);
2146 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2148 offset += sub_parameter_length;
2152 case 0x01: /* Nonce */
2153 if (sub_parameter_length >= 4 && sub_parameter_length <= 16) {
2154 proto_tree_add_item(parameter_tree, hf_session_parameter_nonce, tvb, offset, sub_parameter_length, ENC_NA);
2156 offset += sub_parameter_length;
2158 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2160 offset += sub_parameter_length;
2164 case 0x02: /* Session ID */
2165 if (sub_parameter_length == 16) {
2166 proto_tree_add_item(parameter_tree, hf_session_parameter_session_id, tvb, offset, 16, ENC_NA);
2170 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2172 offset += sub_parameter_length;
2176 case 0x03: /* Next Sequence Number */
2177 if (sub_parameter_length == 1) {
2178 proto_tree_add_item(parameter_tree, hf_session_parameter_next_sequence_number, tvb, offset, 1, ENC_NA);
2182 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2184 offset += sub_parameter_length;
2188 case 0x04: /* Timeout */
2189 if (sub_parameter_length == 4) {
2190 proto_tree_add_item(parameter_tree, hf_session_parameter_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
2194 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2196 offset += sub_parameter_length;
2200 case 0x05: /* Session Opcode */
2201 if (sub_parameter_length == 1) {
2202 proto_tree_add_item(parameter_tree, hf_session_parameter_opcode, tvb, offset, 1, ENC_NA);
2206 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2208 offset += sub_parameter_length;
2213 proto_tree_add_item(parameter_tree, hf_session_parameter_data, tvb, offset, sub_parameter_length, ENC_NA);
2214 offset += sub_parameter_length;
2219 value_length -= 2 + sub_parameter_length;
2223 proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, value_length, ENC_NA);
2224 offset += value_length;
2228 case 0x80: /* 1 byte */
2229 value = tvb_get_guint8(tvb, offset);
2232 case 0x94: /* Action */
2233 proto_tree_add_item(hdr_tree, hf_hdr_val_action, tvb, offset, 1, ENC_NA);
2234 proto_item_append_text(hdr_tree, ": %s", val_to_str_const(value, action_vals, "Unknown"));
2237 case 0x97: /* Single Response Mode */
2238 proto_tree_add_item(hdr_tree, hf_hdr_val_single_response_mode, tvb, offset, 1, ENC_NA);
2239 proto_item_append_text(hdr_tree, ": %s", val_to_str_const(value, single_response_mode_vals, "Unknown"));
2242 case 0x98: /* Single Response Mode Parameter */
2243 proto_tree_add_item(hdr_tree, hf_hdr_val_single_response_mode_parameter, tvb, offset, 1, ENC_NA);
2244 proto_item_append_text(hdr_tree, ": %s", val_to_str_const(value, single_response_mode_parameter_vals, "Unknown"));
2247 case 0x93: /* Session Sequence Number */
2249 proto_tree_add_item(hdr_tree, hf_hdr_val_byte, tvb, offset, 1, ENC_NA);
2250 proto_item_append_text(hdr_tree, ": %i", value);
2256 case 0xC0: /* 4 bytes */
2258 case 0xC0: /* Count */
2259 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2260 proto_tree_add_item(hdr_tree, hf_count, tvb, offset, 4, ENC_BIG_ENDIAN);
2263 case 0xC3: /* Length */
2264 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2265 proto_tree_add_item(hdr_tree, hf_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
2268 case 0xCB: /* Connection Id */
2269 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2270 proto_tree_add_item(hdr_tree, hf_connection_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2273 case 0xC4: /* Time */
2274 case 0xCF: /* Creator */
2275 case 0xD6: /* Permissions */
2277 proto_item_append_text(hdr_tree, ": %i", tvb_get_ntohl(tvb, offset));
2278 proto_tree_add_item(hdr_tree, hf_hdr_val_long, tvb, offset, 4, ENC_BIG_ENDIAN);
2293 dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2295 proto_item *main_item;
2296 proto_tree *main_tree;
2297 proto_item *sub_item;
2298 fragment_head *frag_msg = NULL;
2299 gboolean save_fragmented, complete;
2300 tvbuff_t* new_tvb = NULL;
2301 tvbuff_t* next_tvb = NULL;
2303 gint profile = PROFILE_UNKNOWN;
2304 const gchar *path = path_unknown;
2305 gboolean is_obex_over_l2cap = FALSE;
2306 obex_profile_data_t *obex_profile_data;
2307 guint32 interface_id;
2311 wmem_tree_key_t key[6];
2312 guint32 k_interface_id;
2313 guint32 k_adapter_id;
2314 guint32 k_frame_number;
2317 obex_last_opcode_data_t *obex_last_opcode_data;
2318 obex_path_data_t *obex_path_data;
2320 guint8 *profile_data;
2321 dissector_handle_t current_handle;
2322 dissector_handle_t default_handle;
2324 /* Reject the packet if data is NULL */
2328 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OBEX");
2330 main_item = proto_tree_add_item(tree, proto_btobex, tvb, 0, tvb_captured_length(tvb), ENC_NA);
2331 main_tree = proto_item_add_subtree(main_item, ett_btobex);
2333 save_fragmented = pinfo->fragmented;
2335 is_obex_over_l2cap = (proto_btl2cap == (gint) GPOINTER_TO_UINT(wmem_list_frame_data(
2336 wmem_list_frame_prev(wmem_list_tail(pinfo->layers)))));
2338 if (is_obex_over_l2cap) {
2339 btl2cap_data_t *l2cap_data;
2341 l2cap_data = (btl2cap_data_t *) data;
2343 interface_id = l2cap_data->interface_id;
2344 adapter_id = l2cap_data->adapter_id;
2345 chandle = l2cap_data->chandle;
2346 channel = l2cap_data->cid;
2348 btrfcomm_data_t *rfcomm_data;
2350 rfcomm_data = (btrfcomm_data_t *) data;
2352 interface_id = rfcomm_data->interface_id;
2353 adapter_id = rfcomm_data->adapter_id;
2354 chandle = rfcomm_data->chandle;
2355 channel = rfcomm_data->dlci >> 1;
2358 k_interface_id = interface_id;
2359 k_adapter_id = adapter_id;
2360 k_chandle = chandle;
2361 k_channel = channel;
2362 k_frame_number = pinfo->fd->num;
2365 key[0].key = &k_interface_id;
2367 key[1].key = &k_adapter_id;
2369 key[2].key = &k_chandle;
2371 key[3].key = &k_channel;
2373 key[4].key = &k_frame_number;
2377 profile_data = (guint8 *) p_get_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_BTOBEX_PROFILE);
2378 if (profile_data == NULL) {
2379 obex_profile_data = (obex_profile_data_t *)wmem_tree_lookup32_array_le(obex_profile, key);
2380 if (obex_profile_data && obex_profile_data->interface_id == interface_id &&
2381 obex_profile_data->adapter_id == adapter_id &&
2382 obex_profile_data->chandle == chandle &&
2383 obex_profile_data->channel == channel) {
2384 profile = obex_profile_data->profile;
2387 profile_data = wmem_new(wmem_file_scope(), guint8);
2388 *profile_data = profile;
2390 p_add_proto_data(pinfo->pool, pinfo, proto_btobex, PROTO_DATA_BTOBEX_PROFILE, profile_data);
2393 obex_path_data = (obex_path_data_t *)wmem_tree_lookup32_array_le(obex_path, key);
2394 if (obex_path_data && obex_path_data->interface_id == interface_id &&
2395 obex_path_data->adapter_id == adapter_id &&
2396 obex_path_data->chandle == chandle &&
2397 obex_path_data->channel == channel) {
2398 path = obex_path_data->path;
2401 sub_item = proto_tree_add_uint(main_tree, hf_profile, tvb, 0, 0, profile);
2402 PROTO_ITEM_SET_GENERATED(sub_item);
2405 sub_item = proto_tree_add_string(main_tree, hf_current_path, tvb, 0, 0, path);
2406 PROTO_ITEM_SET_GENERATED(sub_item);
2409 current_handle = dissector_get_uint_handle(btobex_profile, profile);
2410 default_handle = dissector_get_default_uint_handle("btobex.profile", profile);
2411 if (current_handle != default_handle) {
2412 expert_add_info_format(pinfo, main_item, &ei_decoded_as_profile, "Decoded As %s", dissector_handle_get_long_name(current_handle));
2417 if (tvb_captured_length(tvb) == tvb_reported_length(tvb)) {
2418 frag_msg = fragment_get_reassembled_id(&btobex_reassembly_table, pinfo, pinfo->p2p_dir);
2419 if (frag_msg && pinfo->fd->num != frag_msg->reassembled_in) {
2420 /* reassembled but not last */
2422 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2423 "Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, main_tree);
2424 } else if (frag_msg && pinfo->fd->num == frag_msg->reassembled_in) {
2425 /* reassembled and last, so dissect reassembled packet here */
2427 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2428 "Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, main_tree);
2430 frag_msg = fragment_get(&btobex_reassembly_table, pinfo, pinfo->p2p_dir, NULL);
2433 /* not the first fragment */
2435 /* packet stream is guaranted to be sequence of fragments, one by one,
2436 so find last fragment for its offset and length */
2437 while (frag_msg->next) {
2438 frag_msg = frag_msg->next;
2441 frag_msg = fragment_add_check(&btobex_reassembly_table,
2442 tvb, 0, pinfo, pinfo->p2p_dir, NULL,
2443 frag_msg->offset + frag_msg->len, tvb_reported_length(tvb),
2444 ((frag_msg->offset + frag_msg->len + tvb_reported_length(tvb)) <
2445 fragment_get_tot_len(&btobex_reassembly_table, pinfo, pinfo->p2p_dir, NULL)) ? TRUE : FALSE);
2447 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2448 "Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, main_tree);
2450 pinfo->fragmented = TRUE;
2452 if (tvb_reported_length(tvb) < 3) {
2453 /* Packet length is in the second and the third bye of packet, anything shorter than 3 is bad */
2454 col_add_fstr(pinfo->cinfo, COL_INFO, "%s OBEX packet too short",
2455 (pinfo->p2p_dir==P2P_DIR_SENT) ? "Sent" : "Rcvd");
2456 call_dissector(data_handle, tvb, pinfo, main_tree);
2457 return tvb_reported_length(tvb);
2458 } else if (tvb_reported_length(tvb) >= 3 && tvb_reported_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
2459 /* first fragment in a sequence */
2460 frag_msg = fragment_add_check(&btobex_reassembly_table,
2461 tvb, 0, pinfo, pinfo->p2p_dir, NULL,
2462 0, tvb_reported_length(tvb), TRUE);
2464 fragment_set_tot_len(&btobex_reassembly_table,
2465 pinfo, pinfo->p2p_dir, NULL,
2466 tvb_get_ntohs(tvb, offset + 1));
2468 new_tvb = process_reassembled_data(tvb, 0, pinfo,
2469 "Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, main_tree);
2470 pinfo->fragmented = TRUE;
2471 } else if (tvb_reported_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
2472 /* non-fragmented */
2474 pinfo->fragmented = FALSE;
2480 if (new_tvb) { /* take it all */
2483 } else { /* make a new subset */
2484 next_tvb = tvb_new_subset_remaining(tvb, offset);
2491 /* fully dissectable packet ready */
2493 /* op/response code */
2494 code = tvb_get_guint8(next_tvb, offset) & BTOBEX_CODE_VALS_MASK;
2495 final_flag = tvb_get_guint8(next_tvb, offset) & 0x80;
2497 switch (pinfo->p2p_dir) {
2499 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
2502 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
2505 col_set_str(pinfo->cinfo, COL_INFO, "UnknownDirection ");
2509 col_append_str(pinfo->cinfo, COL_INFO,
2510 val_to_str_ext_const(code, &code_vals_ext, "Unknown"));
2512 if (code < BTOBEX_CODE_VALS_CONTINUE || code == BTOBEX_CODE_VALS_ABORT) {
2513 proto_tree_add_item(main_tree, hf_opcode, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2514 if (!pinfo->fd->flags.visited &&
2515 (pinfo->p2p_dir == P2P_DIR_SENT ||
2516 pinfo->p2p_dir == P2P_DIR_RECV)) {
2518 if (is_obex_over_l2cap) {
2519 btl2cap_data_t *l2cap_data;
2521 l2cap_data = (btl2cap_data_t *) data;
2522 interface_id = l2cap_data->interface_id;
2523 adapter_id = l2cap_data->adapter_id;
2524 chandle = l2cap_data->chandle;
2525 channel = l2cap_data->cid;
2527 btrfcomm_data_t *rfcomm_data;
2529 rfcomm_data = (btrfcomm_data_t *) data;
2530 interface_id = rfcomm_data->interface_id;
2531 adapter_id = rfcomm_data->adapter_id;
2532 chandle = rfcomm_data->chandle;
2533 channel = rfcomm_data->dlci >> 1;
2536 k_interface_id = interface_id;
2537 k_adapter_id = adapter_id;
2538 k_chandle = chandle;
2539 k_channel = channel;
2540 k_frame_number = pinfo->fd->num;
2543 key[0].key = &k_interface_id;
2545 key[1].key = &k_adapter_id;
2547 key[2].key = &k_chandle;
2549 key[3].key = &k_channel;
2551 key[4].key = &k_frame_number;
2555 obex_last_opcode_data = wmem_new0(wmem_file_scope(), obex_last_opcode_data_t);
2556 obex_last_opcode_data->interface_id = interface_id;
2557 obex_last_opcode_data->adapter_id = adapter_id;
2558 obex_last_opcode_data->chandle = chandle;
2559 obex_last_opcode_data->channel = channel;
2560 obex_last_opcode_data->code = code;
2561 obex_last_opcode_data->final_flag = final_flag;
2562 obex_last_opcode_data->request_in_frame = k_frame_number;
2563 obex_last_opcode_data->response_in_frame = 0;
2565 wmem_tree_insert32_array(obex_last_opcode, key, obex_last_opcode_data);
2568 proto_tree_add_item(main_tree, hf_response_code, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2571 proto_tree_add_item(main_tree, hf_final_flag, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2575 proto_tree_add_item(main_tree, hf_length, next_tvb, offset, 2, ENC_BIG_ENDIAN);
2576 length = tvb_get_ntohs(tvb, offset) - 3;
2580 if (is_obex_over_l2cap) {
2581 btl2cap_data_t *l2cap_data;
2583 l2cap_data = (btl2cap_data_t *) data;
2584 interface_id = l2cap_data->interface_id;
2585 adapter_id = l2cap_data->adapter_id;
2586 chandle = l2cap_data->chandle;
2587 channel = l2cap_data->cid;
2589 btrfcomm_data_t *rfcomm_data;
2591 rfcomm_data = (btrfcomm_data_t *) data;
2592 interface_id = rfcomm_data->interface_id;
2593 adapter_id = rfcomm_data->adapter_id;
2594 chandle = rfcomm_data->chandle;
2595 channel = rfcomm_data->dlci >> 1;
2598 k_interface_id = interface_id;
2599 k_adapter_id = adapter_id;
2600 k_chandle = chandle;
2601 k_channel = channel;
2602 k_frame_number = pinfo->fd->num;
2605 key[0].key = &k_interface_id;
2607 key[1].key = &k_adapter_id;
2609 key[2].key = &k_chandle;
2611 key[3].key = &k_channel;
2613 key[4].key = &k_frame_number;
2617 obex_last_opcode_data = (obex_last_opcode_data_t *)wmem_tree_lookup32_array_le(obex_last_opcode, key);
2618 if (obex_last_opcode_data && obex_last_opcode_data->interface_id == interface_id &&
2619 obex_last_opcode_data->adapter_id == adapter_id &&
2620 obex_last_opcode_data->chandle == chandle &&
2621 obex_last_opcode_data->channel == channel) {
2622 if (obex_last_opcode_data->request_in_frame > 0 && obex_last_opcode_data->request_in_frame != pinfo->fd->num) {
2623 sub_item = proto_tree_add_uint(main_tree, hf_request_in_frame, next_tvb, 0, 0, obex_last_opcode_data->request_in_frame);
2624 PROTO_ITEM_SET_GENERATED(sub_item);
2627 if (!pinfo->fd->flags.visited && obex_last_opcode_data->response_in_frame == 0 && obex_last_opcode_data->request_in_frame < pinfo->fd->num) {
2628 obex_last_opcode_data->response_in_frame = pinfo->fd->num;
2631 if (obex_last_opcode_data->response_in_frame > 0 && obex_last_opcode_data->response_in_frame != pinfo->fd->num) {
2632 sub_item = proto_tree_add_uint(main_tree, hf_response_in_frame, next_tvb, 0, 0, obex_last_opcode_data->response_in_frame);
2633 PROTO_ITEM_SET_GENERATED(sub_item);
2639 case BTOBEX_CODE_VALS_CONNECT:
2640 proto_tree_add_item(main_tree, hf_version, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2643 proto_tree_add_item(main_tree, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2646 proto_tree_add_item(main_tree, hf_max_pkt_len, next_tvb, offset, 2, ENC_BIG_ENDIAN);
2650 case BTOBEX_CODE_VALS_PUT:
2651 case BTOBEX_CODE_VALS_GET:
2652 col_append_fstr(pinfo->cinfo, COL_INFO, " %s", (final_flag == 0x80) ? "final" : "continue");
2655 case BTOBEX_CODE_VALS_SET_PATH:
2656 proto_tree_add_item(main_tree, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2657 proto_tree_add_item(main_tree, hf_set_path_flags_0, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2658 proto_tree_add_item(main_tree, hf_set_path_flags_1, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2660 if (!pinfo->fd->flags.visited && obex_last_opcode_data) {
2661 obex_last_opcode_data->data.set_data.go_up = tvb_get_guint8(tvb, offset) & 0x01;
2662 obex_last_opcode_data->data.set_data.name = NULL;
2667 proto_tree_add_item(main_tree, hf_constants, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2671 case BTOBEX_CODE_VALS_DISCONNECT:
2672 case BTOBEX_CODE_VALS_ABORT:
2676 if (length == 0 && tvb_reported_length_remaining(tvb, offset) > 0) {
2677 proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_reported_length_remaining(tvb, offset));
2678 offset += tvb_reported_length_remaining(tvb, offset);
2680 } else if (length == 0) break;
2682 if (obex_last_opcode_data && obex_last_opcode_data->code == BTOBEX_CODE_VALS_CONNECT) {
2683 proto_tree_add_item(main_tree, hf_version, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2686 proto_tree_add_item(main_tree, hf_flags, next_tvb, offset, 1, ENC_BIG_ENDIAN);
2689 proto_tree_add_item(main_tree, hf_max_pkt_len, next_tvb, offset, 2, ENC_BIG_ENDIAN);
2692 if (!pinfo->fd->flags.visited)
2693 save_path(pinfo, path, "", FALSE, is_obex_over_l2cap, data);
2698 dissect_headers(main_tree, next_tvb, offset, pinfo, profile, is_obex_over_l2cap, obex_last_opcode_data, data);
2699 if (!pinfo->fd->flags.visited &&
2700 obex_last_opcode_data &&
2701 obex_last_opcode_data->data.set_data.name &&
2702 obex_last_opcode_data->code == BTOBEX_CODE_VALS_SET_PATH &&
2703 code == BTOBEX_CODE_VALS_SUCCESS) {
2704 save_path(pinfo, path, obex_last_opcode_data->data.set_data.name, obex_last_opcode_data->data.set_data.go_up, is_obex_over_l2cap, data);
2707 /* packet fragment */
2708 col_add_fstr(pinfo->cinfo, COL_INFO, "%s OBEX fragment",
2709 (pinfo->p2p_dir==P2P_DIR_SENT) ? "Sent" : "Rcvd");
2710 call_dissector(data_handle, next_tvb, pinfo, main_tree);
2712 offset = tvb_reported_length(tvb);
2715 pinfo->fragmented = save_fragmented;
2722 proto_register_btobex(void)
2725 expert_module_t *expert_btobex;
2734 static hf_register_info hf[] = {
2736 { "Opcode", "btobex.opcode",
2737 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &code_vals_ext, BTOBEX_CODE_VALS_MASK,
2738 "Request Opcode", HFILL}
2740 { &hf_response_code,
2741 { "Response Code", "btobex.resp_code",
2742 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &code_vals_ext, BTOBEX_CODE_VALS_MASK,
2746 { "Final Flag", "btobex.final_flag",
2747 FT_BOOLEAN, 8, NULL, 0x80,
2751 { "Packet Length", "btobex.pkt_len",
2752 FT_UINT16, BASE_DEC, NULL, 0,
2756 { "Version", "btobex.version",
2757 FT_UINT8, BASE_HEX, VALS(version_vals), 0x00,
2758 "Obex Protocol Version", HFILL}
2761 { "Flags", "btobex.flags",
2762 FT_UINT8, BASE_HEX, NULL, 0x00,
2766 { "Constants", "btobex.constants",
2767 FT_UINT8, BASE_HEX, NULL, 0x00,
2771 { "Max. Packet Length", "btobex.max_pkt_len",
2772 FT_UINT16, BASE_DEC, NULL, 0,
2775 { &hf_set_path_flags_0,
2776 { "Go back one folder (../) first", "btobex.set_path_flags_0",
2777 FT_BOOLEAN, 8, NULL, 0x01,
2780 { &hf_set_path_flags_1,
2781 { "Do not create folder, if not existing", "btobex.set_path_flags_1",
2782 FT_BOOLEAN, 8, NULL, 0x02,
2786 { "Headers", "btobex.headers",
2787 FT_NONE, BASE_NONE, NULL, 0x00,
2791 { "Header", "btobex.header",
2792 FT_NONE, BASE_NONE, NULL, 0x00,
2796 { "Header Id", "btobex.header.id",
2797 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &header_id_vals_ext, 0x00,
2800 { &hf_hdr_id_encoding,
2801 { "Encoding", "btobex.header.id.encoding",
2802 FT_UINT8, BASE_HEX, VALS(header_id_encoding_vals), 0xC0,
2805 { &hf_hdr_id_meaning,
2806 { "Meaning", "btobex.header.id.meaning",
2807 FT_UINT8, BASE_HEX, VALS(header_id_meaning_vals), 0x3F,
2811 { "Length", "btobex.header.length",
2812 FT_UINT16, BASE_DEC, NULL, 0,
2813 "Header Length", HFILL}
2815 { &hf_hdr_val_unicode,
2816 { "Value", "btobex.header.value.unicode",
2817 FT_STRING, BASE_NONE, NULL, 0,
2818 "Unicode Value", HFILL }
2820 { &hf_hdr_val_byte_seq,
2821 { "Value", "btobex.header.value.byte_sequence",
2822 FT_BYTES, BASE_NONE, NULL, 0,
2823 "Byte Sequence Value", HFILL}
2826 { "Value", "btobex.header.value.byte",
2827 FT_UINT8, BASE_DEC_HEX, NULL, 0,
2828 "Byte Value", HFILL}
2831 { "Value", "btobex.header.value.long",
2832 FT_UINT32, BASE_DEC, NULL, 0,
2833 "4-byte Value", HFILL}
2836 { "Count", "btobex.count",
2837 FT_UINT32, BASE_DEC, NULL, 0,
2841 { "Length", "btobex.length",
2842 FT_UINT32, BASE_DEC, NULL, 0,
2845 { &hf_connection_id,
2846 { "Connection ID", "btobex.connection_id",
2847 FT_UINT32, BASE_DEC, NULL, 0,
2850 { &hf_session_parameter,
2851 { "Session Parameter", "btobex.session",
2852 FT_UINT8, BASE_HEX, NULL, 0x00,
2855 { &hf_session_parameter_data,
2856 { "Parameter Value", "btobex.session.value",
2857 FT_BYTES, BASE_NONE, NULL, 0,
2860 { &hf_session_parameter_tag,
2861 { "Tag", "btobex.session.tag",
2862 FT_UINT8, BASE_HEX, VALS(session_tag_vals), 0x00,
2865 { &hf_session_parameter_length,
2866 { "Length", "btobex.session.length",
2867 FT_UINT8, BASE_DEC, NULL, 0,
2870 { &hf_session_parameter_nonce,
2871 { "Nonce", "btobex.session.nonce",
2872 FT_BYTES, BASE_NONE, NULL, 0,
2875 { &hf_session_parameter_session_id,
2876 { "Session ID", "btobex.session.session_id",
2877 FT_BYTES, BASE_NONE, NULL, 0,
2880 { &hf_session_parameter_next_sequence_number,
2881 { "Next Sequence Number", "btobex.session.next_sequence_number",
2882 FT_UINT8, BASE_DEC, NULL, 0,
2885 { &hf_session_parameter_timeout,
2886 { "Timeout", "btobex.session.timeout",
2887 FT_UINT32, BASE_DEC, NULL, 0,
2890 { &hf_session_parameter_opcode,
2891 { "Opcode", "btobex.session.opcode",
2892 FT_UINT8, BASE_HEX, VALS(session_opcode_vals), 0,
2895 { &hf_authentication_parameter,
2896 { "Autentication Parameter", "btobex.authentication",
2897 FT_UINT8, BASE_HEX, NULL, 0x00,
2900 { &hf_authentication_parameter_data,
2901 { "Parameter Value", "btobex.authentication.value",
2902 FT_BYTES, BASE_NONE, NULL, 0,
2905 { &hf_authentication_challenge_tag,
2906 { "Tag", "btobex.authentication.challenge_tag",
2907 FT_UINT8, BASE_HEX, VALS(authentication_challenge_tag_vals), 0x00,
2910 { &hf_authentication_response_tag,
2911 { "Tag", "btobex.authentication.response_tag",
2912 FT_UINT8, BASE_HEX, VALS(authentication_response_tag_vals), 0x00,
2915 { &hf_authentication_length,
2916 { "Length", "btobex.authentication.length",
2917 FT_UINT8, BASE_DEC, NULL, 0,
2920 { &hf_authentication_key,
2921 { "Key", "btobex.authentication.key",
2922 FT_BYTES, BASE_NONE, NULL, 0,
2925 { &hf_authentication_result_key,
2926 { "Result Key", "btobex.authentication.result_key",
2927 FT_BYTES, BASE_NONE, NULL, 0,
2930 { &hf_authentication_user_id,
2931 { "User Id", "btobex.authentication.user_id",
2932 FT_BYTES, BASE_NONE, NULL, 0,
2935 { &hf_authentication_option_reserved,
2936 { "Reserved", "btobex.authentication.option.reserved",
2937 FT_UINT8, BASE_HEX, NULL, 0xFC,
2940 { &hf_authentication_option_read_only,
2941 { "Read Only", "btobex.authentication.option.read_only",
2942 FT_BOOLEAN, 8, NULL, 0x02,
2945 { &hf_authentication_option_user_id,
2946 { "User ID", "btobex.authentication.option.user_id",
2947 FT_BOOLEAN, 8, NULL, 0x01,
2950 { &hf_authentication_info_charset,
2951 { "Charset", "btobex.authentication.info.charset",
2952 FT_UINT8, BASE_HEX, VALS(info_charset_vals), 0,
2955 { &hf_authentication_info,
2956 { "Info", "btobex.authentication.info",
2957 FT_STRING, BASE_NONE, NULL, 0,
2960 { &hf_application_parameter,
2961 { "Parameter", "btobex.parameter",
2962 FT_NONE, BASE_NONE, NULL, 0x00,
2965 { &hf_application_parameter_id,
2966 { "Parameter Id", "btobex.parameter.id",
2967 FT_UINT8, BASE_HEX, NULL, 0x00,
2970 { &hf_application_parameter_length,
2971 { "Parameter Length", "btobex.parameter.length",
2972 FT_UINT8, BASE_DEC, NULL, 0,
2975 { &hf_application_parameter_data,
2976 { "Parameter Value", "btobex.parameter.value",
2977 FT_BYTES, BASE_NONE, NULL, 0,
2980 /* application parameters for BPP */
2981 { &hf_bpp_application_parameter_id,
2982 { "Parameter Id", "btobex.parameter.id",
2983 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bpp_application_parameters_vals_ext, 0x00,
2986 { &hf_bpp_application_parameter_data_offset,
2987 { "Offset", "btobex.parameter.value.offset",
2988 FT_UINT32, BASE_DEC_HEX, NULL, 0,
2989 "The byte offset into the image or file.", HFILL}
2991 { &hf_bpp_application_parameter_data_count,
2992 { "Count", "btobex.parameter.value.count",
2993 FT_INT32, BASE_DEC, NULL, 0,
2994 "The number of bytes of the image or file to be sent.", HFILL}
2996 { &hf_bpp_application_parameter_data_job_id,
2997 { "Job ID", "btobex.parameter.value.job_id",
2998 FT_UINT32, BASE_DEC_HEX, NULL, 0,
2999 "The job identifier of the print job.", HFILL}
3001 { &hf_bpp_application_parameter_data_file_size,
3002 { "File Size", "btobex.parameter.value.file_size",
3003 FT_INT32, BASE_DEC, NULL, 0,
3004 "The size (in bytes) of object or file.", HFILL}
3006 /* application parameters for BIP */
3007 { &hf_bip_application_parameter_id,
3008 { "Parameter Id", "btobex.parameter.id",
3009 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bip_application_parameters_vals_ext, 0x00,
3012 { &hf_bip_application_parameter_data_number_of_returned_handles,
3013 { "Number of Returned Handles", "btobex.parameter.value.number_of_returned_handles",
3014 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3017 { &hf_bip_application_parameter_data_list_start_offset,
3018 { "List Start Offset", "btobex.parameter.value.list_start_offset",
3019 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3022 { &hf_bip_application_parameter_data_latest_captured_images,
3023 { "Latest Captured Images", "btobex.parameter.value.latest_captured_images",
3024 FT_BOOLEAN, 8, NULL, 0x00,
3027 { &hf_bip_application_parameter_data_partial_file_length,
3028 { "Partial File Length", "btobex.parameter.value.partial_file_length",
3029 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
3032 { &hf_bip_application_parameter_data_partial_file_start_offset,
3033 { "Partial File Start Offset", "btobex.parameter.value.partial_file_start_offset",
3034 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
3037 { &hf_bip_application_parameter_data_total_file_size,
3038 { "Total File Size", "btobex.parameter.value.total_file_size",
3039 FT_UINT32, BASE_DEC_HEX, NULL, 0x00,
3042 { &hf_bip_application_parameter_data_end_flag,
3043 { "End Flag", "btobex.parameter.value.end_flag",
3044 FT_BOOLEAN, 8, NULL, 0x00,
3047 { &hf_bip_application_parameter_data_remote_display,
3048 { "Remote Display", "btobex.parameter.value.remote_display",
3049 FT_UINT8, BASE_HEX, VALS(bip_remote_display_vals), 0x00,
3052 { &hf_bip_application_parameter_data_service_id,
3053 { "Service ID", "btobex.parameter.value.service_id",
3054 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bluetooth_uuid_vals_ext, 0x00,
3057 { &hf_bip_application_parameter_data_store_flag,
3058 { "Store Flag", "btobex.parameter.value.store_flag",
3059 FT_BOOLEAN, 8, NULL, 0x00,
3062 /* application parameters for PBAP */
3063 { &hf_pbap_application_parameter_id,
3064 { "Parameter Id", "btobex.parameter.id",
3065 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &pbap_application_parameters_vals_ext, 0x00,
3068 { &hf_pbap_application_parameter_data_order,
3069 { "Max List Count", "btobex.parameter.value.order",
3070 FT_UINT8, BASE_HEX, VALS(pbap_order_vals), 0x00,
3073 { &hf_pbap_application_parameter_data_search_value,
3074 { "Search Value", "btobex.parameter.value.search_value",
3075 FT_STRING, BASE_NONE, NULL, 0x00,
3078 { &hf_pbap_application_parameter_data_search_attribute,
3079 { "Search Attribute", "btobex.parameter.value.search_attribute",
3080 FT_UINT8, BASE_HEX, VALS(pbap_search_attribute_vals), 0x00,
3083 { &hf_pbap_application_parameter_data_max_list_count,
3084 { "Max List Count", "btobex.parameter.value.max_list_count",
3085 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3088 { &hf_pbap_application_parameter_data_list_start_offset,
3089 { "List Start Offset", "btobex.parameter.value.list_start_offset",
3090 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3093 { &hf_pbap_application_parameter_data_filter,
3094 { "Filter", "btobex.parameter.value.filter",
3095 FT_UINT32, BASE_HEX, NULL, 0x0,
3098 { &hf_pbap_application_parameter_vcard_selector,
3099 { "vCard Selector", "btobex.parameter.value.filter",
3100 FT_UINT32, BASE_HEX, NULL, 0x0,
3103 { &hf_pbap_application_parameter_data_filter_version,
3104 { "vCard Version", "btobex.parameter.value.filter.version",
3105 FT_BOOLEAN, 32, NULL, 0x00000001,
3108 { &hf_pbap_application_parameter_data_filter_fn,
3109 { "Formatted Name", "btobex.parameter.value.filter.fn",
3110 FT_BOOLEAN, 32, NULL, 0x00000002,
3113 { &hf_pbap_application_parameter_data_filter_n,
3114 { "Structured Presentation of Name", "btobex.parameter.value.filter.n",
3115 FT_BOOLEAN, 32, NULL, 0x00000004,
3118 { &hf_pbap_application_parameter_data_filter_photo,
3119 { "Associated Image or Photo", "btobex.parameter.value.filter.photo",
3120 FT_BOOLEAN, 32, NULL, 0x00000008,
3123 { &hf_pbap_application_parameter_data_filter_birthday,
3124 { "Birthday", "btobex.parameter.value.filter.birthday",
3125 FT_BOOLEAN, 32, NULL, 0x00000010,
3128 { &hf_pbap_application_parameter_data_filter_adr,
3129 { "Delivery Address", "btobex.parameter.value.filter.adr",
3130 FT_BOOLEAN, 32, NULL, 0x00000020,
3133 { &hf_pbap_application_parameter_data_filter_label,
3134 { "Delivery", "btobex.parameter.value.filter.label",
3135 FT_BOOLEAN, 32, NULL, 0x00000040,
3138 { &hf_pbap_application_parameter_data_filter_tel,
3139 { "Telephone Number", "btobex.parameter.value.filter.tel",
3140 FT_BOOLEAN, 32, NULL, 0x00000080,
3143 { &hf_pbap_application_parameter_data_filter_email,
3144 { "Electronic Mail Address", "btobex.parameter.value.filter.email",
3145 FT_BOOLEAN, 32, NULL, 0x00000100,
3148 { &hf_pbap_application_parameter_data_filter_mailer,
3149 { "Electronic Mail", "btobex.parameter.value.filter.mailer",
3150 FT_BOOLEAN, 32, NULL, 0x00000200,
3153 { &hf_pbap_application_parameter_data_filter_time_zone,
3154 { "Time Zone", "btobex.parameter.value.filter.time_zone",
3155 FT_BOOLEAN, 32, NULL, 0x00000400,
3158 { &hf_pbap_application_parameter_data_filter_geographic_position,
3159 { "Geographic Position", "btobex.parameter.value.filter.geographic_position",
3160 FT_BOOLEAN, 32, NULL, 0x00000800,
3163 { &hf_pbap_application_parameter_data_filter_title,
3164 { "Job", "btobex.parameter.value.filter.title",
3165 FT_BOOLEAN, 32, NULL, 0x00001000,
3168 { &hf_pbap_application_parameter_data_filter_role,
3169 { "Role within the Organization", "btobex.parameter.value.filter.role",
3170 FT_BOOLEAN, 32, NULL, 0x00002000,
3173 { &hf_pbap_application_parameter_data_filter_logo,
3174 { "Organization Logo", "btobex.parameter.value.filter.logo",
3175 FT_BOOLEAN, 32, NULL, 0x00004000,
3178 { &hf_pbap_application_parameter_data_filter_agent,
3179 { "vCard of Person Representing", "btobex.parameter.value.filter.agent",
3180 FT_BOOLEAN, 32, NULL, 0x00008000,
3183 { &hf_pbap_application_parameter_data_filter_name_of_organization,
3184 { "Name of Organization", "btobex.parameter.value.filter.name_of_organization",
3185 FT_BOOLEAN, 32, NULL, 0x00010000,
3188 { &hf_pbap_application_parameter_data_filter_comments,
3189 { "Comments", "btobex.parameter.value.filter.comments",
3190 FT_BOOLEAN, 32, NULL, 0x00020000,
3193 { &hf_pbap_application_parameter_data_filter_revision,
3194 { "Revision", "btobex.parameter.value.filter.revision",
3195 FT_BOOLEAN, 32, NULL, 0x00040000,
3198 { &hf_pbap_application_parameter_data_filter_pronunciation_of_name,
3199 { "Pronunciation of Name", "btobex.parameter.value.filter.pronunciation_of_name",
3200 FT_BOOLEAN, 32, NULL, 0x00080000,
3203 { &hf_pbap_application_parameter_data_filter_url,
3204 { "Uniform Resource Locator", "btobex.parameter.value.filter.url",
3205 FT_BOOLEAN, 32, NULL, 0x00100000,
3208 { &hf_pbap_application_parameter_data_filter_uid,
3209 { "Unique ID", "btobex.parameter.value.filter.uid",
3210 FT_BOOLEAN, 32, NULL, 0x00200000,
3213 { &hf_pbap_application_parameter_data_filter_key,
3214 { "Public Encryption Key", "btobex.parameter.value.filter.key",
3215 FT_BOOLEAN, 32, NULL, 0x00400000,
3218 { &hf_pbap_application_parameter_data_filter_nickname,
3219 { "Nickname", "btobex.parameter.value.filter.nickname",
3220 FT_BOOLEAN, 32, NULL, 0x00800000,
3223 { &hf_pbap_application_parameter_data_filter_categories,
3224 { "Categories", "btobex.parameter.value.filter.categories",
3225 FT_BOOLEAN, 32, NULL, 0x01000000,
3228 { &hf_pbap_application_parameter_data_filter_product_id,
3229 { "Product ID", "btobex.parameter.value.filter.product_id",
3230 FT_BOOLEAN, 32, NULL, 0x02000000,
3233 { &hf_pbap_application_parameter_data_filter_class,
3234 { "Class Information", "btobex.parameter.value.filter.class",
3235 FT_BOOLEAN, 32, NULL, 0x04000000,
3238 { &hf_pbap_application_parameter_data_filter_sort_string,
3239 { "String Used For Sorting Operations", "btobex.parameter.value.filter.sort_string",
3240 FT_BOOLEAN, 32, NULL, 0x08000000,
3243 { &hf_pbap_application_parameter_data_filter_timestamp,
3244 { "Timestamp", "btobex.parameter.value.filter.timestamp",
3245 FT_BOOLEAN, 32, NULL, 0x10000000,
3248 { &hf_pbap_application_parameter_data_filter_reserved_29_31,
3249 { "Reserved", "btobex.parameter.value.filter.reserved_29_31",
3250 FT_UINT32, BASE_HEX, NULL, 0xE0000000,
3253 { &hf_pbap_application_parameter_data_filter_reserved_32_38,
3254 { "Reserved", "btobex.parameter.value.filter.reserved_32_38",
3255 FT_UINT32, BASE_HEX, NULL, 0x0000007F,
3258 { &hf_pbap_application_parameter_data_filter_proprietary_filter,
3259 { "Proprietary Filter", "btobex.parameter.value.filter.proprietary_filter",
3260 FT_BOOLEAN, 32, NULL, 0x00000080,
3263 { &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage,
3264 { "Reserved for Proprietary Filter Usage", "btobex.parameter.value.filter.reserved_for_proprietary_filter_usage",
3265 FT_UINT32, BASE_HEX, NULL, 0xFFFFFF00,
3268 { &hf_pbap_application_parameter_data_format,
3269 { "Format", "btobex.parameter.value.format",
3270 FT_UINT8, BASE_HEX, VALS(pbap_format_vals), 0x00,
3273 { &hf_pbap_application_parameter_data_phonebook_size,
3274 { "Phonebook Size", "btobex.parameter.value.phonebook_size",
3275 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3278 { &hf_pbap_application_parameter_data_new_missed_calls,
3279 { "New Missed Calls", "btobex.parameter.value.new_missed_calls",
3280 FT_UINT8, BASE_DEC, NULL, 0x00,
3283 { &hf_pbap_application_parameter_data_primary_version_counter,
3284 { "Primary Version Counter", "btobex.parameter.value.primary_version_counter",
3285 FT_BYTES, BASE_NONE, NULL, 0x00,
3288 { &hf_pbap_application_parameter_data_secondary_version_counter,
3289 { "Secondary Version Counter", "btobex.parameter.value.secondary_version_counter",
3290 FT_BYTES, BASE_NONE, NULL, 0x00,
3293 { &hf_pbap_application_parameter_data_database_identifier,
3294 { "Database Identifier", "btobex.parameter.value.database_identifier",
3295 FT_BYTES, BASE_NONE, NULL, 0x00,
3298 { &hf_pbap_application_parameter_data_vcard_selector_operator,
3299 { "vCard Selector Operator", "btobex.parameter.value.vcard_selector_operator",
3300 FT_UINT8, BASE_HEX, VALS(pbap_application_parameter_data_vcard_selector_operator_vals), 0x00,
3303 { &hf_pbap_application_parameter_data_reset_new_missed_calls,
3304 { "vCard Selector Operator", "btobex.parameter.value.reset_new_missed_calls",
3305 FT_UINT8, BASE_HEX, VALS(pbap_application_parameter_data_reset_new_missed_calls_vals), 0x00,
3308 { &hf_pbap_application_parameter_data_supported_features,
3309 { "Supported Features", "btobex.parameter.supported_features",
3310 FT_UINT32, BASE_HEX, NULL, 0x0,
3313 { &hf_pbap_application_parameter_data_supported_features_reserved,
3314 { "Reserved", "btobex.parameter.supported_features.reserved",
3315 FT_UINT32, BASE_HEX, NULL, 0xFFFFFC00,
3318 { &hf_pbap_application_parameter_data_supported_features_default_contact_image_format,
3319 { "Default Contact Image Format", "btobex.parameter.supported_features.default_contact_image_format",
3320 FT_BOOLEAN, 32, NULL, 0x00000200,
3323 { &hf_pbap_application_parameter_data_supported_features_contact_referencing,
3324 { "Contact Referencing", "btobex.parameter.supported_features.contact_referencing",
3325 FT_BOOLEAN, 32, NULL, 0x00000100,
3328 { &hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property,
3329 { "X-BT-UID vCard Property", "btobex.parameter.supported_features.x_bt_uid_vcard_property",
3330 FT_BOOLEAN, 32, NULL, 0x00000080,
3333 { &hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property,
3334 { "X-BT-UCI vCard Property", "btobex.parameter.supported_features.x_bt_uci_vcard_property",
3335 FT_BOOLEAN, 32, NULL, 0x00000040,
3338 { &hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls,
3339 { "Enhanced Missed Calls", "btobex.parameter.supported_features.enhanced_missed_calls",
3340 FT_BOOLEAN, 32, NULL, 0x00000020,
3343 { &hf_pbap_application_parameter_data_supported_features_vcard_selecting,
3344 { "vCard Selecting", "btobex.parameter.supported_features.vcard_selecting",
3345 FT_BOOLEAN, 32, NULL, 0x00000010,
3348 { &hf_pbap_application_parameter_data_supported_features_folder_version_counters,
3349 { "Folder Version Counters", "btobex.parameter.supported_features.folder_version_counters",
3350 FT_BOOLEAN, 32, NULL, 0x00000008,
3353 { &hf_pbap_application_parameter_data_supported_features_database_identifier,
3354 { "Database Identifier", "btobex.parameter.supported_features.database_identifier",
3355 FT_BOOLEAN, 32, NULL, 0x00000004,
3358 { &hf_pbap_application_parameter_data_supported_features_browsing,
3359 { "Browsing", "btobex.parameter.supported_features.browsing",
3360 FT_BOOLEAN, 32, NULL, 0x00000002,
3363 { &hf_pbap_application_parameter_data_supported_features_download,
3364 { "Download", "btobex.parameter.supported_features.download",
3365 FT_BOOLEAN, 32, NULL, 0x00000001,
3368 /* application parameters for MAP */
3369 { &hf_map_application_parameter_id,
3370 { "Parameter Id", "btobex.parameter.id",
3371 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &map_application_parameters_vals_ext, 0x00,
3374 { &hf_map_application_parameter_data_max_list_count,
3375 { "Max List Count", "btobex.parameter.value.max_list_count",
3376 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3379 { &hf_map_application_parameter_data_start_offset,
3380 { "Start Offset", "btobex.parameter.value.start_offset",
3381 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3384 { &hf_map_application_parameter_data_filter_message_type_reserved,
3385 { "Reserved", "btobex.parameter.value.filter_message_type.reserved",
3386 FT_UINT8, BASE_HEX, NULL, 0xF0,
3389 { &hf_map_application_parameter_data_filter_message_type_mms,
3390 { "MMS", "btobex.parameter.value.filter_message_type.mms",
3391 FT_BOOLEAN, 8, NULL, 0x08,
3392 "True to filter out, False to listing this type", HFILL}
3394 { &hf_map_application_parameter_data_filter_message_type_email,
3395 { "EMAIL", "btobex.parameter.value.filter_message_type.sms_email",
3396 FT_BOOLEAN, 8, NULL, 0x04,
3397 "True to filter out, False to listing this type", HFILL}
3399 { &hf_map_application_parameter_data_filter_message_type_sms_cdma,
3400 { "SMS_CDMA", "btobex.parameter.value.filter_message_type.sms_cdma",
3401 FT_BOOLEAN, 8, NULL, 0x02,
3402 "True to filter out, False to listing this type", HFILL}
3404 { &hf_map_application_parameter_data_filter_message_type_sms_gsm,
3405 { "SMS_GSM", "btobex.parameter.value.filter_message_type.sms_gsm",
3406 FT_BOOLEAN, 8, NULL, 0x01,
3409 { &hf_map_application_parameter_data_filter_period_begin,
3410 { "Filter Period Begin", "btobex.parameter.value.filter_period_begin",
3411 FT_STRING, BASE_NONE, NULL, 0,
3414 { &hf_map_application_parameter_data_filter_period_end,
3415 { "Filter Period End", "btobex.parameter.value.filter_period_end",
3416 FT_STRING, BASE_NONE, NULL, 0,
3419 { &hf_map_application_parameter_data_filter_read_status_reserved_6,
3420 { "Filter Read Status: Reserved", "btobex.parameter.value.filter_read_status.reserved",
3421 FT_UINT8, BASE_HEX, NULL, 0xFC,
3424 { &hf_map_application_parameter_data_filter_read_status_get_read,
3425 { "Filter Read Status: Get Read", "btobex.parameter.value.filter_read_status.get_read",
3426 FT_BOOLEAN, 8, NULL, 0x02,
3429 { &hf_map_application_parameter_data_filter_read_status_get_unread,
3430 { "Filter Read Status: Get Unread", "btobex.parameter.value.filter_read_status.get_unread",
3431 FT_BOOLEAN, 8, NULL, 0x01,
3434 { &hf_map_application_parameter_data_filter_recipient,
3435 { "Filter Recipient", "btobex.parameter.value.filter_recipient",
3436 FT_STRING, BASE_NONE, NULL, 0,
3439 { &hf_map_application_parameter_data_filter_originator,
3440 { "Filter Originator", "btobex.parameter.value.filter_originator",
3441 FT_STRING, BASE_NONE, NULL, 0,
3444 { &hf_map_application_parameter_data_filter_priority_reserved_6,
3445 { "Filter Priority: Reserved", "btobex.parameter.value.filter_priority.reserved",
3446 FT_UINT8, BASE_HEX, NULL, 0xFC,
3449 { &hf_map_application_parameter_data_filter_priority_get_high,
3450 { "Filter Priority: Get Read", "btobex.parameter.value.filter_priority.get_high",
3451 FT_BOOLEAN, 8, NULL, 0x02,
3454 { &hf_map_application_parameter_data_filter_priority_non_high,
3455 { "Filter Priority: Get Non High", "btobex.parameter.value.filter_priority.non_high",
3456 FT_BOOLEAN, 8, NULL, 0x01,
3459 { &hf_map_application_parameter_data_reserved_7,
3460 { "Reserved", "btobex.parameter.value.reserved",
3461 FT_UINT8, BASE_HEX, NULL, 0xFE,
3464 { &hf_map_application_parameter_data_attachment,
3465 { "Attachment", "btobex.parameter.value.attachment",
3466 FT_BOOLEAN, 8, NULL, 0x01,
3469 { &hf_map_application_parameter_data_transparent,
3470 { "Transparent", "btobex.parameter.value.transparent",
3471 FT_BOOLEAN, 8, NULL, 0x01,
3474 { &hf_map_application_parameter_data_retry,
3475 { "Retry", "btobex.parameter.value.retry",
3476 FT_BOOLEAN, 8, NULL, 0x01,
3479 { &hf_map_application_parameter_data_new_message,
3480 { "New Message", "btobex.parameter.value.new_message",
3481 FT_BOOLEAN, 8, NULL, 0x01,
3484 { &hf_map_application_parameter_data_notification_status,
3485 { "Notification Status", "btobex.parameter.value.notification_status",
3486 FT_BOOLEAN, 8, NULL, 0x01,
3489 { &hf_map_application_parameter_data_mas_instance_id,
3490 { "MAS Instance ID", "btobex.parameter.value.mas_instance_id",
3491 FT_UINT8, BASE_DEC_HEX, NULL, 0,
3494 { &hf_map_application_parameter_data_parameter_mask_reserved,
3495 { "Parameter Mask: Reserved", "btobex.parameter.value.parameter_mask.reserved",
3496 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
3499 { &hf_map_application_parameter_data_parameter_mask_reply_to_addressing,
3500 { "Parameter Mask: Reply to Addressing", "btobex.parameter.value.parameter_mask.reply_to_addressing",
3501 FT_BOOLEAN, 32, NULL, 0x8000,
3504 { &hf_map_application_parameter_data_parameter_mask_protected,
3505 { "Parameter Mask: Protected", "btobex.parameter.value.parameter_mask.protected",
3506 FT_BOOLEAN, 32, NULL, 0x4000,
3509 { &hf_map_application_parameter_data_parameter_mask_sent,
3510 { "Parameter Mask: Sent", "btobex.parameter.value.parameter_mask.sent",
3511 FT_BOOLEAN, 32, NULL, 0x2000,
3514 { &hf_map_application_parameter_data_parameter_mask_read,
3515 { "Parameter Mask: Read", "btobex.parameter.value.parameter_mask.read",
3516 FT_BOOLEAN, 32, NULL, 0x1000,
3519 { &hf_map_application_parameter_data_parameter_mask_priority,
3520 { "Parameter Mask: Priority", "btobex.parameter.value.parameter_mask.priority",
3521 FT_BOOLEAN, 32, NULL, 0x0800,
3524 { &hf_map_application_parameter_data_parameter_mask_attachment_size,
3525 { "Parameter Mask: Attachment Size", "btobex.parameter.value.parameter_mask.attachment_size",
3526 FT_BOOLEAN, 32, NULL, 0x0400,
3529 { &hf_map_application_parameter_data_parameter_mask_text,
3530 { "Parameter Mask: Text", "btobex.parameter.value.parameter_mask.text",
3531 FT_BOOLEAN, 32, NULL, 0x0200,
3534 { &hf_map_application_parameter_data_parameter_mask_reception_status,
3535 { "Parameter Mask: Reception Status", "btobex.parameter.value.parameter_mask.reception_status",
3536 FT_BOOLEAN, 32, NULL, 0x0100,
3539 { &hf_map_application_parameter_data_parameter_mask_size,
3540 { "Parameter Mask: Size", "btobex.parameter.value.parameter_mask.size",
3541 FT_BOOLEAN, 32, NULL, 0x0080,
3544 { &hf_map_application_parameter_data_parameter_mask_type,
3545 { "Parameter Mask: Type", "btobex.parameter.value.parameter_mask.type",
3546 FT_BOOLEAN, 32, NULL, 0x0040,
3549 { &hf_map_application_parameter_data_parameter_mask_recipient_addressing,
3550 { "Parameter Mask: Recipient Addressing", "btobex.parameter.value.parameter_mask.recipient_addressing",
3551 FT_BOOLEAN, 32, NULL, 0x0020,
3554 { &hf_map_application_parameter_data_parameter_mask_recipient_name,
3555 { "Parameter Mask: Recipient Name", "btobex.parameter.value.parameter_mask.recipient_name",
3556 FT_BOOLEAN, 32, NULL, 0x0010,
3559 { &hf_map_application_parameter_data_parameter_mask_sender_addressing,
3560 { "Parameter Mask: Sender Addressing", "btobex.parameter.value.parameter_mask.sender_addressing",
3561 FT_BOOLEAN, 32, NULL, 0x0008,
3564 { &hf_map_application_parameter_data_parameter_mask_sender_name,
3565 { "Parameter Mask: Sender Name", "btobex.parameter.value.parameter_mask.sender_name",
3566 FT_BOOLEAN, 32, NULL, 0x0004,
3569 { &hf_map_application_parameter_data_parameter_mask_datetime,
3570 { "Parameter Mask: Datetime", "btobex.parameter.value.parameter_mask.datetime",
3571 FT_BOOLEAN, 32, NULL, 0x0002,
3574 { &hf_map_application_parameter_data_parameter_mask_subject,
3575 { "Parameter Mask: Subject", "btobex.parameter.value.parameter_mask.subject",
3576 FT_BOOLEAN, 32, NULL, 0x0001,
3579 { &hf_map_application_parameter_data_folder_listing_size,
3580 { "Folder Listing Size", "btobex.parameter.value.folder_listing_size",
3581 FT_UINT16, BASE_DEC_HEX, NULL, 0,
3584 { &hf_map_application_parameter_data_messages_listing_size,
3585 { "Messages Listing Size", "btobex.parameter.value.messages_listing_size",
3586 FT_UINT16, BASE_DEC_HEX, NULL, 0,
3589 { &hf_map_application_parameter_data_subject_length,
3590 { "Subject Length", "btobex.parameter.value.subject_length",
3591 FT_UINT8, BASE_DEC_HEX, NULL, 0,
3594 { &hf_map_application_parameter_data_charset,
3595 { "Charset", "btobex.parameter.value.charset",
3596 FT_UINT8, BASE_HEX, VALS(map_charset_vals), 0x01,
3599 { &hf_map_application_parameter_data_fraction_request,
3600 { "Fraction Request", "btobex.parameter.value.fraction_request",
3601 FT_UINT8, BASE_HEX, VALS(map_fraction_request_vals), 0x01,
3604 { &hf_map_application_parameter_data_fraction_deliver,
3605 { "Fraction Deliver", "btobex.parameter.value.fraction_deliver",
3606 FT_UINT8, BASE_HEX, VALS(map_fraction_deliver_vals), 0x01,
3609 { &hf_map_application_parameter_data_status_indicator,
3610 { "Status Indicator", "btobex.parameter.value.status_indicator",
3611 FT_UINT8, BASE_HEX, VALS(map_status_indicator_vals), 0x01,
3614 { &hf_map_application_parameter_data_status_value,
3615 { "Status Value", "btobex.parameter.value.status_value",
3616 FT_BOOLEAN, 8, NULL, 0x01,
3619 { &hf_map_application_parameter_data_mse_time,
3620 { "MSE Time", "btobex.parameter.value.mse_time",
3621 FT_STRING, BASE_NONE, NULL, 0,
3624 /* application parameters for GPP */
3625 { &hf_gpp_application_parameter_id,
3626 { "Parameter Id", "btobex.parameter.gpp.id",
3627 FT_UINT8, BASE_HEX, VALS(gpp_application_parameters_vals), 0x00,
3630 { &hf_gpp_application_parameter_data_max_list_count,
3631 { "Max List Count", "btobex.parameter.gpp.value.max_list_count",
3632 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3635 { &hf_gpp_application_parameter_data_list_start_offset,
3636 { "List Start Offset", "btobex.parameter.gpp.value.list_start_offset",
3637 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3640 { &hf_gpp_application_parameter_data_reserved_7,
3641 { "Reserved", "btobex.parameter.gpp.value.reserved",
3642 FT_UINT8, BASE_HEX, NULL, 0xFE,
3645 { &hf_gpp_application_parameter_data_notification_status,
3646 { "Notification Status", "btobex.parameter.gpp.value.notification_status",
3647 FT_BOOLEAN, 8, NULL, 0x01,
3650 { &hf_gpp_application_parameter_data_instance_id,
3651 { "Instance ID", "btobex.parameter.gpp.value.instance_id",
3652 FT_UINT8, BASE_DEC_HEX, NULL, 0,
3655 { &hf_gpp_application_parameter_data_listing_size,
3656 { "Listing Size", "btobex.parameter.gpp.value.listing_size",
3657 FT_UINT16, BASE_DEC_HEX, NULL, 0x00,
3660 /* application parameters for CTN */
3661 { &hf_ctn_application_parameter_id,
3662 { "Parameter Id", "btobex.parameter.ctn.id",
3663 FT_UINT8, BASE_HEX, VALS(ctn_application_parameters_vals), 0x00,
3666 { &hf_ctn_application_parameter_data_acoustic_alarm_status,
3667 { "Acoustic Alarm Status", "btobex.parameter.ctn.acoustic_alarm_status",
3668 FT_UINT8, BASE_HEX, VALS(off_on_vals), 0x00,
3671 { &hf_ctn_application_parameter_data_attachment,
3672 { "Attachment", "btobex.parameter.ctn.attachment",
3673 FT_UINT8, BASE_HEX, VALS(ctn_application_parameter_data_attachment_vals), 0x00,
3676 { &hf_ctn_application_parameter_data_send,
3677 { "Attachment", "btobex.parameter.ctn.attachment",
3678 FT_UINT8, BASE_HEX, VALS(no_yes_vals), 0x00,
3681 { &hf_ctn_application_parameter_data_filter_period_begin,
3682 { "Filter Period Begin", "btobex.parameter.ctn.filter_period_begin",
3683 FT_STRING, STR_ASCII, NULL, 0x00,
3686 { &hf_ctn_application_parameter_data_filter_period_end,
3687 { "Filter Period End", "btobex.parameter.ctn.filter_period_end",
3688 FT_STRING, STR_ASCII, NULL, 0x00,
3691 { &hf_ctn_application_parameter_data_parameter_mask,
3692 { "Parameter Mask", "btobex.parameter.ctn.parameter_mask",
3693 FT_UINT32, BASE_HEX, NULL, 0x00,
3696 { &hf_ctn_application_parameter_data_parameter_mask_reserved,
3697 { "Reserved", "btobex.parameter.ctn.parameter_mask.reserved",
3698 FT_UINT32, BASE_HEX, NULL, 0xFFFFFC00,
3701 { &hf_ctn_application_parameter_data_parameter_mask_recurrent,
3702 { "Recurrent", "btobex.parameter.ctn.parameter_mask.recurrent",
3703 FT_UINT32, BASE_HEX, NULL, 0x00000200,
3706 { &hf_ctn_application_parameter_data_parameter_mask_send_status,
3707 { "Send Status", "btobex.parameter.ctn.parameter_mask.send_status",
3708 FT_UINT32, BASE_HEX, NULL, 0x00000100,
3711 { &hf_ctn_application_parameter_data_parameter_mask_alarm_status,
3712 { "Alarm Status", "btobex.parameter.ctn.parameter_mask.",
3713 FT_UINT32, BASE_HEX, NULL, 0x00000080,
3716 { &hf_ctn_application_parameter_data_parameter_mask_pstatus,
3717 { "pStatus", "btobex.parameter.ctn.parameter_mask.pstatus",
3718 FT_UINT32, BASE_HEX, NULL, 0x00000040,
3721 { &hf_ctn_application_parameter_data_parameter_mask_priority,
3722 { "Priority", "btobex.parameter.ctn.parameter_mask.priority",
3723 FT_UINT32, BASE_HEX, NULL, 0x00000020,
3726 { &hf_ctn_application_parameter_data_parameter_mask_originator_address,
3727 { "Originator Address", "btobex.parameter.ctn.parameter_mask.originator_address",
3728 FT_UINT32, BASE_HEX, NULL, 0x00000010,
3731 { &hf_ctn_application_parameter_data_parameter_mask_originator_name,
3732 { "Originator Name", "btobex.parameter.ctn.parameter_mask.originator_name",
3733 FT_UINT32, BASE_HEX, NULL, 0x00000008,
3736 { &hf_ctn_application_parameter_data_parameter_mask_end_time,
3737 { "End Time", "btobex.parameter.ctn.parameter_mask.end_time",
3738 FT_UINT32, BASE_HEX, NULL, 0x00000004,
3741 { &hf_ctn_application_parameter_data_parameter_mask_summary,
3742 { "Summary", "btobex.parameter.ctn.parameter_mask.summary",
3743 FT_UINT32, BASE_HEX, NULL, 0x00000002,
3746 { &hf_ctn_application_parameter_data_parameter_mask_attachment,
3747 { "Attachment", "btobex.parameter.ctn.parameter_mask.attachment",
3748 FT_UINT32, BASE_HEX, NULL, 0x00000001,
3751 { &hf_ctn_application_parameter_data_status_indicator,
3752 { "Status Indicator", "btobex.parameter.ctn.status_indicator",
3753 FT_UINT8, BASE_HEX, VALS(ctn_application_parameter_data_status_indicator_vals), 0x00,
3756 { &hf_ctn_application_parameter_data_status_value,
3757 { "Status Value", "btobex.parameter.ctn.status_value",
3758 FT_UINT8, BASE_HEX, VALS(ctn_application_parameter_data_status_value_vals), 0x00,
3761 { &hf_ctn_application_parameter_data_postpone_val,
3762 { "Postpone Val", "btobex.parameter.ctn.postpone_val",
3763 FT_UINT32, BASE_DEC, NULL, 0x00,
3766 { &hf_ctn_application_parameter_data_email_uri,
3767 { "Email URI", "btobex.parameter.ctn.email_uri",
3768 FT_STRING, STR_ASCII, NULL, 0x00,
3771 { &hf_ctn_application_parameter_data_cse_time,
3772 { "CSE Time", "btobex.parameter.ctn.cse_time",
3773 FT_STRING, STR_ASCII, NULL, 0x00,
3776 { &hf_ctn_application_parameter_data_recurrent,
3777 { "Recurrent", "btobex.parameter.ctn.recurrent",
3778 FT_UINT8, BASE_HEX, VALS(no_yes_vals), 0x00,
3781 { &hf_ctn_application_parameter_data_attach_id,
3782 { "Attach ID", "btobex.parameter.ctn.attach_id",
3783 FT_UINT8, BASE_DEC, NULL, 0x00,
3786 { &hf_ctn_application_parameter_data_last_update,
3787 { "Last Update", "btobex.parameter.ctn.last_update",
3788 FT_STRING, STR_ASCII, NULL, 0x00,
3791 /* for fragmentation */
3792 { &hf_btobex_fragment_overlap,
3793 { "Fragment overlap", "btobex.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3794 "Fragment overlaps with other fragments", HFILL }
3796 { &hf_btobex_fragment_overlap_conflict,
3797 { "Conflicting data in fragment overlap", "btobex.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3798 "Overlapping fragments contained conflicting data", HFILL }
3800 { &hf_btobex_fragment_multiple_tails,
3801 { "Multiple tail fragments found", "btobex.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3802 "Several tails were found when defragmenting the packet", HFILL }
3804 { &hf_btobex_fragment_too_long_fragment,
3805 { "Fragment too long", "btobex.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
3806 "Fragment contained data past end of packet", HFILL }
3808 { &hf_btobex_fragment_error,
3809 { "Defragmentation error", "btobex.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
3810 "Defragmentation error due to illegal fragments", HFILL }
3812 { &hf_btobex_fragment_count,
3813 { "Fragment count", "btobex.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0,
3816 { &hf_btobex_fragment,
3817 { "OBEX Fragment", "btobex.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
3818 "btobex Fragment", HFILL }
3820 { &hf_btobex_fragments,
3821 { "OBEX Fragments", "btobex.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
3822 "btobex Fragments", HFILL }
3824 { &hf_btobex_reassembled_in,
3825 { "Reassembled OBEX in frame", "btobex.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
3826 "This OBEX frame is reassembled in this frame", HFILL }
3828 { &hf_btobex_reassembled_length,
3829 { "Reassembled OBEX length", "btobex.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0,
3830 "The total length of the reassembled payload", HFILL }
3833 { "Profile", "btobex.profile", FT_UINT32, BASE_DEC | BASE_EXT_STRING, &profile_vals_ext, 0x0,
3834 "Blutooth Profile used in this OBEX session", HFILL }
3837 { "Type", "btobex.type", FT_STRINGZ, STR_ASCII, NULL, 0x0,
3841 { "Object Class", "btobex.object_class", FT_STRINGZ, STR_ASCII, NULL, 0x0,
3845 { "Time", "btobex.time", FT_STRINGZ, STR_ASCII, NULL, 0x0,
3848 { &hf_hdr_val_action,
3849 { "Action", "btobex.action", FT_UINT8, BASE_DEC, VALS(action_vals), 0x0,
3852 { &hf_hdr_val_single_response_mode,
3853 { "Single Response Mode", "btobex.single_response_mode", FT_UINT8, BASE_DEC, VALS(single_response_mode_vals), 0x0,
3856 { &hf_hdr_val_single_response_mode_parameter,
3857 { "Single Response Mode Parameter", "btobex.single_response_mode_parameter", FT_UINT8, BASE_DEC, VALS(single_response_mode_parameter_vals), 0x0,
3861 { "WAN UUID", "btobex.wan_uuid",
3862 FT_UINT16, BASE_HEX, NULL, 0x00,
3865 { &hf_sender_bd_addr,
3866 { "Sender Address", "btobex.sender_bd_addr",
3867 FT_ETHER, BASE_NONE, NULL, 0x0,
3871 { "Name", "btobex.name",
3872 FT_STRING, BASE_NONE, NULL, 0,
3876 { "Current Path", "btobex.current_path",
3877 FT_STRINGZ, BASE_NONE, NULL, 0,
3880 { &hf_request_in_frame,
3881 { "Request in Frame", "btobex.request_in_frame", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
3884 { &hf_response_in_frame,
3885 { "Response in Frame", "btobex.response_in_frame", FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
3890 /* Setup protocol subtree array */
3891 static gint *ett[] = {
3897 &ett_btobex_parameter,
3898 &ett_btobex_fragment,
3899 &ett_btobex_fragments,
3900 &ett_btobex_session_parameters,
3901 &ett_btobex_application_parameters,
3902 &ett_btobex_authentication_parameters
3905 static ei_register_info ei[] = {
3906 { &ei_application_parameter_length_bad, { "btobex.parameter.length.bad", PI_PROTOCOL, PI_WARN, "Parameter length bad", EXPFILL }},
3907 { &ei_unexpected_data, { "btobex.expert.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }},
3908 { &ei_decoded_as_profile, { "btobex.expert.decoded_as.profile", PI_PROTOCOL, PI_NOTE, "Decoded As", EXPFILL }},
3911 /* Decode As handling */
3912 static build_valid_func btobex_profile_da_build_value[1] = {btobex_profile_value};
3913 static decode_as_value_t btobex_profile_da_values = {btobex_profile_prompt, 1, btobex_profile_da_build_value};
3914 static decode_as_t btobex_profile_da = {"btobex", "OBEX Profile", "btobex.profile", 1, 0, &btobex_profile_da_values, NULL, NULL,
3915 decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
3917 static build_valid_func media_type_da_build_value[1] = {media_type_value};
3918 static decode_as_value_t media_type_da_values = {media_type_prompt, 1, media_type_da_build_value};
3919 static decode_as_t media_type_da = {"btobex", "Media Type", "media_type",
3920 1, 0, &media_type_da_values, NULL, NULL,
3921 decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
3924 obex_path = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3925 obex_profile = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3926 obex_last_opcode = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3928 proto_btobex = proto_register_protocol("Bluetooth OBEX Protocol", "BT OBEX", "btobex");
3930 btobex_handle = new_register_dissector("btobex", dissect_btobex, proto_btobex);
3932 btobex_profile = register_dissector_table("btobex.profile", "BTOBEX Profile", FT_UINT8, BASE_DEC);
3934 /* Required function calls to register the header fields and subtrees used */
3935 proto_register_field_array(proto_btobex, hf, array_length(hf));
3936 proto_register_subtree_array(ett, array_length(ett));
3937 expert_btobex = expert_register_protocol(proto_btobex);
3938 expert_register_field_array(expert_btobex, ei, array_length(ei));
3940 register_init_routine(&defragment_init);
3941 register_cleanup_routine(&defragment_cleanup);
3943 register_decode_as(&btobex_profile_da);
3945 proto_raw = proto_register_protocol("BT OBEX Raw Application Parameters", "Raw Application Parameters", "btobex.parameter.raw");
3946 raw_application_parameters_handle = new_register_dissector("btobex.parameter.raw", dissect_btobex_application_parameter_raw, proto_raw);
3948 proto_bpp = proto_register_protocol("BT OBEX BPP Application Parameters", "BPP Application Parameters", "btobex.parameter.bpp");
3949 bpp_application_parameters_handle = new_register_dissector("btobex.parameter.bpp", dissect_btobex_application_parameter_bpp, proto_bpp);
3951 proto_bip = proto_register_protocol("BT OBEX BIP Application Parameters", "BIP Application Parameters", "btobex.parameter.bip");
3952 bip_application_parameters_handle = new_register_dissector("btobex.parameter.bip", dissect_btobex_application_parameter_bip, proto_bip);
3954 proto_map = proto_register_protocol("BT OBEX MAP Application Parameters", "MAP Application Parameters", "btobex.parameter.map");
3955 map_application_parameters_handle = new_register_dissector("btobex.parameter.map", dissect_btobex_application_parameter_map, proto_map);
3957 proto_gpp = proto_register_protocol("BT OBEX GPP Application Parameters", "GPP Application Parameters", "btobex.parameter.gpp");
3958 gpp_application_parameters_handle = new_register_dissector("btobex.parameter.gpp", dissect_btobex_application_parameter_gpp, proto_gpp);
3960 proto_ctn = proto_register_protocol("BT OBEX CTN Application Parameters", "CTN Application Parameters", "btobex.parameter.ctn");
3961 ctn_application_parameters_handle = new_register_dissector("btobex.parameter.ctn", dissect_btobex_application_parameter_ctn, proto_ctn);
3963 proto_pbap = proto_register_protocol("BT OBEX PBAP Application Parameters", "PBAP Application Parameters", "btobex.parameter.pbap");
3964 pbap_application_parameters_handle = new_register_dissector("btobex.parameter.pbap", dissect_btobex_application_parameter_pbap, proto_pbap);
3966 register_decode_as(&media_type_da);
3968 module = prefs_register_protocol(proto_btobex, NULL);
3969 prefs_register_static_text_preference(module, "obex.version",
3970 "Bluetooth Protocol OBEX support profiles: BIP 1.2, BPP 1.2, CTN 1.0, FTP 1.3, GOEP 1.3, GPP 1.0, MAP 1.2, OPP 1.2, PBAP 1.2, SYNCH 1.2",
3971 "Version of profiles supported by this dissector.");
3975 proto_reg_handoff_btobex(void)
3977 /* register in rfcomm and l2cap the profiles/services this dissector should handle */
3978 dissector_add_uint("btrfcomm.service", BTSDP_OPP_SERVICE_UUID, btobex_handle);
3979 dissector_add_uint("btrfcomm.service", BTSDP_FTP_SERVICE_UUID, btobex_handle);
3980 dissector_add_uint("btrfcomm.service", BTSDP_BPP_DIRECT_PRINTING_SERVICE_UUID, btobex_handle);
3981 dissector_add_uint("btrfcomm.service", BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID, btobex_handle);
3982 dissector_add_uint("btrfcomm.service", BTSDP_BPP_DIRECT_PRINTING_REF_OBJ_SERVICE_UUID, btobex_handle);
3983 dissector_add_uint("btrfcomm.service", BTSDP_BPP_REFLECTED_UI_SERVICE_UUID, btobex_handle);
3984 dissector_add_uint("btrfcomm.service", BTSDP_BPP_SERVICE_UUID, btobex_handle);
3985 dissector_add_uint("btrfcomm.service", BTSDP_BPP_STATUS_SERVICE_UUID, btobex_handle);
3986 dissector_add_uint("btrfcomm.service", BTSDP_BIP_SERVICE_UUID, btobex_handle);
3987 dissector_add_uint("btrfcomm.service", BTSDP_BIP_RESPONDER_SERVICE_UUID, btobex_handle);
3988 dissector_add_uint("btrfcomm.service", BTSDP_BIP_AUTO_ARCH_SERVICE_UUID, btobex_handle);
3989 dissector_add_uint("btrfcomm.service", BTSDP_BIP_REF_OBJ_SERVICE_UUID, btobex_handle);
3990 dissector_add_uint("btrfcomm.service", BTSDP_PBAP_PCE_SERVICE_UUID, btobex_handle);
3991 dissector_add_uint("btrfcomm.service", BTSDP_PBAP_PSE_SERVICE_UUID, btobex_handle);
3992 dissector_add_uint("btrfcomm.service", BTSDP_PBAP_SERVICE_UUID, btobex_handle);
3993 dissector_add_uint("btrfcomm.service", BTSDP_MAP_SERVICE_UUID, btobex_handle);
3994 dissector_add_uint("btrfcomm.service", BTSDP_MAP_ACCESS_SRV_SERVICE_UUID, btobex_handle);
3995 dissector_add_uint("btrfcomm.service", BTSDP_MAP_NOTIFICATION_SRV_SERVICE_UUID, btobex_handle);
3996 dissector_add_uint("btrfcomm.service", BTSDP_SYNC_SERVICE_UUID, btobex_handle);
3997 dissector_add_uint("btrfcomm.service", BTSDP_SYNC_COMMAND_SERVICE_UUID, btobex_handle);
3999 dissector_add_uint("btl2cap.service", BTSDP_OPP_SERVICE_UUID, btobex_handle);
4000 dissector_add_uint("btl2cap.service", BTSDP_FTP_SERVICE_UUID, btobex_handle);
4001 dissector_add_uint("btl2cap.service", BTSDP_BPP_DIRECT_PRINTING_SERVICE_UUID, btobex_handle);
4002 dissector_add_uint("btl2cap.service", BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID, btobex_handle);
4003 dissector_add_uint("btl2cap.service", BTSDP_BPP_DIRECT_PRINTING_REF_OBJ_SERVICE_UUID, btobex_handle);
4004 dissector_add_uint("btl2cap.service", BTSDP_BPP_REFLECTED_UI_SERVICE_UUID, btobex_handle);
4005 dissector_add_uint("btl2cap.service", BTSDP_BPP_SERVICE_UUID, btobex_handle);
4006 dissector_add_uint("btl2cap.service", BTSDP_BPP_STATUS_SERVICE_UUID, btobex_handle);
4007 dissector_add_uint("btl2cap.service", BTSDP_BIP_SERVICE_UUID, btobex_handle);
4008 dissector_add_uint("btl2cap.service", BTSDP_BIP_RESPONDER_SERVICE_UUID, btobex_handle);
4009 dissector_add_uint("btl2cap.service", BTSDP_BIP_AUTO_ARCH_SERVICE_UUID, btobex_handle);
4010 dissector_add_uint("btl2cap.service", BTSDP_BIP_REF_OBJ_SERVICE_UUID, btobex_handle);
4011 dissector_add_uint("btl2cap.service", BTSDP_PBAP_PCE_SERVICE_UUID, btobex_handle);
4012 dissector_add_uint("btl2cap.service", BTSDP_PBAP_PSE_SERVICE_UUID, btobex_handle);
4013 dissector_add_uint("btl2cap.service", BTSDP_PBAP_SERVICE_UUID, btobex_handle);
4014 dissector_add_uint("btl2cap.service", BTSDP_MAP_SERVICE_UUID, btobex_handle);
4015 dissector_add_uint("btl2cap.service", BTSDP_MAP_ACCESS_SRV_SERVICE_UUID, btobex_handle);
4016 dissector_add_uint("btl2cap.service", BTSDP_MAP_NOTIFICATION_SRV_SERVICE_UUID, btobex_handle);
4017 dissector_add_uint("btl2cap.service", BTSDP_SYNC_SERVICE_UUID, btobex_handle);
4018 dissector_add_uint("btl2cap.service", BTSDP_SYNC_COMMAND_SERVICE_UUID, btobex_handle);
4020 http_handle = find_dissector("http");
4021 xml_handle = find_dissector("xml");
4022 data_handle = find_dissector("data");
4023 data_text_lines_handle = find_dissector("data-text-lines");
4025 dissector_add_uint("btobex.profile", PROFILE_UNKNOWN, raw_application_parameters_handle);
4026 dissector_add_uint("btobex.profile", PROFILE_BPP, bpp_application_parameters_handle);
4027 dissector_add_uint("btobex.profile", PROFILE_BIP, bip_application_parameters_handle);
4028 dissector_add_uint("btobex.profile", PROFILE_CTN, ctn_application_parameters_handle);
4029 dissector_add_uint("btobex.profile", PROFILE_GPP, gpp_application_parameters_handle);
4030 dissector_add_uint("btobex.profile", PROFILE_MAP, map_application_parameters_handle);
4031 dissector_add_uint("btobex.profile", PROFILE_PBAP, pbap_application_parameters_handle);
4033 dissector_add_uint("btobex.profile", PROFILE_OPP, raw_application_parameters_handle);
4034 dissector_add_uint("btobex.profile", PROFILE_FTP, raw_application_parameters_handle);
4035 dissector_add_uint("btobex.profile", PROFILE_SYNCML, raw_application_parameters_handle);
4036 dissector_add_uint("btobex.profile", PROFILE_SYNC, raw_application_parameters_handle);
4038 dissector_add_for_decode_as("btrfcomm.channel", btobex_handle);
4039 dissector_add_for_decode_as("btl2cap.psm", btobex_handle);
4040 dissector_add_for_decode_as("btl2cap.cid", btobex_handle);
4043 dissector_add_string("media_type", "x-bt/phonebook", data_text_lines_handle);
4044 dissector_add_string("media_type", "x-bt/vcard", data_text_lines_handle);
4045 dissector_add_string("media_type", "x-bt/vcard-listing", xml_handle);
4047 dissector_add_string("media_type", "x-bt/message", data_text_lines_handle);
4048 dissector_add_string("media_type", "x-bt/messageStatus", data_text_lines_handle);
4049 dissector_add_string("media_type", "x-bt/MAP-messageUpdate", data_text_lines_handle);
4050 dissector_add_string("media_type", "x-bt/MAP-NotificationRegistration", data_text_lines_handle);
4051 dissector_add_string("media_type", "x-bt/MASInstanceInformation", data_text_lines_handle);
4052 dissector_add_string("media_type", "x-bt/MAP-msg-listing", xml_handle);
4053 dissector_add_string("media_type", "x-bt/MAP-event-report", xml_handle);
4054 dissector_add_string("media_type", "x-obex/folder-listing", xml_handle);
4056 dissector_add_string("media_type", "x-bt/CTN-EventReport", xml_handle);
4057 dissector_add_string("media_type", "x-bt/CTN-Listing", xml_handle);
4058 dissector_add_string("media_type", "x-bt/CTN-NotificationRegistration", data_text_lines_handle);
4059 dissector_add_string("media_type", "x-bt/Calendar", data_text_lines_handle);
4060 dissector_add_string("media_type", "x-bt/CalendarStatus", data_text_lines_handle);
4061 dissector_add_string("media_type", "x-bt/CTN-forward", data_text_lines_handle);
4062 dissector_add_string("media_type", "x-bt/InstanceDescription", data_text_lines_handle);
4063 dissector_add_string("media_type", "x-bt/Update", data_text_lines_handle);
4065 dissector_add_string("media_type", "text/x-ref-simple", data_text_lines_handle);
4066 dissector_add_string("media_type", "text/x-ref-list", data_text_lines_handle);
4067 dissector_add_string("media_type", "x-obex/RUI", data_text_lines_handle);
4068 dissector_add_string("media_type", "x-obex/bt-SOAP", xml_handle);
4070 dissector_add_string("media_type", "x-bt/img-listing", xml_handle);
4071 dissector_add_string("media_type", "x-bt/img-properties", xml_handle);
4072 dissector_add_string("media_type", "x-bt/img-capabilities", xml_handle);
4073 dissector_add_string("media_type", "x-bt/img-print", data_text_lines_handle);
4074 dissector_add_string("media_type", "x-bt/img-img", data_handle);
4075 dissector_add_string("media_type", "x-bt/img-thm", data_handle);
4076 dissector_add_string("media_type", "x-bt/img-attachment", data_handle);
4077 dissector_add_string("media_type", "x-bt/img-display", data_handle);
4078 dissector_add_string("media_type", "x-bt/img-partial", data_handle);
4079 dissector_add_string("media_type", "x-bt/img-archive", data_handle);
4080 dissector_add_string("media_type", "x-bt/img-status", data_handle);
4081 dissector_add_string("media_type", "x-bt/img-monitoring", data_handle);
4083 media_type_dissector_table = find_dissector_table("media_type");
4087 * Editor modelines - http://www.wireshark.org/tools/modelines.html
4092 * indent-tabs-mode: nil
4095 * vi: set shiftwidth=4 tabstop=8 expandtab:
4096 * :indentSize=4:tabSize=8:noTabs=true: