2 * Routines for OBEX dissection
4 * Copyright 2010, Allan M. Madsen
5 * Copyright 2013, Michal Labedzki for Tieto Corporation
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
17 #include <epan/prefs.h>
18 #include <epan/reassemble.h>
19 #include <epan/expert.h>
20 #include <epan/decode_as.h>
21 #include <epan/proto_data.h>
22 #include "packet-bluetooth.h"
23 #include "packet-btrfcomm.h"
24 #include "packet-btl2cap.h"
25 #include "packet-btsdp.h"
27 /* Initialize the protocol and registered fields */
28 static int proto_obex
;
30 static int hf_response_code
;
31 static int hf_final_flag
;
33 static int hf_version
;
35 static int hf_constants
;
36 static int hf_max_pkt_len
;
37 static int hf_set_path_flags_0
;
38 static int hf_set_path_flags_1
;
39 static int hf_headers
;
42 static int hf_hdr_id_encoding
;
43 static int hf_hdr_id_meaning
;
44 static int hf_hdr_length
;
45 static int hf_hdr_val_unicode
;
46 static int hf_hdr_val_byte_seq
;
47 static int hf_hdr_val_byte
;
48 static int hf_hdr_val_long
;
49 static int hf_authentication_parameter
;
50 static int hf_authentication_parameter_data
;
51 static int hf_authentication_challenge_tag
;
52 static int hf_authentication_response_tag
;
53 static int hf_authentication_key
;
54 static int hf_authentication_result_key
;
55 static int hf_authentication_user_id
;
56 static int hf_authentication_length
;
57 static int hf_authentication_info_charset
;
58 static int hf_authentication_info
;
59 static int hf_authentication_option_reserved
;
60 static int hf_authentication_option_user_id
;
61 static int hf_authentication_option_read_only
;
62 static int hf_application_parameter
;
63 static int hf_application_parameter_id
;
64 static int hf_application_parameter_length
;
65 static int hf_application_parameter_data
;
66 static int hf_bpp_application_parameter_id
;
67 static int hf_bpp_application_parameter_data_offset
;
68 static int hf_bpp_application_parameter_data_count
;
69 static int hf_bpp_application_parameter_data_job_id
;
70 static int hf_bpp_application_parameter_data_file_size
;
71 static int hf_bip_application_parameter_id
;
72 static int hf_bip_application_parameter_data_number_of_returned_handles
;
73 static int hf_bip_application_parameter_data_list_start_offset
;
74 static int hf_bip_application_parameter_data_latest_captured_images
;
75 static int hf_bip_application_parameter_data_partial_file_length
;
76 static int hf_bip_application_parameter_data_partial_file_start_offset
;
77 static int hf_bip_application_parameter_data_total_file_size
;
78 static int hf_bip_application_parameter_data_end_flag
;
79 static int hf_bip_application_parameter_data_remote_display
;
80 static int hf_bip_application_parameter_data_service_id
;
81 static int hf_bip_application_parameter_data_store_flag
;
82 static int hf_pbap_application_parameter_id
;
83 static int hf_pbap_application_parameter_data_order
;
84 static int hf_pbap_application_parameter_data_search_value
;
85 static int hf_pbap_application_parameter_data_search_attribute
;
86 static int hf_pbap_application_parameter_data_max_list_count
;
87 static int hf_pbap_application_parameter_data_list_start_offset
;
88 static int hf_pbap_application_parameter_data_filter
;
89 static int hf_pbap_application_parameter_vcard_selector
;
90 static int hf_pbap_application_parameter_data_filter_version
;
91 static int hf_pbap_application_parameter_data_filter_fn
;
92 static int hf_pbap_application_parameter_data_filter_n
;
93 static int hf_pbap_application_parameter_data_filter_photo
;
94 static int hf_pbap_application_parameter_data_filter_birthday
;
95 static int hf_pbap_application_parameter_data_filter_adr
;
96 static int hf_pbap_application_parameter_data_filter_label
;
97 static int hf_pbap_application_parameter_data_filter_tel
;
98 static int hf_pbap_application_parameter_data_filter_email
;
99 static int hf_pbap_application_parameter_data_filter_mailer
;
100 static int hf_pbap_application_parameter_data_filter_time_zone
;
101 static int hf_pbap_application_parameter_data_filter_geographic_position
;
102 static int hf_pbap_application_parameter_data_filter_title
;
103 static int hf_pbap_application_parameter_data_filter_role
;
104 static int hf_pbap_application_parameter_data_filter_logo
;
105 static int hf_pbap_application_parameter_data_filter_agent
;
106 static int hf_pbap_application_parameter_data_filter_name_of_organization
;
107 static int hf_pbap_application_parameter_data_filter_comments
;
108 static int hf_pbap_application_parameter_data_filter_revision
;
109 static int hf_pbap_application_parameter_data_filter_pronunciation_of_name
;
110 static int hf_pbap_application_parameter_data_filter_url
;
111 static int hf_pbap_application_parameter_data_filter_uid
;
112 static int hf_pbap_application_parameter_data_filter_key
;
113 static int hf_pbap_application_parameter_data_filter_nickname
;
114 static int hf_pbap_application_parameter_data_filter_categories
;
115 static int hf_pbap_application_parameter_data_filter_product_id
;
116 static int hf_pbap_application_parameter_data_filter_class
;
117 static int hf_pbap_application_parameter_data_filter_sort_string
;
118 static int hf_pbap_application_parameter_data_filter_timestamp
;
119 static int hf_pbap_application_parameter_data_filter_reserved_29_31
;
120 static int hf_pbap_application_parameter_data_filter_reserved_32_38
;
121 static int hf_pbap_application_parameter_data_filter_proprietary_filter
;
122 static int hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage
;
123 static int hf_pbap_application_parameter_data_format
;
124 static int hf_pbap_application_parameter_data_phonebook_size
;
125 static int hf_pbap_application_parameter_data_new_missed_calls
;
126 static int hf_pbap_application_parameter_data_primary_version_counter
;
127 static int hf_pbap_application_parameter_data_secondary_version_counter
;
128 static int hf_pbap_application_parameter_data_database_identifier
;
129 static int hf_pbap_application_parameter_data_vcard_selector_operator
;
130 static int hf_pbap_application_parameter_data_reset_new_missed_calls
;
131 static int hf_pbap_application_parameter_data_supported_features
;
132 static int hf_pbap_application_parameter_data_supported_features_reserved
;
133 static int hf_pbap_application_parameter_data_supported_features_download
;
134 static int hf_pbap_application_parameter_data_supported_features_browsing
;
135 static int hf_pbap_application_parameter_data_supported_features_database_identifier
;
136 static int hf_pbap_application_parameter_data_supported_features_folder_version_counters
;
137 static int hf_pbap_application_parameter_data_supported_features_vcard_selecting
;
138 static int hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls
;
139 static int hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property
;
140 static int hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property
;
141 static int hf_pbap_application_parameter_data_supported_features_contact_referencing
;
142 static int hf_pbap_application_parameter_data_supported_features_default_contact_image_format
;
143 static int hf_map_application_parameter_id
;
144 static int hf_map_application_parameter_data_max_list_count
;
145 static int hf_map_application_parameter_data_start_offset
;
146 static int hf_map_application_parameter_data_filter_message_type_reserved
;
147 static int hf_map_application_parameter_data_filter_message_type_mms
;
148 static int hf_map_application_parameter_data_filter_message_type_email
;
149 static int hf_map_application_parameter_data_filter_message_type_sms_cdma
;
150 static int hf_map_application_parameter_data_filter_message_type_sms_gsm
;
151 static int hf_map_application_parameter_data_filter_period_begin
;
152 static int hf_map_application_parameter_data_filter_period_end
;
153 static int hf_map_application_parameter_data_filter_read_status_reserved_6
;
154 static int hf_map_application_parameter_data_filter_read_status_get_read
;
155 static int hf_map_application_parameter_data_filter_read_status_get_unread
;
156 static int hf_map_application_parameter_data_filter_recipient
;
157 static int hf_map_application_parameter_data_filter_originator
;
158 static int hf_map_application_parameter_data_filter_priority_reserved_6
;
159 static int hf_map_application_parameter_data_filter_priority_get_high
;
160 static int hf_map_application_parameter_data_filter_priority_non_high
;
161 static int hf_map_application_parameter_data_reserved_7
;
162 static int hf_map_application_parameter_data_attachment
;
163 static int hf_map_application_parameter_data_transparent
;
164 static int hf_map_application_parameter_data_retry
;
165 static int hf_map_application_parameter_data_new_message
;
166 static int hf_map_application_parameter_data_notification_status
;
167 static int hf_map_application_parameter_data_mas_instance_id
;
168 static int hf_map_application_parameter_data_parameter_mask_reserved
;
169 static int hf_map_application_parameter_data_parameter_mask_reply_to_addressing
;
170 static int hf_map_application_parameter_data_parameter_mask_protected
;
171 static int hf_map_application_parameter_data_parameter_mask_sent
;
172 static int hf_map_application_parameter_data_parameter_mask_read
;
173 static int hf_map_application_parameter_data_parameter_mask_priority
;
174 static int hf_map_application_parameter_data_parameter_mask_attachment_size
;
175 static int hf_map_application_parameter_data_parameter_mask_text
;
176 static int hf_map_application_parameter_data_parameter_mask_reception_status
;
177 static int hf_map_application_parameter_data_parameter_mask_size
;
178 static int hf_map_application_parameter_data_parameter_mask_type
;
179 static int hf_map_application_parameter_data_parameter_mask_recipient_addressing
;
180 static int hf_map_application_parameter_data_parameter_mask_recipient_name
;
181 static int hf_map_application_parameter_data_parameter_mask_sender_addressing
;
182 static int hf_map_application_parameter_data_parameter_mask_sender_name
;
183 static int hf_map_application_parameter_data_parameter_mask_datetime
;
184 static int hf_map_application_parameter_data_parameter_mask_subject
;
185 static int hf_map_application_parameter_data_folder_listing_size
;
186 static int hf_map_application_parameter_data_messages_listing_size
;
187 static int hf_map_application_parameter_data_subject_length
;
188 static int hf_map_application_parameter_data_charset
;
189 static int hf_map_application_parameter_data_fraction_request
;
190 static int hf_map_application_parameter_data_fraction_deliver
;
191 static int hf_map_application_parameter_data_status_indicator
;
192 static int hf_map_application_parameter_data_status_value
;
193 static int hf_map_application_parameter_data_mse_time
;
194 static int hf_gpp_application_parameter_id
;
195 static int hf_gpp_application_parameter_data_max_list_count
;
196 static int hf_gpp_application_parameter_data_list_start_offset
;
197 static int hf_gpp_application_parameter_data_reserved_7
;
198 static int hf_gpp_application_parameter_data_notification_status
;
199 static int hf_gpp_application_parameter_data_instance_id
;
200 static int hf_gpp_application_parameter_data_listing_size
;
201 static int hf_ctn_application_parameter_id
;
202 static int hf_ctn_application_parameter_data_acoustic_alarm_status
;
203 static int hf_ctn_application_parameter_data_attachment
;
204 static int hf_ctn_application_parameter_data_send
;
205 static int hf_ctn_application_parameter_data_filter_period_begin
;
206 static int hf_ctn_application_parameter_data_filter_period_end
;
207 static int hf_ctn_application_parameter_data_parameter_mask
;
208 static int hf_ctn_application_parameter_data_parameter_mask_reserved
;
209 static int hf_ctn_application_parameter_data_parameter_mask_recurrent
;
210 static int hf_ctn_application_parameter_data_parameter_mask_send_status
;
211 static int hf_ctn_application_parameter_data_parameter_mask_alarm_status
;
212 static int hf_ctn_application_parameter_data_parameter_mask_pstatus
;
213 static int hf_ctn_application_parameter_data_parameter_mask_priority
;
214 static int hf_ctn_application_parameter_data_parameter_mask_originator_address
;
215 static int hf_ctn_application_parameter_data_parameter_mask_originator_name
;
216 static int hf_ctn_application_parameter_data_parameter_mask_end_time
;
217 static int hf_ctn_application_parameter_data_parameter_mask_summary
;
218 static int hf_ctn_application_parameter_data_parameter_mask_attachment
;
219 static int hf_ctn_application_parameter_data_status_indicator
;
220 static int hf_ctn_application_parameter_data_status_value
;
221 static int hf_ctn_application_parameter_data_postpone_val
;
222 static int hf_ctn_application_parameter_data_email_uri
;
223 static int hf_ctn_application_parameter_data_cse_time
;
224 static int hf_ctn_application_parameter_data_recurrent
;
225 static int hf_ctn_application_parameter_data_attach_id
;
226 static int hf_ctn_application_parameter_data_last_update
;
227 static int hf_profile
;
229 static int hf_object_class
;
230 static int hf_time_iso8601
;
231 static int hf_wan_uuid
;
232 static int hf_hdr_val_action
;
233 static int hf_hdr_val_single_response_mode
;
234 static int hf_hdr_val_single_response_mode_parameter
;
235 static int hf_session_parameter
;
236 static int hf_session_parameter_tag
;
237 static int hf_session_parameter_length
;
238 static int hf_session_parameter_data
;
239 static int hf_session_parameter_nonce
;
240 static int hf_session_parameter_session_id
;
241 static int hf_session_parameter_next_sequence_number
;
242 static int hf_session_parameter_timeout
;
243 static int hf_session_parameter_opcode
;
244 static int hf_sender_bd_addr
;
246 static int hf_data_length
;
247 static int hf_connection_id
;
249 static int hf_current_path
;
250 static int hf_request_in_frame
;
251 static int hf_response_in_frame
;
253 static int * const hfx_hdr_id
[] = {
259 static int * const hfx_pbap_application_parameter_data_filter_1
[] = {
260 &hf_pbap_application_parameter_data_filter_reserved_32_38
,
261 &hf_pbap_application_parameter_data_filter_proprietary_filter
,
262 &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage
,
266 static int * const hfx_pbap_application_parameter_data_filter_0
[] = {
267 &hf_pbap_application_parameter_data_filter_version
,
268 &hf_pbap_application_parameter_data_filter_fn
,
269 &hf_pbap_application_parameter_data_filter_n
,
270 &hf_pbap_application_parameter_data_filter_photo
,
271 &hf_pbap_application_parameter_data_filter_birthday
,
272 &hf_pbap_application_parameter_data_filter_adr
,
273 &hf_pbap_application_parameter_data_filter_label
,
274 &hf_pbap_application_parameter_data_filter_tel
,
275 &hf_pbap_application_parameter_data_filter_email
,
276 &hf_pbap_application_parameter_data_filter_mailer
,
277 &hf_pbap_application_parameter_data_filter_time_zone
,
278 &hf_pbap_application_parameter_data_filter_geographic_position
,
279 &hf_pbap_application_parameter_data_filter_title
,
280 &hf_pbap_application_parameter_data_filter_role
,
281 &hf_pbap_application_parameter_data_filter_logo
,
282 &hf_pbap_application_parameter_data_filter_agent
,
283 &hf_pbap_application_parameter_data_filter_name_of_organization
,
284 &hf_pbap_application_parameter_data_filter_comments
,
285 &hf_pbap_application_parameter_data_filter_revision
,
286 &hf_pbap_application_parameter_data_filter_pronunciation_of_name
,
287 &hf_pbap_application_parameter_data_filter_url
,
288 &hf_pbap_application_parameter_data_filter_uid
,
289 &hf_pbap_application_parameter_data_filter_key
,
290 &hf_pbap_application_parameter_data_filter_nickname
,
291 &hf_pbap_application_parameter_data_filter_categories
,
292 &hf_pbap_application_parameter_data_filter_product_id
,
293 &hf_pbap_application_parameter_data_filter_class
,
294 &hf_pbap_application_parameter_data_filter_sort_string
,
295 &hf_pbap_application_parameter_data_filter_timestamp
,
296 &hf_pbap_application_parameter_data_filter_reserved_29_31
,
300 static int * const hfx_pbap_application_parameter_data_supported_features
[] = {
301 &hf_pbap_application_parameter_data_supported_features_reserved
,
302 &hf_pbap_application_parameter_data_supported_features_default_contact_image_format
,
303 &hf_pbap_application_parameter_data_supported_features_contact_referencing
,
304 &hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property
,
305 &hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property
,
306 &hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls
,
307 &hf_pbap_application_parameter_data_supported_features_vcard_selecting
,
308 &hf_pbap_application_parameter_data_supported_features_folder_version_counters
,
309 &hf_pbap_application_parameter_data_supported_features_database_identifier
,
310 &hf_pbap_application_parameter_data_supported_features_browsing
,
311 &hf_pbap_application_parameter_data_supported_features_download
,
315 static int * const hfx_ctn_application_parameter_data_parameter_mask
[] = {
316 &hf_ctn_application_parameter_data_parameter_mask_reserved
,
317 &hf_ctn_application_parameter_data_parameter_mask_recurrent
,
318 &hf_ctn_application_parameter_data_parameter_mask_send_status
,
319 &hf_ctn_application_parameter_data_parameter_mask_alarm_status
,
320 &hf_ctn_application_parameter_data_parameter_mask_pstatus
,
321 &hf_ctn_application_parameter_data_parameter_mask_priority
,
322 &hf_ctn_application_parameter_data_parameter_mask_originator_address
,
323 &hf_ctn_application_parameter_data_parameter_mask_originator_name
,
324 &hf_ctn_application_parameter_data_parameter_mask_end_time
,
325 &hf_ctn_application_parameter_data_parameter_mask_summary
,
326 &hf_ctn_application_parameter_data_parameter_mask_attachment
,
330 static expert_field ei_unexpected_data
;
331 static expert_field ei_application_parameter_length_bad
;
332 static expert_field ei_decoded_as_profile
;
334 static dissector_table_t obex_profile_table
;
335 static dissector_table_t media_type_dissector_table
;
338 /* ************************************************************************* */
339 /* Header values for reassembly */
340 /* ************************************************************************* */
341 static int hf_obex_fragments
;
342 static int hf_obex_fragment
;
343 static int hf_obex_fragment_overlap
;
344 static int hf_obex_fragment_overlap_conflict
;
345 static int hf_obex_fragment_multiple_tails
;
346 static int hf_obex_fragment_too_long_fragment
;
347 static int hf_obex_fragment_error
;
348 static int hf_obex_fragment_count
;
349 static int hf_obex_reassembled_in
;
350 static int hf_obex_reassembled_length
;
352 static int ett_obex_fragment
;
353 static int ett_obex_fragments
;
355 static dissector_handle_t obex_handle
;
356 static dissector_handle_t raw_application_parameters_handle
;
357 static dissector_handle_t bt_bpp_application_parameters_handle
;
358 static dissector_handle_t bt_bip_application_parameters_handle
;
359 static dissector_handle_t bt_gpp_application_parameters_handle
;
360 static dissector_handle_t bt_ctn_application_parameters_handle
;
361 static dissector_handle_t bt_map_application_parameters_handle
;
362 static dissector_handle_t bt_pbap_application_parameters_handle
;
364 static reassembly_table obex_reassembly_table
;
366 static const fragment_items obex_frag_items
= {
371 &hf_obex_fragment_overlap
,
372 &hf_obex_fragment_overlap_conflict
,
373 &hf_obex_fragment_multiple_tails
,
374 &hf_obex_fragment_too_long_fragment
,
375 &hf_obex_fragment_error
,
376 &hf_obex_fragment_count
,
377 &hf_obex_reassembled_in
,
378 &hf_obex_reassembled_length
,
379 /* Reassembled data field */
384 /* Initialize the subtree pointers */
386 static int ett_obex_hdrs
;
387 static int ett_obex_hdr
;
388 static int ett_obex_hdr_id
;
389 static int ett_obex_filter
;
390 static int ett_obex_parameter
;
391 static int ett_obex_session_parameters
;
392 static int ett_obex_application_parameters
;
393 static int ett_obex_authentication_parameters
;
395 static wmem_tree_t
*obex_path
;
396 static wmem_tree_t
*obex_profile
;
397 static wmem_tree_t
*obex_last_opcode
;
399 static dissector_handle_t http_handle
;
400 static dissector_handle_t xml_handle
;
401 static dissector_handle_t data_handle
;
402 static dissector_handle_t data_text_lines_handle
;
404 static const char *path_unknown
= "?";
405 static const char *path_root
= "/";
407 typedef struct _obex_proto_data_t
{
408 uint32_t interface_id
;
414 typedef struct _ext_value_string
{
420 typedef struct _obex_path_data_t
{
421 uint32_t interface_id
;
425 /* TODO: add OBEX ConnectionId */
430 typedef struct _obex_profile_data_t
{
431 uint32_t interface_id
;
435 /* TODO: add OBEX ConnectionId */
438 } obex_profile_data_t
;
440 typedef struct _obex_last_opcode_data_t
{
441 uint32_t interface_id
;
445 /* TODO: add OBEX ConnectionId */
450 uint32_t request_in_frame
;
451 uint32_t response_in_frame
;
463 } obex_last_opcode_data_t
;
466 #define PROFILE_UNKNOWN 0
467 #define PROFILE_OPP 1
468 #define PROFILE_FTP 2
469 #define PROFILE_SYNCML 3
470 #define PROFILE_PBAP 4
471 #define PROFILE_MAP 5
472 #define PROFILE_BIP 6
473 #define PROFILE_BPP 7
474 #define PROFILE_SYNC 8
475 #define PROFILE_CTN 9
476 #define PROFILE_GPP 10
478 #define PROTO_DATA_MEDIA_TYPE 0x00
479 #define PROTO_DATA_OBEX_PROFILE 0x01
481 static const value_string profile_vals
[] = {
482 { PROFILE_UNKNOWN
, "Unknown" },
483 { PROFILE_OPP
, "OPP" },
484 { PROFILE_FTP
, "FTP" },
485 { PROFILE_SYNCML
, "SyncML" },
486 { PROFILE_PBAP
, "PBAP" },
487 { PROFILE_MAP
, "MAP" },
488 { PROFILE_BIP
, "BIP" },
489 { PROFILE_BPP
, "BPP" },
490 { PROFILE_SYNC
, "SYNC" },
491 { PROFILE_CTN
, "CTN" },
492 { PROFILE_GPP
, "GPP" },
495 static value_string_ext(profile_vals_ext
) = VALUE_STRING_EXT_INIT(profile_vals
);
498 static const ext_value_string target_vals
[] = {
499 { { 0xF9, 0xEC, 0x7B, 0xC4, 0x95, 0x3C, 0x11, 0xD2, 0x98, 0x4E, 0x52, 0x54, 0x00, 0xDC, 0x9E, 0x09 }, 16, "Folder Browsing" },
500 { { 0x79, 0x61, 0x35, 0xf0, 0xf0, 0xc5, 0x11, 0xd8, 0x09, 0x66, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Phone Book Access Profile" },
501 { { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x02, 0xEE, 0x00, 0x00, 0x02 }, 16, "SyncML" },
502 { { 0xE3, 0x3D, 0x95, 0x45, 0x83, 0x74, 0x4A, 0xD7, 0x9E, 0xC5, 0xC1, 0x6B, 0xE3, 0x1E, 0xDE, 0x8E }, 16, "Basic Imaging Profile - Push" },
503 { { 0x8E, 0xE9, 0xB3, 0xD0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Pull" },
504 { { 0x92, 0x35, 0x33, 0x50, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Advanced Printing" },
505 { { 0x94, 0x01, 0x26, 0xC0, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Automativ Archive" },
506 { { 0x94, 0x7E, 0x74, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Camera" },
507 { { 0x94, 0xC7, 0xCD, 0x20, 0x46, 0x08, 0x11, 0xD5, 0x84, 0x1A, 0x00, 0x02, 0xA5, 0x32, 0x5B, 0x4E }, 16, "Basic Imaging Profile - Remote Display" },
508 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile- Referenced Objects" },
509 { { 0x8E, 0x61, 0xF9, 0x5D, 0x1A, 0x79, 0x11, 0xD4, 0x8E, 0xA4, 0x00, 0x80, 0x5F, 0x9B, 0x98, 0x34 }, 16, "Basic Imaging Profile - Archived Objects" },
510 { { 0xbb, 0x58, 0x2b, 0x40, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Access Service" },
511 { { 0xbb, 0x58, 0x2b, 0x41, 0x42, 0x0c, 0x11, 0xdb, 0xb0, 0xde, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }, 16, "Message Access Profile - Message Notification Service" },
512 { { 0x00, 0x00, 0x11, 0x18, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Direct Printing Service" },
513 { { 0x00, 0x00, 0x11, 0x19, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reference Printing Service" },
514 { { 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" },
515 { { 0x00, 0x00, 0x11, 0x21, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Reflected UI" },
516 { { 0x00, 0x00, 0x11, 0x22, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Basic Printing" },
517 { { 0x00, 0x00, 0x11, 0x23, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, 16, "Basic Printing Profile - Printing Status" },
518 { { "IRMC-SYNC" }, 9, "Synchronization Profile" },
519 { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, NULL
},
522 /* This table must map targets from "target_vals" to profile */
523 static const int target_to_profile
[] = {
546 static const value_string version_vals
[] = {
556 static const value_string header_id_encoding_vals
[] = {
557 { 0x00, "Null terminated Unicode text, length prefixed with 2 byte Unsigned Integer" },
558 { 0x01, "Byte sequence, length prefixed with 2 byte Unsigned Integer" },
559 { 0x02, "1 byte quantity" },
560 { 0x03, "4 byte quantity (network order)" },
564 #define OBEX_CODE_VALS_CONNECT 0x00
565 #define OBEX_CODE_VALS_DISCONNECT 0x01
566 #define OBEX_CODE_VALS_PUT 0x02
567 #define OBEX_CODE_VALS_GET 0x03
568 #define OBEX_CODE_VALS_SET_PATH 0x05
569 #define OBEX_CODE_VALS_CONTINUE 0x10
570 #define OBEX_CODE_VALS_SUCCESS 0x20
571 #define OBEX_CODE_VALS_ABORT 0x7F
572 #define OBEX_CODE_VALS_MASK 0x7F
574 static const value_string code_vals
[] = {
576 { 0x01, "Disconnect" },
579 { 0x05, "Set Path" },
582 { 0x10, "Continue" },
585 { 0x22, "Accepted" },
586 { 0x23, "Non-Authoritative Information" },
587 { 0x24, "No Content" },
588 { 0x25, "Reset Content" },
589 { 0x26, "Partial Content" },
590 { 0x30, "Multiple Choices" },
591 { 0x31, "Moved Permanently" },
592 { 0x32, "Moved Temporarily" },
593 { 0x33, "See Other" },
594 { 0x34, "Not Modified" },
595 { 0x35, "Use Proxy" },
596 { 0x40, "Bad Request" },
597 { 0x41, "Unauthorised" },
598 { 0x42, "Payment Required" },
599 { 0x43, "Forbidden" },
600 { 0x44, "Not Found" },
601 { 0x45, "Method Not Allowed" },
602 { 0x46, "Not Acceptable" },
603 { 0x47, "Proxy Authentication Required" },
604 { 0x48, "Request Timeout" },
605 { 0x49, "Conflict" },
607 { 0x4b, "Length Required" },
608 { 0x4c, "Precondition Failed" },
609 { 0x4d, "Requested Entity Too Large" },
610 { 0x4e, "Requested URL Too Large" },
611 { 0x4f, "Unsupported Media Type" },
612 { 0x50, "Internal Server Error" },
613 { 0x51, "Not Implemented" },
614 { 0x52, "Bad Gateway" },
615 { 0x53, "Service Unavailable" },
616 { 0x54, "Gateway Timeout" },
617 { 0x55, "HTTP Version Not Supported" },
618 { 0x60, "Database Full" },
619 { 0x61, "Database Locked" },
620 { OBEX_CODE_VALS_ABORT
, "Abort" },
623 static value_string_ext(code_vals_ext
) = VALUE_STRING_EXT_INIT(code_vals
);
625 static const value_string header_id_meaning_vals
[] = {
631 { 0x05, "Description" },
635 { 0x09, "End Of Body" },
637 { 0x0B, "Connection Id" },
638 { 0x0C, "Application Parameters" },
639 { 0x0D, "Authentication Challenge" },
640 { 0x0E, "Authentication Response" },
642 { 0x10, "WAN UUID" },
643 { 0x11, "Object Class" },
644 { 0x12, "Session Parameter" },
645 { 0x13, "Session Sequence Number" },
647 { 0x15, "Destination Name" },
648 { 0x16, "Permissions" },
649 { 0x17, "Single Response Mode" },
650 { 0x18, "Single Response Mode Parameter" },
651 { 0x30, "User Defined" },
652 { 0x31, "User Defined" },
653 { 0x32, "User Defined" },
654 { 0x33, "User Defined" },
655 { 0x34, "User Defined" },
656 { 0x35, "User Defined" },
657 { 0x36, "User Defined" },
658 { 0x37, "User Defined" },
659 { 0x38, "User Defined" },
660 { 0x39, "User Defined" },
661 { 0x3A, "User Defined" },
662 { 0x3B, "User Defined" },
663 { 0x3C, "User Defined" },
664 { 0x3D, "User Defined" },
665 { 0x3E, "User Defined" },
666 { 0x3F, "User Defined" },
670 static const value_string header_id_vals
[] = {
671 /* 0x00 - 0x3F - Null terminated Unicode text, length prefixed with 2 byte Unsigned Integer */
673 { 0x05, "Description" },
674 { 0x15, "Destination Name" },
675 { 0x30, "User Defined" },
676 { 0x31, "User Defined" },
677 { 0x32, "User Defined" },
678 { 0x33, "User Defined" },
679 { 0x34, "User Defined" },
680 { 0x35, "User Defined" },
681 { 0x36, "User Defined" },
682 { 0x37, "User Defined" },
683 { 0x38, "User Defined" },
684 { 0x39, "User Defined" },
685 { 0x3a, "User Defined" },
686 { 0x3b, "User Defined" },
687 { 0x3c, "User Defined" },
688 { 0x3d, "User Defined" },
689 { 0x3e, "User Defined" },
690 { 0x3f, "User Defined" },
691 /* 0x40 - 0x07F - Byte sequence, length prefixed with 2 byte Unsigned Integer */
693 { 0x44, "Time (ISO8601)" },
697 { 0x49, "End Of Body" },
699 { 0x4c, "Application Parameters" },
700 { 0x4d, "Authentication Challenge" },
701 { 0x4e, "Authentication Response" },
702 { 0x50, "WAN UUID" },
703 { 0x51, "Object Class" },
704 { 0x52, "Session Parameter" },
705 /* 0x80 - 0xBF - 1 byte quantity */
706 { 0x93, "Session Sequence Number" },
708 { 0x97, "Single Response Mode" },
709 { 0x98, "Single Response Mode Parameter" },
710 /* 0xC0 - 0xFF - 4 byte quantity (network order) */
713 { 0xc4, "Time (UNIX)" },
714 { 0xcb, "Connection Id" },
716 { 0xd6, "Permissions" },
719 static value_string_ext header_id_vals_ext
= VALUE_STRING_EXT_INIT(header_id_vals
);
721 static const value_string map_application_parameters_vals
[] = {
722 { 0x01, "Max List Count" },
723 { 0x02, "Start Offset" },
724 { 0x03, "Filter Message Type" },
725 { 0x04, "Filter Period Begin" },
726 { 0x05, "End Filter PeriodEnd" },
727 { 0x06, "Filter Read Status" },
728 { 0x07, "Filter Recipient" },
729 { 0x08, "Filter Originator" },
730 { 0x09, "Filter Priority" },
731 { 0x0A, "Attachment" },
732 { 0x0B, "Transparent" },
734 { 0x0D, "New Message" },
735 { 0x0E, "Notification Status" },
736 { 0x0F, "MAS Instance ID" },
737 { 0x10, "Parameter Mask" },
738 { 0x11, "Folder Listing Size" },
739 { 0x12, "Messages Listing Size" },
740 { 0x13, "Subject Length" },
742 { 0x15, "Fraction Request" },
743 { 0x16, "Fraction Deliver" },
744 { 0x17, "Status Indicator" },
745 { 0x18, "Status Value" },
746 { 0x19, "MSE Time" },
750 static const value_string pbap_application_parameters_vals
[] = {
752 { 0x02, "Search Value" },
753 { 0x03, "Search Attribute" },
754 { 0x04, "Max List Count" },
755 { 0x05, "List Start Offset" },
758 { 0x08, "Phonebook Size" },
759 { 0x09, "New Missed Calls" },
760 { 0x0A, "Primary Version Counter" },
761 { 0x0B, "Secondary Version Counter" },
762 { 0x0C, "vCard Selector" },
763 { 0x0D, "Database Identifier" },
764 { 0x0E, "vCard Selector Operator" },
765 { 0x0F, "Reset New Missed Calls" },
766 { 0x10, "PBAP Supported Features" },
770 static const value_string bpp_application_parameters_vals
[] = {
774 { 0x04, "File Size" },
778 static const value_string bip_application_parameters_vals
[] = {
779 { 0x01, "Number of Returned Handles" },
780 { 0x02, "List Start Offset" },
781 { 0x03, "Latest Captures Images" },
782 { 0x04, "Partial File Length" },
783 { 0x05, "Partial File Start Offset" },
784 { 0x06, "Total File Size" },
785 { 0x07, "End Flag" },
786 { 0x08, "Remote Display" },
787 { 0x09, "Service ID" },
788 { 0x0A, "Store Flag" },
792 static const value_string gpp_application_parameters_vals
[] = {
793 { 0x41, "Max List Count" },
794 { 0x42, "List Start Offset" },
795 { 0x43, "Notification Status" },
796 { 0x44, "Instance ID" },
797 { 0x46, "Listing Size" },
801 static const value_string ctn_application_parameters_vals
[] = {
802 { 0x01, "Acoustic Alarm Status" },
803 { 0x02, "Attachment" },
805 { 0x04, "Filter Period Begin" },
806 { 0x05, "Filter Period End" },
807 { 0x06, "Parameter Mask" },
808 { 0x07, "Status Indicator" },
809 { 0x08, "Status Value" },
810 { 0x09, "Postpone Val" },
811 { 0x0A, "Email URI" },
812 { 0x0B, "CSE Time" },
813 { 0x0C, "Recurrent" },
814 { 0x0D, "Attach ID" },
815 { 0x0E, "Last Update" },
816 { 0x41, "Max List Count" },
817 { 0x42, "List Start Offset" },
818 { 0x43, "Notification Status" },
819 { 0x44, "Instance ID" },
820 { 0x46, "Listing Size" },
824 static const value_string bip_remote_display_vals
[] = {
825 { 0x01, "Next Image" },
826 { 0x02, "Previous Image" },
827 { 0x03, "Select Image" },
828 { 0x04, "Current Image" },
832 static const value_string pbap_order_vals
[] = {
834 { 0x01, "Alphanumeric" },
835 { 0x02, "Phonetic" },
839 static const value_string pbap_format_vals
[] = {
845 static const value_string pbap_search_attribute_vals
[] = {
852 static const value_string map_charset_vals
[] = {
858 static const value_string map_fraction_request_vals
[] = {
864 static const value_string map_fraction_deliver_vals
[] = {
870 static const value_string map_status_indicator_vals
[] = {
871 { 0x00, "Read Status" },
872 { 0x01, "Deleted Status" },
876 static const value_string authentication_challenge_tag_vals
[] = {
883 static const value_string authentication_response_tag_vals
[] = {
884 { 0x00, "Result Key" },
890 static const value_string info_charset_vals
[] = {
896 static const value_string action_vals
[] = {
899 { 0x02, "Set Permission" },
903 static const value_string single_response_mode_vals
[] = {
906 { 0x02, "Indicate" },
910 static const value_string single_response_mode_parameter_vals
[] = {
913 { 0x02, "Next and Wait" },
917 static const value_string session_tag_vals
[] = {
918 { 0x00, "Device Address" },
920 { 0x02, "Session ID" },
921 { 0x03, "Next Sequence Number" },
923 { 0x05, "Session Opcode" },
927 static const value_string session_opcode_vals
[] = {
928 { 0x00, "Create Session" },
929 { 0x01, "Close Session" },
930 { 0x02, "Suspend Session" },
931 { 0x03, "Resume Session" },
932 { 0x04, "Set Timeout" },
936 static const value_string pbap_application_parameter_data_vcard_selector_operator_vals
[] = {
942 static const value_string pbap_application_parameter_data_reset_new_missed_calls_vals
[] = {
947 static const value_string off_on_vals
[] = {
953 static const value_string no_yes_vals
[] = {
959 static const value_string ctn_application_parameter_data_attachment_vals
[] = {
962 { 0x02, "Selected" },
966 static const value_string ctn_application_parameter_data_status_indicator_vals
[] = {
968 { 0x01, "Alarm Status" },
969 { 0x02, "Send Status" },
970 { 0x03, "Deleted Status" },
974 static const value_string ctn_application_parameter_data_status_value_vals
[] = {
977 { 0x02, "Postpone" },
978 { 0x03, "Tentative" },
979 { 0x04, "Needs-action" },
980 { 0x05, "Accepted" },
981 { 0x06, "Declined" },
982 { 0x07, "Delegated" },
983 { 0x08, "Completed" },
984 { 0x09, "In-progress" },
988 static value_string_ext map_application_parameters_vals_ext
= VALUE_STRING_EXT_INIT(map_application_parameters_vals
);
989 static value_string_ext pbap_application_parameters_vals_ext
= VALUE_STRING_EXT_INIT(pbap_application_parameters_vals
);
990 static value_string_ext bpp_application_parameters_vals_ext
= VALUE_STRING_EXT_INIT(bpp_application_parameters_vals
);
991 static value_string_ext bip_application_parameters_vals_ext
= VALUE_STRING_EXT_INIT(bip_application_parameters_vals
);
993 void proto_register_obex(void);
994 void proto_reg_handoff_obex(void);
997 save_path(packet_info
*pinfo
, const char *current_path
, const char *name
,
998 bool go_up
, obex_proto_data_t
*obex_proto_data
)
1001 /* On Connect response sets "/"
1002 On SetPath sets what is needed
1004 if (!pinfo
->fd
->visited
) {
1005 obex_path_data_t
*obex_path_data
;
1006 wmem_tree_key_t key
[6];
1007 uint32_t frame_number
;
1008 const char *path
= path_unknown
;
1010 frame_number
= pinfo
->num
;
1013 key
[0].key
= &obex_proto_data
->interface_id
;
1015 key
[1].key
= &obex_proto_data
->adapter_id
;
1017 key
[2].key
= &obex_proto_data
->chandle
;
1019 key
[3].key
= &obex_proto_data
->channel
;
1021 key
[4].key
= &frame_number
;
1025 obex_path_data
= wmem_new(wmem_file_scope(), obex_path_data_t
);
1026 obex_path_data
->interface_id
= obex_proto_data
->interface_id
;
1027 obex_path_data
->adapter_id
= obex_proto_data
->adapter_id
;
1028 obex_path_data
->chandle
= obex_proto_data
->chandle
;
1029 obex_path_data
->channel
= obex_proto_data
->channel
;
1031 if (go_up
== true) {
1032 if (current_path
!= path_unknown
&& current_path
!= path_root
) {
1035 i_path
= g_strrstr(current_path
, "/");
1037 current_path
= path_unknown
;
1039 if (i_path
== current_path
)
1040 path
= current_path
= path_root
;
1042 path
= current_path
= wmem_strndup(wmem_epan_scope(), current_path
, i_path
- current_path
- 1);
1047 if (name
&& *name
== '\0')
1049 else if (name
&& current_path
== path_root
)
1050 path
= wmem_strdup_printf(wmem_file_scope(), "/%s", name
);
1052 path
= wmem_strdup_printf(wmem_file_scope(), "%s/%s", current_path
, name
);
1054 obex_path_data
->path
= path
;
1056 wmem_tree_insert32_array(obex_path
, key
, obex_path_data
);
1060 static void media_type_prompt(packet_info
*pinfo
, char* result
)
1064 value_data
= (char *) p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_MEDIA_TYPE
);
1066 snprintf(result
, MAX_DECODE_AS_PROMPT_LEN
, "Media Type %s as", (char *) value_data
);
1068 snprintf(result
, MAX_DECODE_AS_PROMPT_LEN
, "Unknown Media Type");
1071 static void *media_type_value(packet_info
*pinfo
)
1075 value_data
= (char *) p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_MEDIA_TYPE
);
1078 return (void *) value_data
;
1083 static void obex_profile_prompt(packet_info
*pinfo
, char* result
)
1085 uint8_t *value_data
;
1087 value_data
= (uint8_t *) p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_OBEX_PROFILE
);
1089 snprintf(result
, MAX_DECODE_AS_PROMPT_LEN
, "OBEX Profile 0x%04x as", (unsigned) *value_data
);
1091 snprintf(result
, MAX_DECODE_AS_PROMPT_LEN
, "Unknown OBEX Profile");
1094 static void *obex_profile_value(packet_info
*pinfo
)
1096 uint8_t *value_data
;
1098 value_data
= (uint8_t *) p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_OBEX_PROFILE
);
1101 return GUINT_TO_POINTER((unsigned long)*value_data
);
1107 is_ascii_str(const uint8_t *str
, int length
)
1111 if ((length
< 1) || (str
[length
-1] != '\0'))
1114 for(i
=0; i
<length
-1; i
++) {
1115 if ((str
[i
] < 0x20) && (str
[i
] != 0x0a)) /* not strict ascii */
1126 dissect_obex_application_parameter_raw(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
1128 proto_item
*parameter_item
;
1129 proto_tree
*parameter_tree
;
1130 uint8_t parameter_id
;
1132 int parameters_length
;
1133 int parameter_length
;
1135 parameters_length
= tvb_reported_length(tvb
);
1137 while (parameters_length
> 0) {
1138 parameter_id
= tvb_get_uint8(tvb
, offset
);
1139 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
,
1140 tvb_captured_length_remaining(tvb
, offset
), "Parameter: 0x%02x", parameter_id
);
1141 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1143 proto_tree_add_item(parameter_tree
, hf_application_parameter_id
, tvb
, offset
,
1147 proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
,
1149 parameter_length
= tvb_get_uint8(tvb
, offset
);
1150 proto_item_set_len(parameter_item
, parameter_length
+ 2);
1153 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
,
1154 parameter_length
, ENC_NA
);
1156 parameters_length
-= 2 + parameter_length
;
1157 offset
+= parameter_length
;
1164 dissect_obex_application_parameter_bt_bpp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1167 proto_item
*parameter_item
;
1168 proto_tree
*parameter_tree
;
1169 uint8_t parameter_id
;
1171 int parameters_length
;
1172 int parameter_length
;
1174 parameters_length
= tvb_reported_length(tvb
);
1176 while (parameters_length
> 0) {
1177 parameter_id
= tvb_get_uint8(tvb
, offset
);
1178 parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1180 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
, parameter_length
+ 2,
1181 "Parameter: %s", val_to_str_const(parameter_id
,
1182 bpp_application_parameters_vals
, "Unknown"));
1183 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1185 proto_tree_add_item(parameter_tree
, hf_bpp_application_parameter_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1188 item
= proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1191 if (parameter_length
!= 4) {
1192 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1193 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1194 "According to the specification this parameter length should be 4, but there is %i", parameter_length
);
1195 } else switch (parameter_id
) {
1197 proto_tree_add_item(parameter_tree
, hf_bpp_application_parameter_data_offset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1200 proto_tree_add_item(parameter_tree
, hf_bpp_application_parameter_data_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1203 proto_tree_add_item(parameter_tree
, hf_bpp_application_parameter_data_job_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1206 proto_tree_add_item(parameter_tree
, hf_bpp_application_parameter_data_file_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1209 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1212 parameters_length
-= 2 + parameter_length
;
1213 offset
+= parameter_length
;
1220 dissect_obex_application_parameter_bt_bip(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1223 proto_item
*parameter_item
;
1224 proto_tree
*parameter_tree
;
1225 uint8_t parameter_id
;
1227 int parameters_length
;
1228 int parameter_length
;
1229 static int required_length_map
[] = {0, 2, 2, 1, 4, 4, 4, 1, 1, 16, 1};
1231 parameters_length
= tvb_reported_length(tvb
);
1233 while (parameters_length
> 0) {
1234 parameter_id
= tvb_get_uint8(tvb
, offset
);
1235 parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1237 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
, parameter_length
+ 2,
1238 "Parameter: %s", val_to_str_const(parameter_id
,
1239 bip_application_parameters_vals
, "Unknown"));
1240 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1242 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1245 item
= proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1248 if (parameter_id
< array_length(required_length_map
) &&
1249 required_length_map
[parameter_id
] != parameter_length
) {
1250 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1251 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1252 "According to the specification this parameter length should be %i, but there is %i",
1253 required_length_map
[parameter_id
], parameter_length
);
1254 } else switch (parameter_id
) {
1256 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
);
1259 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_list_start_offset
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1262 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_latest_captured_images
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1265 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_partial_file_length
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1268 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
);
1271 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_total_file_size
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1274 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_end_flag
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1277 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_remote_display
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1280 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_service_id
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1283 proto_tree_add_item(parameter_tree
, hf_bip_application_parameter_data_store_flag
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1286 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1289 parameters_length
-= 2 + parameter_length
;
1290 offset
+= parameter_length
;
1297 dissect_obex_application_parameter_bt_pbap(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1300 proto_item
*parameter_item
;
1301 proto_tree
*parameter_tree
;
1302 uint8_t parameter_id
;
1304 int parameters_length
;
1305 int parameter_length
;
1306 static int required_length_map
[] = {0, 1, -1, 1, 2, 2, 8, 1, 2, 1, 16, 16, 8, 16, 1, 1};
1308 parameters_length
= tvb_reported_length(tvb
);
1310 while (parameters_length
> 0) {
1311 parameter_id
= tvb_get_uint8(tvb
, offset
);
1312 parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1314 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
, parameter_length
+ 2,
1315 "Parameter: %s", val_to_str_const(parameter_id
,
1316 pbap_application_parameters_vals
, "Unknown"));
1317 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1319 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1322 item
= proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1325 if (parameter_id
< array_length(required_length_map
) &&
1326 required_length_map
[parameter_id
] != -1 &&
1327 required_length_map
[parameter_id
] != parameter_length
) {
1328 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1329 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1330 "According to the specification this parameter length should be %i, but there is %i",
1331 required_length_map
[parameter_id
], parameter_length
);
1332 } else switch (parameter_id
) {
1333 case 0x01: /* Order */
1334 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_order
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1336 case 0x02: /* Search Value */
1337 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_search_value
, tvb
, offset
, parameter_length
, ENC_ASCII
| ENC_NA
);
1339 case 0x03: /* Search Attribute */
1340 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_search_attribute
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1342 case 0x04: /* Max List Count */
1343 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_max_list_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1345 case 0x05: /* List Start Offset */
1346 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_list_start_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1348 case 0x06: /* Filter */
1349 proto_tree_add_bitmask(parameter_tree
, tvb
, offset
+ 0, hf_pbap_application_parameter_data_filter
, ett_obex_filter
, hfx_pbap_application_parameter_data_filter_1
, ENC_BIG_ENDIAN
);
1350 proto_tree_add_bitmask(parameter_tree
, tvb
, offset
+ 4, hf_pbap_application_parameter_data_filter
, ett_obex_filter
, hfx_pbap_application_parameter_data_filter_0
, ENC_BIG_ENDIAN
);
1352 case 0x07: /* Format */
1353 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_format
, tvb
, offset
, 1, ENC_NA
);
1355 case 0x08: /* Phonebook Size */
1356 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_phonebook_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1358 case 0x09: /* New Missed Calls */
1359 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_new_missed_calls
, tvb
, offset
, 1, ENC_NA
);
1361 case 0x0A: /* Primary Version Counter */
1362 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_primary_version_counter
, tvb
, offset
, 16, ENC_NA
);
1364 case 0x0B: /* Secondary Version Counter */
1365 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_secondary_version_counter
, tvb
, offset
, 16, ENC_NA
);
1367 case 0x0C: /* vCard Selector */
1368 proto_tree_add_bitmask(parameter_tree
, tvb
, offset
+ 0, hf_pbap_application_parameter_vcard_selector
, ett_obex_filter
, hfx_pbap_application_parameter_data_filter_1
, ENC_BIG_ENDIAN
);
1369 proto_tree_add_bitmask(parameter_tree
, tvb
, offset
+ 4, hf_pbap_application_parameter_vcard_selector
, ett_obex_filter
, hfx_pbap_application_parameter_data_filter_0
, ENC_BIG_ENDIAN
);
1371 case 0x0D: /* Database Identifier */
1372 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_database_identifier
, tvb
, offset
, 16, ENC_NA
);
1374 case 0x0E: /* vCard Selector Operator */
1375 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_vcard_selector_operator
, tvb
, offset
, 1, ENC_NA
);
1377 case 0x0F: /* Reset New Missed Calls */
1378 proto_tree_add_item(parameter_tree
, hf_pbap_application_parameter_data_reset_new_missed_calls
, tvb
, offset
, 1, ENC_NA
);
1380 case 0x10: /* PBAP Supported Features */
1381 proto_tree_add_bitmask(parameter_tree
, tvb
, offset
, hf_pbap_application_parameter_data_supported_features
, ett_obex_parameter
, hfx_pbap_application_parameter_data_supported_features
, ENC_BIG_ENDIAN
);
1384 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1387 parameters_length
-= 2 + parameter_length
;
1388 offset
+= parameter_length
;
1395 dissect_obex_application_parameter_bt_map(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1398 proto_item
*parameter_item
;
1399 proto_tree
*parameter_tree
;
1400 uint8_t parameter_id
;
1402 int parameters_length
;
1403 int parameter_length
;
1404 static int required_length_map
[] = {0, 2, 2, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 4, 2, 2, 1, 1, 1, 1, 1, 1, -1};
1406 parameters_length
= tvb_reported_length(tvb
);
1408 while (parameters_length
> 0) {
1409 parameter_id
= tvb_get_uint8(tvb
, offset
);
1410 parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1412 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
, parameter_length
+ 2,
1413 "Parameter: %s", val_to_str_const(parameter_id
,
1414 map_application_parameters_vals
, "Unknown"));
1415 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1417 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1420 item
= proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1423 if (parameter_id
< array_length(required_length_map
) &&
1424 required_length_map
[parameter_id
] != -1 &&
1425 required_length_map
[parameter_id
] != parameter_length
) {
1426 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1427 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1428 "According to the specification this parameter length should be %i, but there is %i",
1429 required_length_map
[parameter_id
], parameter_length
);
1430 } else switch (parameter_id
) {
1432 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_max_list_count
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1435 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_start_offset
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1438 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
);
1439 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
);
1440 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
);
1441 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
);
1442 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
);
1445 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_filter_period_begin
, tvb
, offset
, parameter_length
, ENC_ASCII
| ENC_NA
);
1448 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_filter_period_end
, tvb
, offset
, parameter_length
, ENC_ASCII
| ENC_NA
);
1451 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
);
1452 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
);
1453 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
);
1456 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_filter_recipient
, tvb
, offset
, parameter_length
, ENC_ASCII
| ENC_NA
);
1459 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_filter_originator
, tvb
, offset
, parameter_length
, ENC_ASCII
| ENC_NA
);
1462 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
);
1463 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
);
1464 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
);
1467 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1468 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_attachment
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1471 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1472 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_transparent
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1475 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1476 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_retry
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1479 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1480 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_new_message
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1483 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1484 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_notification_status
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1487 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_mas_instance_id
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1490 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_reserved
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1491 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
);
1492 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_protected
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1493 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_sent
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1494 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_read
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1495 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_priority
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1496 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
);
1497 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_text
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1498 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
);
1499 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_size
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1500 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_type
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1501 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
);
1502 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
);
1503 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
);
1504 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
);
1505 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_datetime
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1506 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_parameter_mask_subject
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1510 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_folder_listing_size
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1513 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_messages_listing_size
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1516 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_subject_length
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1519 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1520 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_charset
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1523 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1524 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_fraction_request
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1527 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1528 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_fraction_deliver
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1531 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1532 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_status_indicator
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1535 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_reserved_7
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1536 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_status_value
, tvb
, offset
, required_length_map
[parameter_id
], ENC_BIG_ENDIAN
);
1539 proto_tree_add_item(parameter_tree
, hf_map_application_parameter_data_mse_time
, tvb
, offset
, parameter_length
, ENC_ASCII
| ENC_NA
);
1542 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1545 parameters_length
-= 2 + parameter_length
;
1546 offset
+= parameter_length
;
1553 dissect_obex_application_parameter_bt_gpp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1556 proto_item
*parameter_item
;
1557 proto_tree
*parameter_tree
;
1558 uint8_t parameter_id
;
1560 int parameters_length
;
1561 int parameter_length
;
1562 static int required_length_map
[] = {2, 2, 1, 1, 0, 2};
1564 parameters_length
= tvb_reported_length(tvb
);
1566 while (parameters_length
> 0) {
1567 parameter_id
= tvb_get_uint8(tvb
, offset
);
1568 parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1570 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
, parameter_length
+ 2,
1571 "Parameter: %s", val_to_str_const(parameter_id
,
1572 gpp_application_parameters_vals
, "Unknown"));
1573 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1575 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1578 item
= proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1581 if (parameter_id
>= 0x41 && (uint8_t)(parameter_id
- 0x41) < array_length(required_length_map
) &&
1582 required_length_map
[parameter_id
- 0x41] != -1 &&
1583 required_length_map
[parameter_id
- 0x41] != parameter_length
) {
1584 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1585 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1586 "According to the specification this parameter length should be %i, but there is %i",
1587 required_length_map
[parameter_id
- 0x41], parameter_length
);
1588 } else switch (parameter_id
) {
1589 case 0x41: /* Max List Count */
1590 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_max_list_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1592 case 0x42: /* List Start Offset */
1593 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_list_start_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1595 case 0x43: /* Notification Status */
1596 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_reserved_7
, tvb
, offset
, 1, ENC_NA
);
1597 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_notification_status
, tvb
, offset
, 1, ENC_NA
);
1599 case 0x44: /* Instance ID */
1600 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_instance_id
, tvb
, offset
, 1, ENC_NA
);
1602 case 0x46: /* Listing Size */
1603 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_listing_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1606 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1609 parameters_length
-= 2 + parameter_length
;
1610 offset
+= parameter_length
;
1617 dissect_obex_application_parameter_bt_ctn(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
1620 proto_item
*parameter_item
;
1621 proto_tree
*parameter_tree
;
1622 uint8_t parameter_id
;
1624 int parameters_length
;
1625 int parameter_length
;
1626 static int required_length_map
[] = {0, 1, 1, 1, -1, -1, 4, 1, 1, 4, -1, -1, 1, 1, -1};
1627 static int required_length_map_gpp
[] = {2, 2, 1, 1, -1, 2};
1629 parameters_length
= tvb_reported_length(tvb
);
1631 while (parameters_length
> 0) {
1632 parameter_id
= tvb_get_uint8(tvb
, offset
);
1633 parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1635 parameter_item
= proto_tree_add_none_format(tree
, hf_application_parameter
, tvb
, offset
, parameter_length
+ 2,
1636 "Parameter: %s", val_to_str_const(parameter_id
,
1637 ctn_application_parameters_vals
, "Unknown"));
1638 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_application_parameters
);
1640 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1643 item
= proto_tree_add_item(parameter_tree
, hf_application_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1646 if ((parameter_id
< 0x41) && (parameter_id
< array_length(required_length_map
)) &&
1647 required_length_map
[parameter_id
] != -1 &&
1648 required_length_map
[parameter_id
] != parameter_length
) {
1650 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1651 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1652 "According to the specification this parameter length should be %i, but there is %i",
1653 required_length_map
[parameter_id
], parameter_length
);
1654 } else if ((parameter_id
>= 0x41) && ((uint8_t)(parameter_id
- 0x41) < array_length(required_length_map_gpp
)) &&
1655 required_length_map
[parameter_id
- 0x41] != -1 &&
1656 required_length_map
[parameter_id
- 0x41] != parameter_length
) {
1658 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1659 expert_add_info_format(pinfo
, item
, &ei_application_parameter_length_bad
,
1660 "According to the specification this parameter length should be %i, but there is %i",
1661 required_length_map_gpp
[parameter_id
- 0x41], parameter_length
);
1662 } else switch (parameter_id
) {
1663 case 0x41: /* Max List Count */
1664 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_max_list_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1666 case 0x42: /* List Start Offset */
1667 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_list_start_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1669 case 0x43: /* Notification Status */
1670 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_reserved_7
, tvb
, offset
, 1, ENC_NA
);
1671 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_notification_status
, tvb
, offset
, 1, ENC_NA
);
1673 case 0x44: /* Instance ID */
1674 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_instance_id
, tvb
, offset
, 1, ENC_NA
);
1676 case 0x46: /* Listing Size */
1677 proto_tree_add_item(parameter_tree
, hf_gpp_application_parameter_data_listing_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1679 case 0x01: /* Acoustic Alarm Status */
1680 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_acoustic_alarm_status
, tvb
, offset
, 1, ENC_NA
);
1682 case 0x02: /* Attachment */
1683 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_attachment
, tvb
, offset
, 1, ENC_NA
);
1685 case 0x03: /* Send */
1686 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_send
, tvb
, offset
, 1, ENC_NA
);
1688 case 0x04: /* Filter Period Begin */
1689 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_filter_period_begin
, tvb
, offset
, parameter_length
, ENC_NA
| ENC_ASCII
);
1691 case 0x05: /* Filter Period End */
1692 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_filter_period_end
, tvb
, offset
, parameter_length
, ENC_NA
| ENC_ASCII
);
1694 case 0x06: /* Parameter Mask */
1695 proto_tree_add_bitmask(parameter_tree
, tvb
, offset
, hf_ctn_application_parameter_data_parameter_mask
, ett_obex_filter
, hfx_ctn_application_parameter_data_parameter_mask
, ENC_BIG_ENDIAN
);
1697 case 0x07: /* Status Indicator */
1698 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_status_indicator
, tvb
, offset
, 1, ENC_NA
);
1700 case 0x08: /* Status Value */
1701 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_status_value
, tvb
, offset
, 1, ENC_NA
);
1703 case 0x09: /* Postpone Val */
1704 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_postpone_val
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1706 case 0x0A: /* Email URI */
1707 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_email_uri
, tvb
, offset
, parameter_length
, ENC_NA
| ENC_ASCII
);
1709 case 0x0B: /* CSE Time */
1710 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_cse_time
, tvb
, offset
, parameter_length
, ENC_NA
| ENC_ASCII
);
1712 case 0x0C: /* Recurrent */
1713 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_recurrent
, tvb
, offset
, 1, ENC_NA
);
1715 case 0x0D: /* Attach ID */
1716 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_attach_id
, tvb
, offset
, 1, ENC_NA
);
1718 case 0x0E: /* Last Update */
1719 proto_tree_add_item(parameter_tree
, hf_ctn_application_parameter_data_last_update
, tvb
, offset
, parameter_length
, ENC_NA
| ENC_ASCII
);
1722 proto_tree_add_item(parameter_tree
, hf_application_parameter_data
, tvb
, offset
, parameter_length
, ENC_NA
);
1725 parameters_length
-= 2 + parameter_length
;
1726 offset
+= parameter_length
;
1733 dissect_headers(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
1734 int profile
, obex_last_opcode_data_t
*obex_last_opcode_data
,
1735 obex_proto_data_t
*obex_proto_data
)
1737 proto_tree
*hdrs_tree
= NULL
;
1738 proto_tree
*hdr_tree
= NULL
;
1739 proto_item
*hdr
= NULL
;
1740 proto_item
*handle_item
;
1743 int item_length
= 0;
1744 int value_length
= 0;
1747 uint32_t frame_number
;
1751 if (tvb_reported_length_remaining(tvb
, offset
) > 0) {
1753 hdrs
= proto_tree_add_item(tree
, hf_headers
, tvb
, offset
, tvb_reported_length_remaining(tvb
, offset
), ENC_NA
);
1754 hdrs_tree
= proto_item_add_subtree(hdrs
, ett_obex_hdrs
);
1760 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
1761 hdr_id
= tvb_get_uint8(tvb
, offset
);
1763 switch(0xC0 & hdr_id
)
1765 case 0x00: /* null terminated unicode */
1766 item_length
= tvb_get_ntohs(tvb
, offset
+ 1);
1767 value_length
= item_length
- 3;
1769 case 0x40: /* byte sequence */
1770 item_length
= tvb_get_ntohs(tvb
, offset
+ 1);
1771 value_length
= item_length
- 3;
1773 case 0x80: /* 1 byte */
1774 item_length
= 1 + 1;
1777 case 0xc0: /* 4 bytes */
1778 item_length
= 1 + 4;
1783 hdr
= proto_tree_add_none_format(hdrs_tree
, hf_header
, tvb
, offset
, item_length
, "%s",
1784 val_to_str_ext_const(hdr_id
, &header_id_vals_ext
, "Unknown"));
1785 hdr_tree
= proto_item_add_subtree(hdr
, ett_obex_hdr
);
1787 proto_tree_add_bitmask_with_flags(hdr_tree
, tvb
, offset
, hf_hdr_id
, ett_obex_hdr_id
, hfx_hdr_id
, ENC_NA
, BMT_NO_APPEND
);
1791 switch(0xC0 & hdr_id
)
1793 case 0x00: /* null terminated unicode */
1794 proto_tree_add_item(hdr_tree
, hf_hdr_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1798 case 0x01: /* Name */
1799 proto_tree_add_item(hdr_tree
, hf_name
, tvb
, offset
, value_length
, ENC_UCS_2
| ENC_BIG_ENDIAN
);
1800 if (!pinfo
->fd
->visited
&& obex_last_opcode_data
) {
1801 if (obex_last_opcode_data
->code
== OBEX_CODE_VALS_SET_PATH
)
1802 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
);
1803 else if (obex_last_opcode_data
->code
== OBEX_CODE_VALS_GET
|| obex_last_opcode_data
->code
== OBEX_CODE_VALS_PUT
)
1804 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
);
1808 proto_tree_add_item(hdr_tree
, hf_hdr_val_unicode
, tvb
, offset
, value_length
, ENC_UCS_2
| ENC_BIG_ENDIAN
);
1810 str
= tvb_get_string_enc(pinfo
->pool
, tvb
, offset
, value_length
, ENC_UCS_2
| ENC_BIG_ENDIAN
);
1811 proto_item_append_text(hdr_tree
, ": \"%s\"", str
);
1813 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " \"%s\"", str
);
1814 offset
+= value_length
;
1817 case 0x40: /* byte sequence */
1818 proto_tree_add_item(hdr_tree
, hf_hdr_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1822 case 0x4c: /* Application Parameters */
1823 next_tvb
= tvb_new_subset_length(tvb
, offset
, value_length
);
1824 if (!(new_offset
= dissector_try_uint_new(obex_profile_table
, profile
, next_tvb
, pinfo
, hdr_tree
, true, NULL
))) {
1825 new_offset
= call_dissector(raw_application_parameters_handle
, next_tvb
, pinfo
, hdr_tree
);
1827 offset
+= new_offset
;
1830 case 0x4d: /* Authentication Challenge */
1831 while (value_length
) {
1832 uint8_t parameter_id
;
1833 uint8_t sub_parameter_length
;
1834 proto_item
*parameter_item
;
1835 proto_tree
*parameter_tree
;
1837 parameter_id
= tvb_get_uint8(tvb
, offset
);
1838 sub_parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1840 parameter_item
= proto_tree_add_none_format(hdr_tree
, hf_authentication_parameter
, tvb
, offset
,
1841 2 + sub_parameter_length
, "Tag: %s", val_to_str_const(parameter_id
,
1842 authentication_challenge_tag_vals
, "Unknown"));
1843 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_authentication_parameters
);
1845 proto_tree_add_item(parameter_tree
, hf_authentication_challenge_tag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1846 tag
= tvb_get_uint8(tvb
, offset
);
1849 proto_tree_add_item(parameter_tree
, hf_authentication_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1854 proto_tree_add_item(parameter_tree
, hf_authentication_key
, tvb
, offset
, 16, ENC_NA
);
1858 proto_tree_add_item(parameter_tree
, hf_authentication_option_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1859 proto_tree_add_item(parameter_tree
, hf_authentication_option_read_only
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1860 proto_tree_add_item(parameter_tree
, hf_authentication_option_user_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1864 proto_tree_add_item(parameter_tree
, hf_authentication_info_charset
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1866 proto_tree_add_item(parameter_tree
, hf_authentication_info
, tvb
, offset
, sub_parameter_length
- 1, ENC_ASCII
);
1867 offset
+= sub_parameter_length
- 1;
1870 proto_tree_add_item(parameter_tree
, hf_authentication_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
1871 offset
+= sub_parameter_length
;
1874 value_length
-= 2 + sub_parameter_length
;
1877 case 0x4e: /* Authentication Response */
1878 while (value_length
) {
1879 uint8_t parameter_id
;
1880 uint8_t sub_parameter_length
;
1881 proto_item
*parameter_item
;
1882 proto_tree
*parameter_tree
;
1884 parameter_id
= tvb_get_uint8(tvb
, offset
);
1885 sub_parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
1887 parameter_item
= proto_tree_add_none_format(hdr_tree
, hf_authentication_parameter
, tvb
, offset
,
1888 2 + sub_parameter_length
, "Tag: %s", val_to_str_const(parameter_id
,
1889 authentication_response_tag_vals
, "Unknown"));
1890 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_authentication_parameters
);
1892 proto_tree_add_item(parameter_tree
, hf_authentication_response_tag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1893 tag
= tvb_get_uint8(tvb
, offset
);
1896 proto_tree_add_item(parameter_tree
, hf_authentication_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1897 sub_parameter_length
= tvb_get_uint8(tvb
, offset
);
1902 proto_tree_add_item(parameter_tree
, hf_authentication_result_key
, tvb
, offset
, 16, ENC_NA
);
1906 proto_tree_add_item(parameter_tree
, hf_authentication_user_id
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
1907 offset
+= sub_parameter_length
;
1910 proto_tree_add_item(parameter_tree
, hf_authentication_key
, tvb
, offset
, 16, ENC_NA
);
1914 proto_tree_add_item(parameter_tree
, hf_authentication_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
1915 offset
+= sub_parameter_length
;
1920 value_length
-= 2 + sub_parameter_length
;
1923 case 0x42: /* Type */
1924 proto_tree_add_item(hdr_tree
, hf_type
, tvb
, offset
, value_length
, ENC_ASCII
| ENC_NA
);
1925 proto_item_append_text(hdr_tree
, ": \"%s\"", tvb_get_string_enc(pinfo
->pool
, tvb
, offset
, value_length
, ENC_ASCII
));
1926 if (!pinfo
->fd
->visited
&& obex_last_opcode_data
&& (obex_last_opcode_data
->code
== OBEX_CODE_VALS_GET
|| obex_last_opcode_data
->code
== OBEX_CODE_VALS_PUT
)) {
1927 obex_last_opcode_data
->data
.get_put
.type
= tvb_get_string_enc(wmem_file_scope(), tvb
, offset
, value_length
, ENC_ASCII
| ENC_NA
);
1929 if (p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_MEDIA_TYPE
) == NULL
) {
1930 uint8_t *value_data
;
1932 value_data
= tvb_get_string_enc(wmem_file_scope(), tvb
, offset
, value_length
, ENC_ASCII
| ENC_NA
);
1934 p_add_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_MEDIA_TYPE
, value_data
);
1936 offset
+= value_length
;
1939 case 0x44: /* Time (ISO8601) */
1941 const uint8_t* time_str
;
1942 proto_tree_add_item_ret_string(hdr_tree
, hf_time_iso8601
, tvb
, offset
, value_length
, ENC_ASCII
| ENC_NA
, pinfo
->pool
, &time_str
);
1943 proto_item_append_text(hdr_tree
, ": \"%s\"", time_str
);
1945 offset
+= value_length
;
1948 case 0x48: /* Body */
1949 case 0x49: /* End Of Body */
1950 proto_tree_add_item(hdr_tree
, hf_hdr_val_byte_seq
, tvb
, offset
, value_length
, ENC_NA
);
1951 next_tvb
= tvb_new_subset_length(tvb
, offset
, value_length
);
1953 if (value_length
> 0 && obex_last_opcode_data
&&
1954 (obex_last_opcode_data
->code
== OBEX_CODE_VALS_GET
|| obex_last_opcode_data
->code
== OBEX_CODE_VALS_PUT
) &&
1955 p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_MEDIA_TYPE
) == NULL
) {
1956 uint8_t *value_data
;
1958 value_data
= obex_last_opcode_data
->data
.get_put
.type
;
1960 p_add_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_MEDIA_TYPE
, value_data
);
1962 if (value_length
> 0 && obex_last_opcode_data
&&
1963 (obex_last_opcode_data
->code
== OBEX_CODE_VALS_GET
|| obex_last_opcode_data
->code
== OBEX_CODE_VALS_PUT
) &&
1964 obex_last_opcode_data
->data
.get_put
.type
&&
1965 dissector_try_string(media_type_dissector_table
, obex_last_opcode_data
->data
.get_put
.type
, next_tvb
, pinfo
, tree
, NULL
) > 0) {
1966 offset
+= value_length
;
1968 if (!tvb_strneql(tvb
, offset
, "<?xml", 5))
1970 call_dissector(xml_handle
, next_tvb
, pinfo
, tree
);
1971 } else if (is_ascii_str(tvb_get_ptr(tvb
, offset
, value_length
), value_length
)) {
1972 proto_item_append_text(hdr_tree
, ": \"%s\"", tvb_get_string_enc(pinfo
->pool
, tvb
, offset
, value_length
, ENC_ASCII
));
1973 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " \"%s\"", tvb_get_string_enc(pinfo
->pool
, tvb
, offset
, value_length
, ENC_ASCII
));
1975 offset
+= value_length
;
1979 case 0x46: /* Target */
1980 case 0x4a: /* Who */
1981 handle_item
= proto_tree_add_item(hdr_tree
, hf_hdr_val_byte_seq
, tvb
, offset
, value_length
, ENC_NA
);
1983 if (value_length
== 16) for (i
= 0; target_vals
[i
].strptr
!= NULL
; i
++) {
1984 if (tvb_memeql(tvb
, offset
, target_vals
[i
].value
, target_vals
[i
].length
) == 0) {
1985 proto_item_append_text(handle_item
, ": %s", target_vals
[i
].strptr
);
1986 proto_item_append_text(hdr_tree
, ": %s", target_vals
[i
].strptr
);
1988 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - %s", target_vals
[i
].strptr
);
1989 if (!pinfo
->fd
->visited
) {
1990 obex_profile_data_t
*obex_profile_data
;
1992 wmem_tree_key_t key
[6];
1993 frame_number
= pinfo
->num
;
1996 key
[0].key
= &obex_proto_data
->interface_id
;
1998 key
[1].key
= &obex_proto_data
->adapter_id
;
2000 key
[2].key
= &obex_proto_data
->chandle
;
2002 key
[3].key
= &obex_proto_data
->channel
;
2004 key
[4].key
= &frame_number
;
2008 obex_profile_data
= wmem_new(wmem_file_scope(), obex_profile_data_t
);
2009 obex_profile_data
->interface_id
= obex_proto_data
->interface_id
;
2010 obex_profile_data
->adapter_id
= obex_proto_data
->adapter_id
;
2011 obex_profile_data
->chandle
= obex_proto_data
->chandle
;
2012 obex_profile_data
->channel
= obex_proto_data
->channel
;
2013 obex_profile_data
->profile
= target_to_profile
[i
];
2015 wmem_tree_insert32_array(obex_profile
, key
, obex_profile_data
);
2019 offset
+= value_length
;
2022 case 0x47: /* HTTP */ {
2023 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
2025 call_dissector(http_handle
, next_tvb
, pinfo
, hdr_tree
);
2029 case 0x50: /* WAN UUID */
2030 if (value_length
== 2) {
2031 proto_tree_add_item(hdr_tree
, hf_wan_uuid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2034 proto_tree_add_item(hdr_tree
, hf_hdr_val_byte_seq
, tvb
, offset
, value_length
, ENC_NA
);
2035 offset
+= value_length
;
2039 case 0x51: /* Object Class */
2041 const uint8_t* obj_str
;
2042 proto_tree_add_item_ret_string(hdr_tree
, hf_object_class
, tvb
, offset
, value_length
, ENC_ASCII
| ENC_NA
, pinfo
->pool
, &obj_str
);
2043 proto_item_append_text(hdr_tree
, ": \"%s\"", obj_str
);
2045 offset
+= value_length
;
2048 case 0x52: /* Session Parameter */
2049 while (value_length
) {
2050 uint8_t parameter_id
;
2051 uint8_t sub_parameter_length
;
2052 proto_item
*parameter_item
;
2053 proto_tree
*parameter_tree
;
2055 parameter_id
= tvb_get_uint8(tvb
, offset
);
2056 sub_parameter_length
= tvb_get_uint8(tvb
, offset
+ 1);
2058 parameter_item
= proto_tree_add_none_format(hdr_tree
, hf_session_parameter
, tvb
, offset
,
2059 2 + sub_parameter_length
, "Tag: %s", val_to_str_const(parameter_id
,
2060 session_tag_vals
, "Unknown"));
2061 parameter_tree
= proto_item_add_subtree(parameter_item
, ett_obex_session_parameters
);
2063 proto_tree_add_item(parameter_tree
, hf_session_parameter_tag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2064 tag
= tvb_get_uint8(tvb
, offset
);
2067 proto_tree_add_item(parameter_tree
, hf_session_parameter_length
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2068 sub_parameter_length
= tvb_get_uint8(tvb
, offset
);
2072 case 0x00: /* Device Address */
2073 if (sub_parameter_length
== 6) {
2074 offset
= dissect_bd_addr(hf_sender_bd_addr
, pinfo
, parameter_tree
, tvb
, offset
, false, obex_proto_data
->interface_id
, obex_proto_data
->adapter_id
, NULL
);
2076 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2078 offset
+= sub_parameter_length
;
2082 case 0x01: /* Nonce */
2083 if (sub_parameter_length
>= 4 && sub_parameter_length
<= 16) {
2084 proto_tree_add_item(parameter_tree
, hf_session_parameter_nonce
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2086 offset
+= sub_parameter_length
;
2088 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2090 offset
+= sub_parameter_length
;
2094 case 0x02: /* Session ID */
2095 if (sub_parameter_length
== 16) {
2096 proto_tree_add_item(parameter_tree
, hf_session_parameter_session_id
, tvb
, offset
, 16, ENC_NA
);
2100 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2102 offset
+= sub_parameter_length
;
2106 case 0x03: /* Next Sequence Number */
2107 if (sub_parameter_length
== 1) {
2108 proto_tree_add_item(parameter_tree
, hf_session_parameter_next_sequence_number
, tvb
, offset
, 1, ENC_NA
);
2112 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2114 offset
+= sub_parameter_length
;
2118 case 0x04: /* Timeout */
2119 if (sub_parameter_length
== 4) {
2120 proto_tree_add_item(parameter_tree
, hf_session_parameter_timeout
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2124 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2126 offset
+= sub_parameter_length
;
2130 case 0x05: /* Session Opcode */
2131 if (sub_parameter_length
== 1) {
2132 proto_tree_add_item(parameter_tree
, hf_session_parameter_opcode
, tvb
, offset
, 1, ENC_NA
);
2136 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2138 offset
+= sub_parameter_length
;
2143 proto_tree_add_item(parameter_tree
, hf_session_parameter_data
, tvb
, offset
, sub_parameter_length
, ENC_NA
);
2144 offset
+= sub_parameter_length
;
2149 value_length
-= 2 + sub_parameter_length
;
2153 proto_tree_add_item(hdr_tree
, hf_hdr_val_byte_seq
, tvb
, offset
, value_length
, ENC_NA
);
2154 offset
+= value_length
;
2158 case 0x80: /* 1 byte */
2159 value
= tvb_get_uint8(tvb
, offset
);
2162 case 0x94: /* Action */
2163 proto_tree_add_item(hdr_tree
, hf_hdr_val_action
, tvb
, offset
, 1, ENC_NA
);
2164 proto_item_append_text(hdr_tree
, ": %s", val_to_str_const(value
, action_vals
, "Unknown"));
2167 case 0x97: /* Single Response Mode */
2168 proto_tree_add_item(hdr_tree
, hf_hdr_val_single_response_mode
, tvb
, offset
, 1, ENC_NA
);
2169 proto_item_append_text(hdr_tree
, ": %s", val_to_str_const(value
, single_response_mode_vals
, "Unknown"));
2172 case 0x98: /* Single Response Mode Parameter */
2173 proto_tree_add_item(hdr_tree
, hf_hdr_val_single_response_mode_parameter
, tvb
, offset
, 1, ENC_NA
);
2174 proto_item_append_text(hdr_tree
, ": %s", val_to_str_const(value
, single_response_mode_parameter_vals
, "Unknown"));
2177 case 0x93: /* Session Sequence Number */
2179 proto_tree_add_item(hdr_tree
, hf_hdr_val_byte
, tvb
, offset
, 1, ENC_NA
);
2180 proto_item_append_text(hdr_tree
, ": %i", value
);
2186 case 0xC0: /* 4 bytes */
2188 case 0xC0: /* Count */
2189 proto_item_append_text(hdr_tree
, ": %i", tvb_get_ntohl(tvb
, offset
));
2190 proto_tree_add_item(hdr_tree
, hf_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2193 case 0xC3: /* Length */
2194 proto_item_append_text(hdr_tree
, ": %i", tvb_get_ntohl(tvb
, offset
));
2195 proto_tree_add_item(hdr_tree
, hf_data_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2198 case 0xCB: /* Connection Id */
2199 proto_item_append_text(hdr_tree
, ": %i", tvb_get_ntohl(tvb
, offset
));
2200 proto_tree_add_item(hdr_tree
, hf_connection_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2203 case 0xC4: /* Time */
2204 case 0xCF: /* Creator */
2205 case 0xD6: /* Permissions */
2207 proto_item_append_text(hdr_tree
, ": %i", tvb_get_ntohl(tvb
, offset
));
2208 proto_tree_add_item(hdr_tree
, hf_hdr_val_long
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2223 dissect_obex(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
2225 proto_item
*main_item
;
2226 proto_tree
*main_tree
;
2227 proto_item
*sub_item
;
2228 fragment_head
*frag_msg
= NULL
;
2229 fragment_item
*frag
= NULL
;
2230 bool save_fragmented
;
2232 tvbuff_t
* new_tvb
= NULL
;
2233 tvbuff_t
* next_tvb
= NULL
;
2235 int profile
= PROFILE_UNKNOWN
;
2236 const char *path
= path_unknown
;
2237 obex_profile_data_t
*obex_profile_data
;
2238 wmem_tree_key_t key
[6];
2239 uint32_t frame_number
;
2240 obex_last_opcode_data_t
*obex_last_opcode_data
;
2241 obex_path_data_t
*obex_path_data
;
2243 uint8_t *profile_data
;
2244 dissector_handle_t current_handle
;
2245 dissector_handle_t default_handle
;
2247 obex_proto_data_t obex_proto_data
;
2249 previous_proto
= (GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_frame_prev(wmem_list_tail(pinfo
->layers
)))));
2250 if (previous_proto
== proto_btl2cap
) {
2251 btl2cap_data_t
*l2cap_data
;
2253 l2cap_data
= (btl2cap_data_t
*) data
;
2255 obex_proto_data
.interface_id
= l2cap_data
->interface_id
;
2256 obex_proto_data
.adapter_id
= l2cap_data
->adapter_id
;
2257 obex_proto_data
.chandle
= l2cap_data
->chandle
;
2258 obex_proto_data
.channel
= l2cap_data
->cid
;
2259 } else if (previous_proto
== proto_btrfcomm
) {
2260 btrfcomm_data_t
*rfcomm_data
;
2262 rfcomm_data
= (btrfcomm_data_t
*) data
;
2264 obex_proto_data
.interface_id
= rfcomm_data
->interface_id
;
2265 obex_proto_data
.adapter_id
= rfcomm_data
->adapter_id
;
2266 obex_proto_data
.chandle
= rfcomm_data
->chandle
;
2267 obex_proto_data
.channel
= rfcomm_data
->dlci
>> 1;
2269 obex_proto_data
.interface_id
= HCI_INTERFACE_DEFAULT
;
2270 obex_proto_data
.adapter_id
= HCI_ADAPTER_DEFAULT
;
2271 obex_proto_data
.chandle
= 0;
2272 obex_proto_data
.channel
= 0;
2275 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "OBEX");
2277 main_item
= proto_tree_add_item(tree
, proto_obex
, tvb
, 0, tvb_captured_length(tvb
), ENC_NA
);
2278 main_tree
= proto_item_add_subtree(main_item
, ett_obex
);
2280 save_fragmented
= pinfo
->fragmented
;
2282 frame_number
= pinfo
->num
;
2285 key
[0].key
= &obex_proto_data
.interface_id
;
2287 key
[1].key
= &obex_proto_data
.adapter_id
;
2289 key
[2].key
= &obex_proto_data
.chandle
;
2291 key
[3].key
= &obex_proto_data
.channel
;
2293 key
[4].key
= &frame_number
;
2297 profile_data
= (uint8_t *) p_get_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_OBEX_PROFILE
);
2298 if (profile_data
== NULL
) {
2299 obex_profile_data
= (obex_profile_data_t
*)wmem_tree_lookup32_array_le(obex_profile
, key
);
2300 if (obex_profile_data
&& obex_profile_data
->interface_id
== obex_proto_data
.interface_id
&&
2301 obex_profile_data
->adapter_id
== obex_proto_data
.adapter_id
&&
2302 obex_profile_data
->chandle
== obex_proto_data
.chandle
&&
2303 obex_profile_data
->channel
== obex_proto_data
.channel
) {
2304 profile
= obex_profile_data
->profile
;
2307 profile_data
= wmem_new(wmem_file_scope(), uint8_t);
2308 *profile_data
= profile
;
2310 p_add_proto_data(pinfo
->pool
, pinfo
, proto_obex
, PROTO_DATA_OBEX_PROFILE
, profile_data
);
2313 obex_path_data
= (obex_path_data_t
*)wmem_tree_lookup32_array_le(obex_path
, key
);
2314 if (obex_path_data
&& obex_path_data
->interface_id
== obex_proto_data
.interface_id
&&
2315 obex_path_data
->adapter_id
== obex_proto_data
.adapter_id
&&
2316 obex_path_data
->chandle
== obex_proto_data
.chandle
&&
2317 obex_path_data
->channel
== obex_proto_data
.channel
) {
2318 path
= obex_path_data
->path
;
2321 sub_item
= proto_tree_add_uint(main_tree
, hf_profile
, tvb
, 0, 0, profile
);
2322 proto_item_set_generated(sub_item
);
2325 sub_item
= proto_tree_add_string(main_tree
, hf_current_path
, tvb
, 0, 0, path
);
2326 proto_item_set_generated(sub_item
);
2329 current_handle
= dissector_get_uint_handle(obex_profile_table
, profile
);
2330 default_handle
= dissector_get_default_uint_handle("obex.profile", profile
);
2331 if (current_handle
!= default_handle
) {
2332 expert_add_info_format(pinfo
, main_item
, &ei_decoded_as_profile
, "Decoded As %s", dissector_handle_get_protocol_long_name(current_handle
));
2337 if (tvb_captured_length(tvb
) == tvb_reported_length(tvb
)) {
2338 frag_msg
= fragment_get_reassembled_id(&obex_reassembly_table
, pinfo
, pinfo
->p2p_dir
);
2339 if (frag_msg
&& pinfo
->num
!= frag_msg
->reassembled_in
) {
2340 /* reassembled but not last */
2342 new_tvb
= process_reassembled_data(tvb
, 0, pinfo
,
2343 "Reassembled Obex packet", frag_msg
, &obex_frag_items
, NULL
, main_tree
);
2344 } else if (frag_msg
&& pinfo
->num
== frag_msg
->reassembled_in
) {
2345 /* reassembled and last, so dissect reassembled packet here */
2347 new_tvb
= process_reassembled_data(tvb
, 0, pinfo
,
2348 "Reassembled Obex packet", frag_msg
, &obex_frag_items
, NULL
, main_tree
);
2350 frag_msg
= fragment_get(&obex_reassembly_table
, pinfo
, pinfo
->p2p_dir
, NULL
);
2353 /* not the first fragment */
2355 /* packet stream is guaranted to be sequence of fragments, one by one,
2356 so find last fragment for its offset and length */
2357 for (frag
= frag_msg
->next
; frag
->next
; frag
= frag
->next
) {}
2359 frag_msg
= fragment_add_check(&obex_reassembly_table
,
2360 tvb
, 0, pinfo
, pinfo
->p2p_dir
, NULL
,
2361 frag
->offset
+ frag
->len
, tvb_reported_length(tvb
),
2362 ((frag
->offset
+ frag
->len
+ tvb_reported_length(tvb
)) <
2363 fragment_get_tot_len(&obex_reassembly_table
, pinfo
, pinfo
->p2p_dir
, NULL
)) ? true : false);
2365 new_tvb
= process_reassembled_data(tvb
, 0, pinfo
,
2366 "Reassembled Obex packet", frag_msg
, &obex_frag_items
, NULL
, main_tree
);
2368 pinfo
->fragmented
= true;
2370 if (tvb_reported_length(tvb
) < 3) {
2371 /* Packet length is in the second and the third bye of packet, anything shorter than 3 is bad */
2372 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s OBEX packet too short",
2373 (pinfo
->p2p_dir
==P2P_DIR_SENT
) ? "Sent" : "Rcvd");
2374 call_dissector(data_handle
, tvb
, pinfo
, main_tree
);
2375 return tvb_reported_length(tvb
);
2376 } else if (tvb_reported_length(tvb
) >= 3 && tvb_reported_length(tvb
) < tvb_get_ntohs(tvb
, offset
+1)) {
2377 /* first fragment in a sequence */
2378 frag_msg
= fragment_add_check(&obex_reassembly_table
,
2379 tvb
, 0, pinfo
, pinfo
->p2p_dir
, NULL
,
2380 0, tvb_reported_length(tvb
), true);
2382 fragment_set_tot_len(&obex_reassembly_table
,
2383 pinfo
, pinfo
->p2p_dir
, NULL
,
2384 tvb_get_ntohs(tvb
, offset
+ 1));
2386 new_tvb
= process_reassembled_data(tvb
, 0, pinfo
,
2387 "Reassembled Obex packet", frag_msg
, &obex_frag_items
, NULL
, main_tree
);
2388 pinfo
->fragmented
= true;
2389 } else if (tvb_reported_length(tvb
) == tvb_get_ntohs(tvb
, offset
+1)) {
2390 /* non-fragmented */
2392 pinfo
->fragmented
= false;
2398 if (new_tvb
) { /* take it all */
2401 } else { /* make a new subset */
2402 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
2409 /* fully dissectable packet ready */
2411 /* op/response code */
2412 code
= tvb_get_uint8(next_tvb
, offset
) & OBEX_CODE_VALS_MASK
;
2413 final_flag
= tvb_get_uint8(next_tvb
, offset
) & 0x80;
2415 switch (pinfo
->p2p_dir
) {
2417 col_set_str(pinfo
->cinfo
, COL_INFO
, "Sent ");
2420 col_set_str(pinfo
->cinfo
, COL_INFO
, "Rcvd ");
2423 col_set_str(pinfo
->cinfo
, COL_INFO
, "UnknownDirection ");
2427 col_append_str(pinfo
->cinfo
, COL_INFO
,
2428 val_to_str_ext_const(code
, &code_vals_ext
, "Unknown"));
2430 if (code
< OBEX_CODE_VALS_CONTINUE
|| code
== OBEX_CODE_VALS_ABORT
) {
2431 proto_tree_add_item(main_tree
, hf_opcode
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2432 if (!pinfo
->fd
->visited
&&
2433 (pinfo
->p2p_dir
== P2P_DIR_SENT
||
2434 pinfo
->p2p_dir
== P2P_DIR_RECV
)) {
2435 frame_number
= pinfo
->num
;
2438 key
[0].key
= &obex_proto_data
.interface_id
;
2440 key
[1].key
= &obex_proto_data
.adapter_id
;
2442 key
[2].key
= &obex_proto_data
.chandle
;
2444 key
[3].key
= &obex_proto_data
.channel
;
2446 key
[4].key
= &frame_number
;
2450 obex_last_opcode_data
= wmem_new0(wmem_file_scope(), obex_last_opcode_data_t
);
2451 obex_last_opcode_data
->interface_id
= obex_proto_data
.interface_id
;
2452 obex_last_opcode_data
->adapter_id
= obex_proto_data
.adapter_id
;
2453 obex_last_opcode_data
->chandle
= obex_proto_data
.chandle
;
2454 obex_last_opcode_data
->channel
= obex_proto_data
.channel
;
2455 obex_last_opcode_data
->code
= code
;
2456 obex_last_opcode_data
->final_flag
= final_flag
;
2457 obex_last_opcode_data
->request_in_frame
= frame_number
;
2458 obex_last_opcode_data
->response_in_frame
= 0;
2460 wmem_tree_insert32_array(obex_last_opcode
, key
, obex_last_opcode_data
);
2463 proto_tree_add_item(main_tree
, hf_response_code
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2466 proto_tree_add_item(main_tree
, hf_final_flag
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2470 proto_tree_add_item(main_tree
, hf_length
, next_tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2471 length
= tvb_get_ntohs(tvb
, offset
) - 3;
2474 frame_number
= pinfo
->num
;
2477 key
[0].key
= &obex_proto_data
.interface_id
;
2479 key
[1].key
= &obex_proto_data
.adapter_id
;
2481 key
[2].key
= &obex_proto_data
.chandle
;
2483 key
[3].key
= &obex_proto_data
.channel
;
2485 key
[4].key
= &frame_number
;
2489 obex_last_opcode_data
= (obex_last_opcode_data_t
*)wmem_tree_lookup32_array_le(obex_last_opcode
, key
);
2490 if (obex_last_opcode_data
&& obex_last_opcode_data
->interface_id
== obex_proto_data
.interface_id
&&
2491 obex_last_opcode_data
->adapter_id
== obex_proto_data
.adapter_id
&&
2492 obex_last_opcode_data
->chandle
== obex_proto_data
.chandle
&&
2493 obex_last_opcode_data
->channel
== obex_proto_data
.channel
) {
2494 if (obex_last_opcode_data
->request_in_frame
> 0 && obex_last_opcode_data
->request_in_frame
!= pinfo
->num
) {
2495 sub_item
= proto_tree_add_uint(main_tree
, hf_request_in_frame
, next_tvb
, 0, 0, obex_last_opcode_data
->request_in_frame
);
2496 proto_item_set_generated(sub_item
);
2499 if (!pinfo
->fd
->visited
&& obex_last_opcode_data
->response_in_frame
== 0 && obex_last_opcode_data
->request_in_frame
< pinfo
->num
) {
2500 obex_last_opcode_data
->response_in_frame
= pinfo
->num
;
2503 if (obex_last_opcode_data
->response_in_frame
> 0 && obex_last_opcode_data
->response_in_frame
!= pinfo
->num
) {
2504 sub_item
= proto_tree_add_uint(main_tree
, hf_response_in_frame
, next_tvb
, 0, 0, obex_last_opcode_data
->response_in_frame
);
2505 proto_item_set_generated(sub_item
);
2511 case OBEX_CODE_VALS_CONNECT
:
2512 proto_tree_add_item(main_tree
, hf_version
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2515 proto_tree_add_item(main_tree
, hf_flags
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2518 proto_tree_add_item(main_tree
, hf_max_pkt_len
, next_tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2522 case OBEX_CODE_VALS_PUT
:
2523 case OBEX_CODE_VALS_GET
:
2524 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " %s", (final_flag
== 0x80) ? "final" : "continue");
2527 case OBEX_CODE_VALS_SET_PATH
:
2528 proto_tree_add_item(main_tree
, hf_flags
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2529 proto_tree_add_item(main_tree
, hf_set_path_flags_0
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2530 proto_tree_add_item(main_tree
, hf_set_path_flags_1
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2532 if (!pinfo
->fd
->visited
&& obex_last_opcode_data
) {
2533 obex_last_opcode_data
->data
.set_data
.go_up
= tvb_get_uint8(tvb
, offset
) & 0x01;
2534 obex_last_opcode_data
->data
.set_data
.name
= NULL
;
2539 proto_tree_add_item(main_tree
, hf_constants
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2543 case OBEX_CODE_VALS_DISCONNECT
:
2544 case OBEX_CODE_VALS_ABORT
:
2548 if (length
== 0 && tvb_reported_length_remaining(tvb
, offset
) > 0) {
2549 proto_tree_add_expert(main_tree
, pinfo
, &ei_unexpected_data
, tvb
, offset
, tvb_reported_length_remaining(tvb
, offset
));
2550 offset
+= tvb_reported_length_remaining(tvb
, offset
);
2552 } else if (length
== 0) break;
2554 if (obex_last_opcode_data
&& obex_last_opcode_data
->code
== OBEX_CODE_VALS_CONNECT
) {
2555 proto_tree_add_item(main_tree
, hf_version
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2558 proto_tree_add_item(main_tree
, hf_flags
, next_tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2561 proto_tree_add_item(main_tree
, hf_max_pkt_len
, next_tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2564 if (!pinfo
->fd
->visited
)
2565 save_path(pinfo
, path
, "", false, &obex_proto_data
);
2570 dissect_headers(main_tree
, next_tvb
, offset
, pinfo
, profile
, obex_last_opcode_data
, &obex_proto_data
);
2571 if (!pinfo
->fd
->visited
&&
2572 obex_last_opcode_data
&&
2573 obex_last_opcode_data
->data
.set_data
.name
&&
2574 obex_last_opcode_data
->code
== OBEX_CODE_VALS_SET_PATH
&&
2575 code
== OBEX_CODE_VALS_SUCCESS
) {
2576 save_path(pinfo
, path
, obex_last_opcode_data
->data
.set_data
.name
, obex_last_opcode_data
->data
.set_data
.go_up
, &obex_proto_data
);
2579 /* packet fragment */
2580 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s OBEX fragment",
2581 (pinfo
->p2p_dir
==P2P_DIR_SENT
) ? "Sent" : "Rcvd");
2582 call_dissector(data_handle
, next_tvb
, pinfo
, main_tree
);
2584 offset
= tvb_reported_length(tvb
);
2587 pinfo
->fragmented
= save_fragmented
;
2594 proto_register_obex(void)
2597 expert_module_t
*expert_obex
;
2606 static hf_register_info hf
[] = {
2608 { "Opcode", "obex.opcode",
2609 FT_UINT8
, BASE_HEX
|BASE_EXT_STRING
, &code_vals_ext
, OBEX_CODE_VALS_MASK
,
2610 "Request Opcode", HFILL
}
2612 { &hf_response_code
,
2613 { "Response Code", "obex.resp_code",
2614 FT_UINT8
, BASE_HEX
|BASE_EXT_STRING
, &code_vals_ext
, OBEX_CODE_VALS_MASK
,
2618 { "Final Flag", "obex.final_flag",
2619 FT_BOOLEAN
, 8, NULL
, 0x80,
2623 { "Packet Length", "obex.pkt_len",
2624 FT_UINT16
, BASE_DEC
, NULL
, 0,
2628 { "Version", "obex.version",
2629 FT_UINT8
, BASE_HEX
, VALS(version_vals
), 0x00,
2630 "Obex Protocol Version", HFILL
}
2633 { "Flags", "obex.flags",
2634 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2638 { "Constants", "obex.constants",
2639 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2643 { "Max. Packet Length", "obex.max_pkt_len",
2644 FT_UINT16
, BASE_DEC
, NULL
, 0,
2647 { &hf_set_path_flags_0
,
2648 { "Go back one folder (../) first", "obex.set_path_flags_0",
2649 FT_BOOLEAN
, 8, NULL
, 0x01,
2652 { &hf_set_path_flags_1
,
2653 { "Do not create folder, if not existing", "obex.set_path_flags_1",
2654 FT_BOOLEAN
, 8, NULL
, 0x02,
2658 { "Headers", "obex.headers",
2659 FT_NONE
, BASE_NONE
, NULL
, 0x00,
2663 { "Header", "obex.header",
2664 FT_NONE
, BASE_NONE
, NULL
, 0x00,
2668 { "Header Id", "obex.header.id",
2669 FT_UINT8
, BASE_HEX
|BASE_EXT_STRING
, &header_id_vals_ext
, 0x00,
2672 { &hf_hdr_id_encoding
,
2673 { "Encoding", "obex.header.id.encoding",
2674 FT_UINT8
, BASE_HEX
, VALS(header_id_encoding_vals
), 0xC0,
2677 { &hf_hdr_id_meaning
,
2678 { "Meaning", "obex.header.id.meaning",
2679 FT_UINT8
, BASE_HEX
, VALS(header_id_meaning_vals
), 0x3F,
2683 { "Length", "obex.header.length",
2684 FT_UINT16
, BASE_DEC
, NULL
, 0,
2685 "Header Length", HFILL
}
2687 { &hf_hdr_val_unicode
,
2688 { "Value", "obex.header.value.unicode",
2689 FT_STRING
, BASE_NONE
, NULL
, 0,
2690 "Unicode Value", HFILL
}
2692 { &hf_hdr_val_byte_seq
,
2693 { "Value", "obex.header.value.byte_sequence",
2694 FT_BYTES
, BASE_NONE
, NULL
, 0,
2695 "Byte Sequence Value", HFILL
}
2698 { "Value", "obex.header.value.byte",
2699 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0,
2700 "Byte Value", HFILL
}
2703 { "Value", "obex.header.value.long",
2704 FT_UINT32
, BASE_DEC
, NULL
, 0,
2705 "4-byte Value", HFILL
}
2708 { "Count", "obex.count",
2709 FT_UINT32
, BASE_DEC
, NULL
, 0,
2713 { "Length", "obex.length",
2714 FT_UINT32
, BASE_DEC
, NULL
, 0,
2717 { &hf_connection_id
,
2718 { "Connection ID", "obex.connection_id",
2719 FT_UINT32
, BASE_DEC
, NULL
, 0,
2722 { &hf_session_parameter
,
2723 { "Session Parameter", "obex.session",
2724 FT_NONE
, BASE_NONE
, NULL
, 0x00,
2727 { &hf_session_parameter_data
,
2728 { "Parameter Value", "obex.session.value",
2729 FT_BYTES
, BASE_NONE
, NULL
, 0,
2732 { &hf_session_parameter_tag
,
2733 { "Tag", "obex.session.tag",
2734 FT_UINT8
, BASE_HEX
, VALS(session_tag_vals
), 0x00,
2737 { &hf_session_parameter_length
,
2738 { "Length", "obex.session.length",
2739 FT_UINT8
, BASE_DEC
, NULL
, 0,
2742 { &hf_session_parameter_nonce
,
2743 { "Nonce", "obex.session.nonce",
2744 FT_BYTES
, BASE_NONE
, NULL
, 0,
2747 { &hf_session_parameter_session_id
,
2748 { "Session ID", "obex.session.session_id",
2749 FT_BYTES
, BASE_NONE
, NULL
, 0,
2752 { &hf_session_parameter_next_sequence_number
,
2753 { "Next Sequence Number", "obex.session.next_sequence_number",
2754 FT_UINT8
, BASE_DEC
, NULL
, 0,
2757 { &hf_session_parameter_timeout
,
2758 { "Timeout", "obex.session.timeout",
2759 FT_UINT32
, BASE_DEC
, NULL
, 0,
2762 { &hf_session_parameter_opcode
,
2763 { "Opcode", "obex.session.opcode",
2764 FT_UINT8
, BASE_HEX
, VALS(session_opcode_vals
), 0,
2767 { &hf_authentication_parameter
,
2768 { "Authentication Parameter", "obex.authentication",
2769 FT_NONE
, BASE_NONE
, NULL
, 0x00,
2772 { &hf_authentication_parameter_data
,
2773 { "Parameter Value", "obex.authentication.value",
2774 FT_BYTES
, BASE_NONE
, NULL
, 0,
2777 { &hf_authentication_challenge_tag
,
2778 { "Tag", "obex.authentication.challenge_tag",
2779 FT_UINT8
, BASE_HEX
, VALS(authentication_challenge_tag_vals
), 0x00,
2782 { &hf_authentication_response_tag
,
2783 { "Tag", "obex.authentication.response_tag",
2784 FT_UINT8
, BASE_HEX
, VALS(authentication_response_tag_vals
), 0x00,
2787 { &hf_authentication_length
,
2788 { "Length", "obex.authentication.length",
2789 FT_UINT8
, BASE_DEC
, NULL
, 0,
2792 { &hf_authentication_key
,
2793 { "Key", "obex.authentication.key",
2794 FT_BYTES
, BASE_NONE
, NULL
, 0,
2797 { &hf_authentication_result_key
,
2798 { "Result Key", "obex.authentication.result_key",
2799 FT_BYTES
, BASE_NONE
, NULL
, 0,
2802 { &hf_authentication_user_id
,
2803 { "User Id", "obex.authentication.user_id",
2804 FT_BYTES
, BASE_NONE
, NULL
, 0,
2807 { &hf_authentication_option_reserved
,
2808 { "Reserved", "obex.authentication.option.reserved",
2809 FT_UINT8
, BASE_HEX
, NULL
, 0xFC,
2812 { &hf_authentication_option_read_only
,
2813 { "Read Only", "obex.authentication.option.read_only",
2814 FT_BOOLEAN
, 8, NULL
, 0x02,
2817 { &hf_authentication_option_user_id
,
2818 { "User ID", "obex.authentication.option.user_id",
2819 FT_BOOLEAN
, 8, NULL
, 0x01,
2822 { &hf_authentication_info_charset
,
2823 { "Charset", "obex.authentication.info.charset",
2824 FT_UINT8
, BASE_HEX
, VALS(info_charset_vals
), 0,
2827 { &hf_authentication_info
,
2828 { "Info", "obex.authentication.info",
2829 FT_STRING
, BASE_NONE
, NULL
, 0,
2832 { &hf_application_parameter
,
2833 { "Parameter", "obex.parameter",
2834 FT_NONE
, BASE_NONE
, NULL
, 0x00,
2837 { &hf_application_parameter_id
,
2838 { "Parameter Id", "obex.parameter.id",
2839 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2842 { &hf_application_parameter_length
,
2843 { "Parameter Length", "obex.parameter.length",
2844 FT_UINT8
, BASE_DEC
, NULL
, 0,
2847 { &hf_application_parameter_data
,
2848 { "Parameter Value", "obex.parameter.value",
2849 FT_BYTES
, BASE_NONE
, NULL
, 0,
2852 /* application parameters for BPP */
2853 { &hf_bpp_application_parameter_id
,
2854 { "Parameter Id", "obex.parameter.id",
2855 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &bpp_application_parameters_vals_ext
, 0x00,
2858 { &hf_bpp_application_parameter_data_offset
,
2859 { "Offset", "obex.parameter.value.offset",
2860 FT_UINT32
, BASE_DEC_HEX
, NULL
, 0,
2861 "The byte offset into the image or file.", HFILL
}
2863 { &hf_bpp_application_parameter_data_count
,
2864 { "Count", "obex.parameter.value.count",
2865 FT_INT32
, BASE_DEC
, NULL
, 0,
2866 "The number of bytes of the image or file to be sent.", HFILL
}
2868 { &hf_bpp_application_parameter_data_job_id
,
2869 { "Job ID", "obex.parameter.value.job_id",
2870 FT_UINT32
, BASE_DEC_HEX
, NULL
, 0,
2871 "The job identifier of the print job.", HFILL
}
2873 { &hf_bpp_application_parameter_data_file_size
,
2874 { "File Size", "obex.parameter.value.file_size",
2875 FT_INT32
, BASE_DEC
, NULL
, 0,
2876 "The size (in bytes) of object or file.", HFILL
}
2878 /* application parameters for BIP */
2879 { &hf_bip_application_parameter_id
,
2880 { "Parameter Id", "obex.parameter.id",
2881 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &bip_application_parameters_vals_ext
, 0x00,
2884 { &hf_bip_application_parameter_data_number_of_returned_handles
,
2885 { "Number of Returned Handles", "obex.parameter.value.number_of_returned_handles",
2886 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
2889 { &hf_bip_application_parameter_data_list_start_offset
,
2890 { "List Start Offset", "obex.parameter.value.list_start_offset",
2891 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
2894 { &hf_bip_application_parameter_data_latest_captured_images
,
2895 { "Latest Captured Images", "obex.parameter.value.latest_captured_images",
2896 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2899 { &hf_bip_application_parameter_data_partial_file_length
,
2900 { "Partial File Length", "obex.parameter.value.partial_file_length",
2901 FT_UINT32
, BASE_DEC_HEX
, NULL
, 0x00,
2904 { &hf_bip_application_parameter_data_partial_file_start_offset
,
2905 { "Partial File Start Offset", "obex.parameter.value.partial_file_start_offset",
2906 FT_UINT32
, BASE_DEC_HEX
, NULL
, 0x00,
2909 { &hf_bip_application_parameter_data_total_file_size
,
2910 { "Total File Size", "obex.parameter.value.total_file_size",
2911 FT_UINT32
, BASE_DEC_HEX
, NULL
, 0x00,
2914 { &hf_bip_application_parameter_data_end_flag
,
2915 { "End Flag", "obex.parameter.value.end_flag",
2916 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2919 { &hf_bip_application_parameter_data_remote_display
,
2920 { "Remote Display", "obex.parameter.value.remote_display",
2921 FT_UINT8
, BASE_HEX
, VALS(bip_remote_display_vals
), 0x00,
2924 { &hf_bip_application_parameter_data_service_id
,
2925 { "Service ID", "obex.parameter.value.service_id",
2926 FT_UINT16
, BASE_HEX
| BASE_EXT_STRING
, &bluetooth_uuid_vals_ext
, 0x00,
2929 { &hf_bip_application_parameter_data_store_flag
,
2930 { "Store Flag", "obex.parameter.value.store_flag",
2931 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2934 /* application parameters for PBAP */
2935 { &hf_pbap_application_parameter_id
,
2936 { "Parameter Id", "obex.parameter.id",
2937 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &pbap_application_parameters_vals_ext
, 0x00,
2940 { &hf_pbap_application_parameter_data_order
,
2941 { "Max List Count", "obex.parameter.value.order",
2942 FT_UINT8
, BASE_HEX
, VALS(pbap_order_vals
), 0x00,
2945 { &hf_pbap_application_parameter_data_search_value
,
2946 { "Search Value", "obex.parameter.value.search_value",
2947 FT_STRING
, BASE_NONE
, NULL
, 0x00,
2950 { &hf_pbap_application_parameter_data_search_attribute
,
2951 { "Search Attribute", "obex.parameter.value.search_attribute",
2952 FT_UINT8
, BASE_HEX
, VALS(pbap_search_attribute_vals
), 0x00,
2955 { &hf_pbap_application_parameter_data_max_list_count
,
2956 { "Max List Count", "obex.parameter.value.max_list_count",
2957 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
2960 { &hf_pbap_application_parameter_data_list_start_offset
,
2961 { "List Start Offset", "obex.parameter.value.list_start_offset",
2962 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
2965 { &hf_pbap_application_parameter_data_filter
,
2966 { "Filter", "obex.parameter.value.filter",
2967 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
2970 { &hf_pbap_application_parameter_vcard_selector
,
2971 { "vCard Selector", "obex.parameter.value.vcard_selector",
2972 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
2975 { &hf_pbap_application_parameter_data_filter_version
,
2976 { "vCard Version", "obex.parameter.value.filter.version",
2977 FT_BOOLEAN
, 32, NULL
, 0x00000001,
2980 { &hf_pbap_application_parameter_data_filter_fn
,
2981 { "Formatted Name", "obex.parameter.value.filter.fn",
2982 FT_BOOLEAN
, 32, NULL
, 0x00000002,
2985 { &hf_pbap_application_parameter_data_filter_n
,
2986 { "Structured Presentation of Name", "obex.parameter.value.filter.n",
2987 FT_BOOLEAN
, 32, NULL
, 0x00000004,
2990 { &hf_pbap_application_parameter_data_filter_photo
,
2991 { "Associated Image or Photo", "obex.parameter.value.filter.photo",
2992 FT_BOOLEAN
, 32, NULL
, 0x00000008,
2995 { &hf_pbap_application_parameter_data_filter_birthday
,
2996 { "Birthday", "obex.parameter.value.filter.birthday",
2997 FT_BOOLEAN
, 32, NULL
, 0x00000010,
3000 { &hf_pbap_application_parameter_data_filter_adr
,
3001 { "Delivery Address", "obex.parameter.value.filter.adr",
3002 FT_BOOLEAN
, 32, NULL
, 0x00000020,
3005 { &hf_pbap_application_parameter_data_filter_label
,
3006 { "Delivery", "obex.parameter.value.filter.label",
3007 FT_BOOLEAN
, 32, NULL
, 0x00000040,
3010 { &hf_pbap_application_parameter_data_filter_tel
,
3011 { "Telephone Number", "obex.parameter.value.filter.tel",
3012 FT_BOOLEAN
, 32, NULL
, 0x00000080,
3015 { &hf_pbap_application_parameter_data_filter_email
,
3016 { "Electronic Mail Address", "obex.parameter.value.filter.email",
3017 FT_BOOLEAN
, 32, NULL
, 0x00000100,
3020 { &hf_pbap_application_parameter_data_filter_mailer
,
3021 { "Electronic Mail", "obex.parameter.value.filter.mailer",
3022 FT_BOOLEAN
, 32, NULL
, 0x00000200,
3025 { &hf_pbap_application_parameter_data_filter_time_zone
,
3026 { "Time Zone", "obex.parameter.value.filter.time_zone",
3027 FT_BOOLEAN
, 32, NULL
, 0x00000400,
3030 { &hf_pbap_application_parameter_data_filter_geographic_position
,
3031 { "Geographic Position", "obex.parameter.value.filter.geographic_position",
3032 FT_BOOLEAN
, 32, NULL
, 0x00000800,
3035 { &hf_pbap_application_parameter_data_filter_title
,
3036 { "Job", "obex.parameter.value.filter.title",
3037 FT_BOOLEAN
, 32, NULL
, 0x00001000,
3040 { &hf_pbap_application_parameter_data_filter_role
,
3041 { "Role within the Organization", "obex.parameter.value.filter.role",
3042 FT_BOOLEAN
, 32, NULL
, 0x00002000,
3045 { &hf_pbap_application_parameter_data_filter_logo
,
3046 { "Organization Logo", "obex.parameter.value.filter.logo",
3047 FT_BOOLEAN
, 32, NULL
, 0x00004000,
3050 { &hf_pbap_application_parameter_data_filter_agent
,
3051 { "vCard of Person Representing", "obex.parameter.value.filter.agent",
3052 FT_BOOLEAN
, 32, NULL
, 0x00008000,
3055 { &hf_pbap_application_parameter_data_filter_name_of_organization
,
3056 { "Name of Organization", "obex.parameter.value.filter.name_of_organization",
3057 FT_BOOLEAN
, 32, NULL
, 0x00010000,
3060 { &hf_pbap_application_parameter_data_filter_comments
,
3061 { "Comments", "obex.parameter.value.filter.comments",
3062 FT_BOOLEAN
, 32, NULL
, 0x00020000,
3065 { &hf_pbap_application_parameter_data_filter_revision
,
3066 { "Revision", "obex.parameter.value.filter.revision",
3067 FT_BOOLEAN
, 32, NULL
, 0x00040000,
3070 { &hf_pbap_application_parameter_data_filter_pronunciation_of_name
,
3071 { "Pronunciation of Name", "obex.parameter.value.filter.pronunciation_of_name",
3072 FT_BOOLEAN
, 32, NULL
, 0x00080000,
3075 { &hf_pbap_application_parameter_data_filter_url
,
3076 { "Uniform Resource Locator", "obex.parameter.value.filter.url",
3077 FT_BOOLEAN
, 32, NULL
, 0x00100000,
3080 { &hf_pbap_application_parameter_data_filter_uid
,
3081 { "Unique ID", "obex.parameter.value.filter.uid",
3082 FT_BOOLEAN
, 32, NULL
, 0x00200000,
3085 { &hf_pbap_application_parameter_data_filter_key
,
3086 { "Public Encryption Key", "obex.parameter.value.filter.key",
3087 FT_BOOLEAN
, 32, NULL
, 0x00400000,
3090 { &hf_pbap_application_parameter_data_filter_nickname
,
3091 { "Nickname", "obex.parameter.value.filter.nickname",
3092 FT_BOOLEAN
, 32, NULL
, 0x00800000,
3095 { &hf_pbap_application_parameter_data_filter_categories
,
3096 { "Categories", "obex.parameter.value.filter.categories",
3097 FT_BOOLEAN
, 32, NULL
, 0x01000000,
3100 { &hf_pbap_application_parameter_data_filter_product_id
,
3101 { "Product ID", "obex.parameter.value.filter.product_id",
3102 FT_BOOLEAN
, 32, NULL
, 0x02000000,
3105 { &hf_pbap_application_parameter_data_filter_class
,
3106 { "Class Information", "obex.parameter.value.filter.class",
3107 FT_BOOLEAN
, 32, NULL
, 0x04000000,
3110 { &hf_pbap_application_parameter_data_filter_sort_string
,
3111 { "String Used For Sorting Operations", "obex.parameter.value.filter.sort_string",
3112 FT_BOOLEAN
, 32, NULL
, 0x08000000,
3115 { &hf_pbap_application_parameter_data_filter_timestamp
,
3116 { "Timestamp", "obex.parameter.value.filter.timestamp",
3117 FT_BOOLEAN
, 32, NULL
, 0x10000000,
3120 { &hf_pbap_application_parameter_data_filter_reserved_29_31
,
3121 { "Reserved", "obex.parameter.value.filter.reserved_29_31",
3122 FT_UINT32
, BASE_HEX
, NULL
, 0xE0000000,
3125 { &hf_pbap_application_parameter_data_filter_reserved_32_38
,
3126 { "Reserved", "obex.parameter.value.filter.reserved_32_38",
3127 FT_UINT32
, BASE_HEX
, NULL
, 0x0000007F,
3130 { &hf_pbap_application_parameter_data_filter_proprietary_filter
,
3131 { "Proprietary Filter", "obex.parameter.value.filter.proprietary_filter",
3132 FT_BOOLEAN
, 32, NULL
, 0x00000080,
3135 { &hf_pbap_application_parameter_data_filter_reserved_for_proprietary_filter_usage
,
3136 { "Reserved for Proprietary Filter Usage", "obex.parameter.value.filter.reserved_for_proprietary_filter_usage",
3137 FT_UINT32
, BASE_HEX
, NULL
, 0xFFFFFF00,
3140 { &hf_pbap_application_parameter_data_format
,
3141 { "Format", "obex.parameter.value.format",
3142 FT_UINT8
, BASE_HEX
, VALS(pbap_format_vals
), 0x00,
3145 { &hf_pbap_application_parameter_data_phonebook_size
,
3146 { "Phonebook Size", "obex.parameter.value.phonebook_size",
3147 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
3150 { &hf_pbap_application_parameter_data_new_missed_calls
,
3151 { "New Missed Calls", "obex.parameter.value.new_missed_calls",
3152 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
3155 { &hf_pbap_application_parameter_data_primary_version_counter
,
3156 { "Primary Version Counter", "obex.parameter.value.primary_version_counter",
3157 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
3160 { &hf_pbap_application_parameter_data_secondary_version_counter
,
3161 { "Secondary Version Counter", "obex.parameter.value.secondary_version_counter",
3162 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
3165 { &hf_pbap_application_parameter_data_database_identifier
,
3166 { "Database Identifier", "obex.parameter.value.database_identifier",
3167 FT_BYTES
, BASE_NONE
, NULL
, 0x00,
3170 { &hf_pbap_application_parameter_data_vcard_selector_operator
,
3171 { "vCard Selector Operator", "obex.parameter.value.vcard_selector_operator",
3172 FT_UINT8
, BASE_HEX
, VALS(pbap_application_parameter_data_vcard_selector_operator_vals
), 0x00,
3175 { &hf_pbap_application_parameter_data_reset_new_missed_calls
,
3176 { "vCard Selector Operator", "obex.parameter.value.reset_new_missed_calls",
3177 FT_UINT8
, BASE_HEX
, VALS(pbap_application_parameter_data_reset_new_missed_calls_vals
), 0x00,
3180 { &hf_pbap_application_parameter_data_supported_features
,
3181 { "Supported Features", "obex.parameter.supported_features",
3182 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
3185 { &hf_pbap_application_parameter_data_supported_features_reserved
,
3186 { "Reserved", "obex.parameter.supported_features.reserved",
3187 FT_UINT32
, BASE_HEX
, NULL
, 0xFFFFFC00,
3190 { &hf_pbap_application_parameter_data_supported_features_default_contact_image_format
,
3191 { "Default Contact Image Format", "obex.parameter.supported_features.default_contact_image_format",
3192 FT_BOOLEAN
, 32, NULL
, 0x00000200,
3195 { &hf_pbap_application_parameter_data_supported_features_contact_referencing
,
3196 { "Contact Referencing", "obex.parameter.supported_features.contact_referencing",
3197 FT_BOOLEAN
, 32, NULL
, 0x00000100,
3200 { &hf_pbap_application_parameter_data_supported_features_x_bt_uid_vcard_property
,
3201 { "X-BT-UID vCard Property", "obex.parameter.supported_features.x_bt_uid_vcard_property",
3202 FT_BOOLEAN
, 32, NULL
, 0x00000080,
3205 { &hf_pbap_application_parameter_data_supported_features_x_bt_uci_vcard_property
,
3206 { "X-BT-UCI vCard Property", "obex.parameter.supported_features.x_bt_uci_vcard_property",
3207 FT_BOOLEAN
, 32, NULL
, 0x00000040,
3210 { &hf_pbap_application_parameter_data_supported_features_enhanced_missed_calls
,
3211 { "Enhanced Missed Calls", "obex.parameter.supported_features.enhanced_missed_calls",
3212 FT_BOOLEAN
, 32, NULL
, 0x00000020,
3215 { &hf_pbap_application_parameter_data_supported_features_vcard_selecting
,
3216 { "vCard Selecting", "obex.parameter.supported_features.vcard_selecting",
3217 FT_BOOLEAN
, 32, NULL
, 0x00000010,
3220 { &hf_pbap_application_parameter_data_supported_features_folder_version_counters
,
3221 { "Folder Version Counters", "obex.parameter.supported_features.folder_version_counters",
3222 FT_BOOLEAN
, 32, NULL
, 0x00000008,
3225 { &hf_pbap_application_parameter_data_supported_features_database_identifier
,
3226 { "Database Identifier", "obex.parameter.supported_features.database_identifier",
3227 FT_BOOLEAN
, 32, NULL
, 0x00000004,
3230 { &hf_pbap_application_parameter_data_supported_features_browsing
,
3231 { "Browsing", "obex.parameter.supported_features.browsing",
3232 FT_BOOLEAN
, 32, NULL
, 0x00000002,
3235 { &hf_pbap_application_parameter_data_supported_features_download
,
3236 { "Download", "obex.parameter.supported_features.download",
3237 FT_BOOLEAN
, 32, NULL
, 0x00000001,
3240 /* application parameters for MAP */
3241 { &hf_map_application_parameter_id
,
3242 { "Parameter Id", "obex.parameter.id",
3243 FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
, &map_application_parameters_vals_ext
, 0x00,
3246 { &hf_map_application_parameter_data_max_list_count
,
3247 { "Max List Count", "obex.parameter.value.max_list_count",
3248 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
3251 { &hf_map_application_parameter_data_start_offset
,
3252 { "Start Offset", "obex.parameter.value.start_offset",
3253 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
3256 { &hf_map_application_parameter_data_filter_message_type_reserved
,
3257 { "Reserved", "obex.parameter.value.filter_message_type.reserved",
3258 FT_UINT8
, BASE_HEX
, NULL
, 0xF0,
3261 { &hf_map_application_parameter_data_filter_message_type_mms
,
3262 { "MMS", "obex.parameter.value.filter_message_type.mms",
3263 FT_BOOLEAN
, 8, NULL
, 0x08,
3264 "True to filter out, False to listing this type", HFILL
}
3266 { &hf_map_application_parameter_data_filter_message_type_email
,
3267 { "EMAIL", "obex.parameter.value.filter_message_type.sms_email",
3268 FT_BOOLEAN
, 8, NULL
, 0x04,
3269 "True to filter out, False to listing this type", HFILL
}
3271 { &hf_map_application_parameter_data_filter_message_type_sms_cdma
,
3272 { "SMS_CDMA", "obex.parameter.value.filter_message_type.sms_cdma",
3273 FT_BOOLEAN
, 8, NULL
, 0x02,
3274 "True to filter out, False to listing this type", HFILL
}
3276 { &hf_map_application_parameter_data_filter_message_type_sms_gsm
,
3277 { "SMS_GSM", "obex.parameter.value.filter_message_type.sms_gsm",
3278 FT_BOOLEAN
, 8, NULL
, 0x01,
3281 { &hf_map_application_parameter_data_filter_period_begin
,
3282 { "Filter Period Begin", "obex.parameter.value.filter_period_begin",
3283 FT_STRING
, BASE_NONE
, NULL
, 0,
3286 { &hf_map_application_parameter_data_filter_period_end
,
3287 { "Filter Period End", "obex.parameter.value.filter_period_end",
3288 FT_STRING
, BASE_NONE
, NULL
, 0,
3291 { &hf_map_application_parameter_data_filter_read_status_reserved_6
,
3292 { "Filter Read Status: Reserved", "obex.parameter.value.filter_read_status.reserved",
3293 FT_UINT8
, BASE_HEX
, NULL
, 0xFC,
3296 { &hf_map_application_parameter_data_filter_read_status_get_read
,
3297 { "Filter Read Status: Get Read", "obex.parameter.value.filter_read_status.get_read",
3298 FT_BOOLEAN
, 8, NULL
, 0x02,
3301 { &hf_map_application_parameter_data_filter_read_status_get_unread
,
3302 { "Filter Read Status: Get Unread", "obex.parameter.value.filter_read_status.get_unread",
3303 FT_BOOLEAN
, 8, NULL
, 0x01,
3306 { &hf_map_application_parameter_data_filter_recipient
,
3307 { "Filter Recipient", "obex.parameter.value.filter_recipient",
3308 FT_STRING
, BASE_NONE
, NULL
, 0,
3311 { &hf_map_application_parameter_data_filter_originator
,
3312 { "Filter Originator", "obex.parameter.value.filter_originator",
3313 FT_STRING
, BASE_NONE
, NULL
, 0,
3316 { &hf_map_application_parameter_data_filter_priority_reserved_6
,
3317 { "Filter Priority: Reserved", "obex.parameter.value.filter_priority.reserved",
3318 FT_UINT8
, BASE_HEX
, NULL
, 0xFC,
3321 { &hf_map_application_parameter_data_filter_priority_get_high
,
3322 { "Filter Priority: Get Read", "obex.parameter.value.filter_priority.get_high",
3323 FT_BOOLEAN
, 8, NULL
, 0x02,
3326 { &hf_map_application_parameter_data_filter_priority_non_high
,
3327 { "Filter Priority: Get Non High", "obex.parameter.value.filter_priority.non_high",
3328 FT_BOOLEAN
, 8, NULL
, 0x01,
3331 { &hf_map_application_parameter_data_reserved_7
,
3332 { "Reserved", "obex.parameter.value.reserved",
3333 FT_UINT8
, BASE_HEX
, NULL
, 0xFE,
3336 { &hf_map_application_parameter_data_attachment
,
3337 { "Attachment", "obex.parameter.value.attachment",
3338 FT_BOOLEAN
, 8, NULL
, 0x01,
3341 { &hf_map_application_parameter_data_transparent
,
3342 { "Transparent", "obex.parameter.value.transparent",
3343 FT_BOOLEAN
, 8, NULL
, 0x01,
3346 { &hf_map_application_parameter_data_retry
,
3347 { "Retry", "obex.parameter.value.retry",
3348 FT_BOOLEAN
, 8, NULL
, 0x01,
3351 { &hf_map_application_parameter_data_new_message
,
3352 { "New Message", "obex.parameter.value.new_message",
3353 FT_BOOLEAN
, 8, NULL
, 0x01,
3356 { &hf_map_application_parameter_data_notification_status
,
3357 { "Notification Status", "obex.parameter.value.notification_status",
3358 FT_BOOLEAN
, 8, NULL
, 0x01,
3361 { &hf_map_application_parameter_data_mas_instance_id
,
3362 { "MAS Instance ID", "obex.parameter.value.mas_instance_id",
3363 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0,
3366 { &hf_map_application_parameter_data_parameter_mask_reserved
,
3367 { "Parameter Mask: Reserved", "obex.parameter.value.parameter_mask.reserved",
3368 FT_UINT32
, BASE_HEX
, NULL
, 0xFFFF0000,
3371 { &hf_map_application_parameter_data_parameter_mask_reply_to_addressing
,
3372 { "Parameter Mask: Reply to Addressing", "obex.parameter.value.parameter_mask.reply_to_addressing",
3373 FT_BOOLEAN
, 32, NULL
, 0x00008000,
3376 { &hf_map_application_parameter_data_parameter_mask_protected
,
3377 { "Parameter Mask: Protected", "obex.parameter.value.parameter_mask.protected",
3378 FT_BOOLEAN
, 32, NULL
, 0x00004000,
3381 { &hf_map_application_parameter_data_parameter_mask_sent
,
3382 { "Parameter Mask: Sent", "obex.parameter.value.parameter_mask.sent",
3383 FT_BOOLEAN
, 32, NULL
, 0x00002000,
3386 { &hf_map_application_parameter_data_parameter_mask_read
,
3387 { "Parameter Mask: Read", "obex.parameter.value.parameter_mask.read",
3388 FT_BOOLEAN
, 32, NULL
, 0x00001000,
3391 { &hf_map_application_parameter_data_parameter_mask_priority
,
3392 { "Parameter Mask: Priority", "obex.parameter.value.parameter_mask.priority",
3393 FT_BOOLEAN
, 32, NULL
, 0x00000800,
3396 { &hf_map_application_parameter_data_parameter_mask_attachment_size
,
3397 { "Parameter Mask: Attachment Size", "obex.parameter.value.parameter_mask.attachment_size",
3398 FT_BOOLEAN
, 32, NULL
, 0x00000400,
3401 { &hf_map_application_parameter_data_parameter_mask_text
,
3402 { "Parameter Mask: Text", "obex.parameter.value.parameter_mask.text",
3403 FT_BOOLEAN
, 32, NULL
, 0x00000200,
3406 { &hf_map_application_parameter_data_parameter_mask_reception_status
,
3407 { "Parameter Mask: Reception Status", "obex.parameter.value.parameter_mask.reception_status",
3408 FT_BOOLEAN
, 32, NULL
, 0x00000100,
3411 { &hf_map_application_parameter_data_parameter_mask_size
,
3412 { "Parameter Mask: Size", "obex.parameter.value.parameter_mask.size",
3413 FT_BOOLEAN
, 32, NULL
, 0x00000080,
3416 { &hf_map_application_parameter_data_parameter_mask_type
,
3417 { "Parameter Mask: Type", "obex.parameter.value.parameter_mask.type",
3418 FT_BOOLEAN
, 32, NULL
, 0x00000040,
3421 { &hf_map_application_parameter_data_parameter_mask_recipient_addressing
,
3422 { "Parameter Mask: Recipient Addressing", "obex.parameter.value.parameter_mask.recipient_addressing",
3423 FT_BOOLEAN
, 32, NULL
, 0x00000020,
3426 { &hf_map_application_parameter_data_parameter_mask_recipient_name
,
3427 { "Parameter Mask: Recipient Name", "obex.parameter.value.parameter_mask.recipient_name",
3428 FT_BOOLEAN
, 32, NULL
, 0x00000010,
3431 { &hf_map_application_parameter_data_parameter_mask_sender_addressing
,
3432 { "Parameter Mask: Sender Addressing", "obex.parameter.value.parameter_mask.sender_addressing",
3433 FT_BOOLEAN
, 32, NULL
, 0x00000008,
3436 { &hf_map_application_parameter_data_parameter_mask_sender_name
,
3437 { "Parameter Mask: Sender Name", "obex.parameter.value.parameter_mask.sender_name",
3438 FT_BOOLEAN
, 32, NULL
, 0x00000004,
3441 { &hf_map_application_parameter_data_parameter_mask_datetime
,
3442 { "Parameter Mask: Datetime", "obex.parameter.value.parameter_mask.datetime",
3443 FT_BOOLEAN
, 32, NULL
, 0x00000002,
3446 { &hf_map_application_parameter_data_parameter_mask_subject
,
3447 { "Parameter Mask: Subject", "obex.parameter.value.parameter_mask.subject",
3448 FT_BOOLEAN
, 32, NULL
, 0x00000001,
3451 { &hf_map_application_parameter_data_folder_listing_size
,
3452 { "Folder Listing Size", "obex.parameter.value.folder_listing_size",
3453 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0,
3456 { &hf_map_application_parameter_data_messages_listing_size
,
3457 { "Messages Listing Size", "obex.parameter.value.messages_listing_size",
3458 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0,
3461 { &hf_map_application_parameter_data_subject_length
,
3462 { "Subject Length", "obex.parameter.value.subject_length",
3463 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0,
3466 { &hf_map_application_parameter_data_charset
,
3467 { "Charset", "obex.parameter.value.charset",
3468 FT_UINT8
, BASE_HEX
, VALS(map_charset_vals
), 0x01,
3471 { &hf_map_application_parameter_data_fraction_request
,
3472 { "Fraction Request", "obex.parameter.value.fraction_request",
3473 FT_UINT8
, BASE_HEX
, VALS(map_fraction_request_vals
), 0x01,
3476 { &hf_map_application_parameter_data_fraction_deliver
,
3477 { "Fraction Deliver", "obex.parameter.value.fraction_deliver",
3478 FT_UINT8
, BASE_HEX
, VALS(map_fraction_deliver_vals
), 0x01,
3481 { &hf_map_application_parameter_data_status_indicator
,
3482 { "Status Indicator", "obex.parameter.value.status_indicator",
3483 FT_UINT8
, BASE_HEX
, VALS(map_status_indicator_vals
), 0x01,
3486 { &hf_map_application_parameter_data_status_value
,
3487 { "Status Value", "obex.parameter.value.status_value",
3488 FT_BOOLEAN
, 8, NULL
, 0x01,
3491 { &hf_map_application_parameter_data_mse_time
,
3492 { "MSE Time", "obex.parameter.value.mse_time",
3493 FT_STRING
, BASE_NONE
, NULL
, 0,
3496 /* application parameters for GPP */
3497 { &hf_gpp_application_parameter_id
,
3498 { "Parameter Id", "obex.parameter.gpp.id",
3499 FT_UINT8
, BASE_HEX
, VALS(gpp_application_parameters_vals
), 0x00,
3502 { &hf_gpp_application_parameter_data_max_list_count
,
3503 { "Max List Count", "obex.parameter.gpp.value.max_list_count",
3504 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
3507 { &hf_gpp_application_parameter_data_list_start_offset
,
3508 { "List Start Offset", "obex.parameter.gpp.value.list_start_offset",
3509 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
3512 { &hf_gpp_application_parameter_data_reserved_7
,
3513 { "Reserved", "obex.parameter.gpp.value.reserved",
3514 FT_UINT8
, BASE_HEX
, NULL
, 0xFE,
3517 { &hf_gpp_application_parameter_data_notification_status
,
3518 { "Notification Status", "obex.parameter.gpp.value.notification_status",
3519 FT_BOOLEAN
, 8, NULL
, 0x01,
3522 { &hf_gpp_application_parameter_data_instance_id
,
3523 { "Instance ID", "obex.parameter.gpp.value.instance_id",
3524 FT_UINT8
, BASE_DEC_HEX
, NULL
, 0,
3527 { &hf_gpp_application_parameter_data_listing_size
,
3528 { "Listing Size", "obex.parameter.gpp.value.listing_size",
3529 FT_UINT16
, BASE_DEC_HEX
, NULL
, 0x00,
3532 /* application parameters for CTN */
3533 { &hf_ctn_application_parameter_id
,
3534 { "Parameter Id", "obex.parameter.ctn.id",
3535 FT_UINT8
, BASE_HEX
, VALS(ctn_application_parameters_vals
), 0x00,
3538 { &hf_ctn_application_parameter_data_acoustic_alarm_status
,
3539 { "Acoustic Alarm Status", "obex.parameter.ctn.acoustic_alarm_status",
3540 FT_UINT8
, BASE_HEX
, VALS(off_on_vals
), 0x00,
3543 { &hf_ctn_application_parameter_data_attachment
,
3544 { "Attachment", "obex.parameter.ctn.attachment",
3545 FT_UINT8
, BASE_HEX
, VALS(ctn_application_parameter_data_attachment_vals
), 0x00,
3548 { &hf_ctn_application_parameter_data_send
,
3549 { "Attachment", "obex.parameter.ctn.attachment",
3550 FT_UINT8
, BASE_HEX
, VALS(no_yes_vals
), 0x00,
3553 { &hf_ctn_application_parameter_data_filter_period_begin
,
3554 { "Filter Period Begin", "obex.parameter.ctn.filter_period_begin",
3555 FT_STRING
, BASE_NONE
, NULL
, 0x00,
3558 { &hf_ctn_application_parameter_data_filter_period_end
,
3559 { "Filter Period End", "obex.parameter.ctn.filter_period_end",
3560 FT_STRING
, BASE_NONE
, NULL
, 0x00,
3563 { &hf_ctn_application_parameter_data_parameter_mask
,
3564 { "Parameter Mask", "obex.parameter.ctn.parameter_mask",
3565 FT_UINT32
, BASE_HEX
, NULL
, 0x00,
3568 { &hf_ctn_application_parameter_data_parameter_mask_reserved
,
3569 { "Reserved", "obex.parameter.ctn.parameter_mask.reserved",
3570 FT_UINT32
, BASE_HEX
, NULL
, 0xFFFFFC00,
3573 { &hf_ctn_application_parameter_data_parameter_mask_recurrent
,
3574 { "Recurrent", "obex.parameter.ctn.parameter_mask.recurrent",
3575 FT_UINT32
, BASE_HEX
, NULL
, 0x00000200,
3578 { &hf_ctn_application_parameter_data_parameter_mask_send_status
,
3579 { "Send Status", "obex.parameter.ctn.parameter_mask.send_status",
3580 FT_UINT32
, BASE_HEX
, NULL
, 0x00000100,
3583 { &hf_ctn_application_parameter_data_parameter_mask_alarm_status
,
3584 { "Alarm Status", "obex.parameter.ctn.parameter_mask.alarm_status",
3585 FT_UINT32
, BASE_HEX
, NULL
, 0x00000080,
3588 { &hf_ctn_application_parameter_data_parameter_mask_pstatus
,
3589 { "pStatus", "obex.parameter.ctn.parameter_mask.pstatus",
3590 FT_UINT32
, BASE_HEX
, NULL
, 0x00000040,
3593 { &hf_ctn_application_parameter_data_parameter_mask_priority
,
3594 { "Priority", "obex.parameter.ctn.parameter_mask.priority",
3595 FT_UINT32
, BASE_HEX
, NULL
, 0x00000020,
3598 { &hf_ctn_application_parameter_data_parameter_mask_originator_address
,
3599 { "Originator Address", "obex.parameter.ctn.parameter_mask.originator_address",
3600 FT_UINT32
, BASE_HEX
, NULL
, 0x00000010,
3603 { &hf_ctn_application_parameter_data_parameter_mask_originator_name
,
3604 { "Originator Name", "obex.parameter.ctn.parameter_mask.originator_name",
3605 FT_UINT32
, BASE_HEX
, NULL
, 0x00000008,
3608 { &hf_ctn_application_parameter_data_parameter_mask_end_time
,
3609 { "End Time", "obex.parameter.ctn.parameter_mask.end_time",
3610 FT_UINT32
, BASE_HEX
, NULL
, 0x00000004,
3613 { &hf_ctn_application_parameter_data_parameter_mask_summary
,
3614 { "Summary", "obex.parameter.ctn.parameter_mask.summary",
3615 FT_UINT32
, BASE_HEX
, NULL
, 0x00000002,
3618 { &hf_ctn_application_parameter_data_parameter_mask_attachment
,
3619 { "Attachment", "obex.parameter.ctn.parameter_mask.attachment",
3620 FT_UINT32
, BASE_HEX
, NULL
, 0x00000001,
3623 { &hf_ctn_application_parameter_data_status_indicator
,
3624 { "Status Indicator", "obex.parameter.ctn.status_indicator",
3625 FT_UINT8
, BASE_HEX
, VALS(ctn_application_parameter_data_status_indicator_vals
), 0x00,
3628 { &hf_ctn_application_parameter_data_status_value
,
3629 { "Status Value", "obex.parameter.ctn.status_value",
3630 FT_UINT8
, BASE_HEX
, VALS(ctn_application_parameter_data_status_value_vals
), 0x00,
3633 { &hf_ctn_application_parameter_data_postpone_val
,
3634 { "Postpone Val", "obex.parameter.ctn.postpone_val",
3635 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
3638 { &hf_ctn_application_parameter_data_email_uri
,
3639 { "Email URI", "obex.parameter.ctn.email_uri",
3640 FT_STRING
, BASE_NONE
, NULL
, 0x00,
3643 { &hf_ctn_application_parameter_data_cse_time
,
3644 { "CSE Time", "obex.parameter.ctn.cse_time",
3645 FT_STRING
, BASE_NONE
, NULL
, 0x00,
3648 { &hf_ctn_application_parameter_data_recurrent
,
3649 { "Recurrent", "obex.parameter.ctn.recurrent",
3650 FT_UINT8
, BASE_HEX
, VALS(no_yes_vals
), 0x00,
3653 { &hf_ctn_application_parameter_data_attach_id
,
3654 { "Attach ID", "obex.parameter.ctn.attach_id",
3655 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
3658 { &hf_ctn_application_parameter_data_last_update
,
3659 { "Last Update", "obex.parameter.ctn.last_update",
3660 FT_STRING
, BASE_NONE
, NULL
, 0x00,
3663 /* for fragmentation */
3664 { &hf_obex_fragment_overlap
,
3665 { "Fragment overlap", "obex.fragment.overlap", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3666 "Fragment overlaps with other fragments", HFILL
}
3668 { &hf_obex_fragment_overlap_conflict
,
3669 { "Conflicting data in fragment overlap", "obex.fragment.overlap.conflict", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3670 "Overlapping fragments contained conflicting data", HFILL
}
3672 { &hf_obex_fragment_multiple_tails
,
3673 { "Multiple tail fragments found", "obex.fragment.multipletails", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3674 "Several tails were found when defragmenting the packet", HFILL
}
3676 { &hf_obex_fragment_too_long_fragment
,
3677 { "Fragment too long", "obex.fragment.toolongfragment", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
3678 "Fragment contained data past end of packet", HFILL
}
3680 { &hf_obex_fragment_error
,
3681 { "Defragmentation error", "obex.fragment.error", FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
3682 "Defragmentation error due to illegal fragments", HFILL
}
3684 { &hf_obex_fragment_count
,
3685 { "Fragment count", "obex.fragment.count", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3688 { &hf_obex_fragment
,
3689 { "OBEX Fragment", "obex.fragment", FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
3692 { &hf_obex_fragments
,
3693 { "OBEX Fragments", "obex.fragments", FT_NONE
, BASE_NONE
, NULL
, 0x0,
3696 { &hf_obex_reassembled_in
,
3697 { "Reassembled OBEX in frame", "obex.reassembled_in", FT_FRAMENUM
, BASE_NONE
, NULL
, 0x0,
3698 "This OBEX frame is reassembled in this frame", HFILL
}
3700 { &hf_obex_reassembled_length
,
3701 { "Reassembled OBEX length", "obex.reassembled.length", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
3702 "The total length of the reassembled payload", HFILL
}
3705 { "Profile", "obex.profile", FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
, &profile_vals_ext
, 0x0,
3706 "Bluetooth Profile used in this OBEX session", HFILL
}
3709 { "Type", "obex.type", FT_STRINGZ
, BASE_NONE
, NULL
, 0x0,
3713 { "Object Class", "obex.object_class", FT_STRINGZ
, BASE_NONE
, NULL
, 0x0,
3717 { "Time", "obex.time", FT_STRINGZ
, BASE_NONE
, NULL
, 0x0,
3720 { &hf_hdr_val_action
,
3721 { "Action", "obex.action", FT_UINT8
, BASE_DEC
, VALS(action_vals
), 0x0,
3724 { &hf_hdr_val_single_response_mode
,
3725 { "Single Response Mode", "obex.single_response_mode", FT_UINT8
, BASE_DEC
, VALS(single_response_mode_vals
), 0x0,
3728 { &hf_hdr_val_single_response_mode_parameter
,
3729 { "Single Response Mode Parameter", "obex.single_response_mode_parameter", FT_UINT8
, BASE_DEC
, VALS(single_response_mode_parameter_vals
), 0x0,
3733 { "WAN UUID", "obex.wan_uuid",
3734 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
3737 { &hf_sender_bd_addr
,
3738 { "Sender Address", "obex.sender_bd_addr",
3739 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
3743 { "Name", "obex.name",
3744 FT_STRING
, BASE_NONE
, NULL
, 0,
3748 { "Current Path", "obex.current_path",
3749 FT_STRINGZ
, BASE_NONE
, NULL
, 0,
3752 { &hf_request_in_frame
,
3753 { "Request in Frame", "obex.request_in_frame", FT_FRAMENUM
, BASE_NONE
, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST
), 0x0,
3756 { &hf_response_in_frame
,
3757 { "Response in Frame", "obex.response_in_frame", FT_FRAMENUM
, BASE_NONE
, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE
), 0x0,
3762 /* Setup protocol subtree array */
3763 static int *ett
[] = {
3769 &ett_obex_parameter
,
3771 &ett_obex_fragments
,
3772 &ett_obex_session_parameters
,
3773 &ett_obex_application_parameters
,
3774 &ett_obex_authentication_parameters
3777 static ei_register_info ei
[] = {
3778 { &ei_application_parameter_length_bad
, { "obex.parameter.length.bad", PI_PROTOCOL
, PI_WARN
, "Parameter length bad", EXPFILL
}},
3779 { &ei_unexpected_data
, { "obex.expert.unexpected_data", PI_PROTOCOL
, PI_WARN
, "Unexpected data", EXPFILL
}},
3780 { &ei_decoded_as_profile
, { "obex.expert.decoded_as.profile", PI_PROTOCOL
, PI_NOTE
, "Decoded As", EXPFILL
}},
3783 /* Decode As handling */
3784 static build_valid_func obex_profile_da_build_value
[1] = {obex_profile_value
};
3785 static decode_as_value_t obex_profile_da_values
= {obex_profile_prompt
, 1, obex_profile_da_build_value
};
3786 static decode_as_t obex_profile_da
= {"obex", "obex.profile", 1, 0, &obex_profile_da_values
, NULL
, NULL
,
3787 decode_as_default_populate_list
, decode_as_default_reset
, decode_as_default_change
, NULL
};
3789 static build_valid_func media_type_da_build_value
[1] = {media_type_value
};
3790 static decode_as_value_t media_type_da_values
= {media_type_prompt
, 1, media_type_da_build_value
};
3791 static decode_as_t media_type_da
= {"obex", "media_type",
3792 1, 0, &media_type_da_values
, NULL
, NULL
,
3793 decode_as_default_populate_list
, decode_as_default_reset
, decode_as_default_change
, NULL
};
3796 obex_path
= wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3797 obex_profile
= wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3798 obex_last_opcode
= wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
3800 proto_obex
= proto_register_protocol("OBEX Protocol", "OBEX", "obex");
3802 obex_handle
= register_dissector("obex", dissect_obex
, proto_obex
);
3804 obex_profile_table
= register_dissector_table("obex.profile", "OBEX Profile", proto_obex
, FT_UINT8
, BASE_DEC
);
3806 /* Required function calls to register the header fields and subtrees used */
3807 proto_register_field_array(proto_obex
, hf
, array_length(hf
));
3808 proto_register_subtree_array(ett
, array_length(ett
));
3809 expert_obex
= expert_register_protocol(proto_obex
);
3810 expert_register_field_array(expert_obex
, ei
, array_length(ei
));
3812 reassembly_table_register(&obex_reassembly_table
,
3813 &addresses_reassembly_table_functions
);
3815 register_decode_as(&obex_profile_da
);
3817 proto_raw
= proto_register_protocol("OBEX Raw Application Parameters", "Raw Application Parameters", "obex.parameter.raw");
3818 raw_application_parameters_handle
= register_dissector("obex.parameter.raw", dissect_obex_application_parameter_raw
, proto_raw
);
3820 proto_bpp
= proto_register_protocol("Bluetooth OBEX BPP Application Parameters", "BT BPP Application Parameters", "obex.parameter.bt.bpp");
3821 bt_bpp_application_parameters_handle
= register_dissector("obex.parameter.bt.bpp", dissect_obex_application_parameter_bt_bpp
, proto_bpp
);
3823 proto_bip
= proto_register_protocol("Bluetooth OBEX BIP Application Parameters", "BT BIP Application Parameters", "obex.parameter.bt.bip");
3824 bt_bip_application_parameters_handle
= register_dissector("obex.parameter.bt.bip", dissect_obex_application_parameter_bt_bip
, proto_bip
);
3826 proto_map
= proto_register_protocol("Bluetooth OBEX MAP Application Parameters", "BT MAP Application Parameters", "obex.parameter.bt.map");
3827 bt_map_application_parameters_handle
= register_dissector("obex.parameter.bt.map", dissect_obex_application_parameter_bt_map
, proto_map
);
3829 proto_bt_gpp
= proto_register_protocol("Bluetooth OBEX GPP Application Parameters", "BT GPP Application Parameters", "obex.parameter.bt.gpp");
3830 bt_gpp_application_parameters_handle
= register_dissector("obex.parameter.bt.gpp", dissect_obex_application_parameter_bt_gpp
, proto_bt_gpp
);
3832 proto_bt_ctn
= proto_register_protocol("Bluetooth OBEX CTN Application Parameters", "BT CTN Application Parameters", "obex.parameter.bt.ctn");
3833 bt_ctn_application_parameters_handle
= register_dissector("obex.parameter.bt.ctn", dissect_obex_application_parameter_bt_ctn
, proto_bt_ctn
);
3835 proto_bt_pbap
= proto_register_protocol("Bluetooth OBEX PBAP Application Parameters", "BT PBAP Application Parameters", "obex.parameter.bt.pbap");
3836 bt_pbap_application_parameters_handle
= register_dissector("obex.parameter.bt.pbap", dissect_obex_application_parameter_bt_pbap
, proto_bt_pbap
);
3838 register_decode_as(&media_type_da
);
3840 module
= prefs_register_protocol(proto_obex
, NULL
);
3841 prefs_register_static_text_preference(module
, "supported_bluetooth_profiles",
3842 "Protocol OBEX support Bluetooth profiles: BIP 1.2, BPP 1.2, CTN 1.0, FTP 1.3, GOEP 1.3, GPP 1.0, MAP 1.2, OPP 1.2, PBAP 1.2, SYNCH 1.2",
3843 "Versions of Bluetooth profiles supported by this dissector.");
3847 proto_reg_handoff_obex(void)
3849 dissector_add_string("bluetooth.uuid", "1104", obex_handle
);
3850 dissector_add_string("bluetooth.uuid", "1105", obex_handle
);
3851 dissector_add_string("bluetooth.uuid", "1106", obex_handle
);
3852 dissector_add_string("bluetooth.uuid", "1107", obex_handle
);
3853 dissector_add_string("bluetooth.uuid", "1118", obex_handle
);
3854 dissector_add_string("bluetooth.uuid", "1119", obex_handle
);
3855 dissector_add_string("bluetooth.uuid", "111a", obex_handle
);
3856 dissector_add_string("bluetooth.uuid", "111b", obex_handle
);
3857 dissector_add_string("bluetooth.uuid", "111c", obex_handle
);
3858 dissector_add_string("bluetooth.uuid", "111d", obex_handle
);
3859 dissector_add_string("bluetooth.uuid", "1120", obex_handle
);
3860 dissector_add_string("bluetooth.uuid", "1121", obex_handle
);
3861 dissector_add_string("bluetooth.uuid", "1122", obex_handle
);
3862 dissector_add_string("bluetooth.uuid", "1123", obex_handle
);
3863 dissector_add_string("bluetooth.uuid", "112e", obex_handle
);
3864 dissector_add_string("bluetooth.uuid", "112f", obex_handle
);
3865 dissector_add_string("bluetooth.uuid", "1130", obex_handle
);
3866 dissector_add_string("bluetooth.uuid", "1132", obex_handle
);
3867 dissector_add_string("bluetooth.uuid", "1133", obex_handle
);
3868 dissector_add_string("bluetooth.uuid", "1134", obex_handle
);
3870 http_handle
= find_dissector_add_dependency("http", proto_obex
);
3871 xml_handle
= find_dissector_add_dependency("xml", proto_obex
);
3872 data_handle
= find_dissector("data");
3873 data_text_lines_handle
= find_dissector("data-text-lines");
3875 dissector_add_uint("obex.profile", PROFILE_UNKNOWN
, raw_application_parameters_handle
);
3876 dissector_add_uint("obex.profile", PROFILE_BPP
, bt_bpp_application_parameters_handle
);
3877 dissector_add_uint("obex.profile", PROFILE_BIP
, bt_bip_application_parameters_handle
);
3878 dissector_add_uint("obex.profile", PROFILE_CTN
, bt_ctn_application_parameters_handle
);
3879 dissector_add_uint("obex.profile", PROFILE_GPP
, bt_gpp_application_parameters_handle
);
3880 dissector_add_uint("obex.profile", PROFILE_MAP
, bt_map_application_parameters_handle
);
3881 dissector_add_uint("obex.profile", PROFILE_PBAP
, bt_pbap_application_parameters_handle
);
3883 dissector_add_uint("obex.profile", PROFILE_OPP
, raw_application_parameters_handle
);
3884 dissector_add_uint("obex.profile", PROFILE_FTP
, raw_application_parameters_handle
);
3885 dissector_add_uint("obex.profile", PROFILE_SYNCML
, raw_application_parameters_handle
);
3886 dissector_add_uint("obex.profile", PROFILE_SYNC
, raw_application_parameters_handle
);
3888 dissector_add_for_decode_as("btrfcomm.dlci", obex_handle
);
3889 dissector_add_for_decode_as("btl2cap.psm", obex_handle
);
3890 dissector_add_for_decode_as("btl2cap.cid", obex_handle
);
3893 dissector_add_string("media_type", "x-bt/phonebook", data_text_lines_handle
);
3894 dissector_add_string("media_type", "x-bt/vcard", data_text_lines_handle
);
3895 dissector_add_string("media_type", "x-bt/vcard-listing", xml_handle
);
3897 dissector_add_string("media_type", "x-bt/message", data_text_lines_handle
);
3898 dissector_add_string("media_type", "x-bt/messageStatus", data_text_lines_handle
);
3899 dissector_add_string("media_type", "x-bt/MAP-messageUpdate", data_text_lines_handle
);
3900 dissector_add_string("media_type", "x-bt/MAP-NotificationRegistration", data_text_lines_handle
);
3901 dissector_add_string("media_type", "x-bt/MASInstanceInformation", data_text_lines_handle
);
3902 dissector_add_string("media_type", "x-bt/MAP-msg-listing", xml_handle
);
3903 dissector_add_string("media_type", "x-bt/MAP-event-report", xml_handle
);
3904 dissector_add_string("media_type", "x-obex/folder-listing", xml_handle
);
3906 dissector_add_string("media_type", "x-bt/CTN-EventReport", xml_handle
);
3907 dissector_add_string("media_type", "x-bt/CTN-Listing", xml_handle
);
3908 dissector_add_string("media_type", "x-bt/CTN-NotificationRegistration", data_text_lines_handle
);
3909 dissector_add_string("media_type", "x-bt/Calendar", data_text_lines_handle
);
3910 dissector_add_string("media_type", "x-bt/CalendarStatus", data_text_lines_handle
);
3911 dissector_add_string("media_type", "x-bt/CTN-forward", data_text_lines_handle
);
3912 dissector_add_string("media_type", "x-bt/InstanceDescription", data_text_lines_handle
);
3913 dissector_add_string("media_type", "x-bt/Update", data_text_lines_handle
);
3915 dissector_add_string("media_type", "text/x-ref-simple", data_text_lines_handle
);
3916 dissector_add_string("media_type", "text/x-ref-list", data_text_lines_handle
);
3917 dissector_add_string("media_type", "x-obex/RUI", data_text_lines_handle
);
3918 dissector_add_string("media_type", "x-obex/bt-SOAP", xml_handle
);
3920 dissector_add_string("media_type", "x-bt/img-listing", xml_handle
);
3921 dissector_add_string("media_type", "x-bt/img-properties", xml_handle
);
3922 dissector_add_string("media_type", "x-bt/img-capabilities", xml_handle
);
3923 dissector_add_string("media_type", "x-bt/img-print", data_text_lines_handle
);
3924 dissector_add_string("media_type", "x-bt/img-img", data_handle
);
3925 dissector_add_string("media_type", "x-bt/img-thm", data_handle
);
3926 dissector_add_string("media_type", "x-bt/img-attachment", data_handle
);
3927 dissector_add_string("media_type", "x-bt/img-display", data_handle
);
3928 dissector_add_string("media_type", "x-bt/img-partial", data_handle
);
3929 dissector_add_string("media_type", "x-bt/img-archive", data_handle
);
3930 dissector_add_string("media_type", "x-bt/img-status", data_handle
);
3931 dissector_add_string("media_type", "x-bt/img-monitoring", data_handle
);
3933 media_type_dissector_table
= find_dissector_table("media_type");
3935 dissector_add_for_decode_as("usb.product", obex_handle
);
3936 dissector_add_for_decode_as("usb.device", obex_handle
);
3937 dissector_add_for_decode_as("usb.protocol", obex_handle
);
3938 dissector_add_for_decode_as_with_preference("tcp.port", obex_handle
);
3939 dissector_add_for_decode_as_with_preference("udp.port", obex_handle
);
3943 * Editor modelines - https://www.wireshark.org/tools/modelines.html
3948 * indent-tabs-mode: nil
3951 * vi: set shiftwidth=4 tabstop=8 expandtab:
3952 * :indentSize=4:tabSize=8:noTabs=true: