Coverage Report

Created: 2026-05-14 06:28

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