Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-btsdp.c
blob5343be8b8539110a7afa713e3a5f83982a8ad685
1 /* packet-btsdp.c
2 * Routines for Bluetooth SDP dissection
3 * Copyright 2002, Wolfgang Hansmann <hansmann@cs.uni-bonn.de>
4 * Copyright 2006, Ronnie Sahlberg
5 * - refactored for Wireshark checkin
6 * Copyright 2013, Michal Labedzki for Tieto Corporation
7 * - support SDP fragmentation (Continuation State)
8 * - implement DI 1.3
9 * - dissect profile specific attributes
10 * - fix service recognize
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include "config.h"
21 #include <epan/packet.h>
22 #include <epan/expert.h>
23 #include <epan/prefs.h>
24 #include <epan/etypes.h>
25 #include <epan/to_str.h>
26 #include <epan/iana_charsets.h>
28 #include "packet-btsdp.h"
29 #include "packet-btl2cap.h"
31 static int proto_btsdp;
33 static int hf_pdu_id;
34 static int hf_tid;
35 static int hf_parameter_length;
36 static int hf_ssr_total_count;
37 static int hf_ssr_current_count;
38 static int hf_error_code;
39 static int hf_attribute_id_list;
40 static int hf_attribute_id_range;
41 static int hf_attribute_id_range_from;
42 static int hf_attribute_id_range_to;
43 static int hf_attribute_list_byte_count;
44 static int hf_maximum_service_record_count;
45 static int hf_maximum_attribute_byte_count;
46 static int hf_continuation_state;
47 static int hf_continuation_state_length;
48 static int hf_continuation_state_value;
49 static int hf_fragment;
50 static int hf_partial_record_handle_list;
51 static int hf_reassembled_record_handle_list;
52 static int hf_partial_attribute_list;
53 static int hf_reassembled_attribute_list;
54 static int hf_data_element;
55 static int hf_data_element_size;
56 static int hf_data_element_type;
57 static int hf_data_element_var_size;
58 static int hf_data_element_value;
59 static int hf_data_element_value_nil;
60 static int hf_data_element_value_boolean;
61 static int hf_data_element_value_signed_int;
62 static int hf_data_element_value_unsigned_int;
63 static int hf_data_element_value_uuid_16;
64 static int hf_data_element_value_uuid_32;
65 static int hf_data_element_value_uuid_128;
66 static int hf_data_element_value_uuid;
67 static int hf_data_element_value_string;
68 static int hf_data_element_value_url;
69 static int hf_data_element_value_alternative;
70 static int hf_data_element_value_sequence;
71 static int hf_profile_descriptor_list;
72 static int hf_attribute_list;
73 static int hf_attribute_lists;
74 static int hf_service_search_pattern;
75 static int hf_service_record_handle_list;
76 static int hf_service_attribute;
77 static int hf_service_attribute_id;
78 static int hf_service_attribute_value;
79 static int hf_service_attribute_id_generic;
80 static int hf_service_attribute_id_a2dp;
81 static int hf_service_attribute_id_avrcp;
82 static int hf_service_attribute_id_ctp;
83 static int hf_service_attribute_id_bip_imaging_responder;
84 static int hf_service_attribute_id_bip_imaging_other;
85 static int hf_service_attribute_id_bpp;
86 static int hf_service_attribute_id_bpp_rui;
87 static int hf_service_attribute_id_did;
88 static int hf_service_attribute_id_dun;
89 static int hf_service_attribute_id_fax;
90 static int hf_service_attribute_id_ftp;
91 static int hf_service_attribute_id_gnss;
92 static int hf_service_attribute_id_hfp_hf;
93 static int hf_service_attribute_id_hfp_ag;
94 static int hf_service_attribute_id_hcrp;
95 static int hf_service_attribute_id_hsp;
96 static int hf_service_attribute_id_hdp;
97 static int hf_service_attribute_id_hid;
98 static int hf_service_attribute_id_wap;
99 static int hf_service_attribute_id_map_mas;
100 static int hf_service_attribute_id_map_mns;
101 static int hf_service_attribute_id_opp;
102 static int hf_service_attribute_id_pan_nap;
103 static int hf_service_attribute_id_pan_gn;
104 static int hf_service_attribute_id_pan_panu;
105 static int hf_service_attribute_id_pbap;
106 static int hf_service_attribute_id_synch;
107 static int hf_service_attribute_id_ctn_as;
108 static int hf_service_attribute_id_ctn_ns;
109 static int hf_service_attribute_id_mps;
110 static int hf_did_specification_id;
111 static int hf_did_vendor_id;
112 static int hf_did_vendor_id_bluetooth_sig;
113 static int hf_did_vendor_id_usb_forum;
114 static int hf_did_product_id;
115 static int hf_did_primary_record;
116 static int hf_did_version;
117 static int hf_did_vendor_id_source;
118 static int hf_a2dp_sink_supported_features_reserved;
119 static int hf_a2dp_sink_supported_features_amplifier;
120 static int hf_a2dp_sink_supported_features_recorder;
121 static int hf_a2dp_sink_supported_features_speaker;
122 static int hf_a2dp_sink_supported_features_headphone;
123 static int hf_a2dp_source_supported_features_reserved;
124 static int hf_a2dp_source_supported_features_mixer;
125 static int hf_a2dp_source_supported_features_tuner;
126 static int hf_a2dp_source_supported_features_microphone;
127 static int hf_a2dp_source_supported_features_player;
128 static int hf_synch_supported_data_store;
129 static int hf_ctp_external_network;
130 static int hf_avrcp_ct_supported_features_reserved_10_15;
131 static int hf_avrcp_ct_supported_features_cover_art_get_linked_thumbnail;
132 static int hf_avrcp_ct_supported_features_cover_art_get_image;
133 static int hf_avrcp_ct_supported_features_cover_art_get_image_properties;
134 static int hf_avrcp_ct_supported_features_browsing;
135 static int hf_avrcp_ct_supported_features_reserved_4_5;
136 static int hf_avrcp_ct_supported_features_category_4;
137 static int hf_avrcp_ct_supported_features_category_3;
138 static int hf_avrcp_ct_supported_features_category_2;
139 static int hf_avrcp_ct_supported_features_category_1;
140 static int hf_avrcp_tg_supported_features_reserved_9_15;
141 static int hf_avrcp_tg_supported_features_cover_art;
142 static int hf_avrcp_tg_supported_features_multiple_player;
143 static int hf_avrcp_tg_supported_features_browsing;
144 static int hf_avrcp_tg_supported_features_group_navigation;
145 static int hf_avrcp_tg_supported_features_settings;
146 static int hf_avrcp_tg_supported_features_category_4;
147 static int hf_avrcp_tg_supported_features_category_3;
148 static int hf_avrcp_tg_supported_features_category_2;
149 static int hf_avrcp_tg_supported_features_category_1;
150 static int hf_hsp_remote_audio_volume_control;
151 static int hf_gnss_supported_features;
152 static int hf_pbap_pse_supported_repositories;
153 static int hf_pbap_pse_supported_repositories_reserved;
154 static int hf_pbap_pse_supported_repositories_favourites;
155 static int hf_pbap_pse_supported_repositories_speed_dial;
156 static int hf_pbap_pse_supported_repositories_sim_card;
157 static int hf_pbap_pse_supported_repositories_local_phonebook;
158 static int hf_fax_support_class_1;
159 static int hf_fax_support_class_2;
160 static int hf_fax_support_class_2_vendor;
161 static int hf_fax_support_audio_feedback;
162 static int hf_ftp_goep_l2cap_psm;
163 static int hf_map_mas_instance_id;
164 static int hf_map_mas_supported_message_types_reserved;
165 static int hf_map_mas_supported_message_types_mms;
166 static int hf_map_mas_supported_message_types_sms_cdma;
167 static int hf_map_mas_supported_message_types_sms_gsm;
168 static int hf_map_mas_supported_message_types_email;
169 static int hf_hcrp_1284_id;
170 static int hf_hcrp_device_location;
171 static int hf_hcrp_device_name;
172 static int hf_hcrp_friendly_name;
173 static int hf_wap_network_address;
174 static int hf_wap_gateway;
175 static int hf_wap_homepage_url;
176 static int hf_wap_stack_type;
177 static int hf_hdp_data_exchange;
178 static int hf_hdp_support_procedure_reserved_5_7;
179 static int hf_hdp_support_procedure_sync_master_role;
180 static int hf_hdp_support_procedure_clock_synchronization_protocol;
181 static int hf_hdp_support_procedure_reconnect_acceptance;
182 static int hf_hdp_support_procedure_reconnect_initiation;
183 static int hf_hdp_support_procedure_reserved;
184 static int hf_hdp_supported_features_data;
185 static int hf_hdp_supported_features_data_mdep_id;
186 static int hf_hdp_supported_features_data_mdep_data_type;
187 static int hf_hdp_supported_features_data_mdep_role;
188 static int hf_hdp_supported_features_data_mdep_description;
189 static int hf_hdp_supported_features_mdep_id;
190 static int hf_hdp_supported_features_mdep_data_type;
191 static int hf_hdp_supported_features_mdep_data_type_01;
192 static int hf_hdp_supported_features_mdep_role;
193 static int hf_hdp_supported_features_mdep_description;
194 static int hf_pan_sercurity_description;
195 static int hf_pan_ipv4_subnet;
196 static int hf_pan_ipv6_subnet;
197 static int hf_pan_max_net_access_rate;
198 static int hf_pan_net_access_type;
199 static int hf_opp_goep_l2cap_psm;
200 static int hf_opp_supported_format;
201 static int hf_dun_escape_sequence;
202 static int hf_dun_support_audio_feedback;
203 static int hf_hfp_hf_supported_features_reserved;
204 static int hf_hfp_hf_supported_features_wide_band_speech;
205 static int hf_hfp_hf_supported_features_remote_volume_control;
206 static int hf_hfp_hf_supported_features_voice_recognition_activation;
207 static int hf_hfp_hf_supported_features_cli_presentation_capability;
208 static int hf_hfp_hf_supported_features_call_waiting_or_three_way_calling;
209 static int hf_hfp_hf_supported_features_ec_and_or_nr_function;
210 static int hf_hfp_gw_network;
211 static int hf_hfp_gw_supported_features_reserved;
212 static int hf_hfp_gw_supported_features_wide_band_speech;
213 static int hf_hfp_gw_supported_features_attach_phone_number_to_voice_tag;
214 static int hf_hfp_gw_supported_features_inband_ring_tone_capability;
215 static int hf_hfp_gw_supported_features_voice_recognition_function;
216 static int hf_hfp_gw_supported_features_ec_and_or_nr_function;
217 static int hf_hfp_gw_supported_features_three_way_calling;
218 static int hf_sdp_protocol_item;
219 static int hf_sdp_protocol;
220 static int hf_sdp_protocol_psm;
221 static int hf_sdp_protocol_channel;
222 static int hf_sdp_protocol_gatt_handle_start;
223 static int hf_sdp_protocol_gatt_handle_end;
224 static int hf_sdp_protocol_version;
225 static int hf_sdp_protocol_bnep_type;
226 static int hf_sdp_service_record_handle;
227 static int hf_sdp_service_record_state;
228 static int hf_sdp_service_info_time_to_live;
229 static int hf_sdp_service_availability;
230 static int hf_sdp_service_documentation_url;
231 static int hf_sdp_service_client_executable_url;
232 static int hf_sdp_service_icon_url;
233 static int hf_sdp_service_name;
234 static int hf_sdp_service_description;
235 static int hf_sdp_service_provider_name;
236 static int hf_sdp_lang;
237 static int hf_sdp_lang_id;
238 static int hf_sdp_lang_code;
239 static int hf_sdp_lang_encoding;
240 static int hf_sdp_lang_attribute_base;
241 static int hf_hid_descriptor_list_descriptor_data;
242 static int hf_hid_lang;
243 static int hf_hid_device_release_number;
244 static int hf_hid_parser_version;
245 static int hf_hid_device_subclass_type;
246 static int hf_hid_device_subclass_subtype;
247 static int hf_hid_device_subclass_reserved;
248 static int hf_hid_country_code;
249 static int hf_hid_virtual_cable;
250 static int hf_hid_reconnect_initiate;
251 static int hf_hid_sdp_disable;
252 static int hf_hid_battery_power;
253 static int hf_hid_remote_wake;
254 static int hf_hid_profile_version;
255 static int hf_hid_supervision_timeout;
256 static int hf_hid_normally_connectable;
257 static int hf_hid_boot_device;
258 static int hf_hid_ssr_host_max_latency;
259 static int hf_hid_ssr_host_min_timeout;
260 static int hf_hid_descriptor_list_type;
261 static int hf_hid_descriptor_list_descriptor;
262 static int hf_bip_goep_l2cap_psm;
263 static int hf_bip_supported_capabilities_reserved_4_7;
264 static int hf_bip_supported_capabilities_displaying;
265 static int hf_bip_supported_capabilities_printing;
266 static int hf_bip_supported_capabilities_capturing;
267 static int hf_bip_supported_capabilities_genering_imaging;
268 static int hf_bip_supported_features_reserved_9_15;
269 static int hf_bip_supported_features_remote_display;
270 static int hf_bip_supported_features_remote_camera;
271 static int hf_bip_supported_features_automatic_archive;
272 static int hf_bip_supported_features_advanced_image_printing;
273 static int hf_bip_supported_features_image_pull;
274 static int hf_bip_supported_features_image_push_display;
275 static int hf_bip_supported_features_image_push_print;
276 static int hf_bip_supported_features_image_push_store;
277 static int hf_bip_supported_features_image_push;
278 static int hf_bip_supported_functions_reserved_17_31;
279 static int hf_bip_supported_functions_get_status;
280 static int hf_bip_supported_functions_reserved_15;
281 static int hf_bip_supported_functions_get_monitoring_image;
282 static int hf_bip_supported_functions_start_archive;
283 static int hf_bip_supported_functions_reserved_12;
284 static int hf_bip_supported_functions_start_print;
285 static int hf_bip_supported_functions_delete_image;
286 static int hf_bip_supported_functions_get_linked_attachment;
287 static int hf_bip_supported_functions_get_linked_thumbnail;
288 static int hf_bip_supported_functions_get_image;
289 static int hf_bip_supported_functions_get_image_property;
290 static int hf_bip_supported_functions_get_images_list;
291 static int hf_bip_supported_functions_remote_display;
292 static int hf_bip_supported_functions_put_linked_thumbnail;
293 static int hf_bip_supported_functions_put_linked_attachment;
294 static int hf_bip_supported_functions_put_image;
295 static int hf_bip_supported_functions_get_capabilities;
296 static int hf_bip_supported_functions_reserved_13_31;
297 static int hf_bip_supported_functions_get_partial_image;
298 static int hf_bip_supported_functions_reserved_1_11;
299 static int hf_bip_supported_functions_reserved_1_4;
300 static int hf_bip_supported_functions_reserved_11_31;
301 static int hf_bip_total_imaging_data_capacity;
302 static int hf_bpp_document_formats_supported;
303 static int hf_bpp_character_repertoires_support;
304 static int hf_bpp_xhtml_print_image_formats_supported;
305 static int hf_bpp_color_supported;
306 static int hf_bpp_1284_id;
307 static int hf_bpp_printer_name;
308 static int hf_bpp_printer_location;
309 static int hf_bpp_duplex_supported;
310 static int hf_bpp_media_types_supported;
311 static int hf_bpp_max_media_width;
312 static int hf_bpp_max_media_length;
313 static int hf_bpp_enhanced_layout_supported;
314 static int hf_bpp_rui_formats_supported;
315 static int hf_bpp_reference_printing_rui_supported;
316 static int hf_bpp_direct_printing_rui_supported;
317 static int hf_bpp_reference_printing_top_url;
318 static int hf_bpp_direct_printing_top_url;
319 static int hf_bpp_device_name;
320 static int hf_bpp_printer_admin_rui_top_url;
321 static int hf_ctn_instance_id;
322 static int hf_ctn_supported_features;
323 static int hf_ctn_supported_features_reserved;
324 static int hf_ctn_supported_features_forward;
325 static int hf_ctn_supported_features_delete;
326 static int hf_ctn_supported_features_uploading;
327 static int hf_ctn_supported_features_downloading;
328 static int hf_ctn_supported_features_browsing;
329 static int hf_ctn_supported_features_notification;
330 static int hf_ctn_supported_features_account_management;
331 static int hf_mps_mpsd_scenarios;
332 static int hf_mps_mpsd_scenarios_reserved;
333 static int hf_mps_mpsd_scenarios_37;
334 static int hf_mps_mpsd_scenarios_36;
335 static int hf_mps_mpsd_scenarios_35;
336 static int hf_mps_mpsd_scenarios_34;
337 static int hf_mps_mpsd_scenarios_33;
338 static int hf_mps_mpsd_scenarios_32;
339 static int hf_mps_mpsd_scenarios_31;
340 static int hf_mps_mpsd_scenarios_30;
341 static int hf_mps_mpsd_scenarios_29;
342 static int hf_mps_mpsd_scenarios_28;
343 static int hf_mps_mpsd_scenarios_27;
344 static int hf_mps_mpsd_scenarios_26;
345 static int hf_mps_mpsd_scenarios_25;
346 static int hf_mps_mpsd_scenarios_24;
347 static int hf_mps_mpsd_scenarios_23;
348 static int hf_mps_mpsd_scenarios_22;
349 static int hf_mps_mpsd_scenarios_21;
350 static int hf_mps_mpsd_scenarios_20;
351 static int hf_mps_mpsd_scenarios_19;
352 static int hf_mps_mpsd_scenarios_18;
353 static int hf_mps_mpsd_scenarios_17;
354 static int hf_mps_mpsd_scenarios_16;
355 static int hf_mps_mpsd_scenarios_15;
356 static int hf_mps_mpsd_scenarios_14;
357 static int hf_mps_mpsd_scenarios_13;
358 static int hf_mps_mpsd_scenarios_12;
359 static int hf_mps_mpsd_scenarios_11;
360 static int hf_mps_mpsd_scenarios_10;
361 static int hf_mps_mpsd_scenarios_9;
362 static int hf_mps_mpsd_scenarios_8;
363 static int hf_mps_mpsd_scenarios_7;
364 static int hf_mps_mpsd_scenarios_6;
365 static int hf_mps_mpsd_scenarios_5;
366 static int hf_mps_mpsd_scenarios_4;
367 static int hf_mps_mpsd_scenarios_3;
368 static int hf_mps_mpsd_scenarios_2;
369 static int hf_mps_mpsd_scenarios_1;
370 static int hf_mps_mpsd_scenarios_0;
371 static int hf_mps_mpmd_scenarios;
372 static int hf_mps_mpmd_scenarios_reserved;
373 static int hf_mps_mpmd_scenarios_18;
374 static int hf_mps_mpmd_scenarios_17;
375 static int hf_mps_mpmd_scenarios_16;
376 static int hf_mps_mpmd_scenarios_15;
377 static int hf_mps_mpmd_scenarios_14;
378 static int hf_mps_mpmd_scenarios_13;
379 static int hf_mps_mpmd_scenarios_12;
380 static int hf_mps_mpmd_scenarios_11;
381 static int hf_mps_mpmd_scenarios_10;
382 static int hf_mps_mpmd_scenarios_9;
383 static int hf_mps_mpmd_scenarios_8;
384 static int hf_mps_mpmd_scenarios_7;
385 static int hf_mps_mpmd_scenarios_6;
386 static int hf_mps_mpmd_scenarios_5;
387 static int hf_mps_mpmd_scenarios_4;
388 static int hf_mps_mpmd_scenarios_3;
389 static int hf_mps_mpmd_scenarios_2;
390 static int hf_mps_mpmd_scenarios_1;
391 static int hf_mps_mpmd_scenarios_0;
392 static int hf_mps_supported_profile_and_protocol_dependency;
393 static int hf_mps_supported_profile_and_protocol_dependency_reserved;
394 static int hf_mps_supported_profile_and_protocol_dependency_dis_connection_order_behaviour;
395 static int hf_mps_supported_profile_and_protocol_dependency_gavdp_requirements;
396 static int hf_mps_supported_profile_and_protocol_dependency_sniff_mode_during_streaming;
397 static int hf_map_mas_goep_l2cap_psm;
398 static int hf_map_mns_goep_l2cap_psm;
399 static int hf_map_supported_features;
400 static int hf_map_supported_features_reserved;
401 static int hf_map_supported_features_extended_event_report_1_1;
402 static int hf_map_supported_features_instance_information_feature;
403 static int hf_map_supported_features_delete_feature;
404 static int hf_map_supported_features_uploading_feature;
405 static int hf_map_supported_features_browsing_feature;
406 static int hf_map_supported_features_notification_feature;
407 static int hf_map_supported_features_notification_registration_feature;
408 static int hf_pbap_pse_supported_features;
409 static int hf_pbap_pse_supported_features_reserved;
410 static int hf_pbap_pse_supported_features_download;
411 static int hf_pbap_pse_supported_features_browsing;
412 static int hf_pbap_pse_supported_features_database_identifier;
413 static int hf_pbap_pse_supported_features_folder_version_counters;
414 static int hf_pbap_pse_supported_features_vcard_selecting;
415 static int hf_pbap_pse_supported_features_enhanced_missed_calls;
416 static int hf_pbap_pse_supported_features_x_bt_uci_vcard_property;
417 static int hf_pbap_pse_supported_features_x_bt_uid_vcard_property;
418 static int hf_pbap_pse_supported_features_contact_referencing;
419 static int hf_pbap_pse_supported_features_default_contact_image_format;
420 static int hf_pbap_goep_l2cap_psm;
422 static int ett_btsdp;
423 static int ett_btsdp_ssr;
424 static int ett_btsdp_des;
425 static int ett_btsdp_attribute;
426 static int ett_btsdp_attribute_id;
427 static int ett_btsdp_attribute_value;
428 static int ett_btsdp_attribute_idlist;
429 static int ett_btsdp_service_search_pattern;
430 static int ett_btsdp_continuation_state;
431 static int ett_btsdp_data_element;
432 static int ett_btsdp_data_element_value;
433 static int ett_btsdp_reassembled;
434 static int ett_btsdp_supported_features;
435 static int ett_btsdp_supported_features_mdep_id;
436 static int ett_btsdp_supported_features_mdep_data_type;
437 static int ett_btsdp_supported_features_mdep_role;
438 static int ett_btsdp_supported_features_mdep_description;
439 static int ett_btsdp_protocol;
441 static int * const hfx_ctn_supported_features[] = {
442 &hf_ctn_supported_features_reserved,
443 &hf_ctn_supported_features_forward,
444 &hf_ctn_supported_features_delete,
445 &hf_ctn_supported_features_uploading,
446 &hf_ctn_supported_features_downloading,
447 &hf_ctn_supported_features_browsing,
448 &hf_ctn_supported_features_notification,
449 &hf_ctn_supported_features_account_management,
450 NULL
453 static int * const hfx_mps_mpsd_scenarios[] = {
454 &hf_mps_mpsd_scenarios_reserved,
455 &hf_mps_mpsd_scenarios_37,
456 &hf_mps_mpsd_scenarios_36,
457 &hf_mps_mpsd_scenarios_35,
458 &hf_mps_mpsd_scenarios_34,
459 &hf_mps_mpsd_scenarios_33,
460 &hf_mps_mpsd_scenarios_32,
461 &hf_mps_mpsd_scenarios_31,
462 &hf_mps_mpsd_scenarios_30,
463 &hf_mps_mpsd_scenarios_29,
464 &hf_mps_mpsd_scenarios_28,
465 &hf_mps_mpsd_scenarios_27,
466 &hf_mps_mpsd_scenarios_26,
467 &hf_mps_mpsd_scenarios_25,
468 &hf_mps_mpsd_scenarios_24,
469 &hf_mps_mpsd_scenarios_23,
470 &hf_mps_mpsd_scenarios_22,
471 &hf_mps_mpsd_scenarios_21,
472 &hf_mps_mpsd_scenarios_20,
473 &hf_mps_mpsd_scenarios_19,
474 &hf_mps_mpsd_scenarios_18,
475 &hf_mps_mpsd_scenarios_17,
476 &hf_mps_mpsd_scenarios_16,
477 &hf_mps_mpsd_scenarios_15,
478 &hf_mps_mpsd_scenarios_14,
479 &hf_mps_mpsd_scenarios_13,
480 &hf_mps_mpsd_scenarios_12,
481 &hf_mps_mpsd_scenarios_11,
482 &hf_mps_mpsd_scenarios_10,
483 &hf_mps_mpsd_scenarios_9,
484 &hf_mps_mpsd_scenarios_8,
485 &hf_mps_mpsd_scenarios_7,
486 &hf_mps_mpsd_scenarios_6,
487 &hf_mps_mpsd_scenarios_5,
488 &hf_mps_mpsd_scenarios_4,
489 &hf_mps_mpsd_scenarios_3,
490 &hf_mps_mpsd_scenarios_2,
491 &hf_mps_mpsd_scenarios_1,
492 &hf_mps_mpsd_scenarios_0,
493 NULL
496 static int * const hfx_mps_mpmd_scenarios[] = {
497 &hf_mps_mpmd_scenarios_reserved,
498 &hf_mps_mpmd_scenarios_18,
499 &hf_mps_mpmd_scenarios_17,
500 &hf_mps_mpmd_scenarios_16,
501 &hf_mps_mpmd_scenarios_15,
502 &hf_mps_mpmd_scenarios_14,
503 &hf_mps_mpmd_scenarios_13,
504 &hf_mps_mpmd_scenarios_12,
505 &hf_mps_mpmd_scenarios_11,
506 &hf_mps_mpmd_scenarios_10,
507 &hf_mps_mpmd_scenarios_9,
508 &hf_mps_mpmd_scenarios_8,
509 &hf_mps_mpmd_scenarios_7,
510 &hf_mps_mpmd_scenarios_6,
511 &hf_mps_mpmd_scenarios_5,
512 &hf_mps_mpmd_scenarios_4,
513 &hf_mps_mpmd_scenarios_3,
514 &hf_mps_mpmd_scenarios_2,
515 &hf_mps_mpmd_scenarios_1,
516 &hf_mps_mpmd_scenarios_0,
517 NULL
520 static int * const hfx_mps_supported_profile_and_protocol_dependency[] = {
521 &hf_mps_supported_profile_and_protocol_dependency_reserved,
522 &hf_mps_supported_profile_and_protocol_dependency_dis_connection_order_behaviour,
523 &hf_mps_supported_profile_and_protocol_dependency_gavdp_requirements,
524 &hf_mps_supported_profile_and_protocol_dependency_sniff_mode_during_streaming,
525 NULL
528 static int * const hfx_map_supported_features[] = {
529 &hf_map_supported_features_reserved,
530 &hf_map_supported_features_extended_event_report_1_1,
531 &hf_map_supported_features_instance_information_feature,
532 &hf_map_supported_features_delete_feature,
533 &hf_map_supported_features_uploading_feature,
534 &hf_map_supported_features_browsing_feature,
535 &hf_map_supported_features_notification_feature,
536 &hf_map_supported_features_notification_registration_feature,
537 NULL
540 static int * const hfx_pbap_pse_supported_repositories[] = {
541 &hf_pbap_pse_supported_repositories_reserved,
542 &hf_pbap_pse_supported_repositories_favourites,
543 &hf_pbap_pse_supported_repositories_speed_dial,
544 &hf_pbap_pse_supported_repositories_sim_card,
545 &hf_pbap_pse_supported_repositories_local_phonebook,
546 NULL
549 static int * const hfx_pbap_pse_supported_features[] = {
550 &hf_pbap_pse_supported_features_reserved,
551 &hf_pbap_pse_supported_features_default_contact_image_format,
552 &hf_pbap_pse_supported_features_contact_referencing,
553 &hf_pbap_pse_supported_features_x_bt_uid_vcard_property,
554 &hf_pbap_pse_supported_features_x_bt_uci_vcard_property,
555 &hf_pbap_pse_supported_features_enhanced_missed_calls,
556 &hf_pbap_pse_supported_features_vcard_selecting,
557 &hf_pbap_pse_supported_features_folder_version_counters,
558 &hf_pbap_pse_supported_features_database_identifier,
559 &hf_pbap_pse_supported_features_browsing,
560 &hf_pbap_pse_supported_features_download,
561 NULL
564 static expert_field ei_btsdp_continuation_state_none;
565 static expert_field ei_btsdp_continuation_state_large;
566 static expert_field ei_data_element_value_large;
567 static expert_field ei_length_bad;
569 static dissector_handle_t btsdp_handle;
571 static wmem_tree_t *tid_requests;
572 static wmem_tree_t *continuation_states;
573 static wmem_tree_t *record_handle_services;
574 static wmem_tree_t *service_infos;
576 typedef struct _tid_request_t {
577 uint32_t interface_id;
578 uint32_t adapter_id;
579 uint32_t chandle;
580 uint32_t psm;
581 uint32_t tid;
582 uint32_t pdu_type;
584 wmem_array_t *uuid_array;
585 uint32_t record_handle;
587 char *continuation_state;
588 uint8_t continuation_state_length;
590 uint32_t data_length;
591 uint8_t *data;
592 } tid_request_t;
594 typedef struct _continuation_state_data_t {
595 uint32_t interface_id;
596 uint32_t adapter_id;
597 uint32_t chandle;
598 uint32_t psm;
599 uint32_t pdu_type;
600 uint32_t continuation_state[5];
602 uint32_t data_length;
603 uint8_t *data;
604 } continuation_state_data_t;
606 typedef struct _record_handle_service_t {
607 uint32_t interface_id;
608 uint32_t adapter_id;
609 uint32_t chandle;
610 uint32_t psm;
611 uint32_t record_handle;
613 wmem_array_t *uuid_array;
614 } record_handle_service_t;
616 #define PDU_TYPE_SERVICE_SEARCH 0x00
617 #define PDU_TYPE_SERVICE_ATTRIBUTE 0x01
618 #define PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE 0x02
620 #define MAX_SDP_LEN 1024
622 extern value_string_ext ext_usb_vendors_vals;
623 extern value_string_ext ext_usb_products_vals;
625 static const value_string vs_pduid[] = {
626 { 0x01, "Error Response" },
627 { 0x02, "Service Search Request" },
628 { 0x03, "Service Search Response" },
629 { 0x04, "Service Attribute Request" },
630 { 0x05, "Service Attribute Response" },
631 { 0x06, "Service Search Attribute Request" },
632 { 0x07, "Service Search Attribute Response" },
633 { 0, NULL }
636 static const value_string vs_general_attribute_id[] = {
637 { 0x0000, "Service Record Handle" },
638 { 0x0001, "Service Class ID List" },
639 { 0x0002, "Service Record State" },
640 { 0x0003, "Service ID" },
641 { 0x0004, "Protocol Descriptor List" },
642 { 0x0005, "Browse Group List" },
643 { 0x0006, "Language Base Attribute ID List" },
644 { 0x0007, "Service Info Time To Live" },
645 { 0x0008, "Service Availability" },
646 { 0x0009, "Bluetooth Profile Descriptor List" },
647 { 0x000A, "Documentation URL" },
648 { 0x000B, "Client Executable URL" },
649 { 0x000C, "Icon URL" },
650 { 0x000D, "Additional Protocol Descriptor Lists" },
651 /* Localized string default offset is 0x100,
652 the rest based on Language Base Attribute ID List */
653 { 0x0100, "Service Name" },
654 { 0x0101, "Service Description" },
655 { 0x0102, "Provider Name" },
656 { 0, NULL }
659 static const value_string vs_a2dp_attribute_id[] = {
660 { 0x0311, "Supported Features" },
661 { 0, NULL }
664 static const value_string vs_avrcp_attribute_id[] = {
665 { 0x0311, "Supported Features" },
666 { 0, NULL }
669 static const value_string vs_bip_imaging_responder_attribute_id[] = {
670 { 0x0200, "GOEP L2CAP PSM" },
671 { 0x0310, "Supported Capabilities" },
672 { 0x0311, "Supported Features" },
673 { 0x0312, "Supported Functions" },
674 { 0x0313, "Total Imaging Data Capacity" },
675 { 0, NULL }
678 static const value_string vs_bip_imaging_other_attribute_id[] = {
679 { 0x0200, "GOEP L2CAP PSM" },
680 { 0x0312, "Supported Functions" },
681 { 0, NULL }
684 static const value_string vs_bpp_attribute_id[] = {
685 { 0x0350, "Document Formats Supported" },
686 { 0x0352, "Character Repertoires Supported" },
687 { 0x0354, "XHTML-Print Image Formats Supported" },
688 { 0x0356, "Color Supported" },
689 { 0x0358, "1284ID" },
690 { 0x035A, "Printer Name" },
691 { 0x035C, "Printer Location" },
692 { 0x035E, "Duplex Supported" },
693 { 0x0360, "Media Types Supported" },
694 { 0x0362, "Max Media Width" },
695 { 0x0364, "Max Media Length" },
696 { 0x0366, "Enhanced Layout Supported" },
697 { 0x0368, "RUI Formats Supported" },
698 { 0x0370, "Reference Printing RUI Supported" },
699 { 0x0372, "Direct Printing RUI Supported" },
700 { 0x0374, "Reference Printing Top URL" },
701 { 0x0376, "Direct Printing Top URL" },
702 { 0x037A, "Device Name" },
703 { 0, NULL }
706 static const value_string vs_bpp_reflected_ui_attribute_id[] = {
707 { 0x0368, "RUI Formats Supported" },
708 { 0x0378, "Printer Admin RUI Top URL" },
709 { 0, NULL }
712 static const value_string vs_ctp_attribute_id[] = {
713 { 0x0301, "External Network" },
714 { 0, NULL }
717 static const value_string vs_did_attribute_id[] = {
718 { 0x0200, "Specification ID" },
719 { 0x0201, "Vendor ID" },
720 { 0x0202, "Product ID" },
721 { 0x0203, "Version" },
722 { 0x0204, "Primary Record" },
723 { 0x0205, "Vendor ID Source" },
724 { 0, NULL }
727 static const value_string vs_dun_attribute_id[] = {
728 { 0x0305, "Audio Feedback Support" },
729 { 0x0306, "Escape Sequence" },
730 { 0, NULL }
734 static const value_string vs_fax_attribute_id[] = {
735 { 0x0302, "Fax Class 1 Support" },
736 { 0x0303, "Fax Class 2.0 Support" },
737 { 0x0304, "Fax Class 2 Support (vendor-specific class)" },
738 { 0x0305, "Audio Feedback Support" },
739 { 0, NULL }
742 static const value_string vs_ftp_attribute_id[] = {
743 { 0x0200, "GOEP L2CAP PSM" },
744 { 0, NULL }
747 static const value_string vs_gnss_attribute_id[] = {
748 { 0x0200, "Supported Features" },
749 { 0, NULL }
752 static const value_string vs_hfp_gw_attribute_id[] = {
753 { 0x0311, "Supported Features" },
754 { 0, NULL }
757 static const value_string vs_hfp_ag_attribute_id[] = {
758 { 0x0301, "Network" },
759 { 0x0311, "Supported Features" },
760 { 0, NULL }
763 static const value_string vs_hcrp_attribute_id[] = {
764 { 0x0300, "1284ID" },
765 { 0x0302, "Device Name" },
766 { 0x0304, "Friendly Name" },
767 { 0x0306, "Device Location" },
768 { 0, NULL }
771 static const value_string vs_hsp_attribute_id[] = {
772 { 0x0302, "Remote Audio Volume Control" },
773 { 0, NULL }
776 static const value_string vs_hdp_attribute_id[] = {
777 { 0x0200, "Support Features List" },
778 { 0x0301, "Data Exchange Specification" },
779 { 0x0302, "MCAP Supported Procedures" },
780 { 0, NULL }
783 static const value_string vs_hid_attribute_id[] = {
784 { 0x0200, "Device Release Number" },
785 { 0x0201, "Parser Version" },
786 { 0x0202, "Device Subclass" },
787 { 0x0203, "Country Code" },
788 { 0x0204, "Virtual Cable" },
789 { 0x0205, "Reconnect Initiate" },
790 { 0x0206, "Descriptor List" },
791 { 0x0207, "LANG ID Base List" },
792 { 0x0208, "SDP Disable" },
793 { 0x0209, "Battery Power" },
794 { 0x020A, "Remote Wake" },
795 { 0x020B, "Profile Version" },
796 { 0x020C, "Supervision Timeout" },
797 { 0x020D, "Normally Connectable" },
798 { 0x020E, "BootDevice" },
799 { 0x020F, "SSR Host Max Latency" },
800 { 0x0210, "SSR Host Min Timeout" },
801 { 0, NULL }
804 static const value_string vs_wap_attribute_id[] = {
805 { 0x0306, "Network Address" },
806 { 0x0307, "WAP Gateway" },
807 { 0x0308, "Home Page URL" },
808 { 0x0309, "WAP Stack Type" },
809 { 0, NULL }
812 static const value_string vs_map_mas_attribute_id[] = {
813 { 0x200, "GOEP L2CAP PSM" }, /* MAP v1.2 and later */
814 { 0x0315, "MAS Instance ID" },
815 { 0x0316, "Supported Message Types" },
816 { 0x0317, "Supported Features" }, /* MAP v1.2 and later */
817 { 0, NULL }
820 static const value_string vs_map_mns_attribute_id[] = {
821 { 0x200, "GOEP L2CAP PSM" }, /* MAP v1.2 and later */
822 { 0x0317, "Supported Features" }, /* MAP v1.2 and later */
823 { 0, NULL }
826 static const value_string vs_opp_attribute_id[] = {
827 { 0x0200, "GOEP L2CAP PSM" },
828 { 0x0300, "Service Version" },
829 { 0x0303, "Supported Formats List" },
830 { 0, NULL }
833 static const value_string vs_pan_nap_attribute_id[] = {
834 { 0x0200, "IP Subnet" }, /* Deprecated */
835 { 0x030A, "Security Description" },
836 { 0x030B, "Net Access Type" },
837 { 0x030C, "Max Net Access Rate" },
838 { 0x030D, "IPv4Subnet" },
839 { 0x030E, "IPv6Subnet" },
840 { 0, NULL }
843 static const value_string vs_pan_gn_attribute_id[] = {
844 { 0x0200, "IP Subnet" }, /* Deprecated */
845 { 0x030A, "Security Description" },
846 { 0x030D, "IPv4Subnet" },
847 { 0x030E, "IPv6Subnet" },
848 { 0, NULL }
851 static const value_string vs_pan_panu_attribute_id[] = {
852 { 0x030A, "Security Description" },
853 { 0, NULL }
856 static const value_string vs_pbap_attribute_id[] = {
857 { 0x0200, "GOEP L2CAP PSM" },
858 { 0x0314, "Supported Repositories" },
859 { 0x0317, "Supported Features" },
860 { 0, NULL }
863 static const value_string vs_synch_attribute_id[] = {
864 { 0x0301, "Supported Data Stores List" },
865 { 0, NULL }
868 static const value_string vs_mps_attribute_id[] = {
869 { 0x0200, "Multiple Profiles - Single Device Supported Scenarios" },
870 { 0x0201, "Multiple Profiles - Multiple Device Supported Scenarios" },
871 { 0x0202, "Supported Profile and Protocol Dependency" },
872 { 0, NULL }
875 static const value_string vs_ctn_as_attribute_id[] = {
876 { 0x0315, "Instance ID" },
877 { 0x0317, "Supported Features" },
878 { 0, NULL }
881 static const value_string vs_ctn_ns_attribute_id[] = {
882 { 0x0317, "Supported Features" },
883 { 0, NULL }
886 static const value_string did_vendor_id_source_vals[] = {
887 { 0x0001, "Bluetooth SIG" },
888 { 0x0002, "USB Implementer's Forum" },
889 { 0, NULL }
891 value_string_ext did_vendor_id_source_vals_ext = VALUE_STRING_EXT_INIT(did_vendor_id_source_vals);
893 static const value_string synch_supported_data_store_vals[] = {
894 { 0x01, "Phonebook" },
895 { 0x03, "Calendar" },
896 { 0x05, "Notes" },
897 { 0x06, "Messages" },
898 { 0, NULL }
901 static const value_string ctp_external_network_vals[] = {
902 { 0x01, "Phonebook" },
903 { 0x02, "ISDN" },
904 { 0x03, "GSM" },
905 { 0x04, "CDMA" },
906 { 0x05, "Analogue Cellular" },
907 { 0x06, "Packet-switched" },
908 { 0x07, "Other" },
909 { 0, NULL }
912 static const value_string wap_stack_type_vals[] = {
913 { 0x01, "Connectionless" },
914 { 0x02, "Connection Oriented" },
915 { 0x03, "All (Connectionless + Connection Oriented)" },
916 { 0, NULL }
919 static const value_string wap_gateway_vals[] = {
920 { 0x01, "Origin Server" },
921 { 0x02, "Proxy" },
922 { 0, NULL }
925 static const value_string hdp_data_exchange_specification_vals[] = {
926 { 0x01, "ISO/IEEE 11073-20601 (Health informatics)" },
927 { 0, NULL }
930 static const range_string hdp_mdep_id_rvals[] = {
931 { 0x00, 0x00, "Reserved For Echo Test Function" },
932 { 0x01, 0x7F, "Available for use" },
933 { 0x80, 0xFF, "Reserved by MCAP" },
934 { 0, 0, NULL }
937 static const value_string hdp_mdep_role_vals[] = {
938 { 0x00, "Source" },
939 { 0x01, "Sink" },
940 { 0, NULL }
943 static const value_string hdp_mdep_data_type_01_vals[] = {
944 { 0x1004, "Pulse Oximeter" },
945 { 0x1006, "Basic ECG" },
946 { 0x1007, "Blood Pressure Monitor" },
947 { 0x1008, "Body Thermometer" },
948 { 0x100F, "Body Weight Scale" },
949 { 0x1011, "Glucose Meter" },
950 { 0x1012, "International Normalized Ratio Monitor" },
951 { 0x1014, "Body Composition Analyzer" },
952 { 0x1015, "Peak Flow Monitor" },
953 { 0x1029, "Cardiovascular Fitness and Activity Monitor" },
954 { 0x102A, "Strength Fitness Equipment" },
955 { 0x1047, "Independent Living Activity Hub" },
956 { 0x1048, "Medication monitor" },
957 { 0x1068, "Step Counter based on 10441" },
958 { 0x1075, "Fall Sensor" },
959 { 0x1076, "Personal Emergency Response Sensor" },
960 { 0x1077, "Smoke Sensor" },
961 { 0x1078, "Carbon Monoxide Sensor" },
962 { 0x1079, "Water Sensor" },
963 { 0x107A, "Gas Sensor" },
964 { 0x107B, "Motion Sensor" },
965 { 0x107C, "Property Exit Sensor" },
966 { 0x107D, "Enuresis Sensor" },
967 { 0x107E, "Contact Closure Sensor" },
968 { 0x107F, "Usage Sensor" },
969 { 0x1080, "Switch Sensor" },
970 { 0x1081, "Medication Dosing Sensor" },
971 { 0x1082, "Temperature Sensor" },
972 { 0, NULL }
975 static const value_string pan_security_description_vals[] = {
976 { 0x0000, "None" },
977 { 0x0001, "Service-level Enforced Security" },
978 { 0x0002, "802.1x Security" },
979 { 0, NULL }
982 static const value_string opp_supported_format_vals[] = {
983 { 0x01, "vCard 2.1" },
984 { 0x02, "vCard 3.0" },
985 { 0x03, "vCal 1.0" },
986 { 0x04, "iCal 2.0" },
987 { 0x05, "vNote" },
988 { 0x06, "vMessage" },
989 { 0xFF, "AllFormats" },
990 { 0, NULL }
993 static const value_string pan_net_access_type_vals[] = {
994 { 0x0000, "PSTN" },
995 { 0x0001, "ISDN" },
996 { 0x0002, "DSL" },
997 { 0x0003, "Cable Modem" },
998 { 0x0004, "10Mb Ethernet" },
999 { 0x0005, "100Mb Ethernet" },
1000 { 0x0006, "4Mb Token Ring" },
1001 { 0x0007, "16Mb Token Ring" },
1002 { 0x0008, "100Mb Token Ring" },
1003 { 0x0009, "FDDI" },
1004 { 0x000A, "GSM" },
1005 { 0x000B, "CDMA" },
1006 { 0x000c, "GPRS" },
1007 { 0x000D, "3G" },
1008 { 0xFFFE, "Other" },
1009 { 0, NULL }
1012 static const value_string hfp_gw_network_vals[] = {
1013 { 0x00, "No ability to reject a call" },
1014 { 0x01, "Ability to reject a call" },
1015 { 0, NULL }
1018 static const value_string hid_device_subclass_type_vals[] = {
1019 { 0x00, "Not Keyboard / Not Pointing Device" },
1020 { 0x01, "Keyboard" },
1021 { 0x02, "Pointing Device" },
1022 { 0x03, "Combo keyboard/pointing device" },
1023 { 0, NULL }
1026 static const value_string hid_device_subclass_subtype_vals[] = {
1027 { 0x00, "Uncategorized device" },
1028 { 0x01, "Joystick" },
1029 { 0x02, "Gamepad" },
1030 { 0x03, "Remote control" },
1031 { 0x04, "Sensing device" },
1032 { 0x05, "Digitizer tablet" },
1033 { 0x06, "Card Reader" },
1034 { 0, NULL }
1037 /* USB HID 1.11 bCountryCode */
1038 const value_string hid_country_code_vals[] = {
1039 { 0, "Not Supported" },
1040 { 1, "Arabic" },
1041 { 2, "Belgian" },
1042 { 3, "Canadian-Bilingual" },
1043 { 4, "Canadian-French" },
1044 { 5, "Czech Republic" },
1045 { 6, "Danish" },
1046 { 7, "Finnish" },
1047 { 8, "French" },
1048 { 9, "German" },
1049 { 10, "Greek" },
1050 { 11, "Hebrew" },
1051 { 12, "Hungary" },
1052 { 13, "International (ISO)" },
1053 { 14, "Italian" },
1054 { 15, "Japan (Katakana)" },
1055 { 16, "Korean" },
1056 { 17, "Latin American" },
1057 { 18, "Netherlands/Dutch" },
1058 { 19, "Norwegian" },
1059 { 20, "Persian (Farsi)" },
1060 { 21, "Poland" },
1061 { 22, "Portuguese" },
1062 { 23, "Russia" },
1063 { 24, "Slovakia" },
1064 { 25, "Spanish" },
1065 { 26, "Swedish" },
1066 { 27, "Swiss/French" },
1067 { 28, "Swiss/German" },
1068 { 29, "Switzerland" },
1069 { 30, "Taiwan" },
1070 { 31, "Turkish-Q" },
1071 { 32, "UK" },
1072 { 33, "US" },
1073 { 34, "Yugoslavia" },
1074 { 35, "Turkish-F" },
1075 { 0, NULL }
1078 static const value_string descriptor_list_type_vals[] = {
1079 { 0x22, "Report" },
1080 { 0x23, "Physical"},
1081 { 0, NULL }
1084 static const value_string vs_error_code[] = {
1085 { 0x0001, "Invalid/Unsupported SDP Version" },
1086 { 0x0002, "Invalid Service Record Handle" },
1087 { 0x0003, "Invalid Request Syntax" },
1088 { 0x0004, "Invalid PDU Size" },
1089 { 0x0005, "Invalid Continuation State" },
1090 { 0x0006, "Insufficient Resources to Satisfy Request" },
1091 { 0, NULL }
1094 static const value_string vs_data_element_size[] = {
1095 { 0x00, "1 byte (0 bytes if Nil)" },
1096 { 0x01, "2 bytes" },
1097 { 0x02, "4 bytes" },
1098 { 0x03, "8 bytes" },
1099 { 0x04, "16 bytes" },
1100 { 0x05, "uint8" },
1101 { 0x06, "uint16" },
1102 { 0x07, "uint32" },
1103 { 0, NULL }
1106 static const value_string vs_data_element_type[] = {
1107 { 0x00, "Nil" },
1108 { 0x01, "Unsigned Integer" },
1109 { 0x02, "Signed Twos-Complement Integer" },
1110 { 0x03, "UUID" },
1111 { 0x04, "Text string" },
1112 { 0x05, "Boolean" },
1113 { 0x06, "Sequence" },
1114 { 0x07, "Alternative" },
1115 { 0x08, "URL" },
1116 { 0, NULL }
1119 extern value_string_ext ext_psm_vals;
1120 extern value_string_ext usb_langid_vals_ext;
1122 void proto_register_btsdp(void);
1123 void proto_reg_handoff_btsdp(void);
1125 service_info_t* btsdp_get_service_info(wmem_tree_key_t* key)
1127 if (service_infos == NULL)
1128 return NULL;
1130 return (service_info_t *)wmem_tree_lookup32_array_le(service_infos, key);
1133 static bluetooth_uuid_t
1134 get_specified_uuid(wmem_allocator_t *pool, wmem_array_t *uuid_array)
1136 bluetooth_uuid_t uuid;
1138 /* Try to find UUID that is already use in RFCOMM or L2CAP, otherwise try to
1139 return last one (most generic).
1140 NOTE: UUIDs in array are from (most specified) to (most generic) */
1141 if (uuid_array) {
1142 uint32_t i_uuid;
1143 uint32_t size;
1144 bluetooth_uuid_t *p_uuid = NULL;
1146 size = wmem_array_get_count(uuid_array);
1148 for (i_uuid = 0; i_uuid < size; i_uuid += 1) {
1149 p_uuid = (bluetooth_uuid_t *) wmem_array_index(uuid_array, i_uuid);
1150 if (p_uuid->size == 16) /* CustomUUID (UUID128) is always ok */
1151 break;
1152 if (p_uuid->size == 0)
1153 continue;
1154 if (dissector_get_string_handle(bluetooth_uuid_table, print_numeric_bluetooth_uuid(pool, p_uuid)))
1155 break;
1158 if (p_uuid) return *p_uuid;
1161 memset(&uuid, 0, sizeof(bluetooth_uuid_t));
1162 return uuid;
1166 static wmem_array_t *
1167 get_uuids(packet_info *pinfo, uint32_t record_handle, btl2cap_data_t *l2cap_data)
1169 record_handle_service_t *record_handle_service;
1170 wmem_tree_key_t key[7];
1171 uint32_t k_interface_id;
1172 uint32_t k_adapter_id;
1173 uint32_t k_chandle;
1174 uint32_t k_psm;
1175 uint32_t k_record_handle;
1176 uint32_t k_frame_number;
1177 uint32_t interface_id;
1178 uint32_t adapter_id;
1179 uint32_t chandle;
1180 uint32_t psm;
1181 uint32_t frame_number;
1183 interface_id = l2cap_data->interface_id;
1184 adapter_id = l2cap_data->adapter_id;
1185 chandle = l2cap_data->chandle;
1186 psm = l2cap_data->psm;
1187 frame_number = pinfo->num;
1189 k_interface_id = interface_id;
1190 k_adapter_id = adapter_id;
1191 k_chandle = chandle;
1192 k_psm = psm;
1193 k_record_handle = record_handle;
1194 k_frame_number = frame_number;
1197 key[0].length = 1;
1198 key[0].key = &k_interface_id;
1199 key[1].length = 1;
1200 key[1].key = &k_adapter_id;
1201 key[2].length = 1;
1202 key[2].key = &k_chandle;
1203 key[3].length = 1;
1204 key[3].key = &k_psm;
1205 key[4].length = 1;
1206 key[4].key = &k_record_handle;
1207 key[5].length = 1;
1208 key[5].key = &k_frame_number;
1209 key[6].length = 0;
1210 key[6].key = NULL;
1212 record_handle_service = (record_handle_service_t *) wmem_tree_lookup32_array_le(record_handle_services, key);
1213 if (record_handle_service && record_handle_service->interface_id == interface_id &&
1214 record_handle_service->adapter_id == adapter_id &&
1215 record_handle_service->chandle == chandle &&
1216 record_handle_service->psm == psm &&
1217 record_handle_service->record_handle == record_handle) {
1218 return record_handle_service->uuid_array;
1221 return NULL;
1225 static service_info_t *
1226 save_channel(packet_info *pinfo, uint32_t type_protocol, uint32_t channel,
1227 int protocol_order, service_info_t *parent_service_info)
1229 wmem_tree_key_t key[10];
1230 uint32_t k_interface_id;
1231 uint32_t k_adapter_id;
1232 uint32_t k_sdp_psm;
1233 uint32_t k_direction;
1234 uint32_t k_bd_addr_oui;
1235 uint32_t k_bd_addr_id;
1236 uint32_t k_service_type;
1237 uint32_t k_service_channel;
1238 uint32_t k_frame_number;
1239 service_info_t *service_info;
1241 service_info = (service_info_t *) wmem_new(wmem_file_scope(), service_info_t);
1242 service_info->interface_id = parent_service_info->interface_id;
1243 service_info->adapter_id = parent_service_info->adapter_id;
1244 service_info->sdp_psm = parent_service_info->sdp_psm;
1245 service_info->direction = parent_service_info->direction;
1246 service_info->bd_addr_oui = parent_service_info->bd_addr_oui;
1247 service_info->bd_addr_id = parent_service_info->bd_addr_id;
1249 service_info->type = type_protocol;
1250 service_info->channel = channel;
1252 service_info->uuid = parent_service_info->uuid;
1254 service_info->protocol = -1;
1255 service_info->protocol_order = protocol_order;
1256 service_info->parent_info = parent_service_info;
1257 service_info->data = parent_service_info->data;
1260 k_interface_id = service_info->interface_id;
1261 k_adapter_id = service_info->adapter_id;
1262 k_sdp_psm = service_info->sdp_psm;
1263 k_direction = service_info->direction;
1264 k_bd_addr_oui = service_info->bd_addr_oui;
1265 k_bd_addr_id = service_info->bd_addr_id;
1266 k_service_type = service_info->type;
1267 k_service_channel = service_info->channel;
1268 k_frame_number = pinfo->num;
1270 key[0].length = 1;
1271 key[0].key = &k_interface_id;
1272 key[1].length = 1;
1273 key[1].key = &k_adapter_id;
1274 key[2].length = 1;
1275 key[2].key = &k_sdp_psm;
1276 key[3].length = 1;
1277 key[3].key = &k_direction;
1278 key[4].length = 1;
1279 key[4].key = &k_bd_addr_oui;
1280 key[5].length = 1;
1281 key[5].key = &k_bd_addr_id;
1282 key[6].length = 1;
1283 key[6].key = &k_service_type;
1284 key[7].length = 1;
1285 key[7].key = &k_service_channel;
1286 key[8].length = 1;
1287 key[8].key = &k_frame_number;
1288 key[9].length = 0;
1289 key[9].key = NULL;
1291 wmem_tree_insert32_array(service_infos, key, service_info);
1293 return service_info;
1297 static int
1298 get_type_length(tvbuff_t *tvb, int offset, int *length)
1300 int size = 0;
1301 uint8_t byte;
1303 byte = tvb_get_uint8(tvb, offset);
1304 offset += 1;
1306 switch (byte & 0x07) {
1307 case 0:
1308 size = (byte >> 3) == 0 ? 0 : 1;
1309 break;
1310 case 1:
1311 size = 2;
1312 break;
1313 case 2:
1314 size = 4;
1315 break;
1316 case 3:
1317 size = 8;
1318 break;
1319 case 4:
1320 size = 16;
1321 break;
1322 case 5:
1323 size = tvb_get_uint8(tvb, offset);
1324 offset += 1;
1325 break;
1326 case 6:
1327 size = tvb_get_ntohs(tvb, offset);
1328 offset += 2;
1329 break;
1330 case 7:
1331 size = tvb_get_ntohl(tvb, offset);
1332 offset += 4;
1333 break;
1336 if (size < 0) {
1337 *length = 0; /* Add expert info? */
1339 else {
1340 *length = size;
1343 return offset;
1347 static uint32_t
1348 get_uint_by_size(tvbuff_t *tvb, int off, int size)
1350 switch (size) {
1351 case 0:
1352 return tvb_get_uint8(tvb, off);
1353 case 1:
1354 return tvb_get_ntohs(tvb, off);
1355 case 2:
1356 return tvb_get_ntohl(tvb, off);
1357 default:
1358 return 0xffffffff;
1363 static int32_t
1364 get_int_by_size(tvbuff_t *tvb, int off, int size)
1366 switch (size) {
1367 case 0:
1368 return tvb_get_uint8(tvb, off);
1369 case 1:
1370 return tvb_get_ntohs(tvb, off);
1371 case 2:
1372 return tvb_get_ntohl(tvb, off);
1373 default:
1374 return -1;
1378 static int
1379 dissect_uuid(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int size, bluetooth_uuid_t *uuid)
1381 proto_item *item;
1383 DISSECTOR_ASSERT(uuid);
1385 if (size == 2) {
1386 proto_tree_add_item(tree, hf_data_element_value_uuid_16, tvb, offset, size, ENC_BIG_ENDIAN);
1387 uuid->bt_uuid = tvb_get_ntohs(tvb, offset);
1388 } else if (size == 4 && tvb_get_ntohs(tvb, offset) == 0x0000) {
1389 proto_tree_add_item(tree, hf_data_element_value_uuid_32, tvb, offset, size, ENC_BIG_ENDIAN);
1390 uuid->bt_uuid = tvb_get_ntohs(tvb, offset + 2);
1391 } else if (size == 16 && tvb_get_ntohs(tvb, offset) == 0x0000 && tvb_get_ntohl(tvb, offset + 4) == 0x1000 && tvb_get_ntoh64(tvb, offset + 8) == UINT64_C(0x800000805F9B34FB)) {
1392 item = proto_tree_add_item(tree, hf_data_element_value_uuid_128, tvb, offset, size, ENC_NA);
1393 uuid->bt_uuid = tvb_get_ntohs(tvb, offset + 2);
1394 proto_item_append_text(item, " (%s)", val_to_str_ext_const(uuid->bt_uuid, &bluetooth_uuid_vals_ext, "Unknown"));
1395 } else {
1396 bluetooth_uuid_t x_uuid;
1398 item = proto_tree_add_item(tree, hf_data_element_value_uuid, tvb, offset, size, ENC_NA);
1399 x_uuid = get_bluetooth_uuid(tvb, offset, size);
1401 proto_item_append_text(item, " (%s)", print_bluetooth_uuid(pinfo->pool, &x_uuid));
1403 uuid->bt_uuid = 0;
1406 if (size == 2 || size == 4 || size == 16) {
1407 uuid->size = size;
1408 tvb_memcpy(tvb, uuid->data, offset, size);
1409 } else {
1410 uuid->size = 0;
1413 return offset + size;
1417 static int
1418 dissect_continuation_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
1419 int offset)
1421 proto_item *cont_item;
1422 unsigned length;
1424 length = tvb_reported_length_remaining(tvb, offset);
1425 if (length == 0) {
1426 proto_tree_add_expert(tree, pinfo, &ei_btsdp_continuation_state_none, tvb, offset, -1);
1427 } else if (length > 17) {
1428 proto_tree_add_expert(tree, pinfo, &ei_btsdp_continuation_state_large, tvb, offset, -1);
1429 } else if (length == 1 && tvb_get_uint8(tvb, offset) == 0x00) {
1430 proto_tree_add_none_format(tree, hf_continuation_state, tvb,
1431 offset, -1, "Continuation State: no (00)");
1432 } else {
1433 proto_item *cont_tree;
1434 unsigned data;
1435 uint8_t i_data;
1436 uint8_t continuation_state_length;
1438 continuation_state_length = tvb_get_uint8(tvb, offset);
1439 cont_item = proto_tree_add_none_format(tree, hf_continuation_state, tvb, offset,
1440 1 + continuation_state_length, "Continuation State: yes (");
1441 cont_tree = proto_item_add_subtree(cont_item, ett_btsdp_continuation_state);
1443 proto_tree_add_item(cont_tree, hf_continuation_state_length, tvb, offset, 1, ENC_BIG_ENDIAN);
1444 offset += 1;
1445 proto_tree_add_item(cont_tree, hf_continuation_state_value, tvb, offset,
1446 continuation_state_length, ENC_NA);
1448 for (i_data = 0; i_data < continuation_state_length - 1; ++i_data) {
1449 data = tvb_get_uint8(tvb, offset);
1450 proto_item_append_text(cont_item, "%02X ", data);
1451 offset += 1;
1454 data = tvb_get_uint8(tvb, offset);
1455 proto_item_append_text(cont_item, "%02X)", data);
1456 offset += 1;
1459 return offset;
1462 // The only specification I could find says the max length is 16:
1463 // https://lost-contact.mit.edu/afs/nada.kth.se/misc/cas/documentation/bluetooth/bluetooth_e.pdf
1464 #define MAX_CONTINUATION_STATE_LEN 16
1465 static int
1466 reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo,
1467 int offset, unsigned tid, bool is_request,
1468 int attribute_list_byte_offset, int attribute_list_byte_count,
1469 uint32_t pdu_type, tvbuff_t **new_tvb, bool *is_first,
1470 bool *is_continued, wmem_array_t **uuid_array,
1471 uint32_t *record_handle, btl2cap_data_t *l2cap_data)
1473 unsigned length;
1474 tid_request_t *tid_request;
1475 continuation_state_data_t *continuation_state_data;
1476 wmem_tree_key_t key[12];
1477 wmem_tree_t *subtree;
1478 uint32_t k_interface_id;
1479 uint32_t k_adapter_id;
1480 uint32_t k_chandle;
1481 uint32_t k_psm;
1482 uint32_t k_tid;
1483 uint32_t k_pdu_type;
1484 uint32_t k_frame_number;
1485 uint32_t *k_continuation_state_array;
1486 uint8_t *continuation_state;
1487 uint32_t interface_id;
1488 uint32_t adapter_id;
1489 uint32_t chandle;
1490 uint32_t psm;
1491 uint32_t frame_number;
1493 if (new_tvb) *new_tvb = NULL;
1495 interface_id = l2cap_data->interface_id;
1496 adapter_id = l2cap_data->adapter_id;
1497 chandle = l2cap_data->chandle;
1498 psm = l2cap_data->psm;
1499 frame_number = pinfo->num;
1501 k_interface_id = interface_id;
1502 k_adapter_id = adapter_id;
1503 k_chandle = chandle;
1504 k_psm = psm;
1505 k_tid = tid;
1506 k_frame_number = frame_number;
1508 key[0].length = 1;
1509 key[0].key = &k_interface_id;
1510 key[1].length = 1;
1511 key[1].key = &k_adapter_id;
1512 key[2].length = 1;
1513 key[2].key = &k_chandle;
1514 key[3].length = 1;
1515 key[3].key = &k_psm;
1516 key[4].length = 1;
1517 key[4].key = &k_tid;
1518 key[5].length = 1;
1519 key[5].key = &k_frame_number;
1520 key[6].length = 0;
1521 key[6].key = NULL;
1523 if (is_first) *is_first = true;
1524 if (is_continued) *is_continued = true;
1526 length = tvb_reported_length_remaining(tvb, offset);
1527 if (length == 0) {
1528 return offset;
1529 } else if (length > 17) {
1530 return offset;
1531 } else if (length == 1 && tvb_get_uint8(tvb, offset) == 0x00) {
1532 if (is_continued) *is_continued = false;
1534 if (!pinfo->fd->visited) {
1535 if (is_request) {
1536 tid_request = (tid_request_t *) wmem_new(wmem_file_scope(), tid_request_t);
1537 tid_request->interface_id = interface_id;
1538 tid_request->adapter_id = adapter_id;
1539 tid_request->chandle = chandle;
1540 tid_request->psm = psm;
1541 tid_request->tid = tid;
1543 if (uuid_array)
1544 tid_request->uuid_array = *uuid_array;
1545 else
1546 tid_request->uuid_array = NULL;
1547 if (record_handle)
1548 tid_request->record_handle = *record_handle;
1549 else
1550 tid_request->record_handle = 0;
1552 tid_request->data = NULL;
1553 tid_request->data_length = 0;
1555 tid_request->pdu_type = pdu_type;
1557 tid_request->continuation_state = NULL;
1558 tid_request->continuation_state_length = 0;
1560 wmem_tree_insert32_array(tid_requests, key, tid_request);
1561 } else {
1562 tid_request = (tid_request_t *) wmem_tree_lookup32_array_le(tid_requests, key);
1563 if (tid_request && tid_request->interface_id == interface_id &&
1564 tid_request->adapter_id == adapter_id &&
1565 tid_request->chandle == chandle &&
1566 tid_request->psm == psm &&
1567 tid_request->tid == tid) {
1568 if (tid_request->continuation_state_length > 0) {
1569 /* fetch tid_request->continuation_state */
1571 k_continuation_state_array = (uint32_t *) wmem_alloc0(pinfo->pool, 20);
1572 continuation_state = (uint8_t *) k_continuation_state_array;
1573 continuation_state[0] = tid_request->continuation_state_length;
1574 memcpy(&continuation_state[1], tid_request->continuation_state, tid_request->continuation_state_length);
1576 k_interface_id = interface_id;
1577 k_adapter_id = adapter_id;
1578 k_chandle = chandle;
1579 k_psm = psm;
1580 k_pdu_type = tid_request->pdu_type;
1581 k_frame_number = frame_number;
1583 key[0].length = 1;
1584 key[0].key = &k_interface_id;
1585 key[1].length = 1;
1586 key[1].key = &k_adapter_id;
1587 key[2].length = 1;
1588 key[2].key = &k_chandle;
1589 key[3].length = 1;
1590 key[3].key = &k_psm;
1591 key[4].length = 1;
1592 key[4].key = &k_pdu_type;
1593 key[5].length = 1;
1594 key[5].key = &k_continuation_state_array[0];
1595 key[6].length = 1;
1596 key[6].key = &k_continuation_state_array[1];
1597 key[7].length = 1;
1598 key[7].key = &k_continuation_state_array[2];
1599 key[8].length = 1;
1600 key[8].key = &k_continuation_state_array[3];
1601 key[9].length = 1;
1602 key[9].key = &k_continuation_state_array[4];
1603 key[10].length = 1;
1604 key[10].key = &k_frame_number;
1605 key[11].length = 0;
1606 key[11].key = NULL;
1608 continuation_state_data = (continuation_state_data_t *) wmem_tree_lookup32_array_le(continuation_states, key);
1609 if (continuation_state_data && continuation_state_data->interface_id == interface_id &&
1610 continuation_state_data->adapter_id == adapter_id &&
1611 continuation_state_data->chandle == chandle &&
1612 continuation_state_data->psm == psm &&
1613 continuation_state_data->pdu_type == tid_request->pdu_type &&
1614 continuation_state_data->continuation_state[0] == k_continuation_state_array[0] &&
1615 continuation_state_data->continuation_state[1] == k_continuation_state_array[1] &&
1616 continuation_state_data->continuation_state[2] == k_continuation_state_array[2] &&
1617 continuation_state_data->continuation_state[3] == k_continuation_state_array[3] &&
1618 continuation_state_data->continuation_state[4] == k_continuation_state_array[4]) {
1619 tid_request->data = (uint8_t *) wmem_alloc(wmem_file_scope(), continuation_state_data->data_length + attribute_list_byte_count);
1620 tid_request->data_length = continuation_state_data->data_length + attribute_list_byte_count;
1621 memcpy(tid_request->data, continuation_state_data->data, continuation_state_data->data_length);
1622 tvb_memcpy(tvb, tid_request->data + continuation_state_data->data_length, attribute_list_byte_offset, attribute_list_byte_count);
1624 } else {
1625 tid_request->data = (uint8_t *) wmem_alloc(wmem_file_scope(), attribute_list_byte_count);
1626 tid_request->data_length = attribute_list_byte_count;
1628 tvb_memcpy(tvb, tid_request->data, attribute_list_byte_offset, attribute_list_byte_count);
1631 if (uuid_array) *uuid_array = tid_request->uuid_array;
1632 if (record_handle) *record_handle = tid_request->record_handle;
1636 k_interface_id = interface_id;
1637 k_adapter_id = adapter_id;
1638 k_chandle = chandle;
1639 k_psm = psm;
1640 k_tid = tid;
1641 k_frame_number = frame_number;
1643 key[0].length = 1;
1644 key[0].key = &k_interface_id;
1645 key[1].length = 1;
1646 key[1].key = &k_adapter_id;
1647 key[2].length = 1;
1648 key[2].key = &k_chandle;
1649 key[3].length = 1;
1650 key[3].key = &k_psm;
1651 key[4].length = 1;
1652 key[4].key = &k_tid;
1653 key[5].length = 1;
1654 key[5].key = &k_frame_number;
1655 key[6].length = 0;
1656 key[6].key = NULL;
1659 /* full reassemble */
1660 if (!is_request) {
1661 tid_request = (tid_request_t *) wmem_tree_lookup32_array_le(tid_requests, key);
1662 if (tid_request && tid_request->interface_id == interface_id &&
1663 tid_request->adapter_id == adapter_id &&
1664 tid_request->chandle == chandle &&
1665 tid_request->psm == psm &&
1666 tid_request->tid == tid) {
1667 tvbuff_t *next_tvb;
1669 next_tvb = tvb_new_child_real_data(tvb, tid_request->data,
1670 tid_request->data_length, tid_request->data_length);
1672 if (new_tvb) *new_tvb = next_tvb;
1673 if (tid_request->continuation_state_length && is_first) *is_first = false;
1675 if (uuid_array) *uuid_array = tid_request->uuid_array;
1676 if (record_handle) *record_handle = tid_request->record_handle;
1679 } else {
1680 char *continuation_state_buffer;
1681 unsigned continuation_state_length;
1683 continuation_state_length = tvb_get_uint8(tvb, offset);
1684 offset++;
1686 continuation_state_buffer = tvb_bytes_to_str(wmem_file_scope(), tvb, offset, continuation_state_length);
1688 if (continuation_state_length > MAX_CONTINUATION_STATE_LEN) {
1689 // Try to make do with what we can.
1690 expert_add_info(pinfo, NULL, &ei_length_bad);
1691 continuation_state_length = MAX_CONTINUATION_STATE_LEN;
1694 if (!pinfo->fd->visited) {
1695 if (is_request) {
1696 tid_request = (tid_request_t *) wmem_new(wmem_file_scope(), tid_request_t);
1697 tid_request->interface_id = interface_id;
1698 tid_request->adapter_id = adapter_id;
1699 tid_request->chandle = chandle;
1700 tid_request->psm = psm;
1701 tid_request->tid = tid;
1703 if (uuid_array)
1704 tid_request->uuid_array = *uuid_array;
1705 else
1706 tid_request->uuid_array = NULL;
1708 if (record_handle)
1709 tid_request->record_handle = *record_handle;
1710 else
1711 tid_request->record_handle = 0;
1713 /* fetch data saved in continuation_state */
1714 tid_request->data = NULL;
1715 tid_request->data_length = 0;
1717 tid_request->pdu_type = pdu_type;
1719 tid_request->continuation_state = continuation_state_buffer;
1720 tid_request->continuation_state_length = continuation_state_length;
1722 wmem_tree_insert32_array(tid_requests, key, tid_request);
1723 } else {
1724 tid_request = (tid_request_t *) wmem_tree_lookup32_array_le(tid_requests, key);
1725 if (tid_request && tid_request->interface_id == interface_id &&
1726 tid_request->adapter_id == adapter_id &&
1727 tid_request->chandle == chandle &&
1728 tid_request->psm == psm &&
1729 tid_request->tid == tid) {
1730 /* data comes from here and saved in previous continuation_state */
1732 if (tid_request->continuation_state_length > 0) {
1733 /* fetch tid_request->continuation_state */
1734 k_continuation_state_array = (uint32_t *) wmem_alloc0(pinfo->pool, 20);
1735 continuation_state = (uint8_t *) k_continuation_state_array;
1736 continuation_state[0] = tid_request->continuation_state_length;
1737 memcpy(&continuation_state[1], tid_request->continuation_state, tid_request->continuation_state_length);
1739 k_interface_id = interface_id;
1740 k_adapter_id = adapter_id;
1741 k_chandle = chandle;
1742 k_psm = psm;
1743 k_pdu_type = tid_request->pdu_type;
1745 key[0].length = 1;
1746 key[0].key = &k_interface_id;
1747 key[1].length = 1;
1748 key[1].key = &k_adapter_id;
1749 key[2].length = 1;
1750 key[2].key = &k_chandle;
1751 key[3].length = 1;
1752 key[3].key = &k_psm;
1753 key[4].length = 1;
1754 key[4].key = &k_pdu_type;
1755 key[5].length = 1;
1756 key[5].key = &k_continuation_state_array[0];
1757 key[6].length = 1;
1758 key[6].key = &k_continuation_state_array[1];
1759 key[7].length = 1;
1760 key[7].key = &k_continuation_state_array[2];
1761 key[8].length = 1;
1762 key[8].key = &k_continuation_state_array[3];
1763 key[9].length = 1;
1764 key[9].key = &k_continuation_state_array[4];
1765 key[10].length = 0;
1766 key[10].key = NULL;
1768 subtree = (wmem_tree_t *) wmem_tree_lookup32_array(continuation_states, key);
1769 continuation_state_data = (subtree) ? (continuation_state_data_t *) wmem_tree_lookup32_le(subtree, frame_number) : NULL;
1770 if (continuation_state_data) {
1771 tid_request->data = (uint8_t *) wmem_alloc(wmem_file_scope(), continuation_state_data->data_length + attribute_list_byte_count);
1772 tid_request->data_length = continuation_state_data->data_length + attribute_list_byte_count;
1773 memcpy(tid_request->data, continuation_state_data->data, continuation_state_data->data_length);
1774 tvb_memcpy(tvb, tid_request->data + continuation_state_data->data_length, attribute_list_byte_offset, attribute_list_byte_count);
1776 } else {
1777 tid_request->data = (uint8_t *) wmem_alloc(wmem_file_scope(), attribute_list_byte_count);
1778 tid_request->data_length = attribute_list_byte_count;
1780 tvb_memcpy(tvb, tid_request->data, attribute_list_byte_offset, attribute_list_byte_count);
1783 if (uuid_array) *uuid_array = tid_request->uuid_array;
1784 if (record_handle) *record_handle = tid_request->record_handle;
1786 /* save tid_request in continuation_state data */
1787 k_continuation_state_array = (uint32_t *) wmem_alloc0(pinfo->pool, 20);
1788 continuation_state = (uint8_t *) k_continuation_state_array;
1789 continuation_state[0] = continuation_state_length;
1790 memcpy(&continuation_state[1], continuation_state_buffer, continuation_state_length);
1792 k_interface_id = interface_id;
1793 k_adapter_id = adapter_id;
1794 k_chandle = chandle;
1795 k_psm = psm;
1796 k_pdu_type = pdu_type;
1797 k_frame_number = frame_number;
1799 key[0].length = 1;
1800 key[0].key = &k_interface_id;
1801 key[1].length = 1;
1802 key[1].key = &k_adapter_id;
1803 key[2].length = 1;
1804 key[2].key = &k_chandle;
1805 key[3].length = 1;
1806 key[3].key = &k_psm;
1807 key[4].length = 1;
1808 key[4].key = &k_pdu_type;
1809 key[5].length = 1;
1810 key[5].key = &k_continuation_state_array[0];
1811 key[6].length = 1;
1812 key[6].key = &k_continuation_state_array[1];
1813 key[7].length = 1;
1814 key[7].key = &k_continuation_state_array[2];
1815 key[8].length = 1;
1816 key[8].key = &k_continuation_state_array[3];
1817 key[9].length = 1;
1818 key[9].key = &k_continuation_state_array[4];
1819 key[10].length = 1;
1820 key[10].key = &k_frame_number;
1821 key[11].length = 0;
1822 key[11].key = NULL;
1824 continuation_state_data = (continuation_state_data_t *) wmem_new(wmem_file_scope(), continuation_state_data_t);
1825 continuation_state_data->interface_id = interface_id;
1826 continuation_state_data->adapter_id = adapter_id;
1827 continuation_state_data->chandle = chandle;
1828 continuation_state_data->psm = psm;
1829 continuation_state_data->pdu_type = pdu_type;
1830 continuation_state_data->continuation_state[0] = k_continuation_state_array[0];
1831 continuation_state_data->continuation_state[1] = k_continuation_state_array[1];
1832 continuation_state_data->continuation_state[2] = k_continuation_state_array[2];
1833 continuation_state_data->continuation_state[3] = k_continuation_state_array[3];
1834 continuation_state_data->continuation_state[4] = k_continuation_state_array[4];
1835 continuation_state_data->data = tid_request->data;
1836 continuation_state_data->data_length = tid_request->data_length;
1838 wmem_tree_insert32_array(continuation_states, key, continuation_state_data);
1842 k_interface_id = interface_id;
1843 k_adapter_id = adapter_id;
1844 k_chandle = chandle;
1845 k_psm = psm;
1846 k_tid = tid;
1847 k_frame_number = frame_number;
1849 key[0].length = 1;
1850 key[0].key = &k_interface_id;
1851 key[1].length = 1;
1852 key[1].key = &k_adapter_id;
1853 key[2].length = 1;
1854 key[2].key = &k_chandle;
1855 key[3].length = 1;
1856 key[3].key = &k_psm;
1857 key[4].length = 1;
1858 key[4].key = &k_tid;
1859 key[5].length = 1;
1860 key[5].key = &k_frame_number;
1861 key[6].length = 0;
1862 key[6].key = NULL;
1865 /* partial reassemble */
1866 if (!is_request) {
1867 tid_request = (tid_request_t *) wmem_tree_lookup32_array_le(tid_requests, key);
1868 if (tid_request && tid_request->interface_id == interface_id &&
1869 tid_request->adapter_id == adapter_id &&
1870 tid_request->chandle == chandle &&
1871 tid_request->psm == psm &&
1872 tid_request->tid == tid) {
1873 tvbuff_t *next_tvb;
1875 next_tvb = tvb_new_child_real_data(tvb, tid_request->data,
1876 tid_request->data_length, tid_request->data_length);
1878 if (new_tvb) *new_tvb = next_tvb;
1879 if (tid_request->continuation_state_length && is_first) *is_first = false;
1881 if (uuid_array) *uuid_array = tid_request->uuid_array;
1882 if (record_handle) *record_handle = tid_request->record_handle;
1888 return offset;
1891 static int
1892 dissect_data_element(proto_tree *tree, proto_tree **next_tree,
1893 packet_info *pinfo, tvbuff_t *tvb, int offset)
1895 proto_item *pitem;
1896 proto_tree *ptree;
1897 int new_offset;
1898 int length;
1899 int len;
1900 uint8_t type;
1901 uint8_t size;
1903 new_offset = get_type_length(tvb, offset, &length) - 1;
1904 type = tvb_get_uint8(tvb, offset);
1905 size = type & 0x07;
1906 type = type >> 3;
1908 pitem = proto_tree_add_none_format(tree, hf_data_element, tvb, offset, 0, "Data Element: %s %s",
1909 val_to_str_const(type, vs_data_element_type, "Unknown Type"),
1910 val_to_str_const(size, vs_data_element_size, "Unknown Size"));
1911 ptree = proto_item_add_subtree(pitem, ett_btsdp_data_element);
1913 len = (new_offset - offset) + length;
1915 proto_item_set_len(pitem, len + 1);
1917 proto_tree_add_item(ptree, hf_data_element_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1918 proto_tree_add_item(ptree, hf_data_element_size, tvb, offset, 1, ENC_BIG_ENDIAN);
1919 offset += 1;
1921 if (new_offset > offset - 1) {
1922 proto_tree_add_uint(ptree, hf_data_element_var_size, tvb,
1923 offset, len - length, length);
1924 proto_item_append_text(pitem, (length != 1) ? " %u bytes" : " %u byte", length);
1925 offset += len - length;
1928 pitem = proto_tree_add_item(ptree, hf_data_element_value, tvb, offset, length, ENC_NA);
1929 if (length > tvb_reported_length_remaining(tvb, offset)) {
1930 expert_add_info(pinfo, pitem, &ei_data_element_value_large);
1931 proto_item_append_text(pitem, ": MISSING");
1932 } else if (length == 0)
1933 proto_item_append_text(pitem, ": MISSING");
1935 if (next_tree) *next_tree = proto_item_add_subtree(pitem, ett_btsdp_data_element_value);
1936 offset += length;
1938 return offset;
1941 static int
1942 findUintAttribute(tvbuff_t *tvb, int service_offset,
1943 int number_of_attributes, int attribute_id)
1945 int result = 0;
1946 int search_length;
1947 int search_offset;
1948 int i_number_of_attributes;
1949 uint16_t attribute;
1951 search_offset = service_offset;
1952 i_number_of_attributes = 0;
1954 while (i_number_of_attributes < number_of_attributes) {
1955 search_offset = get_type_length(tvb, search_offset, &search_length);
1956 attribute = tvb_get_ntohs(tvb, search_offset);
1958 search_offset += search_length;
1959 search_offset = get_type_length(tvb, search_offset, &search_length);
1961 if (attribute == attribute_id) {
1962 result = get_uint_by_size(tvb, search_offset, 1);
1965 search_offset += search_length;
1966 i_number_of_attributes += 1;
1969 return result;
1973 static void
1974 dissect_protocol_descriptor_list(proto_tree *next_tree, tvbuff_t *tvb,
1975 packet_info *pinfo, int offset, int size, wmem_strbuf_t *info_buf,
1976 service_info_t *service_info, int *protocol_order)
1978 proto_tree *feature_tree;
1979 proto_item *feature_item;
1980 proto_tree *entry_tree;
1981 proto_item *entry_item;
1982 proto_tree *sub_tree;
1983 proto_tree *last_tree;
1984 int new_offset;
1985 int list_offset;
1986 int entry_start;
1987 int entry_offset;
1988 int entry_length;
1989 uint32_t value;
1990 int length;
1991 uint32_t i_protocol;
1992 bluetooth_uuid_t uuid;
1993 service_info_t *record = NULL;
1995 list_offset = offset;
1996 i_protocol = 1;
1997 while (list_offset - offset < size) {
1998 const char *uuid_str;
2000 feature_item = proto_tree_add_none_format(next_tree, hf_sdp_protocol_item, tvb, list_offset, 0, "Protocol #%u", i_protocol);
2001 feature_tree = proto_item_add_subtree(feature_item, ett_btsdp_protocol);
2002 entry_start = get_type_length(tvb, list_offset, &entry_length);
2003 entry_offset = entry_start;
2004 proto_item_set_len(feature_item, entry_length + (entry_offset - list_offset));
2006 dissect_data_element(feature_tree, &sub_tree, pinfo, tvb, list_offset);
2008 entry_item = proto_tree_add_item(sub_tree, hf_sdp_protocol, tvb, entry_offset, entry_length, ENC_NA);
2009 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_id);
2010 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset);
2011 new_offset = get_type_length(tvb, entry_offset, &length);
2012 entry_offset = new_offset;
2014 dissect_uuid(sub_tree, pinfo, tvb, entry_offset, length, &uuid);
2016 uuid_str = print_bluetooth_uuid(pinfo->pool, &uuid);
2017 wmem_strbuf_append(info_buf, uuid_str);
2018 proto_item_append_text(feature_item, ": %s", uuid_str);
2019 proto_item_append_text(entry_item, ": %s", uuid_str);
2021 entry_offset += length;
2023 if (entry_offset - entry_start < entry_length) {
2024 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset);
2025 new_offset = get_type_length(tvb, entry_offset, &length);
2026 entry_offset = new_offset;
2027 value = get_int_by_size(tvb, entry_offset, length / 2);
2029 if (uuid.bt_uuid == BTSDP_L2CAP_PROTOCOL_UUID) {
2030 wmem_strbuf_append_printf(info_buf, ":%u", value);
2031 proto_item_append_text(feature_item, ", PSM: %u", value);
2032 proto_item_append_text(entry_item, ", PSM: %u", value);
2033 proto_tree_add_item(sub_tree, hf_sdp_protocol_psm, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
2034 if (!pinfo->fd->visited && service_info)
2035 record = save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, value, *protocol_order, service_info);
2036 *protocol_order += 1;
2037 } else if (uuid.bt_uuid == BTSDP_RFCOMM_PROTOCOL_UUID) {
2038 wmem_strbuf_append_printf(info_buf, ":%u", value);
2039 proto_item_append_text(feature_item, ", RFCOMM Channel: %u", value);
2040 proto_item_append_text(entry_item, ", RFCOMM Channel: %u", value);
2041 proto_tree_add_item(sub_tree, hf_sdp_protocol_channel, tvb, entry_offset, 1, ENC_BIG_ENDIAN);
2042 if (!pinfo->fd->visited && service_info)
2043 record = save_channel(pinfo, BTSDP_RFCOMM_PROTOCOL_UUID, value, *protocol_order, service_info);
2044 *protocol_order += 1;
2045 } else if (uuid.bt_uuid == BTSDP_ATT_PROTOCOL_UUID) {
2046 proto_item_append_text(feature_item, ", GATT Handle Start: 0x%04x", value);
2047 proto_item_append_text(entry_item, ", GATT Handle Start: 0x%04x", value);
2048 wmem_strbuf_append_printf(info_buf, ":0x%04x.", value);
2049 proto_tree_add_item(sub_tree, hf_sdp_protocol_gatt_handle_start, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
2051 if ((entry_offset - list_offset) + length <= entry_length) {
2052 entry_offset += length;
2053 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset);
2054 new_offset = get_type_length(tvb, entry_offset, &length);
2055 entry_offset = new_offset;
2056 value = get_int_by_size(tvb, entry_offset, length / 2);
2058 wmem_strbuf_append_printf(info_buf, ".0x%04x", value);
2059 proto_item_append_text(feature_item, ", GATT Handle End: 0x%04x", value);
2060 proto_item_append_text(entry_item, ", GATT Handle End: 0x%04x", value);
2061 proto_tree_add_item(sub_tree, hf_sdp_protocol_gatt_handle_end, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
2063 } else {
2064 wmem_strbuf_append_printf(info_buf, " (%x.%x)", value >> 8, value & 0xFF);
2065 proto_item_append_text(feature_item, ", Version %x.%x", value >> 8, value & 0xFF);
2066 proto_item_append_text(entry_item, ", Version 0x%03x", value);
2067 proto_tree_add_item(sub_tree, hf_sdp_protocol_version, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
2070 entry_offset += length;
2073 while (entry_offset - entry_start < entry_length) {
2074 int value_offset;
2075 int len;
2077 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset);
2078 new_offset = get_type_length(tvb, entry_offset, &length);
2080 if (uuid.bt_uuid == BTSDP_BNEP_PROTOCOL_UUID) {
2081 wmem_strbuf_append(info_buf, " (");
2082 value_offset = new_offset;
2083 while (value_offset - new_offset < length) {
2084 int next_offset;
2085 dissect_data_element(sub_tree, &last_tree, pinfo, tvb, value_offset);
2086 next_offset = get_type_length(tvb, value_offset, &len);
2087 value = get_int_by_size(tvb, next_offset, len / 2);
2089 proto_tree_add_item(last_tree, hf_sdp_protocol_bnep_type, tvb, next_offset, 2, ENC_BIG_ENDIAN);
2090 wmem_strbuf_append(info_buf, val_to_str_const(value, etype_vals, "Unknown"));
2091 value_offset = next_offset + len;
2093 if (value_offset - new_offset < length)
2094 wmem_strbuf_append(info_buf, " ");
2096 wmem_strbuf_append(info_buf, ")");
2099 entry_offset = new_offset + length;
2102 i_protocol += 1;
2103 list_offset = entry_offset;
2105 if (list_offset - offset < size)
2106 wmem_strbuf_append(info_buf, " -> ");
2108 if (record)
2109 record->protocol = uuid.bt_uuid;
2115 static int
2116 // NOLINTNEXTLINE(misc-no-recursion)
2117 dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
2118 int offset, int attribute, bluetooth_uuid_t service_uuid,
2119 int service_did_vendor_id, int service_did_vendor_id_source,
2120 int service_hdp_data_exchange_specification,
2121 service_info_t *service_info, wmem_strbuf_t **pinfo_buf)
2123 proto_tree *feature_tree;
2124 proto_item *feature_item;
2125 proto_tree *entry_tree;
2126 proto_item *entry_item;
2127 proto_tree *next_tree;
2128 proto_tree *sub_tree;
2129 proto_tree *last_tree;
2130 int size;
2131 uint8_t byte;
2132 uint8_t type;
2133 uint8_t size_index;
2134 int start_offset;
2135 int new_offset;
2136 int list_offset;
2137 int list_length;
2138 int entry_offset;
2139 int entry_length;
2140 bool found;
2141 uint16_t specification_id;
2142 uint16_t vendor_id;
2143 uint16_t product_id;
2144 uint16_t version;
2145 uint8_t primary_record;
2146 uint8_t mdep_id;
2147 uint16_t vendor_id_source;
2148 const char *str_val;
2149 uint32_t supported_features;
2150 unsigned i_feature;
2151 unsigned i_protocol;
2152 uint16_t psm;
2153 const uint8_t *new_str;
2154 uint32_t value;
2155 uint64_t value_64;
2156 bluetooth_uuid_t uuid;
2157 const char *uuid_str;
2158 int length;
2159 int protocol_order;
2160 wmem_strbuf_t *info_buf;
2162 info_buf = wmem_strbuf_create(pinfo->pool);
2163 *pinfo_buf = info_buf;
2166 byte = tvb_get_uint8(tvb, offset);
2167 type = (byte >> 3) & 0x1f;
2168 size_index = byte & 0x07;
2170 start_offset = offset;
2171 new_offset = dissect_data_element(tree, &next_tree, pinfo, tvb, offset);
2173 offset = get_type_length(tvb, offset, &size);
2175 found = true;
2176 switch(service_uuid.bt_uuid) {
2177 case BTSDP_DID_SERVICE_UUID:
2178 switch (attribute) {
2179 case 0x200:
2180 proto_tree_add_item(next_tree, hf_did_specification_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2181 specification_id = tvb_get_ntohs(tvb, offset);
2182 wmem_strbuf_append_printf(info_buf, "%x.%02x (0x%04x)", specification_id >> 8, specification_id & 0xFF, specification_id);
2183 break;
2184 case 0x201:
2185 vendor_id = tvb_get_ntohs(tvb, offset);
2186 if (service_did_vendor_id_source == DID_VENDOR_ID_SOURCE_BLUETOOTH_SIG) {
2187 proto_tree_add_item(next_tree, hf_did_vendor_id_bluetooth_sig, tvb, offset, 2, ENC_BIG_ENDIAN);
2188 str_val = val_to_str_ext_const(vendor_id, &bluetooth_company_id_vals_ext, "Unknown");
2189 } else if (service_did_vendor_id_source == DID_VENDOR_ID_SOURCE_USB_FORUM) {
2190 proto_tree_add_item(next_tree, hf_did_vendor_id_usb_forum, tvb, offset, 2, ENC_BIG_ENDIAN);
2191 str_val = val_to_str_ext_const(vendor_id, &ext_usb_vendors_vals, "Unknown");
2192 } else {
2193 proto_tree_add_item(next_tree, hf_did_vendor_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2194 str_val = "Unknown";
2196 wmem_strbuf_append_printf(info_buf, "%s (0x%04x)", str_val, vendor_id);
2197 break;
2198 case 0x202:
2199 entry_item = proto_tree_add_item(next_tree, hf_did_product_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2200 product_id = tvb_get_ntohs(tvb, offset);
2202 if (service_did_vendor_id_source == DID_VENDOR_ID_SOURCE_USB_FORUM) {
2203 str_val = val_to_str_ext_const(service_did_vendor_id << 16 | product_id, &ext_usb_products_vals, "Unknown");
2204 wmem_strbuf_append_printf(info_buf, "%s (0x%04x)", str_val, product_id);
2205 proto_item_append_text(entry_item, " (%s)", str_val);
2206 } else {
2207 wmem_strbuf_append_printf(info_buf, "0x%04x", product_id);
2209 break;
2210 case 0x203:
2211 proto_tree_add_item(next_tree, hf_did_version, tvb, offset, 2, ENC_BIG_ENDIAN);
2212 version = tvb_get_ntohs(tvb, offset);
2213 wmem_strbuf_append_printf(info_buf, "%x.%x.%x (0x%04x)", version >> 8, (version >> 4) & 0xF, version & 0xF, version);
2214 break;
2215 case 0x204:
2216 proto_tree_add_item(next_tree, hf_did_primary_record, tvb, offset, 1, ENC_BIG_ENDIAN);
2217 primary_record = tvb_get_uint8(tvb, offset);
2218 wmem_strbuf_append(info_buf, primary_record ? "true" : "false");
2219 break;
2220 case 0x205:
2221 proto_tree_add_item(next_tree, hf_did_vendor_id_source, tvb, offset, 2, ENC_BIG_ENDIAN);
2222 vendor_id_source = tvb_get_ntohs(tvb, offset);
2223 wmem_strbuf_append_printf(info_buf, "%s (0x%04x)",
2224 val_to_str_const(vendor_id_source, did_vendor_id_source_vals, "Unknown"),
2225 vendor_id_source);
2226 break;
2227 default:
2228 found = false;
2230 break;
2231 case BTSDP_A2DP_SINK_SERVICE_UUID:
2232 switch (attribute) {
2233 case 0x311:
2234 proto_tree_add_item(next_tree, hf_a2dp_sink_supported_features_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2235 proto_tree_add_item(next_tree, hf_a2dp_sink_supported_features_amplifier, tvb, offset, 2, ENC_BIG_ENDIAN);
2236 proto_tree_add_item(next_tree, hf_a2dp_sink_supported_features_recorder, tvb, offset, 2, ENC_BIG_ENDIAN);
2237 proto_tree_add_item(next_tree, hf_a2dp_sink_supported_features_speaker, tvb, offset, 2, ENC_BIG_ENDIAN);
2238 proto_tree_add_item(next_tree, hf_a2dp_sink_supported_features_headphone, tvb, offset, 2, ENC_BIG_ENDIAN);
2240 supported_features = tvb_get_ntohs(tvb, offset);
2242 wmem_strbuf_append_printf(info_buf, "%s%s%s%s",
2243 (supported_features & 0x01) ? "Headphone " : "",
2244 (supported_features & 0x02) ? "Speaker " : "",
2245 (supported_features & 0x04) ? "Recorder " : "",
2246 (supported_features & 0x08) ? "Amplifier " : "");
2247 break;
2248 default:
2249 found = false;
2251 break;
2252 case BTSDP_A2DP_SOURCE_SERVICE_UUID:
2253 switch (attribute) {
2254 case 0x311:
2255 proto_tree_add_item(next_tree, hf_a2dp_source_supported_features_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2256 proto_tree_add_item(next_tree, hf_a2dp_source_supported_features_mixer, tvb, offset, 2, ENC_BIG_ENDIAN);
2257 proto_tree_add_item(next_tree, hf_a2dp_source_supported_features_tuner, tvb, offset, 2, ENC_BIG_ENDIAN);
2258 proto_tree_add_item(next_tree, hf_a2dp_source_supported_features_microphone, tvb, offset, 2, ENC_BIG_ENDIAN);
2259 proto_tree_add_item(next_tree, hf_a2dp_source_supported_features_player, tvb, offset, 2, ENC_BIG_ENDIAN);
2261 supported_features = tvb_get_ntohs(tvb, offset);
2263 wmem_strbuf_append_printf(info_buf, "%s%s%s%s",
2264 (supported_features & 0x01) ? "Player " : "",
2265 (supported_features & 0x02) ? "Microphone " : "",
2266 (supported_features & 0x04) ? "Tuner " : "",
2267 (supported_features & 0x08) ? "Mixer " : "");
2268 break;
2269 default:
2270 found = false;
2272 break;
2273 case BTSDP_SYNC_SERVICE_UUID:
2274 switch (attribute) {
2275 case 0x301:
2276 list_offset = offset;
2277 while (list_offset - offset < size) {
2278 dissect_data_element(next_tree, &entry_tree, pinfo, tvb, list_offset);
2279 list_offset = get_type_length(tvb, list_offset, &list_length);
2280 proto_tree_add_item(entry_tree, hf_synch_supported_data_store, tvb, list_offset, 1, ENC_BIG_ENDIAN);
2281 value = tvb_get_uint8(tvb, list_offset);
2283 wmem_strbuf_append_printf(info_buf, "%s ", val_to_str_const(value, synch_supported_data_store_vals, "Unknown"));
2284 list_offset += list_length;
2286 break;
2287 default:
2288 found = false;
2290 break;
2291 case BTSDP_CTP_SERVICE_UUID:
2292 switch (attribute) {
2293 case 0x311:
2294 proto_tree_add_item(next_tree, hf_ctp_external_network, tvb, offset, 1, ENC_BIG_ENDIAN);
2295 value = tvb_get_uint8(tvb, offset);
2297 wmem_strbuf_append(info_buf, val_to_str_const(value, ctp_external_network_vals, "Unknown"));
2298 break;
2299 default:
2300 found = false;
2302 break;
2303 case BTSDP_AVRCP_SERVICE_UUID:
2304 case BTSDP_AVRCP_CT_SERVICE_UUID:
2305 switch (attribute) {
2306 case 0x311:
2307 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_reserved_10_15, tvb, offset, 2, ENC_BIG_ENDIAN);
2308 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_cover_art_get_linked_thumbnail, tvb, offset, 2, ENC_BIG_ENDIAN);
2309 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_cover_art_get_image, tvb, offset, 2, ENC_BIG_ENDIAN);
2310 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_cover_art_get_image_properties, tvb, offset, 2, ENC_BIG_ENDIAN);
2311 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_browsing, tvb, offset, 2, ENC_BIG_ENDIAN);
2312 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_reserved_4_5, tvb, offset, 2, ENC_BIG_ENDIAN);
2313 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_category_4, tvb, offset, 2, ENC_BIG_ENDIAN);
2314 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_category_3, tvb, offset, 2, ENC_BIG_ENDIAN);
2315 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_category_2, tvb, offset, 2, ENC_BIG_ENDIAN);
2316 proto_tree_add_item(next_tree, hf_avrcp_ct_supported_features_category_1, tvb, offset, 2, ENC_BIG_ENDIAN);
2318 supported_features = tvb_get_ntohs(tvb, offset);
2320 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s%s",
2321 (supported_features & 0x01) ? "Category1(Player/Recorder) " : "",
2322 (supported_features & 0x02) ? "Category2(Monitor/Amplifier) " : "",
2323 (supported_features & 0x04) ? "Category3(Tuner) " : "",
2324 (supported_features & 0x08) ? "Category4(Menu) " : "",
2325 (supported_features & 0x40) ? "Browsing " : "",
2326 (supported_features & 0x80) ? "CoverArt/GetImageProperties) " : "",
2327 (supported_features & 0x100) ? "CoverArt/GetImage) " : "",
2328 (supported_features & 0x200) ? "CoverArt/GetLinkedThumbnail) " : "");
2329 break;
2330 default:
2331 found = false;
2333 break;
2334 case BTSDP_AVRCP_TG_SERVICE_UUID:
2335 switch (attribute) {
2336 case 0x311:
2337 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_reserved_9_15, tvb, offset, 2, ENC_BIG_ENDIAN);
2338 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_cover_art, tvb, offset, 2, ENC_BIG_ENDIAN);
2339 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_multiple_player, tvb, offset, 2, ENC_BIG_ENDIAN);
2340 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_browsing, tvb, offset, 2, ENC_BIG_ENDIAN);
2341 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_group_navigation, tvb, offset, 2, ENC_BIG_ENDIAN);
2342 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_settings, tvb, offset, 2, ENC_BIG_ENDIAN);
2343 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_category_4, tvb, offset, 2, ENC_BIG_ENDIAN);
2344 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_category_3, tvb, offset, 2, ENC_BIG_ENDIAN);
2345 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_category_2, tvb, offset, 2, ENC_BIG_ENDIAN);
2346 proto_tree_add_item(next_tree, hf_avrcp_tg_supported_features_category_1, tvb, offset, 2, ENC_BIG_ENDIAN);
2348 supported_features = tvb_get_ntohs(tvb, offset);
2350 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s%s%s",
2351 (supported_features & 0x01) ? "Category1(Player/Recorder) " : "",
2352 (supported_features & 0x02) ? "Category2(Monitor/Amplifier) " : "",
2353 (supported_features & 0x04) ? "Category3(Tuner) " : "",
2354 (supported_features & 0x08) ? "Category4(Menu) " : "",
2355 (supported_features & 0x10) ? "PlayerApplicationSettings " : "",
2356 (supported_features & 0x20) ? "GroupNavigation " : "",
2357 (supported_features & 0x40) ? "Browsing " : "",
2358 (supported_features & 0x80) ? "MultiplePlayers " : "",
2359 (supported_features & 0x100) ? "CoverArt " : "");
2360 break;
2361 default:
2362 found = false;
2364 break;
2365 case BTSDP_HSP_SERVICE_UUID:
2366 case BTSDP_HSP_HS_SERVICE_UUID:
2367 switch (attribute) {
2368 case 0x302:
2369 proto_tree_add_item(next_tree, hf_hsp_remote_audio_volume_control, tvb, offset, 1, ENC_BIG_ENDIAN);
2370 value = tvb_get_uint8(tvb, offset);
2371 wmem_strbuf_append(info_buf, value ? "true" : "false");
2372 break;
2373 default:
2374 found = false;
2376 break;
2377 case BTSDP_GNSS_UUID:
2378 case BTSDP_GNSS_SERVER_UUID:
2379 switch (attribute) {
2380 case 0x200:
2381 proto_tree_add_item(next_tree, hf_gnss_supported_features, tvb, offset, 2, ENC_BIG_ENDIAN);
2382 supported_features = tvb_get_ntohs(tvb, offset);
2383 wmem_strbuf_append_printf(info_buf, "reserved (0x%04x)", supported_features);
2384 break;
2385 default:
2386 found = false;
2388 break;
2389 case BTSDP_PBAP_PSE_SERVICE_UUID:
2390 switch (attribute) {
2391 case 0x200:
2392 proto_tree_add_item(next_tree, hf_pbap_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
2393 psm = tvb_get_ntohs(tvb, offset);
2394 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
2395 if (!pinfo->fd->visited && service_info)
2396 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
2397 break;
2398 case 0x314:
2399 proto_tree_add_bitmask_with_flags(next_tree, tvb, offset, hf_pbap_pse_supported_repositories, ett_btsdp_supported_features, hfx_pbap_pse_supported_repositories, ENC_NA, BMT_NO_APPEND);
2400 supported_features = tvb_get_uint8(tvb, offset);
2402 wmem_strbuf_append_printf(info_buf, "%s%s%s%s",
2403 (supported_features & 0x01) ? "LocalPhonebook " : "",
2404 (supported_features & 0x02) ? "SIM " : "",
2405 (supported_features & 0x04) ? "SpeedDial " : "",
2406 (supported_features & 0x08) ? "Favourites " : "");
2407 break;
2408 case 0x317:
2409 proto_tree_add_bitmask_with_flags(next_tree, tvb, offset, hf_pbap_pse_supported_features, ett_btsdp_supported_features, hfx_pbap_pse_supported_features, ENC_NA, BMT_NO_APPEND);
2410 supported_features = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
2411 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s%s%s%s",
2412 (supported_features & 0x001) ? "Download " : "",
2413 (supported_features & 0x002) ? "Browsing " : "",
2414 (supported_features & 0x004) ? "DatabaseIdentifier " : "",
2415 (supported_features & 0x008) ? "FolderVersionCounters " : "",
2416 (supported_features & 0x010) ? "vCardSelecting " : "",
2417 (supported_features & 0x020) ? "EnhancedMissedCalls " : "",
2418 (supported_features & 0x040) ? "X-BT-UCIvCardProperty " : "",
2419 (supported_features & 0x080) ? "X-BT-UIDvCardProperty " : "",
2420 (supported_features & 0x100) ? "ContactReferencing " : "",
2421 (supported_features & 0x200) ? "DefaultContactImageFormat " : "");
2422 break;
2423 default:
2424 found = false;
2426 break;
2427 case BTSDP_FAX_SERVICE_UUID:
2428 switch (attribute) {
2429 case 0x302:
2430 proto_tree_add_item(next_tree, hf_fax_support_class_1, tvb, offset, 1, ENC_BIG_ENDIAN);
2431 supported_features = tvb_get_uint8(tvb, offset);
2432 wmem_strbuf_append(info_buf, supported_features ? "true" : "false");
2433 break;
2434 case 0x303:
2435 proto_tree_add_item(next_tree, hf_fax_support_class_2, tvb, offset, 1, ENC_BIG_ENDIAN);
2436 supported_features = tvb_get_uint8(tvb, offset);
2437 wmem_strbuf_append(info_buf, supported_features ? "true" : "false");
2438 break;
2439 case 0x304:
2440 proto_tree_add_item(next_tree, hf_fax_support_class_2_vendor, tvb, offset, 1, ENC_BIG_ENDIAN);
2441 supported_features = tvb_get_uint8(tvb, offset);
2442 wmem_strbuf_append(info_buf, supported_features ? "true" : "false");
2443 break;
2444 case 0x305:
2445 proto_tree_add_item(next_tree, hf_fax_support_audio_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
2446 supported_features = tvb_get_uint8(tvb, offset);
2447 wmem_strbuf_append(info_buf, supported_features ? "true" : "false");
2448 break;
2449 default:
2450 found = false;
2452 break;
2453 case BTSDP_FTP_SERVICE_UUID:
2454 switch (attribute) {
2455 case 0x200:
2456 proto_tree_add_item(next_tree, hf_ftp_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
2457 psm = tvb_get_ntohs(tvb, offset);
2458 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
2459 if (!pinfo->fd->visited && service_info)
2460 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
2461 break;
2462 default:
2463 found = false;
2465 break;
2466 case BTSDP_MAP_SERVICE_UUID:
2467 case BTSDP_MAP_ACCESS_SRV_SERVICE_UUID:
2468 switch (attribute) {
2469 case 0x200:
2470 proto_tree_add_item(next_tree, hf_map_mas_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
2471 psm = tvb_get_ntohs(tvb, offset);
2472 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
2473 if (!pinfo->fd->visited && service_info)
2474 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
2475 break;
2476 case 0x315:
2477 proto_tree_add_item(next_tree, hf_map_mas_instance_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2478 value = tvb_get_uint8(tvb, offset);
2479 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", value, value);
2480 break;
2481 case 0x316:
2482 proto_tree_add_item(next_tree, hf_map_mas_supported_message_types_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2483 proto_tree_add_item(next_tree, hf_map_mas_supported_message_types_mms, tvb, offset, 1, ENC_BIG_ENDIAN);
2484 proto_tree_add_item(next_tree, hf_map_mas_supported_message_types_sms_cdma, tvb, offset, 1, ENC_BIG_ENDIAN);
2485 proto_tree_add_item(next_tree, hf_map_mas_supported_message_types_sms_gsm, tvb, offset, 1, ENC_BIG_ENDIAN);
2486 proto_tree_add_item(next_tree, hf_map_mas_supported_message_types_email, tvb, offset, 1, ENC_BIG_ENDIAN);
2488 supported_features = tvb_get_uint8(tvb, offset);
2489 wmem_strbuf_append_printf(info_buf, "%s%s%s%s",
2490 (supported_features & 0x01) ? "Email " : "",
2491 (supported_features & 0x02) ? "SMS_GSM " : "",
2492 (supported_features & 0x04) ? "SMS_CDMA " : "",
2493 (supported_features & 0x08) ? "MMS " : "");
2494 break;
2495 case 0x317:
2496 proto_tree_add_bitmask_with_flags(next_tree, tvb, offset, hf_map_supported_features, ett_btsdp_supported_features, hfx_map_supported_features, ENC_NA, BMT_NO_APPEND);
2497 supported_features = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
2498 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s",
2499 (supported_features & 0x01) ? "NotificationRegistration Feature " : "",
2500 (supported_features & 0x02) ? "NotificationFeature " : "",
2501 (supported_features & 0x04) ? "BrowsingFeature " : "",
2502 (supported_features & 0x08) ? "UploadingFeature " : "",
2503 (supported_features & 0x10) ? "DeleteFeature " : "",
2504 (supported_features & 0x20) ? "InstanceInformationFeature " : "",
2505 (supported_features & 0x40) ? "ExtendedEventReport1.1 " : "");
2506 break;
2507 default:
2508 found = false;
2510 break;
2511 case BTSDP_MAP_NOTIFICATION_SRV_SERVICE_UUID:
2512 switch (attribute) {
2513 case 0x200:
2514 proto_tree_add_item(next_tree, hf_map_mns_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
2515 psm = tvb_get_ntohs(tvb, offset);
2516 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
2517 if (!pinfo->fd->visited && service_info)
2518 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
2519 break;
2520 case 0x317:
2521 proto_tree_add_bitmask_with_flags(next_tree, tvb, offset, hf_map_supported_features, ett_btsdp_supported_features, hfx_map_supported_features, ENC_NA, BMT_NO_APPEND);
2522 supported_features = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
2523 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s",
2524 (supported_features & 0x01) ? "NotificationRegistration Feature " : "",
2525 (supported_features & 0x02) ? "NotificationFeature " : "",
2526 (supported_features & 0x04) ? "BrowsingFeature " : "",
2527 (supported_features & 0x08) ? "UploadingFeature " : "",
2528 (supported_features & 0x10) ? "DeleteFeature " : "",
2529 (supported_features & 0x20) ? "InstanceInformationFeature " : "",
2530 (supported_features & 0x40) ? "ExtendedEventReport1.1 " : "");
2531 break;
2532 default:
2533 found = false;
2535 break;
2536 case BTSDP_HCRP_SERVICE_UUID:
2537 case BTSDP_HCRP_PRINT_SERVICE_UUID:
2538 case BTSDP_HCRP_SCAN_SERVICE_UUID:
2539 switch (attribute) {
2540 case 0x300:
2541 proto_tree_add_item_ret_string(next_tree, hf_hcrp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2542 wmem_strbuf_append(info_buf, (const char*)new_str);
2543 break;
2544 case 0x302:
2545 proto_tree_add_item_ret_string(next_tree, hf_hcrp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2546 wmem_strbuf_append(info_buf, (const char*)new_str);
2547 break;
2548 case 0x304:
2549 proto_tree_add_item_ret_string(next_tree, hf_hcrp_friendly_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2550 wmem_strbuf_append(info_buf, (const char*)new_str);
2551 break;
2552 case 0x306:
2553 proto_tree_add_item_ret_string(next_tree, hf_hcrp_device_location, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2554 wmem_strbuf_append(info_buf, (const char*)new_str);
2555 break;
2556 default:
2557 found = false;
2559 break;
2560 case BTSDP_WAP_SERVICE_UUID:
2561 case BTSDP_WAP_CLIENT_SERVICE_UUID:
2562 switch (attribute) {
2563 case 0x306:
2564 proto_tree_add_item(next_tree, hf_wap_network_address, tvb, offset, 4, ENC_BIG_ENDIAN);
2565 wmem_strbuf_append(info_buf, tvb_ip_to_str(pinfo->pool, tvb, offset));
2566 break;
2567 case 0x307:
2568 proto_tree_add_item(next_tree, hf_wap_gateway, tvb, offset, 1, ENC_BIG_ENDIAN);
2569 value = tvb_get_uint8(tvb, offset);
2570 wmem_strbuf_append(info_buf, val_to_str_const(value, wap_gateway_vals, "Unknown"));
2571 break;
2572 case 0x308:
2573 proto_tree_add_item_ret_string(next_tree, hf_wap_homepage_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2574 wmem_strbuf_append(info_buf, (const char*)new_str);
2575 break;
2576 case 0x309:
2577 proto_tree_add_item(next_tree, hf_wap_stack_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2578 value = tvb_get_uint8(tvb, offset);
2579 wmem_strbuf_append(info_buf, val_to_str_const(value, wap_stack_type_vals, "Unknown"));
2580 break;
2581 default:
2582 found = false;
2584 break;
2585 case BTSDP_HDP_SERVICE_UUID:
2586 case BTSDP_HDP_SOURCE_SERVICE_UUID:
2587 case BTSDP_HDP_SINK_SERVICE_UUID:
2588 switch (attribute) {
2589 case 0x200:
2590 i_feature = 1;
2591 list_offset = offset;
2592 while (list_offset - offset < size) {
2593 entry_offset = get_type_length(tvb, list_offset, &entry_length);
2594 feature_item = proto_tree_add_none_format(next_tree, hf_hdp_supported_features_data, tvb, entry_offset, entry_length, "Supported Feature #%u", i_feature);
2595 feature_tree = proto_item_add_subtree(feature_item, ett_btsdp_supported_features);
2597 dissect_data_element(feature_tree, &sub_tree, pinfo, tvb, list_offset);
2599 entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_id, tvb, entry_offset, 0, ENC_NA);
2600 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_id);
2601 dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset);
2602 new_offset = get_type_length(tvb, entry_offset, &length);
2603 proto_item_set_len(entry_item, (new_offset - entry_offset) + length);
2604 entry_offset = new_offset;
2606 proto_tree_add_item(next_tree, hf_hdp_supported_features_mdep_id, tvb, entry_offset, 1, ENC_BIG_ENDIAN);
2607 mdep_id = tvb_get_uint8(tvb, entry_offset);
2608 proto_item_append_text(entry_item, ": %u (0x%02x)", mdep_id, mdep_id);
2609 entry_offset += length;
2611 entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_data_type, tvb, entry_offset, 0, ENC_NA);
2612 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_data_type);
2614 dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset);
2615 new_offset = get_type_length(tvb, entry_offset, &length);
2616 proto_item_set_len(entry_item, (new_offset - entry_offset) + length);
2617 entry_offset = new_offset;
2618 if (service_hdp_data_exchange_specification == 0x01)
2619 proto_tree_add_item(next_tree, hf_hdp_supported_features_mdep_data_type_01, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
2620 else
2621 proto_tree_add_item(next_tree, hf_hdp_supported_features_mdep_data_type, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
2622 value = tvb_get_ntohs(tvb, entry_offset);
2623 proto_item_append_text(entry_item, ": %u (0x%04x)", value, value);
2624 entry_offset += length;
2626 entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_role, tvb, entry_offset, 0, ENC_NA);
2627 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_role);
2629 dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset);
2630 new_offset = get_type_length(tvb, entry_offset, &length);
2631 proto_item_set_len(entry_item, (new_offset - entry_offset) + length);
2632 entry_offset = new_offset;
2633 proto_tree_add_item(next_tree, hf_hdp_supported_features_mdep_role, tvb, entry_offset, 1, ENC_BIG_ENDIAN);
2634 value = tvb_get_uint8(tvb, entry_offset);
2635 wmem_strbuf_append_printf(info_buf, "MDEP ID: %u (Role: %s) ", mdep_id, val_to_str_const(value, hdp_mdep_role_vals ,"Unknown"));
2636 proto_item_append_text(entry_item, ": %s", val_to_str_const(value, hdp_mdep_role_vals ,"Unknown"));
2637 entry_offset += length;
2639 if (entry_length - (entry_offset - list_offset) > 0) {
2640 const uint8_t* entry_str;
2642 entry_item = proto_tree_add_item(sub_tree, hf_hdp_supported_features_data_mdep_description, tvb, entry_offset, entry_length, ENC_NA);
2643 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_supported_features_mdep_description);
2645 dissect_data_element(entry_tree, &next_tree, pinfo, tvb, entry_offset);
2646 new_offset = get_type_length(tvb, entry_offset, &length);
2647 proto_item_set_len(entry_item, (new_offset - entry_offset) + length);
2648 entry_offset = new_offset;
2649 proto_tree_add_item_ret_string(next_tree, hf_hdp_supported_features_mdep_description, tvb, entry_offset, length,
2650 ENC_ASCII | ENC_NA, pinfo->pool, &entry_str);
2651 proto_item_append_text(entry_item, ": %s", entry_str);
2652 entry_offset += length;
2655 list_offset = entry_offset;
2656 i_feature += 1;
2658 break;
2659 case 0x301:
2660 proto_tree_add_item(next_tree, hf_hdp_data_exchange, tvb, offset, 1, ENC_BIG_ENDIAN);
2661 value = tvb_get_uint8(tvb, offset);
2662 wmem_strbuf_append(info_buf, val_to_str_const(value, hdp_data_exchange_specification_vals, "Unknown"));
2663 break;
2664 case 0x302:
2665 proto_tree_add_item(next_tree, hf_hdp_support_procedure_reserved_5_7, tvb, offset, 1, ENC_BIG_ENDIAN);
2666 proto_tree_add_item(next_tree, hf_hdp_support_procedure_sync_master_role, tvb, offset, 1, ENC_BIG_ENDIAN);
2667 proto_tree_add_item(next_tree, hf_hdp_support_procedure_clock_synchronization_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
2668 proto_tree_add_item(next_tree, hf_hdp_support_procedure_reconnect_acceptance, tvb, offset, 1, ENC_BIG_ENDIAN);
2669 proto_tree_add_item(next_tree, hf_hdp_support_procedure_reconnect_initiation, tvb, offset, 1, ENC_BIG_ENDIAN);
2670 proto_tree_add_item(next_tree, hf_hdp_support_procedure_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2672 supported_features = tvb_get_uint8(tvb, offset);
2673 wmem_strbuf_append_printf(info_buf, "%s%s%s%s",
2674 (supported_features & 0x02) ? "ReconnectInitiation " : "",
2675 (supported_features & 0x04) ? "ReconnectAcceptance " : "",
2676 (supported_features & 0x08) ? "ClockSynchronizationProtocol " : "",
2677 (supported_features & 0x10) ? "SyncMasterRole " : "");
2678 break;
2679 default:
2680 found = false;
2682 break;
2683 case BTSDP_PAN_GN_SERVICE_UUID:
2684 switch (attribute) {
2685 case 0x30A:
2686 proto_tree_add_item(next_tree, hf_pan_sercurity_description, tvb, offset, 2, ENC_BIG_ENDIAN);
2687 value = tvb_get_ntohs(tvb, offset);
2688 wmem_strbuf_append(info_buf, val_to_str_const(value, pan_security_description_vals, "Unknown"));
2689 break;
2690 case 0x30D:
2691 case 0x200:
2692 proto_tree_add_item_ret_string(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2693 wmem_strbuf_append(info_buf, (const char*)new_str);
2694 break;
2695 case 0x30E:
2696 proto_tree_add_item_ret_string(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2697 wmem_strbuf_append(info_buf, (const char*)new_str);
2698 break;
2699 default:
2700 found = false;
2702 break;
2703 case BTSDP_PAN_NAP_SERVICE_UUID:
2704 switch (attribute) {
2705 case 0x30A:
2706 proto_tree_add_item(next_tree, hf_pan_sercurity_description, tvb, offset, 2, ENC_BIG_ENDIAN);
2707 value = tvb_get_ntohs(tvb, offset);
2708 wmem_strbuf_append(info_buf, val_to_str_const(value, pan_security_description_vals, "Unknown"));
2709 break;
2710 case 0x30B:
2711 proto_tree_add_item(next_tree, hf_pan_net_access_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2712 value = tvb_get_ntohs(tvb, offset);
2713 wmem_strbuf_append(info_buf, val_to_str_const(value, pan_net_access_type_vals, "Unknown"));
2714 break;
2715 case 0x30C:
2716 proto_tree_add_item(next_tree, hf_pan_max_net_access_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
2717 value = tvb_get_ntohl(tvb, offset);
2718 wmem_strbuf_append_printf(info_buf, "%u (0x%08x)", value, value);
2719 break;
2720 case 0x30D:
2721 case 0x200:
2722 proto_tree_add_item_ret_string(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2723 wmem_strbuf_append(info_buf, (const char*)new_str);
2724 break;
2725 case 0x30E:
2726 proto_tree_add_item_ret_string(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2727 wmem_strbuf_append(info_buf, (const char*)new_str);
2728 break;
2729 default:
2730 found = false;
2732 break;
2733 case BTSDP_PAN_PANU_SERVICE_UUID:
2734 switch (attribute) {
2735 case 0x30A:
2736 proto_tree_add_item(next_tree, hf_pan_sercurity_description, tvb, offset, 2, ENC_BIG_ENDIAN);
2737 value = tvb_get_ntohs(tvb, offset);
2738 wmem_strbuf_append(info_buf, val_to_str_const(value, pan_security_description_vals, "Unknown"));
2739 break;
2740 default:
2741 found = false;
2743 break;
2744 case BTSDP_OPP_SERVICE_UUID:
2745 switch (attribute) {
2746 case 0x200:
2747 proto_tree_add_item(next_tree, hf_opp_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
2748 psm = tvb_get_ntohs(tvb, offset);
2749 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
2750 if (!pinfo->fd->visited && service_info)
2751 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
2752 break;
2753 case 0x303:
2754 list_offset = offset;
2755 while (list_offset - offset < size) {
2756 dissect_data_element(next_tree, &entry_tree, pinfo, tvb, list_offset);
2757 list_offset = get_type_length(tvb, list_offset, &list_length);
2758 proto_tree_add_item(entry_tree, hf_opp_supported_format, tvb, list_offset, 1, ENC_BIG_ENDIAN);
2759 value = tvb_get_uint8(tvb, list_offset);
2761 wmem_strbuf_append_printf(info_buf, "%s ", val_to_str_const(value, opp_supported_format_vals, "Unknown"));
2762 list_offset += list_length;
2764 break;
2765 default:
2766 found = false;
2768 break;
2769 case BTSDP_DUN_SERVICE_UUID:
2770 switch (attribute) {
2771 case 0x305:
2772 proto_tree_add_item(next_tree, hf_dun_support_audio_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
2773 supported_features = tvb_get_uint8(tvb, offset);
2774 wmem_strbuf_append(info_buf, supported_features ? "true" : "false");
2775 break;
2776 case 0x306:
2777 proto_tree_add_item_ret_string(next_tree, hf_dun_escape_sequence, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
2778 wmem_strbuf_append(info_buf, (const char*)new_str);
2779 break;
2780 default:
2781 found = false;
2783 break;
2784 case BTSDP_HFP_SERVICE_UUID:
2785 switch (attribute) {
2786 case 0x311:
2787 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2788 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_wide_band_speech, tvb, offset, 2, ENC_BIG_ENDIAN);
2789 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_remote_volume_control, tvb, offset, 2, ENC_BIG_ENDIAN);
2790 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_voice_recognition_activation, tvb, offset, 2, ENC_BIG_ENDIAN);
2791 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_cli_presentation_capability, tvb, offset, 2, ENC_BIG_ENDIAN);
2792 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_call_waiting_or_three_way_calling, tvb, offset, 2, ENC_BIG_ENDIAN);
2793 proto_tree_add_item(next_tree, hf_hfp_hf_supported_features_ec_and_or_nr_function, tvb, offset, 2, ENC_BIG_ENDIAN);
2795 supported_features = tvb_get_ntohs(tvb, offset);
2796 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s",
2797 (supported_features & 0x01) ? "(EC and/or Nr Function) " : "",
2798 (supported_features & 0x02) ? "(Call Waiting or Three Way Calling) " : "",
2799 (supported_features & 0x04) ? "(CLI Presentation Capability) " : "",
2800 (supported_features & 0x08) ? "(Voice Recognition Activation) " : "",
2801 (supported_features & 0x10) ? "(Remote Volume Control) " : "",
2802 (supported_features & 0x20) ? "(Wide Band Speech) " : "");
2803 break;
2804 default:
2805 found = false;
2807 break;
2808 case BTSDP_HFP_GW_SERVICE_UUID:
2809 switch (attribute) {
2810 case 0x301:
2811 proto_tree_add_item(next_tree, hf_hfp_gw_network, tvb, offset, 1, ENC_BIG_ENDIAN);
2812 value = tvb_get_uint8(tvb, offset);
2813 wmem_strbuf_append(info_buf, val_to_str_const(value, hfp_gw_network_vals, "Unknown"));
2814 break;
2815 case 0x311:
2816 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
2817 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_wide_band_speech, tvb, offset, 2, ENC_BIG_ENDIAN);
2818 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_attach_phone_number_to_voice_tag, tvb, offset, 2, ENC_BIG_ENDIAN);
2819 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_inband_ring_tone_capability, tvb, offset, 2, ENC_BIG_ENDIAN);
2820 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_voice_recognition_function, tvb, offset, 2, ENC_BIG_ENDIAN);
2821 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_ec_and_or_nr_function, tvb, offset, 2, ENC_BIG_ENDIAN);
2822 proto_tree_add_item(next_tree, hf_hfp_gw_supported_features_three_way_calling, tvb, offset, 2, ENC_BIG_ENDIAN);
2824 supported_features = tvb_get_ntohs(tvb, offset);
2825 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s",
2826 (supported_features & 0x01) ? "(Three Way Calling) " : "",
2827 (supported_features & 0x02) ? "(EC and/or Nr Function) " : "",
2828 (supported_features & 0x04) ? "(Voice Recognition Function) " : "",
2829 (supported_features & 0x08) ? "(Inband Ring Tone Capability) " : "",
2830 (supported_features & 0x10) ? "(Attach a Phone Number to a Voice Tag) " : "",
2831 (supported_features & 0x20) ? "(Wide Band Speech) " : "");
2832 break;
2833 default:
2834 found = false;
2836 break;
2837 case BTSDP_HID_SERVICE_UUID:
2838 switch (attribute) {
2839 case 0x200:
2840 proto_tree_add_item(next_tree, hf_hid_device_release_number, tvb, offset, 2, ENC_BIG_ENDIAN);
2841 version = tvb_get_ntohs(tvb, offset);
2842 wmem_strbuf_append_printf(info_buf, "%x.%x.%x (0x%04x)", version >> 8, (version >> 4) & 0xF, version & 0xF, version);
2843 break;
2844 case 0x201:
2845 proto_tree_add_item(next_tree, hf_hid_parser_version, tvb, offset, 2, ENC_BIG_ENDIAN);
2846 version = tvb_get_ntohs(tvb, offset);
2847 wmem_strbuf_append_printf(info_buf, "%x.%x.%x (0x%04x)", version >> 8, (version >> 4) & 0xF, version & 0xF, version);
2848 break;
2849 case 0x202:
2850 proto_tree_add_item(next_tree, hf_hid_device_subclass_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2851 proto_tree_add_item(next_tree, hf_hid_device_subclass_subtype, tvb, offset, 1, ENC_BIG_ENDIAN);
2852 proto_tree_add_item(next_tree, hf_hid_device_subclass_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2853 value = tvb_get_uint8(tvb, offset);
2854 wmem_strbuf_append_printf(info_buf, "%s, %s",
2855 val_to_str_const(value >> 6, hid_device_subclass_type_vals, "Unknown"),
2856 val_to_str_const(((value & 0x3C) >> 2) , hid_device_subclass_subtype_vals, "Unknown"));
2857 break;
2858 case 0x203:
2859 proto_tree_add_item(next_tree, hf_hid_country_code, tvb, offset, 1, ENC_BIG_ENDIAN);
2860 value = tvb_get_uint8(tvb, offset);
2861 wmem_strbuf_append(info_buf, val_to_str_const(value, hid_country_code_vals, "Unknown"));
2862 break;
2863 case 0x204:
2864 proto_tree_add_item(next_tree, hf_hid_virtual_cable, tvb, offset, 1, ENC_BIG_ENDIAN);
2865 value = tvb_get_uint8(tvb, offset);
2866 wmem_strbuf_append(info_buf, value ? "true" : "false");
2867 break;
2868 case 0x205:
2869 proto_tree_add_item(next_tree, hf_hid_reconnect_initiate, tvb, offset, 1, ENC_BIG_ENDIAN);
2870 value = tvb_get_uint8(tvb, offset);
2871 wmem_strbuf_append(info_buf, value ? "true" : "false");
2872 break;
2873 case 0x206:
2874 list_offset = offset;
2875 i_feature = 1;
2876 while (list_offset - offset < size) {
2877 entry_item = proto_tree_add_none_format(next_tree, hf_hid_descriptor_list_descriptor_data, tvb, list_offset, size, "Descriptor #%u", i_feature);
2878 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element);
2880 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset);
2881 list_offset = get_type_length(tvb, list_offset, &entry_length);
2883 dissect_data_element(sub_tree, &last_tree, pinfo, tvb, list_offset);
2884 list_offset = get_type_length(tvb, list_offset, &entry_length);
2885 proto_tree_add_item(last_tree, hf_hid_descriptor_list_type, tvb, list_offset, 1, ENC_BIG_ENDIAN);
2886 value = tvb_get_uint8(tvb, list_offset);
2887 wmem_strbuf_append(info_buf, val_to_str_const(value, descriptor_list_type_vals, "Unknown"));
2888 proto_item_append_text(entry_item, ": %s", val_to_str_const(value, descriptor_list_type_vals, "Unknown"));
2889 list_offset += entry_length;
2891 dissect_data_element(sub_tree, &last_tree, pinfo, tvb, list_offset);
2892 list_offset = get_type_length(tvb, list_offset, &entry_length);
2893 proto_tree_add_item(last_tree, hf_hid_descriptor_list_descriptor, tvb, list_offset, entry_length, ENC_NA);
2894 list_offset += entry_length;
2896 i_feature += 1;
2898 if (list_offset - offset < size)
2899 wmem_strbuf_append(info_buf, ", ");
2901 break;
2902 case 0x207:
2903 list_offset = offset;
2904 i_feature = 1;
2905 while (list_offset - offset < size) {
2906 wmem_strbuf_append(info_buf, "[");
2907 entry_item = proto_tree_add_none_format(next_tree, hf_hid_lang, tvb, list_offset, size, "Language #%u", i_feature);
2908 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element);
2910 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset);
2911 list_offset = get_type_length(tvb, list_offset, &entry_length);
2913 dissect_data_element(sub_tree, &last_tree, pinfo, tvb, list_offset);
2914 list_offset = get_type_length(tvb, list_offset, &entry_length);
2915 value = tvb_get_ntohs(tvb, list_offset);
2916 wmem_strbuf_append_printf(info_buf, "Lang ID: %s", val_to_str_ext_const(value, &usb_langid_vals_ext, "Unknown"));
2917 proto_item_append_text(entry_item, ": Lang ID: %s", val_to_str_ext_const(value, &usb_langid_vals_ext, "Unknown"));
2918 proto_tree_add_item(last_tree, hf_sdp_lang_id, tvb, list_offset, entry_length, ENC_BIG_ENDIAN);
2919 list_offset += entry_length;
2921 dissect_data_element(sub_tree, &last_tree, pinfo, tvb, list_offset);
2922 list_offset = get_type_length(tvb, list_offset, &entry_length);
2923 value = tvb_get_ntohs(tvb, list_offset);
2924 wmem_strbuf_append_printf(info_buf, ", Attribute Base: 0x%04x", value);
2925 proto_item_append_text(entry_item, ", Attribute Base: 0x%04x", value);
2926 proto_tree_add_item(last_tree, hf_sdp_lang_attribute_base, tvb, list_offset, 2, ENC_BIG_ENDIAN);
2927 list_offset += entry_length;
2928 i_feature += 1;
2930 if (list_offset - offset < size)
2931 wmem_strbuf_append(info_buf, "], ");
2932 else
2933 wmem_strbuf_append(info_buf, "]");
2935 break;
2936 case 0x208:
2937 proto_tree_add_item(next_tree, hf_hid_sdp_disable, tvb, offset, 1, ENC_BIG_ENDIAN);
2938 value = tvb_get_uint8(tvb, offset);
2939 wmem_strbuf_append(info_buf, value ? "true" : "false");
2940 break;
2941 case 0x209:
2942 proto_tree_add_item(next_tree, hf_hid_battery_power, tvb, offset, 1, ENC_BIG_ENDIAN);
2943 value = tvb_get_uint8(tvb, offset);
2944 wmem_strbuf_append(info_buf, value ? "true" : "false");
2945 break;
2946 case 0x20A:
2947 proto_tree_add_item(next_tree, hf_hid_remote_wake, tvb, offset, 1, ENC_BIG_ENDIAN);
2948 value = tvb_get_uint8(tvb, offset);
2949 wmem_strbuf_append(info_buf, value ? "true" : "false");
2950 break;
2951 case 0x20B:
2952 proto_tree_add_item(next_tree, hf_hid_profile_version, tvb, offset, 2, ENC_BIG_ENDIAN);
2953 version = tvb_get_ntohs(tvb, offset);
2954 wmem_strbuf_append_printf(info_buf, "%x.%x.%x (0x%04x)", version >> 8, (version >> 4) & 0xF, version & 0xF, version);
2955 break;
2956 case 0x20C:
2957 proto_tree_add_item(next_tree, hf_hid_supervision_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
2958 value = tvb_get_ntohs(tvb, offset);
2959 wmem_strbuf_append_printf(info_buf, "%u", value);
2960 break;
2961 case 0x20D:
2962 proto_tree_add_item(next_tree, hf_hid_normally_connectable, tvb, offset, 1, ENC_BIG_ENDIAN);
2963 value = tvb_get_uint8(tvb, offset);
2964 wmem_strbuf_append(info_buf, value ? "true" : "false");
2965 break;
2966 case 0x20E:
2967 proto_tree_add_item(next_tree, hf_hid_boot_device, tvb, offset, 1, ENC_BIG_ENDIAN);
2968 value = tvb_get_uint8(tvb, offset);
2969 wmem_strbuf_append(info_buf, value ? "true" : "false");
2970 break;
2971 case 0x20F:
2972 proto_tree_add_item(next_tree, hf_hid_ssr_host_max_latency, tvb, offset, 2, ENC_BIG_ENDIAN);
2973 value = tvb_get_ntohs(tvb, offset);
2974 wmem_strbuf_append_printf(info_buf, "%u", value);
2975 break;
2976 case 0x210:
2977 proto_tree_add_item(next_tree, hf_hid_ssr_host_min_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
2978 value = tvb_get_ntohs(tvb, offset);
2979 wmem_strbuf_append_printf(info_buf, "%u", value);
2980 break;
2981 default:
2982 found = false;
2984 break;
2985 case BTSDP_BIP_SERVICE_UUID:
2986 case BTSDP_BIP_RESPONDER_SERVICE_UUID:
2987 switch (attribute) {
2988 case 0x200:
2989 proto_tree_add_item(next_tree, hf_bip_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
2990 psm = tvb_get_ntohs(tvb, offset);
2991 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
2992 if (!pinfo->fd->visited && service_info)
2993 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
2994 break;
2995 case 0x310:
2996 proto_tree_add_item(next_tree, hf_bip_supported_capabilities_reserved_4_7, tvb, offset, 1, ENC_BIG_ENDIAN);
2997 proto_tree_add_item(next_tree, hf_bip_supported_capabilities_displaying, tvb, offset, 1, ENC_BIG_ENDIAN);
2998 proto_tree_add_item(next_tree, hf_bip_supported_capabilities_printing, tvb, offset, 1, ENC_BIG_ENDIAN);
2999 proto_tree_add_item(next_tree, hf_bip_supported_capabilities_capturing, tvb, offset, 1, ENC_BIG_ENDIAN);
3000 proto_tree_add_item(next_tree, hf_bip_supported_capabilities_genering_imaging, tvb, offset, 1, ENC_BIG_ENDIAN);
3001 value = tvb_get_uint8(tvb, offset);
3003 wmem_strbuf_append_printf(info_buf, "%s%s%s%s",
3004 (value & 0x01) ? "GeneringImaging " : "",
3005 (value & 0x02) ? "Capturing " : "",
3006 (value & 0x04) ? "Printing " : "",
3007 (value & 0x08) ? "Displaying " : "");
3008 break;
3009 case 0x311:
3010 proto_tree_add_item(next_tree, hf_bip_supported_features_reserved_9_15, tvb, offset, 2, ENC_BIG_ENDIAN);
3011 proto_tree_add_item(next_tree, hf_bip_supported_features_remote_display, tvb, offset, 2, ENC_BIG_ENDIAN);
3012 proto_tree_add_item(next_tree, hf_bip_supported_features_remote_camera, tvb, offset, 2, ENC_BIG_ENDIAN);
3013 proto_tree_add_item(next_tree, hf_bip_supported_features_automatic_archive, tvb, offset, 2, ENC_BIG_ENDIAN);
3014 proto_tree_add_item(next_tree, hf_bip_supported_features_advanced_image_printing, tvb, offset, 2, ENC_BIG_ENDIAN);
3015 proto_tree_add_item(next_tree, hf_bip_supported_features_image_pull, tvb, offset, 2, ENC_BIG_ENDIAN);
3016 proto_tree_add_item(next_tree, hf_bip_supported_features_image_push_display, tvb, offset, 2, ENC_BIG_ENDIAN);
3017 proto_tree_add_item(next_tree, hf_bip_supported_features_image_push_print, tvb, offset, 2, ENC_BIG_ENDIAN);
3018 proto_tree_add_item(next_tree, hf_bip_supported_features_image_push_store, tvb, offset, 2, ENC_BIG_ENDIAN);
3019 proto_tree_add_item(next_tree, hf_bip_supported_features_image_push, tvb, offset, 2, ENC_BIG_ENDIAN);
3020 value = tvb_get_ntohs(tvb, offset);
3022 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s%s%s",
3023 (value & 0x001) ? "ImagePush " : "",
3024 (value & 0x002) ? "ImagePushStore " : "",
3025 (value & 0x004) ? "ImagePushPrint " : "",
3026 (value & 0x008) ? "ImagePushDisplay " : "",
3027 (value & 0x010) ? "ImagePull " : "",
3028 (value & 0x020) ? "AdvancedImagePrinting " : "",
3029 (value & 0x040) ? "AutomatingArchive " : "",
3030 (value & 0x080) ? "RemoteCamera " : "",
3031 (value & 0x100) ? "RemoteDisplay " : "");
3032 break;
3033 case 0x312:
3034 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_17_31, tvb, offset, 4, ENC_BIG_ENDIAN);
3035 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_status, tvb, offset, 4, ENC_BIG_ENDIAN);
3036 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_15, tvb, offset, 4, ENC_BIG_ENDIAN);
3037 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_monitoring_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3038 proto_tree_add_item(next_tree, hf_bip_supported_functions_start_archive, tvb, offset, 4, ENC_BIG_ENDIAN);
3039 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_12, tvb, offset, 4, ENC_BIG_ENDIAN);
3040 proto_tree_add_item(next_tree, hf_bip_supported_functions_start_print, tvb, offset, 4, ENC_BIG_ENDIAN);
3041 proto_tree_add_item(next_tree, hf_bip_supported_functions_delete_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3042 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_linked_attachment, tvb, offset, 4, ENC_BIG_ENDIAN);
3043 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_linked_thumbnail, tvb, offset, 4, ENC_BIG_ENDIAN);
3044 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3045 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_image_property, tvb, offset, 4, ENC_BIG_ENDIAN);
3046 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_images_list, tvb, offset, 4, ENC_BIG_ENDIAN);
3047 proto_tree_add_item(next_tree, hf_bip_supported_functions_remote_display, tvb, offset, 4, ENC_BIG_ENDIAN);
3048 proto_tree_add_item(next_tree, hf_bip_supported_functions_put_linked_thumbnail, tvb, offset, 4, ENC_BIG_ENDIAN);
3049 proto_tree_add_item(next_tree, hf_bip_supported_functions_put_linked_attachment, tvb, offset, 4, ENC_BIG_ENDIAN);
3050 proto_tree_add_item(next_tree, hf_bip_supported_functions_put_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3051 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
3052 value = tvb_get_ntohl(tvb, offset);
3054 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
3055 (value & 0x001) ? "GetCapabilities " : "",
3056 (value & 0x002) ? "PutImage " : "",
3057 (value & 0x004) ? "PutLinkedAttachment " : "",
3058 (value & 0x008) ? "PutLinkedThumbnail " : "",
3059 (value & 0x010) ? "RemoteDisplay " : "",
3060 (value & 0x020) ? "GetImageList " : "",
3061 (value & 0x040) ? "GetImageProperty " : "",
3062 (value & 0x080) ? "GetImage " : "",
3063 (value & 0x100) ? "GetLinkedThumbnail " : "",
3064 (value & 0x200) ? "GetLinkedAttachment " : "",
3065 (value & 0x400) ? "DeleteImage " : "",
3066 (value & 0x800) ? "StartPrint " : "",
3067 (value & 0x2000) ? "StartArchive " : "",
3068 (value & 0x4000) ? "GetMonitoringImage " : "",
3069 (value & 0x10000) ? "GetStatus " : "");
3070 break;
3071 case 0x313:
3072 proto_tree_add_item(next_tree, hf_bip_total_imaging_data_capacity, tvb, offset, 8, ENC_BIG_ENDIAN);
3073 value_64 = tvb_get_ntoh64(tvb, offset);
3075 wmem_strbuf_append_printf(info_buf, "%"PRIu64, value_64);
3076 break;
3077 default:
3078 found = false;
3080 break;
3081 case BTSDP_BIP_REF_OBJ_SERVICE_UUID:
3082 switch (attribute) {
3083 case 0x200:
3084 proto_tree_add_item(next_tree, hf_bip_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
3085 psm = tvb_get_ntohs(tvb, offset);
3086 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
3087 if (!pinfo->fd->visited && service_info)
3088 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
3089 break;
3090 case 0x312:
3091 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_13_31, tvb, offset, 4, ENC_BIG_ENDIAN);
3092 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_partial_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3093 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_1_11, tvb, offset, 4, ENC_BIG_ENDIAN);
3094 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
3095 value = tvb_get_ntohl(tvb, offset);
3097 wmem_strbuf_append_printf(info_buf, "%s%s",
3098 (value & 0x0001) ? "GetCapabilities " : "",
3099 (value & 0x1000) ? "GetPartialImage " : "");
3100 break;
3101 default:
3102 found = false;
3104 break;
3105 case BTSDP_BIP_AUTO_ARCH_SERVICE_UUID:
3106 switch (attribute) {
3107 case 0x200:
3108 proto_tree_add_item(next_tree, hf_bip_goep_l2cap_psm, tvb, offset, 2, ENC_BIG_ENDIAN);
3109 psm = tvb_get_ntohs(tvb, offset);
3110 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", psm, psm);
3111 if (!pinfo->fd->visited)
3112 save_channel(pinfo, BTSDP_L2CAP_PROTOCOL_UUID, psm, -1, service_info);
3113 break;
3114 case 0x312:
3115 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_11_31, tvb, offset, 4, ENC_BIG_ENDIAN);
3116 proto_tree_add_item(next_tree, hf_bip_supported_functions_delete_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3117 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_linked_attachment, tvb, offset, 4, ENC_BIG_ENDIAN);
3118 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_linked_thumbnail, tvb, offset, 4, ENC_BIG_ENDIAN);
3119 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_image, tvb, offset, 4, ENC_BIG_ENDIAN);
3120 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_image_property, tvb, offset, 4, ENC_BIG_ENDIAN);
3121 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_images_list, tvb, offset, 4, ENC_BIG_ENDIAN);
3122 proto_tree_add_item(next_tree, hf_bip_supported_functions_reserved_1_4, tvb, offset, 4, ENC_BIG_ENDIAN);
3123 proto_tree_add_item(next_tree, hf_bip_supported_functions_get_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
3124 value = tvb_get_ntohl(tvb, offset);
3126 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s",
3127 (value & 0x001) ? "GetCapabilities " : "",
3128 (value & 0x020) ? "GetImageList " : "",
3129 (value & 0x040) ? "GetImageProperty " : "",
3130 (value & 0x080) ? "GetImage " : "",
3131 (value & 0x100) ? "GetLinkedThumbnail " : "",
3132 (value & 0x200) ? "GetLinkedAttachment " : "",
3133 (value & 0x400) ? "DeleteImage " : "");
3134 break;
3135 default:
3136 found = false;
3138 break;
3139 case BTSDP_BPP_SERVICE_UUID:
3140 case BTSDP_BPP_STATUS_SERVICE_UUID:
3141 case BTSDP_BPP_DIRECT_PRINTING_SERVICE_UUID:
3142 case BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID:
3143 switch (attribute) {
3144 case 0x350:
3145 proto_tree_add_item_ret_string(next_tree, hf_bpp_document_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3146 wmem_strbuf_append(info_buf, (const char*)new_str);
3147 break;
3148 case 0x352:
3149 proto_tree_add_item(next_tree, hf_bpp_character_repertoires_support, tvb, offset, size, ENC_NA);
3150 new_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, size);
3151 wmem_strbuf_append(info_buf, (const char*)new_str);
3152 break;
3153 case 0x354:
3154 proto_tree_add_item_ret_string(next_tree, hf_bpp_xhtml_print_image_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3155 wmem_strbuf_append(info_buf, (const char*)new_str);
3156 break;
3157 case 0x356:
3158 proto_tree_add_item(next_tree, hf_bpp_color_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
3159 value = tvb_get_uint8(tvb, offset);
3160 wmem_strbuf_append(info_buf, value ? "true" : "false");
3161 break;
3162 case 0x358:
3163 proto_tree_add_item_ret_string(next_tree, hf_bpp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3164 wmem_strbuf_append(info_buf, (const char*)new_str);
3165 break;
3166 case 0x35A:
3167 proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3168 wmem_strbuf_append(info_buf, (const char*)new_str);
3169 break;
3170 case 0x35C:
3171 proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_location, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3172 wmem_strbuf_append(info_buf, (const char*)new_str);
3173 break;
3174 case 0x35E:
3175 proto_tree_add_item(next_tree, hf_bpp_duplex_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
3176 value = tvb_get_uint8(tvb, offset);
3177 wmem_strbuf_append(info_buf, value ? "true" : "false");
3178 break;
3179 case 0x360:
3180 proto_tree_add_item_ret_string(next_tree, hf_bpp_media_types_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3181 wmem_strbuf_append(info_buf, (const char*)new_str);
3182 break;
3183 case 0x362:
3184 proto_tree_add_item(next_tree, hf_bpp_max_media_width, tvb, offset, 2, ENC_BIG_ENDIAN);
3185 value = tvb_get_ntohs(tvb, offset);
3186 wmem_strbuf_append_printf(info_buf, "%u", value);
3187 break;
3188 case 0x364:
3189 proto_tree_add_item(next_tree, hf_bpp_max_media_length, tvb, offset, 2, ENC_BIG_ENDIAN);
3190 value = tvb_get_ntohs(tvb, offset);
3191 wmem_strbuf_append_printf(info_buf, "%u", value);
3192 break;
3193 case 0x366:
3194 proto_tree_add_item(next_tree, hf_bpp_enhanced_layout_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
3195 value = tvb_get_uint8(tvb, offset);
3196 wmem_strbuf_append(info_buf, value ? "true" : "false");
3197 break;
3198 case 0x368:
3199 proto_tree_add_item_ret_string(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3200 wmem_strbuf_append(info_buf, (const char*)new_str);
3201 break;
3202 case 0x370:
3203 proto_tree_add_item(next_tree, hf_bpp_reference_printing_rui_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
3204 value = tvb_get_uint8(tvb, offset);
3205 wmem_strbuf_append(info_buf, value ? "true" : "false");
3206 break;
3207 case 0x372:
3208 proto_tree_add_item(next_tree, hf_bpp_direct_printing_rui_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
3209 value = tvb_get_uint8(tvb, offset);
3210 wmem_strbuf_append(info_buf, value ? "true" : "false");
3211 break;
3212 case 0x374:
3213 proto_tree_add_item_ret_string(next_tree, hf_bpp_reference_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3214 wmem_strbuf_append(info_buf, (const char*)new_str);
3215 break;
3216 case 0x376:
3217 proto_tree_add_item_ret_string(next_tree, hf_bpp_direct_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3218 wmem_strbuf_append(info_buf, (const char*)new_str);
3219 break;
3220 case 0x37A:
3221 proto_tree_add_item_ret_string(next_tree, hf_bpp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3222 wmem_strbuf_append(info_buf, (const char*)new_str);
3223 break;
3224 default:
3225 found = false;
3227 break;
3228 case BTSDP_BPP_REFLECTED_UI_SERVICE_UUID:
3229 switch (attribute) {
3230 case 0x368:
3231 proto_tree_add_item_ret_string(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3232 wmem_strbuf_append(info_buf, (const char*)new_str);
3233 break;
3234 case 0x378:
3235 proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_admin_rui_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3236 wmem_strbuf_append(info_buf, (const char*)new_str);
3237 break;
3238 default:
3239 found = false;
3241 break;
3242 case BTSDP_CTN_ACCESS_SERVICE_UUID:
3243 case BTSDP_CTN_NOTIFICATION_SERVICE_UUID:
3244 if (service_uuid.bt_uuid == BTSDP_CTN_NOTIFICATION_SERVICE_UUID && attribute != 0x317) {
3245 found = false;
3246 break;
3248 switch (attribute) {
3249 case 0x315:
3250 proto_tree_add_item(next_tree, hf_ctn_instance_id, tvb, offset, 1, ENC_NA);
3251 value = tvb_get_uint8(tvb, offset);
3252 wmem_strbuf_append_printf(info_buf, "%u (0x%02x)", value, value);
3254 break;
3255 case 0x317:
3256 proto_tree_add_bitmask(next_tree, tvb, offset, hf_ctn_supported_features, ett_btsdp_supported_features, hfx_ctn_supported_features, ENC_NA);
3258 supported_features = tvb_get_ntohl(tvb, offset);
3259 wmem_strbuf_append_printf(info_buf, "%s%s%s%s%s%s%s",
3260 (supported_features & 0x01) ? "AccountManager " : "",
3261 (supported_features & 0x02) ? "Notification " : "",
3262 (supported_features & 0x04) ? "Browsing " : "",
3263 (supported_features & 0x08) ? "Downloading " : "",
3264 (supported_features & 0x10) ? "Uploading " : "",
3265 (supported_features & 0x20) ? "Delete " : "",
3266 (supported_features & 0x40) ? "Forward " : "");
3267 break;
3268 default:
3269 found = false;
3271 break;
3272 case BTSDP_MULTI_PROFILE_UUID:
3273 case BTSDP_MULTI_PROFILE_SC_UUID:
3274 switch (attribute) {
3275 case 0x200:
3276 proto_tree_add_bitmask(next_tree, tvb, offset, hf_mps_mpsd_scenarios, ett_btsdp_supported_features, hfx_mps_mpsd_scenarios, ENC_NA);
3278 break;
3279 case 0x201:
3280 proto_tree_add_bitmask(next_tree, tvb, offset, hf_mps_mpmd_scenarios, ett_btsdp_supported_features, hfx_mps_mpmd_scenarios, ENC_NA);
3282 break;
3283 case 0x202:
3284 proto_tree_add_bitmask(next_tree, tvb, offset, hf_mps_supported_profile_and_protocol_dependency, ett_btsdp_supported_features, hfx_mps_supported_profile_and_protocol_dependency, ENC_NA);
3286 break;
3287 default:
3288 found = false;
3290 break;
3291 default:
3292 found = false;
3295 if (!found) {
3296 found = true;
3297 switch (attribute) {
3298 case 0x000:
3299 proto_tree_add_item(next_tree, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
3300 value = tvb_get_ntohl(tvb, offset);
3301 wmem_strbuf_append_printf(info_buf, "0x%08x (%u)", value, value);
3302 break;
3303 case 0x001:
3304 list_offset = offset;
3305 while (list_offset - offset < size) {
3306 dissect_data_element(next_tree, &entry_tree, pinfo, tvb, list_offset);
3307 list_offset = get_type_length(tvb, list_offset, &list_length);
3309 dissect_uuid(entry_tree, pinfo, tvb, list_offset, list_length, &uuid);
3311 wmem_strbuf_append(info_buf, print_bluetooth_uuid(pinfo->pool, &uuid));
3312 list_offset += list_length;
3314 if (list_offset - offset < size)
3315 wmem_strbuf_append(info_buf, " -> ");
3317 break;
3318 case 0x002:
3319 proto_tree_add_item(next_tree, hf_sdp_service_record_state, tvb, offset, 4, ENC_BIG_ENDIAN);
3320 value = tvb_get_ntohl(tvb, offset);
3321 wmem_strbuf_append_printf(info_buf, "0x%08x (%u)", value, value);
3322 break;
3323 case 0x003:
3324 dissect_uuid(next_tree, pinfo, tvb, offset, size, &uuid);
3325 wmem_strbuf_append(info_buf, print_bluetooth_uuid(pinfo->pool, &uuid));
3326 break;
3327 case 0x004:
3328 protocol_order = 0;
3329 dissect_protocol_descriptor_list(next_tree, tvb, pinfo,
3330 offset, size, info_buf, service_info, &protocol_order);
3331 break;
3332 case 0x005:
3333 list_offset = offset;
3334 while (list_offset - offset < size) {
3335 dissect_data_element(next_tree, &entry_tree, pinfo, tvb, list_offset);
3336 list_offset = get_type_length(tvb, list_offset, &list_length);
3338 dissect_uuid(entry_tree, pinfo, tvb, list_offset, list_length, &uuid);
3340 wmem_strbuf_append(info_buf, print_bluetooth_uuid(pinfo->pool, &uuid));
3341 list_offset += list_length;
3343 if (list_offset - offset < size)
3344 wmem_strbuf_append(info_buf, ", ");
3346 break;
3347 case 0x006:
3348 list_offset = offset;
3349 i_feature = 1;
3350 while (list_offset - offset < size) {
3351 wmem_strbuf_append(info_buf, "(");
3352 entry_item = proto_tree_add_none_format(next_tree, hf_sdp_lang, tvb, list_offset, size, "Language #%u", i_feature);
3353 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element);
3355 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset);
3356 list_offset = get_type_length(tvb, list_offset, &entry_length);
3357 proto_tree_add_item_ret_string(sub_tree, hf_sdp_lang_code, tvb, list_offset, entry_length, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3358 wmem_strbuf_append_printf(info_buf, "Lang: %s", (const char*)new_str);
3359 proto_item_append_text(entry_item, ": Lang: %s", (const char*)new_str);
3360 list_offset += entry_length;
3362 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset);
3363 list_offset = get_type_length(tvb, list_offset, &entry_length);
3364 value = tvb_get_ntohs(tvb, list_offset);
3365 wmem_strbuf_append_printf(info_buf, ", Encoding: %s", val_to_str_ext_const(value, &mibenum_vals_character_sets_ext, "Unknown"));
3366 proto_item_append_text(entry_item, ", Encoding: %s", val_to_str_ext_const(value, &mibenum_vals_character_sets_ext, "Unknown"));
3367 proto_tree_add_item(sub_tree, hf_sdp_lang_encoding, tvb, list_offset, 2, ENC_BIG_ENDIAN);
3368 list_offset += entry_length;
3370 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset);
3371 list_offset = get_type_length(tvb, list_offset, &entry_length);
3372 value = tvb_get_ntohs(tvb, list_offset);
3373 wmem_strbuf_append_printf(info_buf, ", Attribute Base: 0x%04x", value);
3374 proto_item_append_text(entry_item, ", Attribute Base: 0x%04x", value);
3375 proto_tree_add_item(sub_tree, hf_sdp_lang_attribute_base, tvb, list_offset, 2, ENC_BIG_ENDIAN);
3376 list_offset += entry_length;
3377 i_feature += 1;
3379 if (list_offset - offset < size)
3380 wmem_strbuf_append(info_buf, "), ");
3381 else
3382 wmem_strbuf_append(info_buf, ")");
3384 break;
3385 case 0x007:
3386 proto_tree_add_item(next_tree, hf_sdp_service_info_time_to_live, tvb, offset, 4, ENC_BIG_ENDIAN);
3387 value = tvb_get_ntohl(tvb, offset);
3388 wmem_strbuf_append_printf(info_buf, "%u (0x%08x)", value, value);
3389 break;
3390 case 0x008:
3391 proto_tree_add_item(next_tree, hf_sdp_service_availability, tvb, offset, 1, ENC_BIG_ENDIAN);
3392 value = tvb_get_uint8(tvb, offset);
3393 wmem_strbuf_append_printf(info_buf, "0x%02x (%u)", value, value);
3394 break;
3395 case 0x009:
3396 list_offset = offset;
3397 i_protocol = 1;
3398 while (list_offset - offset < size) {
3399 entry_offset = get_type_length(tvb, list_offset, &entry_length);
3400 dissect_data_element(next_tree, &sub_tree, pinfo, tvb, list_offset);
3401 entry_item = proto_tree_add_none_format(sub_tree, hf_profile_descriptor_list, tvb, entry_offset, entry_length, "Profile Descriptor List #%u", i_protocol);
3402 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element);
3404 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset);
3405 entry_offset = get_type_length(tvb, entry_offset, &entry_length);
3407 dissect_uuid(sub_tree, pinfo, tvb, entry_offset, entry_length, &uuid);
3409 uuid_str = print_bluetooth_uuid(pinfo->pool, &uuid);
3410 wmem_strbuf_append(info_buf, uuid_str);
3411 proto_item_append_text(entry_item, ": %s", uuid_str);
3413 entry_offset += entry_length;
3415 dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, entry_offset);
3416 entry_offset = get_type_length(tvb, entry_offset, &entry_length);
3417 value = tvb_get_ntohs(tvb, entry_offset);
3419 wmem_strbuf_append_printf(info_buf, " %x.%x", value >> 8, value & 0xFF);
3420 proto_item_append_text(entry_item, ", Version %x.%x", value >> 8, value & 0xFF);
3421 proto_tree_add_item(sub_tree, hf_sdp_protocol_version, tvb, entry_offset, 2, ENC_BIG_ENDIAN);
3423 entry_offset += entry_length;
3425 list_offset = entry_offset;
3427 if (list_offset - offset < size)
3428 wmem_strbuf_append(info_buf, ", ");
3429 i_protocol += 1;
3431 break;
3432 case 0x00A:
3433 proto_tree_add_item_ret_string(next_tree, hf_sdp_service_documentation_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3434 wmem_strbuf_append(info_buf, (const char*)new_str);
3435 break;
3436 case 0x00B:
3437 proto_tree_add_item_ret_string(next_tree, hf_sdp_service_client_executable_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3438 wmem_strbuf_append(info_buf, (const char*)new_str);
3439 break;
3440 case 0x00C:
3441 proto_tree_add_item_ret_string(next_tree, hf_sdp_service_icon_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3442 wmem_strbuf_append(info_buf, (const char*)new_str);
3443 break;
3444 case 0x00D:
3445 protocol_order = 1;
3446 list_offset = offset;
3447 i_protocol = 1;
3448 while (list_offset - offset < size) {
3449 entry_offset = get_type_length(tvb, list_offset, &entry_length);
3450 dissect_data_element(next_tree, &sub_tree, pinfo, tvb, list_offset);
3451 entry_item = proto_tree_add_none_format(sub_tree, hf_profile_descriptor_list, tvb, entry_offset, entry_length, "Protocol Descriptor List #%u", i_protocol);
3452 entry_tree = proto_item_add_subtree(entry_item, ett_btsdp_data_element);
3454 list_offset = get_type_length(tvb, list_offset, &list_length);
3456 wmem_strbuf_append(info_buf, "[");
3457 dissect_protocol_descriptor_list(entry_tree, tvb,
3458 pinfo, list_offset, list_length, info_buf,
3459 service_info, &protocol_order);
3461 list_offset += list_length;
3463 wmem_strbuf_append(info_buf, "] ");
3464 i_protocol += 1;
3466 break;
3467 case 0x100:
3468 proto_tree_add_item_ret_string(next_tree, hf_sdp_service_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3469 wmem_strbuf_append(info_buf, (const char*)new_str);
3470 break;
3471 case 0x101:
3472 proto_tree_add_item_ret_string(next_tree, hf_sdp_service_description, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3473 wmem_strbuf_append(info_buf, (const char*)new_str);
3474 break;
3475 case 0x102:
3476 proto_tree_add_item_ret_string(next_tree, hf_sdp_service_provider_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str);
3477 wmem_strbuf_append(info_buf, (const char*)new_str);
3478 break;
3479 default:
3480 found = false;
3484 if (!found) switch (type) {
3485 case 0:
3486 proto_tree_add_item(next_tree, hf_data_element_value_nil, tvb, offset, size, ENC_NA);
3487 wmem_strbuf_append(info_buf, "Nil ");
3488 break;
3489 case 1: {
3490 uint32_t val = get_uint_by_size(tvb, offset, size_index);
3491 proto_tree_add_item(next_tree, hf_data_element_value_unsigned_int, tvb, offset, size, ENC_BIG_ENDIAN);
3492 wmem_strbuf_append_printf(info_buf, "%u ", val);
3493 break;
3495 case 2: {
3496 uint32_t val = get_int_by_size(tvb, offset, size_index);
3497 proto_tree_add_item(next_tree, hf_data_element_value_signed_int, tvb, offset, size, ENC_BIG_ENDIAN);
3498 wmem_strbuf_append_printf(info_buf, "%d ", val);
3499 break;
3501 case 3:
3502 dissect_uuid(next_tree, pinfo, tvb, offset, size, &uuid);
3503 wmem_strbuf_append_printf(info_buf, ": %s", print_bluetooth_uuid(pinfo->pool, &uuid));
3504 break;
3505 case 8: /* fall through */
3506 case 4: {
3507 const uint8_t *ptr;
3509 proto_tree_add_item_ret_string(next_tree, (type == 8) ? hf_data_element_value_url : hf_data_element_value_string, tvb, offset, size, ENC_NA | ENC_ASCII, pinfo->pool, &ptr);
3510 wmem_strbuf_append_printf(info_buf, "%s ", ptr);
3511 break;
3513 case 5: {
3514 uint8_t var = tvb_get_uint8(tvb, offset);
3516 proto_tree_add_item(next_tree, hf_data_element_value_boolean, tvb, offset, size, ENC_BIG_ENDIAN);
3517 wmem_strbuf_append_printf(info_buf, "%s ", var ? "true" : "false");
3518 break;
3520 case 6: /* Data Element sequence */
3521 case 7: /* Data Element alternative */ {
3522 proto_tree *st;
3523 proto_item *ti;
3524 int bytes_to_go = size;
3525 int first = 1;
3526 wmem_strbuf_t *substr;
3527 tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, size);
3528 int next_offset = 0;
3530 ti = proto_tree_add_item(next_tree, (type == 6) ? hf_data_element_value_sequence : hf_data_element_value_alternative,
3531 tvb, offset, size, ENC_NA);
3532 st = proto_item_add_subtree(ti, ett_btsdp_des);
3534 wmem_strbuf_append(info_buf, "{ ");
3536 increment_dissection_depth(pinfo);
3537 while (bytes_to_go > 0) {
3538 if (!first) {
3539 wmem_strbuf_append(info_buf, ", ");
3540 } else {
3541 first = 0;
3544 size = dissect_sdp_type(st, pinfo, next_tvb, next_offset,
3545 attribute, service_uuid,
3546 service_did_vendor_id, service_did_vendor_id_source,
3547 service_hdp_data_exchange_specification, service_info, &substr);
3548 if (size < 1) {
3549 break;
3551 wmem_strbuf_append_printf(info_buf, "%s ", wmem_strbuf_finalize(substr));
3552 next_offset += size;
3553 bytes_to_go -= size;
3555 decrement_dissection_depth(pinfo);
3557 wmem_strbuf_append(info_buf, "} ");
3558 break;
3562 return new_offset - start_offset;
3566 static int
3567 dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, int offset,
3568 packet_info *pinfo, bluetooth_uuid_t uuid, int service_offset,
3569 service_info_t *service_info, int number_of_attributes, bool attribute_only)
3571 proto_tree *attribute_tree;
3572 proto_item *attribute_item;
3573 proto_tree *attribute_id_tree;
3574 proto_item *attribute_id_item;
3575 proto_tree *attribute_value_tree;
3576 proto_item *attribute_value_item;
3577 proto_tree *next_tree;
3578 int size = 0;
3579 const char *attribute_name;
3580 wmem_strbuf_t *attribute_value = NULL;
3581 uint16_t id;
3582 int service_did_vendor_id = -1;
3583 int service_did_vendor_id_source = -1;
3584 int service_hdp_data_exchange_specification = -1;
3585 int hfx_attribute_id = hf_service_attribute_id_generic;
3586 const value_string *name_vals = NULL;
3587 const char *profile_speficic = "";
3588 int new_offset;
3589 int old_offset;
3590 uint8_t type;
3592 type = tvb_get_uint8(tvb, offset);
3593 id = tvb_get_ntohs(tvb, offset + 1);
3595 switch (uuid.bt_uuid) {
3596 case BTSDP_DID_SERVICE_UUID:
3597 name_vals = vs_did_attribute_id;
3598 hfx_attribute_id = hf_service_attribute_id_did;
3599 profile_speficic = "(DID) ";
3601 if (number_of_attributes > 1) {
3602 service_did_vendor_id_source = findUintAttribute(tvb, service_offset, number_of_attributes, 0x205);
3603 service_did_vendor_id = findUintAttribute(tvb, service_offset, number_of_attributes, 0x201);
3605 break;
3606 case BTSDP_HID_SERVICE_UUID:
3607 name_vals = vs_hid_attribute_id;
3608 hfx_attribute_id = hf_service_attribute_id_hid;
3609 profile_speficic = "(HID) ";
3610 break;
3611 case BTSDP_SYNC_SERVICE_UUID:
3612 name_vals = vs_synch_attribute_id;
3613 hfx_attribute_id = hf_service_attribute_id_synch;
3614 profile_speficic = "(SYNCH) ";
3615 break;
3616 case BTSDP_PBAP_PSE_SERVICE_UUID:
3617 case BTSDP_PBAP_SERVICE_UUID:
3618 name_vals = vs_pbap_attribute_id;
3619 hfx_attribute_id = hf_service_attribute_id_pbap;
3620 profile_speficic = "(PBAP) ";
3621 break;
3622 case BTSDP_PAN_NAP_SERVICE_UUID:
3623 name_vals = vs_pan_nap_attribute_id;
3624 hfx_attribute_id = hf_service_attribute_id_pan_nap;
3625 profile_speficic = "(PAN NAP) ";
3626 break;
3627 case BTSDP_PAN_GN_SERVICE_UUID:
3628 name_vals = vs_pan_gn_attribute_id;
3629 hfx_attribute_id = hf_service_attribute_id_pan_gn;
3630 profile_speficic = "(PAN GN) ";
3631 break;
3632 case BTSDP_PAN_PANU_SERVICE_UUID:
3633 name_vals = vs_pan_panu_attribute_id;
3634 hfx_attribute_id = hf_service_attribute_id_pan_panu;
3635 profile_speficic = "(PAN PANU) ";
3636 break;
3637 case BTSDP_OPP_SERVICE_UUID:
3638 name_vals = vs_opp_attribute_id;
3639 hfx_attribute_id = hf_service_attribute_id_opp;
3640 profile_speficic = "(OPP) ";
3641 break;
3642 case BTSDP_MAP_SERVICE_UUID:
3643 case BTSDP_MAP_ACCESS_SRV_SERVICE_UUID:
3644 name_vals = vs_map_mas_attribute_id;
3645 hfx_attribute_id = hf_service_attribute_id_map_mas;
3646 profile_speficic = "(MAP MAS) ";
3647 break;
3648 case BTSDP_MAP_NOTIFICATION_SRV_SERVICE_UUID:
3649 name_vals = vs_map_mns_attribute_id;
3650 hfx_attribute_id = hf_service_attribute_id_map_mns;
3651 profile_speficic = "(MAP MNS) ";
3652 break;
3653 case BTSDP_WAP_SERVICE_UUID:
3654 case BTSDP_WAP_CLIENT_SERVICE_UUID:
3655 name_vals = vs_wap_attribute_id;
3656 hfx_attribute_id = hf_service_attribute_id_wap;
3657 profile_speficic = "(WAP) ";
3658 break;
3659 case BTSDP_HDP_SERVICE_UUID:
3660 case BTSDP_HDP_SOURCE_SERVICE_UUID:
3661 case BTSDP_HDP_SINK_SERVICE_UUID:
3662 name_vals = vs_hdp_attribute_id;
3663 hfx_attribute_id = hf_service_attribute_id_hdp;
3664 profile_speficic = "(HDP) ";
3666 if (number_of_attributes > 1) {
3667 service_hdp_data_exchange_specification = findUintAttribute(tvb, service_offset, number_of_attributes, 0x301);
3669 break;
3670 case BTSDP_HSP_SERVICE_UUID:
3671 case BTSDP_HSP_HS_SERVICE_UUID:
3672 name_vals = vs_hsp_attribute_id;
3673 hfx_attribute_id = hf_service_attribute_id_hsp;
3674 profile_speficic = "(HSP) ";
3675 break;
3676 case BTSDP_HCRP_SERVICE_UUID:
3677 case BTSDP_HCRP_PRINT_SERVICE_UUID:
3678 case BTSDP_HCRP_SCAN_SERVICE_UUID:
3679 name_vals = vs_hcrp_attribute_id;
3680 hfx_attribute_id = hf_service_attribute_id_hcrp;
3681 profile_speficic = "(HCRP) ";
3682 break;
3683 case BTSDP_HFP_SERVICE_UUID:
3684 name_vals = vs_hfp_gw_attribute_id;
3685 hfx_attribute_id = hf_service_attribute_id_hfp_hf;
3686 profile_speficic = "(HFP HS) ";
3687 break;
3688 case BTSDP_HFP_GW_SERVICE_UUID:
3689 name_vals = vs_hfp_ag_attribute_id;
3690 hfx_attribute_id = hf_service_attribute_id_hfp_ag;
3691 profile_speficic = "(HFP AG) ";
3692 break;
3693 case BTSDP_GNSS_UUID:
3694 case BTSDP_GNSS_SERVER_UUID:
3695 name_vals = vs_gnss_attribute_id;
3696 hfx_attribute_id = hf_service_attribute_id_gnss;
3697 profile_speficic = "(GNSS) ";
3698 break;
3699 case BTSDP_FTP_SERVICE_UUID:
3700 name_vals = vs_ftp_attribute_id;
3701 hfx_attribute_id = hf_service_attribute_id_ftp;
3702 profile_speficic = "(FTP) ";
3703 break;
3704 case BTSDP_FAX_SERVICE_UUID:
3705 name_vals = vs_fax_attribute_id;
3706 hfx_attribute_id = hf_service_attribute_id_fax;
3707 profile_speficic = "(FAX) ";
3708 break;
3709 case BTSDP_CTP_SERVICE_UUID:
3710 name_vals = vs_ctp_attribute_id;
3711 hfx_attribute_id = hf_service_attribute_id_ctp;
3712 profile_speficic = "(CTP) ";
3713 break;
3714 case BTSDP_A2DP_SOURCE_SERVICE_UUID:
3715 case BTSDP_A2DP_SINK_SERVICE_UUID:
3716 case BTSDP_A2DP_DISTRIBUTION_SERVICE_UUID:
3717 name_vals = vs_a2dp_attribute_id;
3718 hfx_attribute_id = hf_service_attribute_id_a2dp;
3719 profile_speficic = "(A2DP) ";
3720 break;
3721 case BTSDP_AVRCP_TG_SERVICE_UUID:
3722 case BTSDP_AVRCP_SERVICE_UUID:
3723 case BTSDP_AVRCP_CT_SERVICE_UUID:
3724 name_vals = vs_avrcp_attribute_id;
3725 hfx_attribute_id = hf_service_attribute_id_avrcp;
3726 profile_speficic = "(AVRCP) ";
3727 break;
3728 case BTSDP_BIP_SERVICE_UUID:
3729 case BTSDP_BIP_RESPONDER_SERVICE_UUID:
3730 name_vals = vs_bip_imaging_responder_attribute_id;
3731 hfx_attribute_id = hf_service_attribute_id_bip_imaging_responder;
3732 profile_speficic = "(BIP IR) ";
3733 break;
3734 case BTSDP_BIP_AUTO_ARCH_SERVICE_UUID:
3735 name_vals = vs_bip_imaging_other_attribute_id;
3736 hfx_attribute_id = hf_service_attribute_id_bip_imaging_other;
3737 profile_speficic = "(BIP IAA) ";
3738 break;
3739 case BTSDP_BIP_REF_OBJ_SERVICE_UUID:
3740 name_vals = vs_bip_imaging_other_attribute_id;
3741 hfx_attribute_id = hf_service_attribute_id_bip_imaging_other;
3742 profile_speficic = "(BIP IRO) ";
3743 break;
3744 case BTSDP_BPP_SERVICE_UUID:
3745 case BTSDP_BPP_STATUS_SERVICE_UUID:
3746 case BTSDP_BPP_DIRECT_PRINTING_SERVICE_UUID:
3747 case BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID:
3748 name_vals = vs_bpp_attribute_id;
3749 hfx_attribute_id = hf_service_attribute_id_bpp;
3750 profile_speficic = "(BPP) ";
3751 break;
3752 case BTSDP_BPP_REFLECTED_UI_SERVICE_UUID:
3753 name_vals = vs_bpp_reflected_ui_attribute_id;
3754 hfx_attribute_id = hf_service_attribute_id_bpp_rui;
3755 profile_speficic = "(BPP RUI) ";
3756 break;
3757 case BTSDP_DUN_SERVICE_UUID:
3758 name_vals = vs_dun_attribute_id;
3759 hfx_attribute_id = hf_service_attribute_id_dun;
3760 profile_speficic = "(DUN) ";
3761 break;
3762 case BTSDP_CTN_ACCESS_SERVICE_UUID:
3763 name_vals = vs_ctn_as_attribute_id;
3764 hfx_attribute_id = hf_service_attribute_id_ctn_as;
3765 profile_speficic = "(CTN AS) ";
3766 break;
3767 case BTSDP_CTN_NOTIFICATION_SERVICE_UUID:
3768 name_vals = vs_ctn_ns_attribute_id;
3769 hfx_attribute_id = hf_service_attribute_id_ctn_ns;
3770 profile_speficic = "(CTN NS) ";
3771 break;
3772 case BTSDP_MULTI_PROFILE_UUID:
3773 case BTSDP_MULTI_PROFILE_SC_UUID:
3774 name_vals = vs_mps_attribute_id;
3775 hfx_attribute_id = hf_service_attribute_id_mps;
3776 profile_speficic = "(MPS) ";
3777 break;
3780 if (name_vals && try_val_to_str(id, name_vals)) {
3781 attribute_name = val_to_str_const(id, name_vals, "Unknown");
3782 } else {
3783 attribute_name = val_to_str_const(id, vs_general_attribute_id, "Unknown");
3784 profile_speficic = "";
3785 hfx_attribute_id = hf_service_attribute_id_generic;
3788 if (!attribute_only) {
3789 attribute_item = proto_tree_add_none_format(tree, hf_service_attribute, tvb, offset, tvb_reported_length_remaining(tvb, offset),
3790 "Service Attribute: %s%s (0x%x)", profile_speficic, attribute_name, id);
3791 attribute_tree = proto_item_add_subtree(attribute_item, ett_btsdp_attribute);
3792 } else {
3793 attribute_tree = tree;
3796 if (attribute_only && type == 0x0a) {
3797 dissect_data_element(attribute_tree, &next_tree, pinfo, tvb, offset);
3798 offset += 1;
3800 attribute_id_item = proto_tree_add_item(next_tree, hf_attribute_id_range, tvb, offset, 4, ENC_BIG_ENDIAN);
3801 attribute_id_tree = proto_item_add_subtree(attribute_id_item, ett_btsdp_attribute_id);
3803 col_append_fstr(pinfo->cinfo, COL_INFO, "Attribute Range (0x%04x - 0x%04x) ",
3804 tvb_get_ntohs(tvb, offset), tvb_get_ntohs(tvb, offset + 2));
3806 proto_tree_add_item(attribute_id_tree, hf_attribute_id_range_from, tvb, offset, 2, ENC_BIG_ENDIAN);
3807 offset += 2;
3809 proto_tree_add_item(attribute_id_tree, hf_attribute_id_range_to, tvb, offset, 2, ENC_BIG_ENDIAN);
3810 offset += 2;
3811 } else {
3812 attribute_id_item = proto_tree_add_none_format(attribute_tree, hf_service_attribute_id, tvb, offset, 3, "Attribute ID: %s", attribute_name);
3813 attribute_id_tree = proto_item_add_subtree(attribute_id_item, ett_btsdp_attribute_id);
3815 new_offset = dissect_data_element(attribute_id_tree, &next_tree, pinfo, tvb, offset);
3816 proto_tree_add_item(next_tree, hfx_attribute_id, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
3817 offset = new_offset;
3819 if (!attribute_only){
3820 attribute_value_item = proto_tree_add_item(attribute_tree, hf_service_attribute_value, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
3821 attribute_value_tree = proto_item_add_subtree(attribute_value_item, ett_btsdp_attribute_value);
3823 dissect_sdp_type(attribute_value_tree, pinfo, tvb, offset, id, uuid,
3824 service_did_vendor_id, service_did_vendor_id_source,
3825 service_hdp_data_exchange_specification, service_info,
3826 &attribute_value);
3827 old_offset = offset;
3828 offset = get_type_length(tvb, offset, &size);
3829 proto_item_append_text(attribute_item, ", value = %s", wmem_strbuf_get_str(attribute_value));
3831 proto_item_set_len(attribute_item, 3 + size + (offset - old_offset));
3832 proto_item_set_len(attribute_value_item, size + (offset - old_offset));
3833 } else {
3834 proto_item_append_text(attribute_id_item, " %s", profile_speficic);
3835 col_append_fstr(pinfo->cinfo, COL_INFO, "[%s%s 0x%04x] ", profile_speficic, attribute_name, id);
3839 return offset + size;
3843 static int
3844 dissect_attribute_id_list(proto_tree *tree, tvbuff_t *tvb, int offset,
3845 packet_info *pinfo, bluetooth_uuid_t *uuid)
3847 proto_item *list_item;
3848 proto_tree *list_tree;
3849 proto_tree *sub_tree;
3850 int start_offset;
3851 int previous_offset;
3852 int service_offset;
3853 int bytes_to_go;
3854 bluetooth_uuid_t empty_uuid;
3856 if (!uuid)
3857 memset(&empty_uuid, 0, sizeof(bluetooth_uuid_t));
3859 start_offset = offset;
3860 list_item = proto_tree_add_item(tree, hf_attribute_id_list, tvb, offset, 0, ENC_NA);
3861 list_tree = proto_item_add_subtree(list_item, ett_btsdp_attribute_idlist);
3863 dissect_data_element(list_tree, &sub_tree, pinfo, tvb, offset);
3865 offset = get_type_length(tvb, offset, &bytes_to_go);
3866 service_offset = offset;
3867 proto_item_set_len(list_item, offset - start_offset + bytes_to_go);
3869 previous_offset = offset;
3870 while (bytes_to_go > 0) {
3871 offset = dissect_sdp_service_attribute(sub_tree, tvb, offset, pinfo, (uuid) ? *uuid : empty_uuid, service_offset, NULL, 1, true);
3872 bytes_to_go -= offset - previous_offset;
3873 previous_offset = offset;
3876 return offset - start_offset;
3880 static int
3881 dissect_sdp_error_response(proto_tree *tree, tvbuff_t *tvb, int offset)
3883 proto_tree_add_item(tree, hf_error_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3884 offset += 2;
3886 return offset;
3890 static int
3891 dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, int offset,
3892 packet_info *pinfo, bluetooth_uuid_t *service_uuid, btl2cap_data_t *l2cap_data)
3894 proto_item *list_item;
3895 proto_tree *list_tree;
3896 proto_tree *next_tree;
3897 int start_offset = offset;
3898 int search_offset;
3899 int search_length;
3900 int len;
3901 unsigned number_of_attributes;
3902 uint16_t attribute;
3903 int element_length;
3904 int new_offset;
3905 int service_offset;
3906 bluetooth_uuid_t uuid;
3907 wmem_tree_key_t key[10];
3908 uint32_t k_interface_id;
3909 uint32_t k_adapter_id;
3910 uint32_t k_sdp_psm;
3911 uint32_t k_direction;
3912 uint32_t k_bd_addr_oui;
3913 uint32_t k_bd_addr_id;
3914 uint32_t k_service_type;
3915 uint32_t k_service_channel;
3916 uint32_t k_frame_number;
3917 service_info_t *service_info;
3918 wmem_array_t *uuid_array;
3920 uuid_array = wmem_array_new(pinfo->pool, sizeof(bluetooth_uuid_t));
3922 offset = get_type_length(tvb, offset, &len);
3923 memset(&uuid, 0, sizeof(bluetooth_uuid_t));
3925 list_item = proto_tree_add_item(tree, hf_attribute_list, tvb,
3926 start_offset, len + (offset - start_offset), ENC_NA);
3927 list_tree = proto_item_add_subtree(list_item, ett_btsdp_attribute);
3928 dissect_data_element(list_tree, &next_tree, pinfo, tvb, start_offset);
3930 /* search for main service uuid */
3931 search_offset = offset;
3932 number_of_attributes = 0;
3934 while ((search_offset - start_offset) < len) {
3935 search_offset = get_type_length(tvb, search_offset, &search_length);
3936 attribute = tvb_get_ntohs(tvb, search_offset);
3938 search_offset += search_length;
3939 search_offset = get_type_length(tvb, search_offset, &search_length);
3941 if (attribute == 0x01) {
3942 new_offset = 0;
3943 while (new_offset <= search_offset) {
3944 new_offset = get_type_length(tvb, search_offset, &element_length);
3945 dissect_uuid(NULL, pinfo, tvb, new_offset, element_length, &uuid);
3946 wmem_array_append_one(uuid_array, uuid);
3947 new_offset += element_length;
3951 search_offset += search_length;
3952 number_of_attributes += 1;
3955 uuid = get_specified_uuid(pinfo->pool, uuid_array);
3956 if (uuid.size == 0 && service_uuid)
3957 uuid = *service_uuid;
3959 if (!pinfo->fd->visited) {
3960 service_info = (service_info_t *) wmem_new(wmem_file_scope(), service_info_t);
3961 service_info->interface_id = l2cap_data->interface_id;
3962 service_info->adapter_id = l2cap_data->adapter_id;
3963 service_info->sdp_psm = l2cap_data->psm;
3964 service_info->direction = pinfo->p2p_dir;
3965 if (service_info->direction == P2P_DIR_RECV) {
3966 service_info->bd_addr_oui = l2cap_data->remote_bd_addr_oui;
3967 service_info->bd_addr_id = l2cap_data->remote_bd_addr_id;
3968 } else {
3969 service_info->bd_addr_oui = 0;
3970 service_info->bd_addr_id = 0;
3973 service_info->uuid = uuid;
3975 service_info->type = 0;
3976 service_info->channel = 0;
3977 service_info->protocol_order = 0;
3978 service_info->protocol = -1;
3979 service_info->parent_info = NULL;
3980 } else {
3981 service_info = NULL;
3984 service_offset = offset;
3985 while ((offset - start_offset) < len) {
3986 offset = dissect_sdp_service_attribute(next_tree, tvb, offset, pinfo,
3987 uuid, service_offset, service_info, number_of_attributes, false);
3990 if (!pinfo->fd->visited && service_info) {
3991 k_interface_id = l2cap_data->interface_id;
3992 k_adapter_id = l2cap_data->adapter_id;
3993 k_sdp_psm = l2cap_data->psm;
3994 k_direction = service_info->direction;
3995 k_bd_addr_oui = service_info->bd_addr_oui;
3996 k_bd_addr_id = service_info->bd_addr_id;
3997 k_service_type = service_info->type;
3998 k_service_channel = service_info->channel;
3999 k_frame_number = pinfo->num;
4001 key[0].length = 1;
4002 key[0].key = &k_interface_id;
4003 key[1].length = 1;
4004 key[1].key = &k_adapter_id;
4005 key[2].length = 1;
4006 key[2].key = &k_sdp_psm;
4007 key[3].length = 1;
4008 key[3].key = &k_direction;
4009 key[4].length = 1;
4010 key[4].key = &k_bd_addr_oui;
4011 key[5].length = 1;
4012 key[5].key = &k_bd_addr_id;
4013 key[6].length = 1;
4014 key[6].key = &k_service_type;
4015 key[7].length = 1;
4016 key[7].key = &k_service_channel;
4017 key[8].length = 1;
4018 key[8].key = &k_frame_number;
4019 key[9].length = 0;
4020 key[9].key = NULL;
4022 wmem_tree_insert32_array(service_infos, key, service_info);
4025 proto_item_set_len(list_item, offset - start_offset);
4027 if (uuid.size)
4028 proto_item_append_text(list_tree, " [count = %2u] (%s%s)",
4029 number_of_attributes, (uuid.bt_uuid) ? "" : "CustomUUID: ", print_bluetooth_uuid(pinfo->pool, &uuid));
4030 else
4031 proto_item_append_text(list_tree, " [count = %2u]",
4032 number_of_attributes);
4034 return offset;
4038 static int
4039 dissect_sdp_service_attribute_list_array(proto_tree *tree, tvbuff_t *tvb,
4040 int offset, packet_info *pinfo, int attribute_list_byte_count,
4041 bluetooth_uuid_t *service_uuid, btl2cap_data_t *l2cap_data)
4043 proto_item *lists_item;
4044 proto_tree *lists_tree;
4045 proto_tree *next_tree;
4046 int start_offset;
4047 int len;
4048 unsigned number_of_attributes;
4050 start_offset = offset;
4052 offset = get_type_length(tvb, offset, &len);
4054 lists_item = proto_tree_add_item(tree, hf_attribute_lists, tvb, start_offset,
4055 attribute_list_byte_count, ENC_NA);
4056 lists_tree = proto_item_add_subtree(lists_item, ett_btsdp_attribute);
4057 dissect_data_element(lists_tree, &next_tree, pinfo, tvb, start_offset);
4059 number_of_attributes = 0;
4061 while (offset - start_offset < attribute_list_byte_count) {
4062 number_of_attributes += 1;
4064 offset = dissect_sdp_service_attribute_list(next_tree, tvb, offset,
4065 pinfo, service_uuid, l2cap_data);
4068 proto_item_append_text(lists_tree, " [count = %2u]", number_of_attributes);
4070 return offset;
4074 static int
4075 dissect_sdp_service_search_request(proto_tree *tree, tvbuff_t *tvb, int offset,
4076 packet_info *pinfo, uint16_t tid, btl2cap_data_t *l2cap_data)
4078 int start_offset;
4079 int bytes_to_go;
4080 int size;
4081 proto_item *ti;
4082 proto_tree *st;
4083 proto_tree *sub_tree = NULL;
4084 bluetooth_uuid_t empty_uuid;
4085 wmem_array_t *uuid_array = NULL;
4087 start_offset = offset;
4088 memset(&empty_uuid, 0, sizeof(bluetooth_uuid_t));
4089 if (!pinfo->fd->visited)
4090 uuid_array = wmem_array_new(wmem_file_scope(), sizeof(bluetooth_uuid_t));
4092 ti = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA);
4093 st = proto_item_add_subtree(ti, ett_btsdp_service_search_pattern);
4095 dissect_data_element(st, &sub_tree, pinfo, tvb, offset);
4096 offset = get_type_length(tvb, offset, &bytes_to_go);
4097 proto_item_set_len(ti, offset - start_offset + bytes_to_go);
4099 while (bytes_to_go > 0) {
4100 wmem_strbuf_t *str = NULL;
4101 int entry_offset;
4102 int entry_size;
4103 bluetooth_uuid_t uuid;
4105 size = dissect_sdp_type(sub_tree, pinfo, tvb, offset, -1, empty_uuid, 0, 0, -1, NULL, &str);
4107 entry_offset = get_type_length(tvb, offset, &entry_size);
4108 dissect_uuid(NULL, pinfo, tvb, entry_offset, entry_size, &uuid);
4109 if (uuid_array)
4110 wmem_array_append_one(uuid_array, uuid);
4112 proto_item_append_text(ti, " %s", wmem_strbuf_get_str(str));
4113 col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(str));
4115 if (size < 1)
4116 break;
4118 offset += size;
4119 bytes_to_go -= size;
4122 proto_tree_add_item(tree, hf_maximum_service_record_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4123 offset += 2;
4125 reassemble_continuation_state(tvb, pinfo, offset, tid, true,
4126 0, 0, PDU_TYPE_SERVICE_SEARCH, NULL, NULL, NULL, &uuid_array, NULL, l2cap_data);
4128 offset = dissect_continuation_state(tvb, tree, pinfo, offset);
4130 return offset;
4134 static int
4135 dissect_sdp_service_search_response(proto_tree *tree, tvbuff_t *tvb,
4136 int offset, packet_info *pinfo, uint16_t tid, btl2cap_data_t *l2cap_data)
4138 proto_tree *st;
4139 proto_item *ti;
4140 uint16_t current_count;
4141 bool is_first;
4142 bool is_continued;
4143 tvbuff_t *new_tvb;
4144 unsigned i_record;
4145 wmem_array_t *uuid_array = NULL;
4146 wmem_array_t *record_handle_array = NULL;
4148 proto_tree_add_item(tree, hf_ssr_total_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4149 offset += 2;
4151 current_count = tvb_get_ntohs(tvb, offset);
4152 proto_tree_add_item(tree, hf_ssr_current_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4153 offset += 2;
4155 ti = proto_tree_add_none_format(tree, hf_service_record_handle_list, tvb, offset,
4156 current_count * 4, "Service Record Handle List [count = %u]", current_count);
4157 st = proto_item_add_subtree(ti, ett_btsdp_ssr);
4159 if (!pinfo->fd->visited)
4160 record_handle_array = wmem_array_new(pinfo->pool, sizeof(uint32_t));
4162 while (current_count > 0) {
4163 proto_tree_add_item(st, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
4165 if (record_handle_array) {
4166 uint32_t value;
4168 value = tvb_get_ntohl(tvb, offset);
4169 wmem_array_append_one(record_handle_array, value);
4172 offset += 4;
4173 current_count -= 1;
4176 reassemble_continuation_state(tvb, pinfo, offset, tid, false,
4177 offset - current_count * 4, current_count * 4, PDU_TYPE_SERVICE_SEARCH,
4178 &new_tvb, &is_first, &is_continued, &uuid_array, NULL, l2cap_data);
4180 if (is_continued)
4181 col_append_str(pinfo->cinfo, COL_INFO, "(fragment)");
4183 if (!pinfo->fd->visited) {
4184 record_handle_service_t *record_handle_service;
4185 wmem_tree_key_t key[7];
4186 uint32_t k_interface_id;
4187 uint32_t k_adapter_id;
4188 uint32_t k_chandle;
4189 uint32_t k_psm;
4190 uint32_t k_record_handle;
4191 uint32_t k_frame_number;
4192 uint32_t interface_id;
4193 uint32_t adapter_id;
4194 uint32_t chandle;
4195 uint32_t psm;
4196 uint32_t record_handle;
4197 uint32_t frame_number;
4199 interface_id = l2cap_data->interface_id;
4200 adapter_id = l2cap_data->adapter_id;
4201 chandle = l2cap_data->chandle;
4202 psm = l2cap_data->psm;
4203 frame_number = pinfo->num;
4205 k_interface_id = interface_id;
4206 k_adapter_id = adapter_id;
4207 k_chandle = chandle;
4208 k_psm = psm;
4209 k_frame_number = frame_number;
4211 for (i_record = 0; i_record < wmem_array_get_count(record_handle_array); ++i_record) {
4213 record_handle = *((uint32_t *)wmem_array_index(record_handle_array, i_record));
4214 k_record_handle = record_handle;
4216 key[0].length = 1;
4217 key[0].key = &k_interface_id;
4218 key[1].length = 1;
4219 key[1].key = &k_adapter_id;
4220 key[2].length = 1;
4221 key[2].key = &k_chandle;
4222 key[3].length = 1;
4223 key[3].key = &k_psm;
4224 key[4].length = 1;
4225 key[4].key = &k_record_handle;
4226 key[5].length = 1;
4227 key[5].key = &k_frame_number;
4228 key[6].length = 0;
4229 key[6].key = NULL;
4231 record_handle_service = (record_handle_service_t *) wmem_new(wmem_file_scope(), record_handle_service_t);
4232 record_handle_service->interface_id = interface_id;
4233 record_handle_service->adapter_id = adapter_id;
4234 record_handle_service->chandle = chandle;
4235 record_handle_service->psm = psm;
4236 record_handle_service->record_handle = record_handle;
4238 record_handle_service->uuid_array = uuid_array;
4240 wmem_tree_insert32_array(record_handle_services, key, record_handle_service);
4244 offset = dissect_continuation_state(tvb, tree, pinfo, offset);
4246 if (!is_first && new_tvb) {
4247 proto_item *reassembled_item;
4248 proto_tree *reassembled_tree;
4249 int new_offset = 0;
4250 int new_length;
4252 new_length = tvb_reported_length(new_tvb);
4254 reassembled_item = proto_tree_add_item(tree, (is_continued) ? hf_partial_record_handle_list : hf_reassembled_record_handle_list,new_tvb, 0, new_length, ENC_NA);
4255 proto_item_append_text(reassembled_item, " [count = %u]", new_length / 4);
4256 reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
4257 proto_item_set_generated(reassembled_item);
4259 while (new_length > 0) {
4260 proto_tree_add_item(reassembled_tree, hf_sdp_service_record_handle, new_tvb,
4261 new_offset, 4, ENC_BIG_ENDIAN);
4262 new_offset += 4;
4263 new_length -= 4;
4267 return offset;
4271 static int
4272 dissect_sdp_service_attribute_request(proto_tree *tree, tvbuff_t *tvb,
4273 int offset, packet_info *pinfo, uint16_t tid, btl2cap_data_t *l2cap_data)
4275 uint32_t record_handle;
4276 wmem_array_t *uuid_array;
4277 bluetooth_uuid_t uuid;
4279 proto_tree_add_item(tree, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN);
4280 record_handle = tvb_get_ntohl(tvb, offset);
4281 col_append_fstr(pinfo->cinfo, COL_INFO, ": 0x%08x - ", record_handle);
4282 offset += 4;
4284 proto_tree_add_item(tree, hf_maximum_attribute_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4285 offset += 2;
4287 uuid_array = get_uuids(pinfo, record_handle, l2cap_data);
4288 uuid = get_specified_uuid(pinfo->pool, uuid_array);
4290 offset += dissect_attribute_id_list(tree, tvb, offset, pinfo, &uuid);
4292 reassemble_continuation_state(tvb, pinfo, offset, tid, true,
4293 0, 0, PDU_TYPE_SERVICE_ATTRIBUTE, NULL, NULL, NULL, NULL, &record_handle, l2cap_data);
4295 offset = dissect_continuation_state(tvb, tree, pinfo, offset);
4297 return offset;
4301 static int
4302 dissect_sdp_service_attribute_response(proto_tree *tree, tvbuff_t *tvb,
4303 int offset, packet_info *pinfo, uint16_t tid, btl2cap_data_t *l2cap_data)
4305 int attribute_list_byte_count;
4306 bool is_first;
4307 bool is_continued;
4308 tvbuff_t *new_tvb;
4309 uint32_t record_handle = 0;
4310 bluetooth_uuid_t uuid;
4312 proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4313 attribute_list_byte_count = tvb_get_ntohs(tvb, offset);
4314 offset += 2;
4316 reassemble_continuation_state(tvb, pinfo,
4317 offset + attribute_list_byte_count, tid, false,
4318 offset, attribute_list_byte_count,
4319 PDU_TYPE_SERVICE_ATTRIBUTE, &new_tvb, &is_first,
4320 &is_continued, NULL, &record_handle, l2cap_data);
4322 if (!is_continued) {
4323 wmem_array_t *uuid_array;
4325 uuid_array = get_uuids(pinfo, record_handle, l2cap_data);
4326 uuid = get_specified_uuid(pinfo->pool, uuid_array);
4327 } else {
4328 memset(&uuid, 0, sizeof(bluetooth_uuid_t));
4331 if (is_first && !is_continued) {
4332 dissect_sdp_service_attribute_list(tree, tvb, offset, pinfo, &uuid, l2cap_data);
4333 } else {
4334 proto_tree_add_item(tree, hf_fragment, tvb, offset,
4335 attribute_list_byte_count, ENC_NA);
4338 if (is_continued)
4339 col_append_str(pinfo->cinfo, COL_INFO, "(fragment)");
4341 offset = dissect_continuation_state(tvb, tree, pinfo, offset + attribute_list_byte_count);
4343 if (!is_first && new_tvb) {
4344 proto_item *reassembled_item;
4345 proto_tree *reassembled_tree;
4347 add_new_data_source(pinfo, new_tvb, (is_continued) ? "Partial Reassembled SDP" : "Reassembled SDP");
4349 reassembled_item = proto_tree_add_item(tree,
4350 (is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list,
4351 new_tvb, 0, tvb_reported_length(new_tvb), ENC_NA);
4352 reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
4353 proto_item_set_generated(reassembled_item);
4355 if (!is_continued) {
4356 dissect_sdp_service_attribute_list(reassembled_tree, new_tvb, 0,
4357 pinfo, &uuid, l2cap_data);
4361 return offset;
4365 static int
4366 dissect_sdp_service_search_attribute_request(proto_tree *tree, tvbuff_t *tvb,
4367 int offset, packet_info *pinfo, uint16_t tid, btl2cap_data_t *l2cap_data)
4369 proto_tree *ptree;
4370 proto_item *pitem;
4371 proto_tree *next_tree;
4372 int start_offset;
4373 int size;
4374 int bytes_to_go;
4375 wmem_strbuf_t *info_buf = NULL;
4376 bluetooth_uuid_t empty_uuid;
4377 wmem_array_t *uuid_array = NULL;
4378 bluetooth_uuid_t uuid;
4380 memset(&empty_uuid, 0, sizeof(bluetooth_uuid_t));
4381 if (!pinfo->fd->visited)
4382 uuid_array = wmem_array_new(wmem_file_scope(), sizeof(bluetooth_uuid_t));
4383 else
4384 uuid_array = wmem_array_new(pinfo->pool, sizeof(bluetooth_uuid_t));
4386 start_offset = offset;
4387 pitem = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA);
4388 ptree = proto_item_add_subtree(pitem, ett_btsdp_attribute);
4390 dissect_data_element(ptree, &next_tree, pinfo, tvb, offset);
4391 offset = get_type_length(tvb, offset, &bytes_to_go);
4392 proto_item_set_len(pitem, bytes_to_go + (offset - start_offset));
4394 while (bytes_to_go > 0) {
4395 int entry_offset;
4396 int entry_size;
4397 bluetooth_uuid_t a_uuid;
4399 memset(&a_uuid, 0, sizeof(bluetooth_uuid_t));
4401 size = dissect_sdp_type(next_tree, pinfo, tvb, offset, -1, empty_uuid, 0, 0, -1, NULL, &info_buf);
4402 proto_item_append_text(pitem,"%s", wmem_strbuf_get_str(info_buf));
4403 col_append_str(pinfo->cinfo, COL_INFO, wmem_strbuf_get_str(info_buf));
4405 entry_offset = get_type_length(tvb, offset, &entry_size);
4406 dissect_uuid(NULL, pinfo, tvb, entry_offset, entry_size, &a_uuid);
4407 if (uuid_array)
4408 wmem_array_append_one(uuid_array, a_uuid);
4410 offset += size;
4411 bytes_to_go -= size;
4414 col_append_str(pinfo->cinfo, COL_INFO, ": ");
4416 proto_tree_add_item(tree, hf_maximum_attribute_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4417 offset += 2;
4419 uuid = get_specified_uuid(pinfo->pool, uuid_array);
4421 offset += dissect_attribute_id_list(tree, tvb, offset, pinfo, &uuid);
4423 reassemble_continuation_state(tvb, pinfo, offset, tid, true,
4424 0, 0, PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE, NULL, NULL, NULL, &uuid_array, NULL, l2cap_data);
4426 offset = dissect_continuation_state(tvb, tree, pinfo, offset);
4428 return offset;
4432 static int
4433 dissect_sdp_service_search_attribute_response(proto_tree *tree, tvbuff_t *tvb,
4434 int offset, packet_info *pinfo, uint16_t tid, btl2cap_data_t *l2cap_data)
4436 int attribute_list_byte_count;
4437 bool is_first;
4438 bool is_continued;
4439 tvbuff_t *new_tvb;
4440 bluetooth_uuid_t uuid;
4441 wmem_array_t *uuid_array = NULL;
4443 proto_tree_add_item(tree, hf_attribute_list_byte_count, tvb, offset, 2, ENC_BIG_ENDIAN);
4444 attribute_list_byte_count = tvb_get_ntohs(tvb, offset);
4445 offset += 2;
4447 reassemble_continuation_state(tvb, pinfo,
4448 offset + attribute_list_byte_count, tid, false,
4449 offset, attribute_list_byte_count,
4450 PDU_TYPE_SERVICE_SEARCH_ATTRIBUTE, &new_tvb, &is_first,
4451 &is_continued, &uuid_array, NULL, l2cap_data);
4453 uuid = get_specified_uuid(pinfo->pool, uuid_array);
4455 if (is_first && !is_continued) {
4456 dissect_sdp_service_attribute_list_array(tree, tvb, offset, pinfo,
4457 attribute_list_byte_count, &uuid, l2cap_data);
4458 } else {
4459 proto_tree_add_item(tree, hf_fragment, tvb, offset,
4460 attribute_list_byte_count, ENC_NA);
4463 if (is_continued)
4464 col_append_str(pinfo->cinfo, COL_INFO, "(fragment)");
4466 offset = dissect_continuation_state(tvb, tree, pinfo, offset + attribute_list_byte_count);
4468 if (!is_first && new_tvb) {
4469 proto_item *reassembled_item;
4470 proto_tree *reassembled_tree;
4472 add_new_data_source(pinfo, new_tvb, (is_continued) ? "Partial Reassembled SDP" : "Reassembled SDP");
4474 reassembled_item = proto_tree_add_item(tree,
4475 (is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list,
4476 new_tvb, 0, tvb_reported_length(new_tvb), ENC_NA);
4477 reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
4478 proto_item_set_generated(reassembled_item);
4480 if (!is_continued)
4481 dissect_sdp_service_attribute_list_array(reassembled_tree, new_tvb, 0,
4482 pinfo, tvb_reported_length(new_tvb), &uuid, l2cap_data);
4485 return offset;
4489 static int
4490 dissect_btsdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
4492 proto_item *ti;
4493 proto_tree *st;
4494 int offset = 0;
4495 uint8_t pdu_id;
4496 uint16_t tid;
4497 btl2cap_data_t *l2cap_data;
4499 /* Reject the packet if data is NULL */
4500 if (data == NULL)
4501 return 0;
4502 l2cap_data = (btl2cap_data_t *) data;
4504 ti = proto_tree_add_item(tree, proto_btsdp, tvb, 0, tvb_captured_length(tvb), ENC_NA);
4505 st = proto_item_add_subtree(ti, ett_btsdp);
4507 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SDP");
4509 switch (pinfo->p2p_dir) {
4510 case P2P_DIR_SENT:
4511 col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
4512 break;
4513 case P2P_DIR_RECV:
4514 col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
4515 break;
4516 default:
4517 col_set_str(pinfo->cinfo, COL_INFO, "UnknownDirection ");
4518 break;
4521 proto_tree_add_item(st, hf_pdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
4522 pdu_id = tvb_get_uint8(tvb, offset);
4523 offset += 1;
4525 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
4526 val_to_str_const(pdu_id, vs_pduid, "Unknown"));
4528 proto_tree_add_item(st, hf_tid, tvb, offset, 2, ENC_BIG_ENDIAN);
4529 tid = tvb_get_ntohs(tvb, offset);
4530 offset += 2;
4532 proto_tree_add_item(st, hf_parameter_length, tvb, offset, 2, ENC_BIG_ENDIAN);
4533 offset += 2;
4535 switch (pdu_id) {
4536 case 0x01:
4537 offset = dissect_sdp_error_response(st, tvb, offset);
4538 break;
4539 case 0x02:
4540 offset = dissect_sdp_service_search_request(st, tvb, offset, pinfo, tid, l2cap_data);
4541 break;
4542 case 0x03:
4543 offset = dissect_sdp_service_search_response(st, tvb, offset, pinfo, tid, l2cap_data);
4544 break;
4545 case 0x04:
4546 offset = dissect_sdp_service_attribute_request(st, tvb, offset, pinfo, tid, l2cap_data);
4547 break;
4548 case 0x05:
4549 offset = dissect_sdp_service_attribute_response(st, tvb, offset, pinfo, tid, l2cap_data);
4550 break;
4551 case 0x06:
4552 offset = dissect_sdp_service_search_attribute_request(st, tvb, offset, pinfo, tid, l2cap_data);
4553 break;
4554 case 0x07:
4555 offset = dissect_sdp_service_search_attribute_response(st, tvb, offset, pinfo, tid, l2cap_data);
4556 break;
4559 return offset;
4562 void
4563 proto_register_btsdp(void)
4565 module_t *module;
4566 expert_module_t *expert_btsdp;
4568 static hf_register_info hf[] = {
4569 { &hf_pdu_id,
4570 { "PDU", "btsdp.pdu",
4571 FT_UINT8, BASE_HEX, VALS(vs_pduid), 0,
4572 "PDU type", HFILL }
4574 { &hf_tid,
4575 { "Transaction Id", "btsdp.tid",
4576 FT_UINT16, BASE_HEX, NULL, 0,
4577 NULL, HFILL}
4579 { &hf_parameter_length,
4580 { "Parameter Length", "btsdp.len",
4581 FT_UINT16, BASE_DEC, NULL, 0,
4582 NULL, HFILL}
4584 { &hf_error_code,
4585 { "Error Code", "btsdp.error_code",
4586 FT_UINT16, BASE_HEX, VALS(vs_error_code), 0,
4587 NULL, HFILL}
4589 { &hf_ssr_total_count,
4590 { "Total Service Record Count", "btsdp.ssr.total_count",
4591 FT_UINT16, BASE_DEC, NULL, 0,
4592 "Total count of service records", HFILL}
4594 { &hf_ssr_current_count,
4595 { "Current Service Record Count", "btsdp.ssr.current_count",
4596 FT_UINT16, BASE_DEC, NULL, 0,
4597 "Count of service records in this message", HFILL}
4599 { &hf_attribute_id_list,
4600 { "Attribute ID List", "btsdp.attribute_id_list",
4601 FT_NONE, BASE_NONE, NULL, 0,
4602 NULL, HFILL }
4604 { &hf_attribute_id_range,
4605 { "Attribute Range", "btsdp.attribute_range",
4606 FT_UINT32, BASE_HEX, NULL, 0,
4607 NULL, HFILL }
4609 { &hf_attribute_id_range_from,
4610 { "Attribute Range From", "btsdp.attribute_range.from",
4611 FT_UINT16, BASE_HEX, NULL, 0,
4612 NULL, HFILL }
4614 { &hf_attribute_id_range_to,
4615 { "Attribute Range To", "btsdp.attribute_range.to",
4616 FT_UINT16, BASE_HEX, NULL, 0,
4617 NULL, HFILL }
4619 { &hf_attribute_list_byte_count,
4620 { "Attribute List Byte Count", "btsdp.attribute_list_byte_count",
4621 FT_UINT16, BASE_DEC, NULL, 0,
4622 "Count of bytes in attribute list response", HFILL}
4624 { &hf_maximum_service_record_count,
4625 {"Maximum Service Record Count", "btsdp.maximum_service_record_count",
4626 FT_UINT16, BASE_DEC, NULL, 0,
4627 NULL, HFILL}
4629 { &hf_maximum_attribute_byte_count,
4630 {"Maximum Attribute Byte Count", "btsdp.maximum_attribute_byte_count",
4631 FT_UINT16, BASE_DEC, NULL, 0,
4632 NULL, HFILL}
4634 { &hf_service_attribute,
4635 { "Service Attribute", "btsdp.service_attribute",
4636 FT_NONE, BASE_NONE, NULL, 0,
4637 NULL, HFILL }
4639 { &hf_service_attribute_id,
4640 { "Attribute", "btsdp.service_attribute.attribute",
4641 FT_NONE, BASE_NONE, NULL, 0,
4642 NULL, HFILL }
4644 { &hf_service_attribute_value,
4645 { "Value", "btsdp.service_attribute.value",
4646 FT_NONE, BASE_NONE, NULL, 0,
4647 NULL, HFILL }
4649 { &hf_profile_descriptor_list,
4650 { "Profile Descriptor List", "btsdp.profile_descriptor_list",
4651 FT_NONE, BASE_NONE, NULL, 0,
4652 NULL, HFILL }
4654 { &hf_attribute_list,
4655 { "Attribute List", "btsdp.attribute_list",
4656 FT_NONE, BASE_NONE, NULL, 0,
4657 NULL, HFILL }
4659 { &hf_attribute_lists,
4660 { "Attribute Lists", "btsdp.attribute_lists",
4661 FT_NONE, BASE_NONE, NULL, 0,
4662 NULL, HFILL }
4664 { &hf_service_search_pattern,
4665 { "Service Search Pattern", "btsdp.service_search_pattern",
4666 FT_NONE, BASE_NONE, NULL, 0,
4667 NULL, HFILL }
4669 { &hf_service_record_handle_list,
4670 { "Service Record Handle List", "btsdp.service_record_handle_list",
4671 FT_NONE, BASE_NONE, NULL, 0,
4672 NULL, HFILL }
4674 { &hf_continuation_state,
4675 { "Continuation State", "btsdp.continuation_state",
4676 FT_NONE, BASE_NONE, NULL, 0,
4677 NULL, HFILL }
4679 { &hf_continuation_state_length,
4680 { "Continuation State Length", "btsdp.continuation_state.length",
4681 FT_UINT16, BASE_DEC, NULL, 0,
4682 NULL, HFILL }
4684 { &hf_continuation_state_value,
4685 { "Continuation State Value", "btsdp.continuation_state.value",
4686 FT_NONE, BASE_NONE, NULL, 0,
4687 NULL, HFILL }
4689 { &hf_data_element,
4690 { "Data Element", "btsdp.data_element",
4691 FT_NONE, BASE_NONE, NULL, 0,
4692 NULL, HFILL }
4694 { &hf_data_element_type,
4695 { "Data Element Type", "btsdp.data_element.type",
4696 FT_UINT8, BASE_DEC, VALS(vs_data_element_type), 0xF8,
4697 NULL, HFILL }
4699 { &hf_data_element_size,
4700 { "Data Element Size", "btsdp.data_element.size",
4701 FT_UINT8, BASE_DEC, VALS(vs_data_element_size), 0x07,
4702 NULL, HFILL }
4704 { &hf_data_element_var_size,
4705 { "Data Element Var Size", "btsdp.data_element.var_size",
4706 FT_UINT32, BASE_DEC, NULL, 0,
4707 NULL, HFILL }
4709 { &hf_data_element_value,
4710 { "Data Value", "btsdp.data_element.value",
4711 FT_NONE, BASE_NONE, NULL, 0,
4712 NULL, HFILL }
4714 { &hf_data_element_value_nil,
4715 { "Value: Nil", "btsdp.data_element.value.nil",
4716 FT_NONE, BASE_NONE, NULL, 0,
4717 NULL, HFILL }
4719 { &hf_data_element_value_signed_int,
4720 { "Value: Signed Int", "btsdp.data_element.value.signed_int",
4721 FT_INT64, BASE_DEC, NULL, 0,
4722 NULL, HFILL }
4724 { &hf_data_element_value_unsigned_int,
4725 { "Value: Unsigned Int", "btsdp.data_element.value.unsigned_int",
4726 FT_UINT64, BASE_DEC_HEX, NULL, 0,
4727 NULL, HFILL }
4729 { &hf_data_element_value_boolean,
4730 { "Value: Boolean", "btsdp.data_element.value.boolean",
4731 FT_BOOLEAN, BASE_NONE, NULL, 0,
4732 NULL, HFILL }
4734 { &hf_data_element_value_string,
4735 { "Value: String", "btsdp.data_element.value.string",
4736 FT_STRING, BASE_NONE, NULL, 0,
4737 NULL, HFILL }
4739 { &hf_data_element_value_url,
4740 { "Value: URL", "btsdp.data_element.value.url",
4741 FT_STRING, BASE_NONE, NULL, 0,
4742 NULL, HFILL }
4744 { &hf_data_element_value_uuid_16,
4745 { "Value: UUID", "btsdp.data_element.value.uuid_16",
4746 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bluetooth_uuid_vals_ext, 0,
4747 NULL, HFILL }
4749 { &hf_data_element_value_uuid_32,
4750 { "Value: UUID", "btsdp.data_element.value.uuid_32",
4751 FT_UINT32, BASE_HEX | BASE_EXT_STRING, &bluetooth_uuid_vals_ext, 0,
4752 NULL, HFILL }
4754 { &hf_data_element_value_uuid_128,
4755 { "Value: UUID", "btsdp.data_element.value.uuid_128",
4756 FT_BYTES, BASE_NONE, NULL, 0,
4757 NULL, HFILL }
4759 { &hf_data_element_value_uuid,
4760 { "Value: Custom UUID", "btsdp.data_element.value.custom_uuid",
4761 FT_BYTES, BASE_NONE, NULL, 0,
4762 NULL, HFILL }
4764 { &hf_data_element_value_sequence,
4765 { "Value: Sequence", "btsdp.data_element.value.sequence",
4766 FT_NONE, BASE_NONE, NULL, 0,
4767 NULL, HFILL }
4769 { &hf_data_element_value_alternative,
4770 { "Value: Alternative", "btsdp.data_element.value.alternative",
4771 FT_NONE, BASE_NONE, NULL, 0,
4772 NULL, HFILL }
4774 { &hf_fragment,
4775 { "Data Fragment", "btsdp.fragment",
4776 FT_NONE, BASE_NONE, NULL, 0,
4777 NULL, HFILL }
4779 { &hf_partial_attribute_list,
4780 { "Partial Attribute List", "btsdp.partial_attribute_list",
4781 FT_NONE, BASE_NONE, NULL, 0,
4782 NULL, HFILL }
4784 { &hf_reassembled_attribute_list,
4785 { "Reassembled Attribute List", "btsdp.reassembled_attribute_list",
4786 FT_NONE, BASE_NONE, NULL, 0,
4787 NULL, HFILL }
4789 { &hf_partial_record_handle_list,
4790 { "Partial Record Handle List", "btsdp.partial_record_handle_list",
4791 FT_NONE, BASE_NONE, NULL, 0,
4792 NULL, HFILL }
4794 { &hf_reassembled_record_handle_list,
4795 { "Reassembled Record Handle List", "btsdp.reassembled_record_handle_list",
4796 FT_NONE, BASE_NONE, NULL, 0,
4797 NULL, HFILL }
4799 { &hf_service_attribute_id_generic,
4800 { "Attribute ID", "btsdp.service.attribute",
4801 FT_UINT16, BASE_HEX, VALS(vs_general_attribute_id), 0,
4802 NULL, HFILL }
4804 { &hf_service_attribute_id_a2dp,
4805 { "Attribute ID", "btsdp.service.attribute",
4806 FT_UINT16, BASE_HEX, VALS(vs_a2dp_attribute_id), 0,
4807 NULL, HFILL }
4809 { &hf_service_attribute_id_avrcp,
4810 { "Attribute ID", "btsdp.service.attribute",
4811 FT_UINT16, BASE_HEX, VALS(vs_avrcp_attribute_id), 0,
4812 NULL, HFILL }
4814 { &hf_service_attribute_id_bip_imaging_responder,
4815 { "Attribute ID", "btsdp.service.attribute",
4816 FT_UINT16, BASE_HEX, VALS(vs_bip_imaging_responder_attribute_id), 0,
4817 NULL, HFILL }
4819 { &hf_service_attribute_id_bip_imaging_other,
4820 { "Attribute ID", "btsdp.service.attribute",
4821 FT_UINT16, BASE_HEX, VALS(vs_bip_imaging_other_attribute_id), 0,
4822 NULL, HFILL }
4824 { &hf_service_attribute_id_bpp,
4825 { "Attribute ID", "btsdp.service.attribute",
4826 FT_UINT16, BASE_HEX, VALS(vs_bpp_attribute_id), 0,
4827 NULL, HFILL }
4829 { &hf_service_attribute_id_bpp_rui,
4830 { "Attribute ID", "btsdp.service.attribute",
4831 FT_UINT16, BASE_HEX, VALS(vs_bpp_reflected_ui_attribute_id), 0,
4832 NULL, HFILL }
4834 { &hf_service_attribute_id_ctp,
4835 { "Attribute ID", "btsdp.service.attribute",
4836 FT_UINT16, BASE_HEX, VALS(vs_ctp_attribute_id), 0,
4837 NULL, HFILL }
4839 { &hf_service_attribute_id_did,
4840 { "Attribute ID", "btsdp.service.attribute",
4841 FT_UINT16, BASE_HEX, VALS(vs_did_attribute_id), 0,
4842 NULL, HFILL }
4844 { &hf_service_attribute_id_dun,
4845 { "Attribute ID", "btsdp.service.attribute",
4846 FT_UINT16, BASE_HEX, VALS(vs_dun_attribute_id), 0,
4847 NULL, HFILL }
4849 { &hf_service_attribute_id_fax,
4850 { "Attribute ID", "btsdp.service.attribute",
4851 FT_UINT16, BASE_HEX, VALS(vs_fax_attribute_id), 0,
4852 NULL, HFILL }
4854 { &hf_service_attribute_id_ftp,
4855 { "Attribute ID", "btsdp.service.attribute",
4856 FT_UINT16, BASE_HEX, VALS(vs_ftp_attribute_id), 0,
4857 NULL, HFILL }
4859 { &hf_service_attribute_id_gnss,
4860 { "Attribute ID", "btsdp.service.attribute",
4861 FT_UINT16, BASE_HEX, VALS(vs_gnss_attribute_id), 0,
4862 NULL, HFILL }
4864 { &hf_service_attribute_id_hfp_hf,
4865 { "Attribute ID", "btsdp.service.attribute",
4866 FT_UINT16, BASE_HEX, VALS(vs_hfp_gw_attribute_id), 0,
4867 NULL, HFILL }
4869 { &hf_service_attribute_id_hfp_ag,
4870 { "Attribute ID", "btsdp.service.attribute",
4871 FT_UINT16, BASE_HEX, VALS(vs_hfp_ag_attribute_id), 0,
4872 NULL, HFILL }
4874 { &hf_service_attribute_id_hcrp,
4875 { "Attribute ID", "btsdp.service.attribute",
4876 FT_UINT16, BASE_HEX, VALS(vs_hcrp_attribute_id), 0,
4877 NULL, HFILL }
4879 { &hf_service_attribute_id_hsp,
4880 { "Attribute ID", "btsdp.service.attribute",
4881 FT_UINT16, BASE_HEX, VALS(vs_hsp_attribute_id), 0,
4882 NULL, HFILL }
4884 { &hf_service_attribute_id_hdp,
4885 { "Attribute ID", "btsdp.service.attribute",
4886 FT_UINT16, BASE_HEX, VALS(vs_hdp_attribute_id), 0,
4887 NULL, HFILL }
4889 { &hf_service_attribute_id_hid,
4890 { "Attribute ID", "btsdp.service.attribute",
4891 FT_UINT16, BASE_HEX, VALS(vs_hid_attribute_id), 0,
4892 NULL, HFILL }
4894 { &hf_service_attribute_id_wap,
4895 { "Attribute ID", "btsdp.service.attribute",
4896 FT_UINT16, BASE_HEX, VALS(vs_wap_attribute_id), 0,
4897 NULL, HFILL }
4899 { &hf_service_attribute_id_map_mas,
4900 { "Attribute ID", "btsdp.service.attribute",
4901 FT_UINT16, BASE_HEX, VALS(vs_map_mas_attribute_id), 0,
4902 NULL, HFILL }
4904 { &hf_service_attribute_id_map_mns,
4905 { "Attribute ID", "btsdp.service.attribute",
4906 FT_UINT16, BASE_HEX, VALS(vs_map_mns_attribute_id), 0,
4907 NULL, HFILL }
4909 { &hf_service_attribute_id_opp,
4910 { "Attribute ID", "btsdp.service.attribute",
4911 FT_UINT16, BASE_HEX, VALS(vs_opp_attribute_id), 0,
4912 NULL, HFILL }
4914 { &hf_service_attribute_id_pan_nap,
4915 { "Attribute ID", "btsdp.service.attribute",
4916 FT_UINT16, BASE_HEX, VALS(vs_pan_nap_attribute_id), 0,
4917 NULL, HFILL }
4919 { &hf_service_attribute_id_pan_gn,
4920 { "Attribute ID", "btsdp.service.attribute",
4921 FT_UINT16, BASE_HEX, VALS(vs_pan_gn_attribute_id), 0,
4922 NULL, HFILL }
4924 { &hf_service_attribute_id_pan_panu,
4925 { "Attribute ID", "btsdp.service.attribute",
4926 FT_UINT16, BASE_HEX, VALS(vs_pan_panu_attribute_id), 0,
4927 NULL, HFILL }
4929 { &hf_service_attribute_id_pbap,
4930 { "Attribute ID", "btsdp.service.attribute",
4931 FT_UINT16, BASE_HEX, VALS(vs_pbap_attribute_id), 0,
4932 NULL, HFILL }
4934 { &hf_service_attribute_id_synch,
4935 { "Attribute ID", "btsdp.service.attribute",
4936 FT_UINT16, BASE_HEX, VALS(vs_synch_attribute_id), 0,
4937 NULL, HFILL }
4939 { &hf_service_attribute_id_ctn_as,
4940 { "Attribute ID", "btsdp.service.attribute",
4941 FT_UINT16, BASE_HEX, VALS(vs_ctn_as_attribute_id), 0,
4942 NULL, HFILL }
4944 { &hf_service_attribute_id_ctn_ns,
4945 { "Attribute ID", "btsdp.service.attribute",
4946 FT_UINT16, BASE_HEX, VALS(vs_ctn_ns_attribute_id), 0,
4947 NULL, HFILL }
4949 { &hf_service_attribute_id_mps,
4950 { "Attribute ID", "btsdp.service.attribute",
4951 FT_UINT16, BASE_HEX, VALS(vs_mps_attribute_id), 0,
4952 NULL, HFILL }
4954 { &hf_did_specification_id,
4955 { "Specification ID", "btsdp.service.did.specification_id",
4956 FT_UINT16, BASE_HEX, NULL, 0,
4957 NULL, HFILL }
4959 { &hf_did_vendor_id,
4960 { "Vendor ID", "btsdp.service.did.vendor_id",
4961 FT_UINT16, BASE_HEX, NULL, 0,
4962 NULL, HFILL }
4964 { &hf_did_vendor_id_bluetooth_sig,
4965 { "Vendor ID", "btsdp.service.did.vendor_id",
4966 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bluetooth_company_id_vals_ext, 0,
4967 NULL, HFILL }
4969 { &hf_did_vendor_id_usb_forum,
4970 { "Vendor ID", "btsdp.service.did.vendor_id",
4971 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &ext_usb_vendors_vals, 0,
4972 NULL, HFILL }
4974 { &hf_did_product_id,
4975 { "Product ID", "btsdp.service.did.product_id",
4976 FT_UINT16, BASE_HEX, NULL, 0,
4977 NULL, HFILL }
4979 { &hf_did_primary_record,
4980 { "Primary Record", "btsdp.service.did.primary_record",
4981 FT_BOOLEAN, BASE_NONE, NULL, 0,
4982 NULL, HFILL }
4984 { &hf_did_version,
4985 { "Version", "btsdp.service.did.version",
4986 FT_UINT16, BASE_HEX, NULL, 0,
4987 NULL, HFILL }
4989 { &hf_did_vendor_id_source,
4990 { "Vendor ID Source", "btsdp.service.did.vendor_id_source",
4991 FT_UINT16, BASE_HEX, VALS(did_vendor_id_source_vals), 0,
4992 NULL, HFILL }
4994 { &hf_a2dp_sink_supported_features_reserved,
4995 { "Supported Features: Reserved", "btsdp.service.a2dp.sink.supported_features.reserved",
4996 FT_UINT16, BASE_HEX, NULL, 0xFFF0,
4997 NULL, HFILL }
4999 { &hf_a2dp_sink_supported_features_amplifier,
5000 { "Supported Features: Amplifier", "btsdp.service.a2dp.sink.supported_features.amplifier",
5001 FT_BOOLEAN, 16, NULL, 0x0008,
5002 NULL, HFILL }
5004 { &hf_a2dp_sink_supported_features_recorder,
5005 { "Supported Features: Recorder", "btsdp.service.a2dp.sink.supported_features.recorder",
5006 FT_BOOLEAN, 16, NULL, 0x0004,
5007 NULL, HFILL }
5009 { &hf_a2dp_sink_supported_features_speaker,
5010 { "Supported Features: Speaker", "btsdp.service.a2dp.sink.supported_features.speaker",
5011 FT_BOOLEAN, 16, NULL, 0x0002,
5012 NULL, HFILL }
5014 { &hf_a2dp_sink_supported_features_headphone,
5015 { "Supported Features: Headphone", "btsdp.service.a2dp.sink.supported_features.headphone",
5016 FT_BOOLEAN, 16, NULL, 0x0001,
5017 NULL, HFILL }
5019 { &hf_a2dp_source_supported_features_reserved,
5020 { "Supported Features: Reserved", "btsdp.service.a2dp.source.supported_features.reserved",
5021 FT_UINT16, BASE_HEX, NULL, 0xFFF0,
5022 NULL, HFILL }
5024 { &hf_a2dp_source_supported_features_mixer,
5025 { "Supported Features: Mixer", "btsdp.service.a2dp.source.supported_features.mixer",
5026 FT_BOOLEAN, 16, NULL, 0x0008,
5027 NULL, HFILL }
5029 { &hf_a2dp_source_supported_features_tuner,
5030 { "Supported Features: Tuner", "btsdp.service.a2dp.source.supported_features.tuner",
5031 FT_BOOLEAN, 16, NULL, 0x0004,
5032 NULL, HFILL }
5034 { &hf_a2dp_source_supported_features_microphone,
5035 { "Supported Features: Microphone", "btsdp.service.a2dp.source.supported_features.microphone",
5036 FT_BOOLEAN, 16, NULL, 0x0002,
5037 NULL, HFILL }
5039 { &hf_a2dp_source_supported_features_player,
5040 { "Supported Features: Player", "btsdp.service.a2dp.source.supported_features.player",
5041 FT_BOOLEAN, 16, NULL, 0x0001,
5042 NULL, HFILL }
5044 { &hf_synch_supported_data_store,
5045 { "Supported Data Store", "btsdp.service.synch.supported_data_store",
5046 FT_UINT8, BASE_HEX, VALS(synch_supported_data_store_vals), 0,
5047 NULL, HFILL }
5049 { &hf_ctp_external_network,
5050 { "External Network", "btsdp.service.ctp.external_network",
5051 FT_UINT8, BASE_HEX, VALS(ctp_external_network_vals), 0,
5052 NULL, HFILL }
5054 { &hf_avrcp_ct_supported_features_reserved_10_15,
5055 { "Supported Features: Reserved", "btsdp.service.avrcp.ct.supported_features.reserved",
5056 FT_UINT16, BASE_HEX, NULL, 0xFC00,
5057 NULL, HFILL }
5059 { &hf_avrcp_ct_supported_features_cover_art_get_linked_thumbnail,
5060 { "Supported Features: Cover Art - Get Linked Thumbnail", "btsdp.service.avrcp.ct.supported_features.cover_art_get_linked_thumbnail",
5061 FT_BOOLEAN, 16, NULL, 0x0200,
5062 NULL, HFILL }
5064 { &hf_avrcp_ct_supported_features_cover_art_get_image,
5065 { "Supported Features: Cover Art - Get Image", "btsdp.service.avrcp.ct.supported_features.cover_art_get_image",
5066 FT_BOOLEAN, 16, NULL, 0x0100,
5067 NULL, HFILL }
5069 { &hf_avrcp_ct_supported_features_cover_art_get_image_properties,
5070 { "Supported Features: Cover Art - Get Image Properties", "btsdp.service.avrcp.ct.supported_features.cover_art_get_image_properties",
5071 FT_BOOLEAN, 16, NULL, 0x0080,
5072 NULL, HFILL }
5074 { &hf_avrcp_ct_supported_features_browsing,
5075 { "Supported Features: Browsing", "btsdp.service.avrcp.ct.supported_features.browsing",
5076 FT_BOOLEAN, 16, NULL, 0x0040,
5077 NULL, HFILL }
5079 { &hf_avrcp_ct_supported_features_reserved_4_5,
5080 { "Supported Features: Reserved", "btsdp.service.avrcp.ct.supported_features.reserved",
5081 FT_UINT16, BASE_HEX, NULL, 0x0030,
5082 NULL, HFILL }
5084 { &hf_avrcp_ct_supported_features_category_4,
5085 { "Supported Features: Category 4: Menu", "btsdp.service.avrcp.ct.supported_features.category_4",
5086 FT_BOOLEAN, 16, NULL, 0x0008,
5087 NULL, HFILL }
5089 { &hf_avrcp_ct_supported_features_category_3,
5090 { "Supported Features: Category 3: Tuner", "btsdp.service.avrcp.ct.supported_features.category_3",
5091 FT_BOOLEAN, 16, NULL, 0x0004,
5092 NULL, HFILL }
5094 { &hf_avrcp_ct_supported_features_category_2,
5095 { "Supported Features: Category 2: Monitor/Amplifier", "btsdp.service.avrcp.ct.supported_features.category_2",
5096 FT_BOOLEAN, 16, NULL, 0x0002,
5097 NULL, HFILL }
5099 { &hf_avrcp_ct_supported_features_category_1,
5100 { "Supported Features: Category 1: Player/Recorder", "btsdp.service.avrcp.ct.supported_features.category_1",
5101 FT_BOOLEAN, 16, NULL, 0x0001,
5102 NULL, HFILL }
5104 { &hf_avrcp_tg_supported_features_reserved_9_15,
5105 { "Supported Features: Reserved", "btsdp.service.avrcp.tg.supported_features.reserved",
5106 FT_UINT16, BASE_HEX, NULL, 0xFE00,
5107 NULL, HFILL }
5109 { &hf_avrcp_tg_supported_features_cover_art,
5110 { "Supported Features: Cover Art", "btsdp.service.avrcp.tg.supported_features.cover_art",
5111 FT_BOOLEAN, 16, NULL, 0x0100,
5112 NULL, HFILL }
5114 { &hf_avrcp_tg_supported_features_multiple_player,
5115 { "Supported Features: Multiple Player", "btsdp.service.avrcp.tg.supported_features.multiple_player",
5116 FT_BOOLEAN, 16, NULL, 0x0080,
5117 NULL, HFILL }
5119 { &hf_avrcp_tg_supported_features_browsing,
5120 { "Supported Features: Browsing", "btsdp.service.avrcp.tg.supported_features.browsing",
5121 FT_BOOLEAN, 16, NULL, 0x0040,
5122 NULL, HFILL }
5124 { &hf_avrcp_tg_supported_features_group_navigation,
5125 { "Supported Features: Group Navigation", "btsdp.service.avrcp.tg.supported_features.group_navigation",
5126 FT_BOOLEAN, 16, NULL, 0x0020,
5127 NULL, HFILL }
5129 { &hf_avrcp_tg_supported_features_settings,
5130 { "Supported Features: Settings", "btsdp.service.avrcp.tg.supported_features.settings",
5131 FT_BOOLEAN, 16, NULL, 0x0010,
5132 NULL, HFILL }
5134 { &hf_avrcp_tg_supported_features_category_4,
5135 { "Supported Features: Category 4: Menu", "btsdp.service.avrcp.tg.supported_features.category_4",
5136 FT_BOOLEAN, 16, NULL, 0x0008,
5137 NULL, HFILL }
5139 { &hf_avrcp_tg_supported_features_category_3,
5140 { "Supported Features: Category 3: Tuner", "btsdp.service.avrcp.tg.supported_features.category_3",
5141 FT_BOOLEAN, 16, NULL, 0x0004,
5142 NULL, HFILL }
5144 { &hf_avrcp_tg_supported_features_category_2,
5145 { "Supported Features: Category 2: Monitor/Amplifier", "btsdp.service.avrcp.tg.supported_features.category_2",
5146 FT_BOOLEAN, 16, NULL, 0x0002,
5147 NULL, HFILL }
5149 { &hf_avrcp_tg_supported_features_category_1,
5150 { "Supported Features: Category 1: Player/Recorder", "btsdp.service.avrcp.tg.supported_features.category_1",
5151 FT_BOOLEAN, 16, NULL, 0x0001,
5152 NULL, HFILL }
5154 { &hf_hsp_remote_audio_volume_control,
5155 { "Remote Audio Volume Control", "btsdp.service.hsp.remote_audio_volume_control",
5156 FT_BOOLEAN, BASE_NONE, NULL, 0,
5157 NULL, HFILL }
5159 { &hf_gnss_supported_features,
5160 { "Supported Features: Reserved", "btsdp.service.gnss.supported_features.reserved",
5161 FT_UINT16, BASE_HEX, NULL, 0x0,
5162 NULL, HFILL }
5164 { &hf_pbap_pse_supported_repositories,
5165 { "Supported Repositories", "btsdp.service.pbap.pse.supported_repositories",
5166 FT_UINT8, BASE_HEX, NULL, 0x0,
5167 NULL, HFILL }
5169 { &hf_pbap_pse_supported_repositories_reserved,
5170 { "Reserved", "btsdp.service.pbap.pse.supported_repositories.reserved",
5171 FT_UINT8, BASE_HEX, NULL, 0xF0,
5172 NULL, HFILL }
5174 { &hf_pbap_pse_supported_repositories_favourites,
5175 { "Favourites", "btsdp.service.pbap.pse.supported_repositories.favourites",
5176 FT_BOOLEAN, 8, NULL, 0x08,
5177 NULL, HFILL }
5179 { &hf_pbap_pse_supported_repositories_speed_dial,
5180 { "Speed Dial", "btsdp.service.pbap.pse.supported_repositories.speed_dial",
5181 FT_BOOLEAN, 8, NULL, 0x04,
5182 NULL, HFILL }
5184 { &hf_pbap_pse_supported_repositories_sim_card,
5185 { "SIM Card", "btsdp.service.pbap.pse.supported_repositories.sim_card",
5186 FT_BOOLEAN, 8, NULL, 0x02,
5187 NULL, HFILL }
5189 { &hf_pbap_pse_supported_repositories_local_phonebook,
5190 { "Local Phonebook", "btsdp.service.pbap.pse.supported_repositories.local_phonebook",
5191 FT_BOOLEAN, 8, NULL, 0x01,
5192 NULL, HFILL }
5194 { &hf_pbap_pse_supported_features,
5195 { "Supported Features", "btsdp.service.pbap.pse.supported_features",
5196 FT_UINT32, BASE_HEX, NULL, 0x0,
5197 NULL, HFILL }
5199 { &hf_pbap_pse_supported_features_reserved,
5200 { "Reserved", "btsdp.service.pbap.pse.supported_features.reserved",
5201 FT_UINT32, BASE_HEX, NULL, 0xFFFFFC00,
5202 NULL, HFILL }
5204 { &hf_pbap_pse_supported_features_default_contact_image_format,
5205 { "Default Contact Image Format", "btsdp.service.pbap.pse.supported_features.default_contact_image_format",
5206 FT_BOOLEAN, 32, NULL, 0x00000200,
5207 NULL, HFILL }
5209 { &hf_pbap_pse_supported_features_contact_referencing,
5210 { "Contact Referencing", "btsdp.service.pbap.pse.supported_features.contact_referencing",
5211 FT_BOOLEAN, 32, NULL, 0x00000100,
5212 NULL, HFILL }
5214 { &hf_pbap_pse_supported_features_x_bt_uid_vcard_property,
5215 { "X-BT-UID vCard Property", "btsdp.service.pbap.pse.supported_features.x_bt_uid_vcard_property",
5216 FT_BOOLEAN, 32, NULL, 0x00000080,
5217 NULL, HFILL }
5219 { &hf_pbap_pse_supported_features_x_bt_uci_vcard_property,
5220 { "X-BT-UCI vCard Property", "btsdp.service.pbap.pse.supported_features.x_bt_uci_vcard_property",
5221 FT_BOOLEAN, 32, NULL, 0x00000040,
5222 NULL, HFILL }
5224 { &hf_pbap_pse_supported_features_enhanced_missed_calls,
5225 { "Enhanced Missed Calls", "btsdp.service.pbap.pse.supported_features.enhanced_missed_calls",
5226 FT_BOOLEAN, 32, NULL, 0x00000020,
5227 NULL, HFILL }
5229 { &hf_pbap_pse_supported_features_vcard_selecting,
5230 { "vCard Selecting", "btsdp.service.pbap.pse.supported_features.vcard_selecting",
5231 FT_BOOLEAN, 32, NULL, 0x00000010,
5232 NULL, HFILL }
5234 { &hf_pbap_pse_supported_features_folder_version_counters,
5235 { "Folder Version Counters", "btsdp.service.pbap.pse.supported_features.folder_version_counters",
5236 FT_BOOLEAN, 32, NULL, 0x00000008,
5237 NULL, HFILL }
5239 { &hf_pbap_pse_supported_features_database_identifier,
5240 { "Database Identifier", "btsdp.service.pbap.pse.supported_features.database_identifier",
5241 FT_BOOLEAN, 32, NULL, 0x00000004,
5242 NULL, HFILL }
5244 { &hf_pbap_pse_supported_features_browsing,
5245 { "Browsing", "btsdp.service.pbap.pse.supported_features.browsing",
5246 FT_BOOLEAN, 32, NULL, 0x00000002,
5247 NULL, HFILL }
5249 { &hf_pbap_pse_supported_features_download,
5250 { "Download", "btsdp.service.pbap.pse.supported_features.download",
5251 FT_BOOLEAN, 32, NULL, 0x00000001,
5252 NULL, HFILL }
5254 { &hf_pbap_goep_l2cap_psm,
5255 { "GOEP L2CAP PSM", "btsdp.pbap.goep_l2cap_psm",
5256 FT_UINT16, BASE_DEC_HEX, NULL, 0,
5257 NULL, HFILL }
5259 { &hf_dun_support_audio_feedback,
5260 { "Support: Audio Feedback", "btsdp.dun.support.audio_feedback",
5261 FT_BOOLEAN, BASE_NONE, NULL, 0,
5262 NULL, HFILL }
5264 { &hf_dun_escape_sequence,
5265 { "Escape Sequence", "btsdp.dun.support.escape_sequence",
5266 FT_STRING, BASE_NONE, NULL, 0,
5267 NULL, HFILL }
5269 { &hf_fax_support_class_1,
5270 { "Support: Fax Class 1", "btsdp.fax.support.class_1",
5271 FT_BOOLEAN, BASE_NONE, NULL, 0,
5272 NULL, HFILL }
5274 { &hf_fax_support_class_2,
5275 { "Support: Fax Class 2.0", "btsdp.fax.support.class_2",
5276 FT_BOOLEAN, BASE_NONE, NULL, 0,
5277 NULL, HFILL }
5279 { &hf_fax_support_class_2_vendor,
5280 { "Support: Fax Class 2 Vendor", "btsdp.fax.support.class_2_vendor",
5281 FT_BOOLEAN, BASE_NONE, NULL, 0,
5282 NULL, HFILL }
5284 { &hf_fax_support_audio_feedback,
5285 { "Support: Audio Feedback", "btsdp.fax.support.audio_feedback",
5286 FT_BOOLEAN, BASE_NONE, NULL, 0,
5287 NULL, HFILL }
5289 { &hf_ftp_goep_l2cap_psm,
5290 { "GOEP L2CAP PSM", "btsdp.ftp.goep_l2cap_psm",
5291 FT_UINT16, BASE_DEC_HEX, NULL, 0,
5292 NULL, HFILL }
5294 { &hf_map_mas_instance_id,
5295 { "MAS Instance ID", "btsdp.map.mas.instance_id",
5296 FT_UINT8, BASE_DEC_HEX, NULL, 0,
5297 NULL, HFILL }
5299 { &hf_map_mas_goep_l2cap_psm,
5300 { "GOEP L2CAP PSM", "btsdp.map.mas.goep_l2cap_psm",
5301 FT_UINT16, BASE_DEC_HEX, NULL, 0,
5302 NULL, HFILL }
5304 { &hf_map_mns_goep_l2cap_psm,
5305 { "GOEP L2CAP PSM", "btsdp.map.mns.goep_l2cap_psm",
5306 FT_UINT16, BASE_DEC_HEX, NULL, 0,
5307 NULL, HFILL }
5309 { &hf_map_mas_supported_message_types_reserved,
5310 { "Supported Message Types: Reserved", "btsdp.map.mas.supported_message_types.reserved",
5311 FT_UINT8, BASE_DEC_HEX, NULL, 0xF0,
5312 NULL, HFILL }
5314 { &hf_map_mas_supported_message_types_mms,
5315 { "Supported Message Types: MMS", "btsdp.map.mas.supported_message_types.mms",
5316 FT_BOOLEAN, 8, NULL, 0x08,
5317 NULL, HFILL }
5319 { &hf_map_mas_supported_message_types_sms_cdma,
5320 { "Supported Message Types: SMS CDMA", "btsdp.map.mas.supported_message_types.sms_cdma",
5321 FT_BOOLEAN, 8, NULL, 0x04,
5322 NULL, HFILL }
5324 { &hf_map_mas_supported_message_types_sms_gsm,
5325 { "Supported Message Types: SMS GSM", "btsdp.map.mas.supported_message_types.sms_gsm",
5326 FT_BOOLEAN, 8, NULL, 0x02,
5327 NULL, HFILL }
5329 { &hf_map_mas_supported_message_types_email,
5330 { "Supported Message Types: Email", "btsdp.map.mas.supported_message_types.email",
5331 FT_BOOLEAN, 8, NULL, 0x01,
5332 NULL, HFILL }
5334 { &hf_hcrp_1284_id,
5335 { "1284 ID", "btsdp.hcrp.1284_id",
5336 FT_STRING, BASE_NONE, NULL, 0,
5337 NULL, HFILL }
5339 { &hf_hcrp_device_location,
5340 { "Service Location", "btsdp.hcrp.device_location",
5341 FT_STRING, BASE_NONE, NULL, 0,
5342 NULL, HFILL }
5344 { &hf_hcrp_device_name,
5345 { "Device Name", "btsdp.hcrp.device_name",
5346 FT_STRING, BASE_NONE, NULL, 0,
5347 NULL, HFILL }
5349 { &hf_hcrp_friendly_name,
5350 { "Friendly Name", "btsdp.hcrp.friendly_name",
5351 FT_STRING, BASE_NONE, NULL, 0,
5352 NULL, HFILL }
5354 { &hf_wap_network_address,
5355 { "Network Address", "btsdp.wap.network_address",
5356 FT_IPv4, BASE_NONE, NULL, 0,
5357 NULL, HFILL }
5359 { &hf_wap_homepage_url,
5360 { "Homepage URL", "btsdp.wap.homepage_url",
5361 FT_STRING, BASE_NONE, NULL, 0,
5362 NULL, HFILL }
5364 { &hf_wap_gateway,
5365 { "Gateway", "btsdp.wap.gateway",
5366 FT_UINT8, BASE_HEX, VALS(wap_gateway_vals), 0,
5367 NULL, HFILL }
5369 { &hf_wap_stack_type,
5370 { "Stack Type", "btsdp.wap.stack_type",
5371 FT_UINT8, BASE_HEX, VALS(wap_stack_type_vals), 0,
5372 NULL, HFILL }
5374 { &hf_hdp_support_procedure_reserved_5_7,
5375 { "Support: Reserved_5_7", "btsdp.hdp.support.reserved_5_7",
5376 FT_UINT8, BASE_HEX, NULL, 0xE0,
5377 NULL, HFILL }
5379 { &hf_hdp_support_procedure_sync_master_role,
5380 { "Support: SyncMaster Role", "btsdp.hdp.support.sync_master_role",
5381 FT_BOOLEAN, 8, NULL, 0x10,
5382 NULL, HFILL }
5384 { &hf_hdp_support_procedure_clock_synchronization_protocol,
5385 { "Support: Clock Synchronization Protocol", "btsdp.hdp.support.clock_synchronization_protocol",
5386 FT_BOOLEAN, 8, NULL, 0x08,
5387 NULL, HFILL }
5389 { &hf_hdp_support_procedure_reconnect_acceptance,
5390 { "Support: Reconnect Acceptance", "btsdp.hdp.support.reconnect_acceptance",
5391 FT_BOOLEAN, 8, NULL, 0x04,
5392 NULL, HFILL }
5394 { &hf_hdp_support_procedure_reconnect_initiation,
5395 { "Support: Reconnect Initiation", "btsdp.hdp.support.reconnect_initiation",
5396 FT_BOOLEAN, 8, NULL, 0x02,
5397 NULL, HFILL }
5399 { &hf_hdp_support_procedure_reserved,
5400 { "Support: Reserved", "btsdp.hdp.support.reserved",
5401 FT_BOOLEAN, 8, NULL, 0x01,
5402 NULL, HFILL }
5404 { &hf_hdp_data_exchange,
5405 { "Data Exchange Specification", "btsdp.hdp.data_exchange_specification",
5406 FT_UINT8, BASE_HEX, VALS(hdp_data_exchange_specification_vals), 0,
5407 NULL, HFILL }
5409 { &hf_hdp_supported_features_data,
5410 { "Supported Features", "btsdp.hdp.supported_features_data",
5411 FT_NONE, BASE_NONE, NULL, 0,
5412 NULL, HFILL }
5414 { &hf_hdp_supported_features_data_mdep_id,
5415 { "MDEP ID", "btsdp.hdp.supported_features_data.mdep_id",
5416 FT_NONE, BASE_NONE, NULL, 0,
5417 NULL, HFILL }
5419 { &hf_hdp_supported_features_data_mdep_data_type,
5420 { "MDEP Data Type", "btsdp.hdp.supported_features_data.mdep_data_type",
5421 FT_NONE, BASE_NONE, NULL, 0,
5422 NULL, HFILL }
5424 { &hf_hdp_supported_features_data_mdep_role,
5425 { "MDEP Role", "btsdp.hdp.supported_features_data.mdep_role",
5426 FT_NONE, BASE_NONE, NULL, 0,
5427 NULL, HFILL }
5429 { &hf_hdp_supported_features_data_mdep_description,
5430 { "MDEP Description", "btsdp.hdp.supported_features_data.mdep_description",
5431 FT_NONE, BASE_NONE, NULL, 0,
5432 NULL, HFILL }
5434 { &hf_hdp_supported_features_mdep_id,
5435 { "MDEP ID", "btsdp.hdp.supported_features.mdep_id",
5436 FT_UINT8, BASE_DEC_HEX|BASE_RANGE_STRING, RVALS(hdp_mdep_id_rvals), 0,
5437 NULL, HFILL }
5439 { &hf_hdp_supported_features_mdep_data_type_01,
5440 { "MDEP Data Type", "btsdp.hdp.supported_features.mdep_data_type",
5441 FT_UINT16, BASE_HEX, VALS(hdp_mdep_data_type_01_vals), 0,
5442 NULL, HFILL }
5444 { &hf_hdp_supported_features_mdep_data_type,
5445 { "MDEP Data Type", "btsdp.hdp.supported_features.mdep_data_type",
5446 FT_UINT16, BASE_HEX, NULL, 0,
5447 NULL, HFILL }
5449 { &hf_hdp_supported_features_mdep_role,
5450 { "MDEP Role", "btsdp.hdp.supported_features.mdep_role",
5451 FT_UINT8, BASE_HEX, VALS(hdp_mdep_role_vals), 0,
5452 NULL, HFILL }
5454 { &hf_hdp_supported_features_mdep_description,
5455 { "MDEP Description", "btsdp.hdp.supported_features.mdep_description",
5456 FT_STRING, BASE_NONE, NULL, 0,
5457 NULL, HFILL }
5459 { &hf_pan_sercurity_description,
5460 { "Security Description", "btsdp.pan.security_description",
5461 FT_UINT16, BASE_HEX, VALS(pan_security_description_vals), 0,
5462 NULL, HFILL }
5464 { &hf_pan_ipv4_subnet,
5465 { "IPv4 Subnet", "btsdp.pan.ipv4_subnet",
5466 FT_STRING, BASE_NONE, NULL, 0,
5467 NULL, HFILL }
5469 { &hf_pan_ipv6_subnet,
5470 { "IPv6 Subnet", "btsdp.pan.ipv6_subnet",
5471 FT_STRING, BASE_NONE, NULL, 0,
5472 NULL, HFILL }
5474 { &hf_pan_net_access_type,
5475 { "Net Access Type", "btsdp.pan.net_access_type",
5476 FT_UINT16, BASE_HEX, VALS(pan_net_access_type_vals), 0,
5477 NULL, HFILL }
5479 { &hf_pan_max_net_access_rate,
5480 { "Max Net Access Rate", "btsdp.pan.max_net_access_rate",
5481 FT_UINT32, BASE_DEC_HEX, NULL, 0,
5482 NULL, HFILL }
5484 { &hf_opp_goep_l2cap_psm,
5485 { "GOEP L2CAP PSM", "btsdp.opp.goep_l2cap_psm",
5486 FT_UINT16, BASE_DEC_HEX, NULL, 0,
5487 NULL, HFILL }
5489 { &hf_opp_supported_format,
5490 { "Supported Format", "btsdp.opp.supported_format",
5491 FT_UINT8, BASE_HEX, VALS(opp_supported_format_vals), 0,
5492 NULL, HFILL }
5494 { &hf_hfp_hf_supported_features_reserved,
5495 { "Supported Features: Reserved", "btsdp.service.hfp.hf.supported_features.reserved",
5496 FT_UINT16, BASE_HEX, NULL, 0xFFC0,
5497 NULL, HFILL }
5499 { &hf_hfp_hf_supported_features_wide_band_speech,
5500 { "Supported Features: Wide Band Speech", "btsdp.service.hfp.hf.supported_features.wide_band_speech",
5501 FT_BOOLEAN, 16, NULL, 0x0020,
5502 NULL, HFILL }
5504 { &hf_hfp_hf_supported_features_remote_volume_control,
5505 { "Supported Features: Remote Volume Control", "btsdp.service.hfp.hf.supported_features.remote_volume_control",
5506 FT_BOOLEAN, 16, NULL, 0x0010,
5507 NULL, HFILL }
5509 { &hf_hfp_hf_supported_features_voice_recognition_activation,
5510 { "Supported Features: Voice Recognition Activation", "btsdp.service.hfp.hf.supported_features.voice_recognition_activation",
5511 FT_BOOLEAN, 16, NULL, 0x0008,
5512 NULL, HFILL }
5514 { &hf_hfp_hf_supported_features_cli_presentation_capability,
5515 { "Supported Features: CLI Presentation Capability", "btsdp.service.hfp.hf.supported_features.cli_presentation_capability",
5516 FT_BOOLEAN, 16, NULL, 0x0004,
5517 NULL, HFILL }
5519 { &hf_hfp_hf_supported_features_call_waiting_or_three_way_calling,
5520 { "Supported Features: Call Waiting or Three Way Calling", "btsdp.service.hfp.hf.supported_features.call_waiting_or_three_way_calling",
5521 FT_BOOLEAN, 16, NULL, 0x0002,
5522 NULL, HFILL }
5524 { &hf_hfp_hf_supported_features_ec_and_or_nr_function,
5525 { "Supported Features: EC and/or Nr Function", "btsdp.service.hfp.hf.supported_features.ec_and_or_nr_function",
5526 FT_BOOLEAN, 16, NULL, 0x0001,
5527 NULL, HFILL }
5529 { &hf_hfp_gw_supported_features_reserved,
5530 { "Supported Features: Reserved", "btsdp.service.hfp.gw.supported_features.reserved",
5531 FT_UINT16, BASE_HEX, NULL, 0xFFC0,
5532 NULL, HFILL }
5534 { &hf_hfp_gw_supported_features_wide_band_speech,
5535 { "Supported Features: Wide Band Speech", "btsdp.service.hfp.gw.supported_features.wide_band_speech",
5536 FT_BOOLEAN, 16, NULL, 0x0020,
5537 NULL, HFILL }
5539 { &hf_hfp_gw_supported_features_attach_phone_number_to_voice_tag,
5540 { "Supported Features: Attach a Phone Number to a Voice Tag", "btsdp.service.hfp.gw.supported_features.attach_a_phone_number_to_a_voice_tag",
5541 FT_BOOLEAN, 16, NULL, 0x0010,
5542 NULL, HFILL }
5544 { &hf_hfp_gw_supported_features_inband_ring_tone_capability,
5545 { "Supported Features: Inband Ring Tone Capability", "btsdp.service.hfp.gw.supported_features.inband_ring_tone_capability",
5546 FT_BOOLEAN, 16, NULL, 0x0008,
5547 NULL, HFILL }
5549 { &hf_hfp_gw_supported_features_voice_recognition_function,
5550 { "Supported Features: Voice Recognition Function", "btsdp.service.hfp.gw.supported_features.voice_recognition_function",
5551 FT_BOOLEAN, 16, NULL, 0x0004,
5552 NULL, HFILL }
5554 { &hf_hfp_gw_supported_features_ec_and_or_nr_function,
5555 { "Supported Features: EC and/or Nr Function", "btsdp.service.hfp.gw.supported_features.ec_and_or_nr_function",
5556 FT_BOOLEAN, 16, NULL, 0x0002,
5557 NULL, HFILL }
5559 { &hf_hfp_gw_supported_features_three_way_calling,
5560 { "Supported Features: Three Way Calling", "btsdp.service.hfp.gw.supported_features.three_way_calling",
5561 FT_BOOLEAN, 16, NULL, 0x0001,
5562 NULL, HFILL }
5564 { &hf_hfp_gw_network,
5565 { "Network", "btsdp.service.hfp.gw.network",
5566 FT_UINT8, BASE_HEX, VALS(hfp_gw_network_vals), 0,
5567 NULL, HFILL }
5569 { &hf_ctn_instance_id,
5570 { "Instance ID", "btsdp.ctn.instance_id",
5571 FT_UINT8, BASE_DEC_HEX, NULL, 0,
5572 NULL, HFILL }
5574 { &hf_ctn_supported_features,
5575 { "Supported Features", "btsdp.ctn.supported_features",
5576 FT_UINT32, BASE_HEX, NULL, 0,
5577 NULL, HFILL }
5579 { &hf_ctn_supported_features_reserved,
5580 { "Reserved", "btsdp.ctn.supported_features.reserved",
5581 FT_BOOLEAN, 32, NULL, 0xFFFFFF80,
5582 NULL, HFILL }
5584 { &hf_ctn_supported_features_forward,
5585 { "Forward", "btsdp.ctn.supported_features.forward",
5586 FT_BOOLEAN, 32, NULL, 0x00000040,
5587 NULL, HFILL }
5589 { &hf_ctn_supported_features_delete,
5590 { "Delete", "btsdp.ctn.supported_features.delete",
5591 FT_BOOLEAN, 32, NULL, 0x00000020,
5592 NULL, HFILL }
5594 { &hf_ctn_supported_features_uploading,
5595 { "Uploading", "btsdp.ctn.supported_features.uploading",
5596 FT_BOOLEAN, 32, NULL, 0x00000010,
5597 NULL, HFILL }
5599 { &hf_ctn_supported_features_downloading,
5600 { "Downloading", "btsdp.ctn.supported_features.downloading",
5601 FT_BOOLEAN, 32, NULL, 0x00000008,
5602 NULL, HFILL }
5604 { &hf_ctn_supported_features_browsing,
5605 { "Browsing", "btsdp.ctn.supported_features.browsing",
5606 FT_BOOLEAN, 32, NULL, 0x00000004,
5607 NULL, HFILL }
5609 { &hf_ctn_supported_features_notification,
5610 { "Notification", "btsdp.ctn.supported_features.notification",
5611 FT_BOOLEAN, 32, NULL, 0x00000002,
5612 NULL, HFILL }
5614 { &hf_ctn_supported_features_account_management,
5615 { "Account Management", "btsdp.ctn.supported_features.account_management",
5616 FT_BOOLEAN, 32, NULL, 0x00000001,
5617 NULL, HFILL }
5619 { &hf_mps_mpsd_scenarios,
5620 { "Supported Profile and Protocol Dependency", "btsdp.mps.mpsd_scenarios",
5621 FT_UINT64, BASE_HEX, NULL, 0,
5622 NULL, HFILL }
5624 { &hf_mps_mpsd_scenarios_reserved,
5625 { "Reserved", "btsdp.mps.mpsd_scenarios.reserved",
5626 FT_UINT64, BASE_HEX, NULL, UINT64_C(0xFFFFFFC000000000),
5627 NULL, HFILL }
5629 { &hf_mps_mpsd_scenarios_37,
5630 { "Phonebook Download during Audio Streaming (A2DP-SNK_PBAP-Client)", "btsdp.mps.mpsd_scenarios.37",
5631 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000002000000000),
5632 NULL, HFILL }
5634 { &hf_mps_mpsd_scenarios_36,
5635 { "Phonebook Download during Audio Streaming (A2DP-SRC_PBAP-Server)", "btsdp.mps.mpsd_scenarios.36",
5636 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000001000000000),
5637 NULL, HFILL }
5639 { &hf_mps_mpsd_scenarios_35,
5640 { "Data communication establishment in Personal Area Network during Audio Streaming (A2DP-SNK_PAN_PANU)", "btsdp.mps.mpsd_scenarios.35",
5641 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000800000000),
5642 NULL, HFILL }
5644 { &hf_mps_mpsd_scenarios_34,
5645 { "Data communication establishment in Personal Area Network during Audio Streaming (A2DP-SRC_PAN-NAP)", "btsdp.mps.mpsd_scenarios.34",
5646 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000400000000),
5647 NULL, HFILL }
5649 { &hf_mps_mpsd_scenarios_33,
5650 { "Start Audio Streaming during Data communication in Personal Area Network (A2DP-SNK_PAN-PANU)", "btsdp.mps.mpsd_scenarios.33",
5651 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000200000000),
5652 NULL, HFILL }
5654 { &hf_mps_mpsd_scenarios_32,
5655 { "Start Audio Streaming during Data communication in Personal Area Network (A2DP-SRC_PAN-NAP)", "btsdp.mps.mpsd_scenarios.32",
5656 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000100000000),
5657 NULL, HFILL }
5659 { &hf_mps_mpsd_scenarios_31,
5660 { "Incoming voice call during Data communication in Personal Area Network (HFP-HF_PAN-PANU)", "btsdp.mps.mpsd_scenarios.31",
5661 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000080000000),
5662 NULL, HFILL }
5664 { &hf_mps_mpsd_scenarios_30,
5665 { "Incoming voice call during Data communication in Personal Area Network (HFP-AG_PAN-NAP)", "btsdp.mps.mpsd_scenarios.30",
5666 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000040000000),
5667 NULL, HFILL }
5669 { &hf_mps_mpsd_scenarios_29,
5670 { "Outgoing voice call during Data communication in Personal Area Network (HFP-HF_PAN-PANU)", "btsdp.mps.mpsd_scenarios.29",
5671 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000020000000),
5672 NULL, HFILL }
5674 { &hf_mps_mpsd_scenarios_28,
5675 { "Outgoing voice call during Data communication in Personal Area Network (HFP-AG_PAN-NAP)", "btsdp.mps.mpsd_scenarios.28",
5676 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000010000000),
5677 NULL, HFILL }
5679 { &hf_mps_mpsd_scenarios_27,
5680 { "Data communication in Personal Area Network during active voice call (HFP-HF_PAN-PANU)", "btsdp.mps.mpsd_scenarios.27",
5681 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000008000000),
5682 NULL, HFILL }
5684 { &hf_mps_mpsd_scenarios_26,
5685 { "Data communication in Personal Area Network during active voice call (HFP-AG_PAN-NAP)", "btsdp.mps.mpsd_scenarios.26",
5686 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000004000000),
5687 NULL, HFILL }
5689 { &hf_mps_mpsd_scenarios_25,
5690 { "Terminate voice call / data call during data communication and voice call (HFP-HF_DUN-DT)", "btsdp.mps.mpsd_scenarios.25",
5691 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000002000000),
5692 NULL, HFILL }
5694 { &hf_mps_mpsd_scenarios_24,
5695 { "Terminate voice call / data call during data communication and voice call (HFP-AG_DUN-GW)", "btsdp.mps.mpsd_scenarios.24",
5696 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000001000000),
5697 NULL, HFILL }
5699 { &hf_mps_mpsd_scenarios_23,
5700 { "Data communication establishment under PSDM (DUN) during Audio Streaming (A2DP-SNK_DUN-DT)", "btsdp.mps.mpsd_scenarios.23",
5701 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000800000),
5702 NULL, HFILL }
5704 { &hf_mps_mpsd_scenarios_22,
5705 { "Data communication establishment under PSDM (DUN) during Audio Streaming (A2DP-SRC_DUN-GW)", "btsdp.mps.mpsd_scenarios.22",
5706 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000400000),
5707 NULL, HFILL }
5709 { &hf_mps_mpsd_scenarios_21,
5710 { "Start Audio Streaming during Data communication under PSDM (DUN) (A2DP-SNK_DUN-DT)", "btsdp.mps.mpsd_scenarios.21",
5711 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000200000),
5712 NULL, HFILL }
5714 { &hf_mps_mpsd_scenarios_20,
5715 { "Start Audio Streaming during Data communication under PSDM (DUN) (A2DP-SRC_DUN-GW)", "btsdp.mps.mpsd_scenarios.20",
5716 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000100000),
5717 NULL, HFILL }
5719 { &hf_mps_mpsd_scenarios_19,
5720 { "Incoming voice call during Data communication under PSDM (DUN) (HFP-HF_DUN-DT)", "btsdp.mps.mpsd_scenarios.19",
5721 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000080000),
5722 NULL, HFILL }
5724 { &hf_mps_mpsd_scenarios_18,
5725 { "Incoming voice call during Data communication under PSDM (DUN) (HFP-AG_DUN-GW)", "btsdp.mps.mpsd_scenarios.18",
5726 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000040000),
5727 NULL, HFILL }
5729 { &hf_mps_mpsd_scenarios_17,
5730 { "Outgoing voice call during Data communication under PSDM (DUN) (HFP-HF_DUN-DT)", "btsdp.mps.mpsd_scenarios.17",
5731 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000020000),
5732 NULL, HFILL }
5734 { &hf_mps_mpsd_scenarios_16,
5735 { "Outgoing voice call during Data communication under PSDM (DUN) (HFP-AG_DUN-GW)", "btsdp.mps.mpsd_scenarios.16",
5736 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000010000),
5737 NULL, HFILL }
5739 { &hf_mps_mpsd_scenarios_15,
5740 { "Data communication under PSDM (DUN) during active voice call (HFP-HF_DUN-DT)", "btsdp.mps.mpsd_scenarios.15",
5741 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000008000),
5742 NULL, HFILL }
5744 { &hf_mps_mpsd_scenarios_14,
5745 { "Data communication under PSDM (DUN) during active voice call (HFP-AG_DUN-GW)", "btsdp.mps.mpsd_scenarios.14",
5746 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000004000),
5747 NULL, HFILL }
5749 { &hf_mps_mpsd_scenarios_13,
5750 { "Suspend Audio Streaming after AVRCP Pause/Stop (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.13",
5751 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000002000),
5752 NULL, HFILL }
5754 { &hf_mps_mpsd_scenarios_12,
5755 { "Suspend Audio Streaming after AVRCP Pause/Stop (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.12",
5756 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000001000),
5757 NULL, HFILL }
5759 { &hf_mps_mpsd_scenarios_11,
5760 { "Start Audio Streaming after AVRCP Play Command (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.11",
5761 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000800),
5762 NULL, HFILL }
5764 { &hf_mps_mpsd_scenarios_10,
5765 { "Start Audio Streaming after AVRCP Play Command (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.10",
5766 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000400),
5767 NULL, HFILL }
5769 { &hf_mps_mpsd_scenarios_9,
5770 { "Press Play on Audio Player during active call (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.9",
5771 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000200),
5772 NULL, HFILL }
5774 { &hf_mps_mpsd_scenarios_8,
5775 { "Press Play on Audio Player during active call (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.8",
5776 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000100),
5777 NULL, HFILL }
5779 { &hf_mps_mpsd_scenarios_7,
5780 { "HFP call termination during AVP connection (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.7",
5781 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000080),
5782 NULL, HFILL }
5784 { &hf_mps_mpsd_scenarios_6,
5785 { "HFP call termination during AVP connection (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.6",
5786 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000040),
5787 NULL, HFILL }
5789 { &hf_mps_mpsd_scenarios_5,
5790 { "Reject/Ignore Incoming Call during Audio Streaming (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.5",
5791 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000020),
5792 NULL, HFILL }
5794 { &hf_mps_mpsd_scenarios_4,
5795 { "Reject/Ignore Incoming Call during Audio Streaming (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.4",
5796 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000010),
5797 NULL, HFILL }
5799 { &hf_mps_mpsd_scenarios_3,
5800 { "Outgoing Call during Audio Streaming (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.3",
5801 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000008),
5802 NULL, HFILL }
5804 { &hf_mps_mpsd_scenarios_2,
5805 { "Outgoing Call during Audio Streaming (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.2",
5806 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000004),
5807 NULL, HFILL }
5809 { &hf_mps_mpsd_scenarios_1,
5810 { "Answer Incoming Call during Audio Streaming (HFP-HF_A2DP-SNK)", "btsdp.mps.mpsd_scenarios.1",
5811 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000002),
5812 NULL, HFILL }
5814 { &hf_mps_mpsd_scenarios_0,
5815 { "Answer Incoming Call during Audio Streaming (HFP-AG_A2DP-SRC)", "btsdp.mps.mpsd_scenarios.0",
5816 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000001),
5817 NULL, HFILL }
5819 { &hf_mps_mpmd_scenarios,
5820 { "Supported Profile and Protocol Dependency", "btsdp.mps.mpmd_scenarios",
5821 FT_UINT64, BASE_HEX, NULL, 0,
5822 NULL, HFILL }
5824 { &hf_mps_mpmd_scenarios_reserved,
5825 { "Reserved", "btsdp.mps.mpmd_scenarios.reserved",
5826 FT_UINT64, BASE_HEX, NULL, UINT64_C(0xFFFFFFFFFFF80000),
5827 NULL, HFILL }
5829 { &hf_mps_mpmd_scenarios_18,
5830 { "Start Packet data communication during Audio streaming (A2DP-SNK_AVRCP-CT_DUN-DT)", "btsdp.mps.mpmd_scenarios.18",
5831 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000040000),
5832 NULL, HFILL }
5834 { &hf_mps_mpmd_scenarios_17,
5835 { "Start Packet data communication during Audio streaming (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.17",
5836 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000020000),
5837 NULL, HFILL }
5839 { &hf_mps_mpmd_scenarios_16,
5840 { "Start Audio streaming during Data communication under PSDM (A2DP-SNK_AVRCP-CT_DUN-DT)", "btsdp.mps.mpmd_scenarios.16",
5841 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000010000),
5842 NULL, HFILL }
5844 { &hf_mps_mpmd_scenarios_15,
5845 { "Start Audio streaming during Data communication under PSDM (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.15",
5846 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000008000),
5847 NULL, HFILL }
5849 { &hf_mps_mpmd_scenarios_14,
5850 { "Suspend Audio Streaming after AVRCP Pause/Stop (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.14",
5851 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000004000),
5852 NULL, HFILL }
5854 { &hf_mps_mpmd_scenarios_13,
5855 { "Suspend Audio Streaming after AVRCP Pause/Stop (AVRCP-CT where the same device does not carry out the role of an A2DP SNK)", "btsdp.mps.mpmd_scenarios.13",
5856 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000002000),
5857 NULL, HFILL }
5859 { &hf_mps_mpmd_scenarios_12,
5860 { "Start Audio Streaming after AVRCP Play Command (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.12",
5861 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000001000),
5862 NULL, HFILL }
5864 { &hf_mps_mpmd_scenarios_11,
5865 { "Start Audio Streaming after AVRCP Play Command (AVRCP-CT where the same device does not carry out the role of an A2DP SNK)", "btsdp.mps.mpmd_scenarios.11",
5866 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000800),
5867 NULL, HFILL }
5869 { &hf_mps_mpmd_scenarios_10,
5870 { "Press Play on Audio Player during active call (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.10",
5871 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000400),
5872 NULL, HFILL }
5874 { &hf_mps_mpmd_scenarios_9,
5875 { "Press Play on Audio Player during active call (HFP-HF_A2DP-SNK_AVRCP-CT)", "btsdp.mps.mpmd_scenarios.9",
5876 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000200),
5877 NULL, HFILL }
5879 { &hf_mps_mpmd_scenarios_8,
5880 { "HFP Call termination during AVP connection (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.8",
5881 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000100),
5882 NULL, HFILL }
5884 { &hf_mps_mpmd_scenarios_7,
5885 { "HFP Call termination during AVP connection (HFP-HF_ A2DP-SNK_AVRCP-CT)", "btsdp.mps.mpmd_scenarios.7",
5886 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000080),
5887 NULL, HFILL }
5889 { &hf_mps_mpmd_scenarios_6,
5890 { "HFP Call termination during AVP connection (HFP-AG)", "btsdp.mps.mpmd_scenarios.6",
5891 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000040),
5892 NULL, HFILL }
5894 { &hf_mps_mpmd_scenarios_5,
5895 { "Reject/Ignore Incoming Call during Audio Streaming (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.5",
5896 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000020),
5897 NULL, HFILL }
5899 { &hf_mps_mpmd_scenarios_4,
5900 { "Reject/Ignore Incoming Call during Audio Streaming (HFP-HF_A2DP-SNK_AVRCP-CT)", "btsdp.mps.mpmd_scenarios.4",
5901 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000010),
5902 NULL, HFILL }
5904 { &hf_mps_mpmd_scenarios_3,
5905 { "Outgoing Call during Audio Streaming (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.3",
5906 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000008),
5907 NULL, HFILL }
5909 { &hf_mps_mpmd_scenarios_2,
5910 { "Outgoing Call during Audio Streaming (HFP-HF_A2DP-SNK_AVRCP-CT)", "btsdp.mps.mpmd_scenarios.2",
5911 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000004),
5912 NULL, HFILL }
5914 { &hf_mps_mpmd_scenarios_1,
5915 { "Answer Incoming Call during Audio Streaming (A2DP-SRC_AVRCP-TG)", "btsdp.mps.mpmd_scenarios.1",
5916 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000002),
5917 NULL, HFILL }
5919 { &hf_mps_mpmd_scenarios_0,
5920 { "Answer Incoming Call during Audio Streaming (HFP-HF_A2DP-SNK_AVRCP-CT)", "btsdp.mps.mpmd_scenarios.0",
5921 FT_BOOLEAN, 64, NULL, UINT64_C(0x0000000000000001),
5922 NULL, HFILL }
5924 { &hf_mps_supported_profile_and_protocol_dependency,
5925 { "Supported Profile and Protocol Dependency", "btsdp.mps.supported_profile_and_protocol_dependency",
5926 FT_UINT16, BASE_HEX, NULL, 0,
5927 NULL, HFILL }
5929 { &hf_mps_supported_profile_and_protocol_dependency_reserved,
5930 { "Reserved", "btsdp.mps.supported_profile_and_protocol_dependency.reserved",
5931 FT_UINT16, BASE_HEX, NULL, 0xFFF8,
5932 NULL, HFILL }
5934 { &hf_mps_supported_profile_and_protocol_dependency_dis_connection_order_behaviour,
5935 { "(Dis)Connection Order/Behaviour", "btsdp.mps.supported_profile_and_protocol_dependency.dis_connection_order_behaviour",
5936 FT_BOOLEAN, 16, NULL, 0x0004,
5937 NULL, HFILL }
5939 { &hf_mps_supported_profile_and_protocol_dependency_gavdp_requirements,
5940 { "GAVDP Requirements", "btsdp.mps.supported_profile_and_protocol_dependency.gavdp_requirements",
5941 FT_BOOLEAN, 16, NULL, 0x0002,
5942 NULL, HFILL }
5944 { &hf_mps_supported_profile_and_protocol_dependency_sniff_mode_during_streaming,
5945 { "Sniff Mode During Streaming", "btsdp.mps.supported_profile_and_protocol_dependency.sniff_mode_during_streaming",
5946 FT_BOOLEAN, 16, NULL, 0x0001,
5947 NULL, HFILL }
5949 { &hf_map_supported_features,
5950 { "Supported Features", "btsdp.map.supported_features",
5951 FT_UINT32, BASE_HEX, NULL, 0x0,
5952 NULL, HFILL }
5954 { &hf_map_supported_features_reserved,
5955 { "Reserved", "btsdp.map.supported_features.reserved",
5956 FT_UINT32, BASE_HEX, NULL, 0xFFFFFF80,
5957 NULL, HFILL }
5959 { &hf_map_supported_features_extended_event_report_1_1,
5960 { "Extended Event Report 1.1", "btsdp.map.supported_features.extended_event_report_1_1",
5961 FT_BOOLEAN, 32, NULL, 0x00000040,
5962 NULL, HFILL }
5964 { &hf_map_supported_features_instance_information_feature,
5965 { "Instance Information Feature", "btsdp.map.supported_features.instance_information_feature",
5966 FT_BOOLEAN, 32, NULL, 0x00000020,
5967 NULL, HFILL }
5969 { &hf_map_supported_features_delete_feature,
5970 { "Delete Feature", "btsdp.map.supported_features.delete_feature",
5971 FT_BOOLEAN, 32, NULL, 0x00000010,
5972 NULL, HFILL }
5974 { &hf_map_supported_features_uploading_feature,
5975 { "Uploading Feature", "btsdp.map.supported_features.uploading_feature",
5976 FT_BOOLEAN, 32, NULL, 0x00000008,
5977 NULL, HFILL }
5979 { &hf_map_supported_features_browsing_feature,
5980 { "Browsing Feature", "btsdp.map.supported_features.browsing_feature",
5981 FT_BOOLEAN, 32, NULL, 0x00000004,
5982 NULL, HFILL }
5984 { &hf_map_supported_features_notification_feature,
5985 { "Notification Feature", "btsdp.map.supported_features.notification_feature",
5986 FT_BOOLEAN, 32, NULL, 0x00000002,
5987 NULL, HFILL }
5989 { &hf_map_supported_features_notification_registration_feature,
5990 { "Notification Registration Feature", "btsdp.map.supported_features.notification_registration_feature",
5991 FT_BOOLEAN, 32, NULL, 0x00000001,
5992 NULL, HFILL }
5994 { &hf_sdp_protocol_item,
5995 { "Protocol", "btsdp.protocol_item",
5996 FT_NONE, BASE_NONE, NULL, 0,
5997 NULL, HFILL }
5999 { &hf_sdp_protocol,
6000 { "Protocol Entry", "btsdp.protocol",
6001 FT_NONE, BASE_NONE, NULL, 0,
6002 NULL, HFILL }
6004 { &hf_sdp_protocol_psm,
6005 { "L2CAP PSM", "btsdp.protocol.psm",
6006 FT_UINT16, BASE_DEC_HEX | BASE_EXT_STRING, &ext_psm_vals, 0,
6007 NULL, HFILL }
6009 { &hf_sdp_protocol_channel,
6010 { "RFCOMM Channel", "btsdp.protocol.channel",
6011 FT_UINT8, BASE_DEC_HEX, NULL, 0,
6012 NULL, HFILL }
6014 { &hf_sdp_protocol_gatt_handle_start,
6015 { "GATT Handle Start", "btsdp.protocol.gatt_handle_start",
6016 FT_UINT16, BASE_HEX, NULL, 0,
6017 NULL, HFILL }
6019 { &hf_sdp_protocol_gatt_handle_end,
6020 { "GATT Handle Start", "btsdp.protocol.gatt_handle_end",
6021 FT_UINT16, BASE_HEX, NULL, 0,
6022 NULL, HFILL }
6024 { &hf_sdp_protocol_version,
6025 { "Protocol Version", "btsdp.protocol.version",
6026 FT_UINT16, BASE_HEX, NULL, 0,
6027 NULL, HFILL }
6029 { &hf_sdp_protocol_bnep_type,
6030 { "BNEP Type", "btsdp.protocol.bnep_type",
6031 FT_UINT16, BASE_HEX, VALS(etype_vals), 0,
6032 NULL, HFILL }
6034 { &hf_sdp_service_record_handle,
6035 { "Service Record Handle", "btsdp.service_record_handle",
6036 FT_UINT32, BASE_HEX, NULL, 0,
6037 NULL, HFILL }
6039 { &hf_sdp_service_record_state,
6040 { "Service Record State", "btsdp.service_record_state",
6041 FT_UINT32, BASE_HEX_DEC, NULL, 0,
6042 NULL, HFILL }
6045 { &hf_sdp_service_info_time_to_live,
6046 { "Service Info Time to Live", "btsdp.service_info_time_to_live",
6047 FT_UINT32, BASE_DEC_HEX, NULL, 0,
6048 NULL, HFILL }
6050 { &hf_sdp_service_availability,
6051 { "Service Availability", "btsdp.service_availability",
6052 FT_UINT8, BASE_HEX, NULL, 0,
6053 NULL, HFILL }
6055 { &hf_sdp_service_documentation_url,
6056 { "Documentation URL", "btsdp.documentation_url",
6057 FT_STRING, BASE_NONE, NULL, 0,
6058 NULL, HFILL }
6060 { &hf_sdp_service_client_executable_url,
6061 { "Service Client Executable URL", "btsdp.service_client_executable_url",
6062 FT_STRING, BASE_NONE, NULL, 0,
6063 NULL, HFILL }
6065 { &hf_sdp_service_icon_url,
6066 { "Icon URL", "btsdp.icon_url",
6067 FT_STRING, BASE_NONE, NULL, 0,
6068 NULL, HFILL }
6070 { &hf_sdp_service_name,
6071 { "Service Name", "btsdp.service_name",
6072 FT_STRING, BASE_NONE, NULL, 0,
6073 NULL, HFILL }
6075 { &hf_sdp_service_description,
6076 { "Service Description", "btsdp.service_description",
6077 FT_STRING, BASE_NONE, NULL, 0,
6078 NULL, HFILL }
6080 { &hf_sdp_service_provider_name,
6081 { "Provider Name", "btsdp.provider_name",
6082 FT_STRING, BASE_NONE, NULL, 0,
6083 NULL, HFILL }
6085 { &hf_sdp_lang,
6086 { "Language", "btsdp.lang",
6087 FT_NONE, BASE_NONE, NULL, 0,
6088 NULL, HFILL }
6090 { &hf_sdp_lang_code,
6091 { "Language Code", "btsdp.lang.code",
6092 FT_STRING, BASE_NONE, NULL, 0,
6093 NULL, HFILL }
6095 { &hf_sdp_lang_id,
6096 { "Language ID", "btsdp.lang.id",
6097 FT_UINT16, BASE_HEX | BASE_EXT_STRING, &usb_langid_vals_ext, 0,
6098 NULL, HFILL }
6100 { &hf_sdp_lang_encoding,
6101 { "Language Encoding", "btsdp.lang.encoding",
6102 FT_UINT16, BASE_DEC | BASE_EXT_STRING, &mibenum_vals_character_sets_ext, 0,
6103 NULL, HFILL }
6105 { &hf_sdp_lang_attribute_base,
6106 { "Attribute Base", "btsdp.lang.attribute_base",
6107 FT_UINT16, BASE_HEX, NULL, 0,
6108 NULL, HFILL }
6110 { &hf_hid_device_release_number,
6111 { "Device Release Number", "btsdp.service.hid.device_release_number",
6112 FT_UINT16, BASE_HEX, NULL, 0,
6113 NULL, HFILL }
6115 { &hf_hid_parser_version,
6116 { "Parser Version", "btsdp.service.hid.parser_version",
6117 FT_UINT16, BASE_HEX, NULL, 0,
6118 NULL, HFILL }
6120 { &hf_hid_device_subclass_type,
6121 { "Device Subclass: Type", "btsdp.service.hid.device_subclass.type",
6122 FT_UINT8, BASE_HEX, VALS(hid_device_subclass_type_vals), 0xC0,
6123 NULL, HFILL }
6125 { &hf_hid_device_subclass_subtype,
6126 { "Device Subclass: SubType", "btsdp.service.hid.device_subclass.subtype",
6127 FT_UINT8, BASE_HEX, VALS(hid_device_subclass_subtype_vals), 0x3C,
6128 NULL, HFILL }
6130 { &hf_hid_device_subclass_reserved,
6131 { "Device Subclass: Reserved", "btsdp.service.hid.device_subclass.reserved",
6132 FT_UINT8, BASE_HEX, NULL, 0x03,
6133 NULL, HFILL }
6135 { &hf_hid_country_code,
6136 { "Country Code", "btsdp.service.hid.country_code",
6137 FT_UINT8, BASE_DEC_HEX, VALS(hid_country_code_vals), 0,
6138 NULL, HFILL }
6140 { &hf_hid_virtual_cable,
6141 { "Virtual Cable", "btsdp.service.hid.virtual_cable",
6142 FT_BOOLEAN, BASE_NONE, NULL, 0,
6143 NULL, HFILL }
6145 { &hf_hid_reconnect_initiate,
6146 { "Reconnect Initiate", "btsdp.service.hid.reconnect_initiate",
6147 FT_BOOLEAN, BASE_NONE, NULL, 0,
6148 NULL, HFILL }
6150 { &hf_hid_sdp_disable,
6151 { "SDP Disable", "btsdp.service.hid.sdp_disable",
6152 FT_BOOLEAN, BASE_NONE, NULL, 0,
6153 NULL, HFILL }
6155 { &hf_hid_battery_power,
6156 { "Battery Power", "btsdp.service.hid.battery_power",
6157 FT_BOOLEAN, BASE_NONE, NULL, 0,
6158 NULL, HFILL }
6160 { &hf_hid_remote_wake,
6161 { "Remote Wake", "btsdp.service.hid.remote_wake",
6162 FT_BOOLEAN, BASE_NONE, NULL, 0,
6163 NULL, HFILL }
6165 { &hf_hid_normally_connectable,
6166 { "Normally Connectable", "btsdp.service.hid.normally_connectable",
6167 FT_BOOLEAN, BASE_NONE, NULL, 0,
6168 NULL, HFILL }
6170 { &hf_hid_boot_device,
6171 { "Boot Device", "btsdp.service.hid.boot_device",
6172 FT_BOOLEAN, BASE_NONE, NULL, 0,
6173 NULL, HFILL }
6175 { &hf_hid_profile_version,
6176 { "Profile Version", "btsdp.service.hid.profile_version",
6177 FT_UINT16, BASE_HEX, NULL, 0,
6178 NULL, HFILL }
6180 { &hf_hid_supervision_timeout,
6181 { "Supervision Timeout", "btsdp.service.hid.supervision_timeout",
6182 FT_UINT16, BASE_DEC, NULL, 0,
6183 NULL, HFILL }
6185 { &hf_hid_ssr_host_max_latency,
6186 { "SSR Host Max Latency", "btsdp.service.hid.ssr_host_max_latency",
6187 FT_UINT16, BASE_DEC, NULL, 0,
6188 NULL, HFILL }
6190 { &hf_hid_ssr_host_min_timeout,
6191 { "SSR Host Min Timeout", "btsdp.service.hid.ssr_host_min_timeout",
6192 FT_UINT16, BASE_DEC, NULL, 0,
6193 NULL, HFILL }
6195 { &hf_hid_descriptor_list_type,
6196 { "Descriptor Type", "btsdp.service.hid.descriptor.type",
6197 FT_UINT8, BASE_HEX, VALS(descriptor_list_type_vals), 0,
6198 NULL, HFILL }
6200 { &hf_hid_lang,
6201 { "Language", "btsdp.service.hid.lang",
6202 FT_NONE, BASE_NONE, NULL, 0,
6203 NULL, HFILL }
6205 { &hf_hid_descriptor_list_descriptor_data,
6206 { "Descriptor", "btsdp.service.hid.descriptor_list.descriptor_data",
6207 FT_NONE, BASE_NONE, NULL, 0,
6208 NULL, HFILL }
6210 { &hf_hid_descriptor_list_descriptor,
6211 { "Descriptor", "btsdp.service.hid.descriptor_list.descriptor",
6212 FT_BYTES, BASE_NONE, NULL, 0,
6213 NULL, HFILL }
6215 { &hf_bip_supported_capabilities_reserved_4_7,
6216 { "Supported Capabilities: Reserved", "btsdp.service.bip.supported_capabilities.reserved",
6217 FT_UINT8, BASE_HEX, NULL, 0xF0,
6218 NULL, HFILL }
6220 { &hf_bip_supported_capabilities_displaying,
6221 { "Supported Capabilities: Displaying", "btsdp.service.bip.supported_capabilities.displaying",
6222 FT_BOOLEAN, 8, NULL, 0x08,
6223 NULL, HFILL }
6225 { &hf_bip_supported_capabilities_printing,
6226 { "Supported Capabilities: Printing", "btsdp.service.bip.supported_capabilities.printing",
6227 FT_BOOLEAN, 8, NULL, 0x04,
6228 NULL, HFILL }
6230 { &hf_bip_supported_capabilities_capturing,
6231 { "Supported Capabilities: Capturing", "btsdp.service.bip.supported_capabilities.capturing",
6232 FT_BOOLEAN, 8, NULL, 0x02,
6233 NULL, HFILL }
6235 { &hf_bip_supported_capabilities_genering_imaging,
6236 { "Supported Capabilities: Genering Imaging", "btsdp.service.bip.supported_capabilities.genering_imaging",
6237 FT_BOOLEAN, 8, NULL, 0x01,
6238 NULL, HFILL }
6240 { &hf_bip_supported_features_reserved_9_15,
6241 { "Supported Features: Reserved", "btsdp.service.bip.supported_features.reserved",
6242 FT_UINT16, BASE_HEX, NULL, 0xFE00,
6243 NULL, HFILL }
6245 { &hf_bip_supported_features_remote_display,
6246 { "Supported Features: Remote Display", "btsdp.service.bip.supported_features.remote_display",
6247 FT_BOOLEAN, 16, NULL, 0x0100,
6248 NULL, HFILL }
6250 { &hf_bip_supported_features_remote_camera,
6251 { "Supported Features: Remote Camera", "btsdp.service.bip.supported_features.remote_camera",
6252 FT_BOOLEAN, 16, NULL, 0x0080,
6253 NULL, HFILL }
6255 { &hf_bip_supported_features_automatic_archive,
6256 { "Supported Features: Automatic Archive", "btsdp.service.bip.supported_features.automatic_archive",
6257 FT_BOOLEAN, 16, NULL, 0x0040,
6258 NULL, HFILL }
6260 { &hf_bip_supported_features_advanced_image_printing,
6261 { "Supported Features: Advanced Image Printing","btsdp.service.bip.supported_features.advanced_image_printing",
6262 FT_BOOLEAN, 16, NULL, 0x0020,
6263 NULL, HFILL }
6265 { &hf_bip_supported_features_image_pull,
6266 { "Supported Features: Image Pull", "btsdp.service.bip.supported_features.image_pull",
6267 FT_BOOLEAN, 16, NULL, 0x0010,
6268 NULL, HFILL }
6270 { &hf_bip_supported_features_image_push_display,
6271 { "Supported Features: Image Push Display", "btsdp.service.bip.supported_features.image_push_display",
6272 FT_BOOLEAN, 16, NULL, 0x0008,
6273 NULL, HFILL }
6275 { &hf_bip_supported_features_image_push_print,
6276 { "Supported Features: Image Push Print", "btsdp.service.bip.supported_features.image_push_print",
6277 FT_BOOLEAN, 16, NULL, 0x0004,
6278 NULL, HFILL }
6280 { &hf_bip_supported_features_image_push_store,
6281 { "Supported Features: Image Push Store", "btsdp.service.bip.supported_features.image_push_store",
6282 FT_BOOLEAN, 16, NULL, 0x0002,
6283 NULL, HFILL }
6285 { &hf_bip_supported_features_image_push,
6286 { "Supported Features: Image Push", "btsdp.service.bip.supported_features.image_push",
6287 FT_BOOLEAN, 16, NULL, 0x0001,
6288 NULL, HFILL }
6290 { &hf_bip_supported_functions_reserved_17_31,
6291 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved",
6292 FT_UINT32, BASE_HEX, NULL, 0xFFFE0000,
6293 NULL, HFILL }
6295 { &hf_bip_supported_functions_reserved_13_31,
6296 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved",
6297 FT_UINT32, BASE_HEX, NULL, 0xFFFFE000,
6298 NULL, HFILL }
6300 { &hf_bip_supported_functions_reserved_11_31,
6301 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved",
6302 FT_UINT32, BASE_HEX, NULL, 0xFFFFF800,
6303 NULL, HFILL }
6305 { &hf_bip_supported_functions_reserved_1_11,
6306 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved",
6307 FT_UINT32, BASE_HEX, NULL, 0x00000FFE,
6308 NULL, HFILL }
6310 { &hf_bip_supported_functions_reserved_1_4,
6311 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved",
6312 FT_UINT32, BASE_HEX, NULL, 0x0000001E,
6313 NULL, HFILL }
6315 { &hf_bip_supported_functions_get_status,
6316 { "Supported Functions: Get Status", "btsdp.service.bip.supported_functions.get_status",
6317 FT_BOOLEAN, 32, NULL, 0x00010000,
6318 NULL, HFILL }
6320 { &hf_bip_supported_functions_reserved_15,
6321 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved_15",
6322 FT_BOOLEAN, 32, NULL, 0x00008000,
6323 NULL, HFILL }
6325 { &hf_bip_supported_functions_get_monitoring_image,
6326 { "Supported Functions: Get Monitoring Image", "btsdp.service.bip.supported_functions.get_monitoring_image",
6327 FT_BOOLEAN, 32, NULL, 0x00004000,
6328 NULL, HFILL }
6330 { &hf_bip_supported_functions_start_archive,
6331 { "Supported Functions: Start Archive", "btsdp.service.bip.supported_functions.start_archive",
6332 FT_BOOLEAN, 32, NULL, 0x00002000,
6333 NULL, HFILL }
6335 { &hf_bip_supported_functions_reserved_12,
6336 { "Supported Functions: Reserved", "btsdp.service.bip.supported_functions.reserved_12",
6337 FT_BOOLEAN, 32, NULL, 0x00001000,
6338 NULL, HFILL }
6340 { &hf_bip_supported_functions_get_partial_image,
6341 { "Supported Functions: Get Partial Image", "btsdp.service.bip.supported_functions.get_partial_image",
6342 FT_BOOLEAN, 32, NULL, 0x00001000,
6343 NULL, HFILL }
6345 { &hf_bip_supported_functions_start_print,
6346 { "Supported Functions: Start Print", "btsdp.service.bip.supported_functions.start_print",
6347 FT_BOOLEAN, 32, NULL, 0x00000800,
6348 NULL, HFILL }
6350 { &hf_bip_supported_functions_delete_image,
6351 { "Supported Functions: Delete Image", "btsdp.service.bip.supported_functions.delete_image",
6352 FT_BOOLEAN, 32, NULL, 0x00000400,
6353 NULL, HFILL }
6355 { &hf_bip_supported_functions_get_linked_attachment,
6356 { "Supported Functions: Get Linked Attachment","btsdp.service.bip.supported_functions.get_linked_attachment",
6357 FT_BOOLEAN, 32, NULL, 0x00000200,
6358 NULL, HFILL }
6360 { &hf_bip_supported_functions_get_linked_thumbnail,
6361 { "Supported Functions: Get Linked Thumbnail", "btsdp.service.bip.supported_functions.get_linked_thumbnail",
6362 FT_BOOLEAN, 32, NULL, 0x00000100,
6363 NULL, HFILL }
6365 { &hf_bip_supported_functions_get_image,
6366 { "Supported Functions: Get Image", "btsdp.service.bip.supported_functions.get_image",
6367 FT_BOOLEAN, 32, NULL, 0x00000080,
6368 NULL, HFILL }
6370 { &hf_bip_supported_functions_get_image_property,
6371 { "Supported Functions: Get Image Property", "btsdp.service.bip.supported_functions.get_image_property",
6372 FT_BOOLEAN, 32, NULL, 0x00000040,
6373 NULL, HFILL }
6375 { &hf_bip_supported_functions_get_images_list,
6376 { "Supported Functions: Get Images List", "btsdp.service.bip.supported_functions.get_images_list",
6377 FT_BOOLEAN, 32, NULL, 0x00000020,
6378 NULL, HFILL }
6380 { &hf_bip_supported_functions_remote_display,
6381 { "Supported Functions: Remote Display", "btsdp.service.bip.supported_functions.remote_display",
6382 FT_BOOLEAN, 32, NULL, 0x00000010,
6383 NULL, HFILL }
6385 { &hf_bip_supported_functions_put_linked_thumbnail,
6386 { "Supported Functions: Put Linked Thumbnail", "btsdp.service.bip.supported_functions.put_linked_thumbnail",
6387 FT_BOOLEAN, 32, NULL, 0x00000008,
6388 NULL, HFILL }
6390 { &hf_bip_supported_functions_put_linked_attachment,
6391 { "Supported Functions: Put Linked Attachment","btsdp.service.bip.supported_functions.put_linked_attachment",
6392 FT_BOOLEAN, 32, NULL, 0x00000004,
6393 NULL, HFILL }
6395 { &hf_bip_supported_functions_put_image,
6396 { "Supported Functions: Put Image", "btsdp.service.bip.supported_functions.put_image",
6397 FT_BOOLEAN, 32, NULL, 0x00000002,
6398 NULL, HFILL }
6400 { &hf_bip_supported_functions_get_capabilities,
6401 { "Supported Functions: Get Capabilities", "btsdp.service.bip.supported_functions.get_capabilities",
6402 FT_BOOLEAN, 32, NULL, 0x00000001,
6403 NULL, HFILL }
6405 { &hf_bip_total_imaging_data_capacity,
6406 { "Total Imaging Data Capacity", "btsdp.bip.total_imaging_data_capacity",
6407 FT_UINT64, BASE_DEC, NULL, 0,
6408 NULL, HFILL }
6410 { &hf_bip_goep_l2cap_psm,
6411 { "GOEP L2CAP PSM", "btsdp.bip.goep_l2cap_psm",
6412 FT_UINT16, BASE_DEC_HEX, NULL, 0,
6413 NULL, HFILL }
6415 { &hf_bpp_document_formats_supported,
6416 { "Document Formats Supported", "btsdp.service.bpp.document_formats_supported",
6417 FT_STRING, BASE_NONE, NULL, 0,
6418 NULL, HFILL }
6420 { &hf_bpp_character_repertoires_support,
6421 { "Character Repertoires Support", "btsdp.service.bpp.character_repertoires_support",
6422 FT_BYTES, BASE_NONE, NULL, 0,
6423 NULL, HFILL }
6425 { &hf_bpp_xhtml_print_image_formats_supported,
6426 { "XHTML Print Image Formats Supported", "btsdp.service.bpp.xhtml_print_image_formats_supported",
6427 FT_STRING, BASE_NONE, NULL, 0,
6428 NULL, HFILL }
6430 { &hf_bpp_color_supported,
6431 { "Color Supported", "btsdp.service.bpp.color_supported",
6432 FT_BOOLEAN, BASE_NONE, NULL, 0,
6433 NULL, HFILL }
6435 { &hf_bpp_1284_id,
6436 { "1284 ID", "btsdp.service.bpp.1284_id",
6437 FT_STRING, BASE_NONE, NULL, 0,
6438 NULL, HFILL }
6440 { &hf_bpp_printer_name,
6441 { "Printer Name", "btsdp.service.bpp.printer_name",
6442 FT_STRING, BASE_NONE, NULL, 0,
6443 NULL, HFILL }
6445 { &hf_bpp_printer_location,
6446 { "Printer Location", "btsdp.service.bpp.location",
6447 FT_STRING, BASE_NONE, NULL, 0,
6448 NULL, HFILL }
6450 { &hf_bpp_duplex_supported,
6451 { "Duplex Supported", "btsdp.service.bpp.duplex_supported",
6452 FT_BOOLEAN, BASE_NONE, NULL, 0,
6453 NULL, HFILL }
6455 { &hf_bpp_media_types_supported,
6456 { "Media Types Supported", "btsdp.service.bpp.media_types_supported",
6457 FT_STRING, BASE_NONE, NULL, 0,
6458 NULL, HFILL }
6460 { &hf_bpp_max_media_width,
6461 { "Max Media Width", "btsdp.service.bpp.max_media_width",
6462 FT_UINT16, BASE_DEC, NULL, 0,
6463 NULL, HFILL }
6465 { &hf_bpp_max_media_length,
6466 { "Max Media Length", "btsdp.service.bpp.max_media_length",
6467 FT_UINT16, BASE_DEC, NULL, 0,
6468 NULL, HFILL }
6470 { &hf_bpp_enhanced_layout_supported,
6471 { "Enhanced Layout Supported", "btsdp.service.bpp.enhanced_layout_supported",
6472 FT_BOOLEAN, BASE_NONE, NULL, 0,
6473 NULL, HFILL }
6475 { &hf_bpp_rui_formats_supported,
6476 { "RUI Formats Supported", "btsdp.service.bpp.rui_formats_supported",
6477 FT_STRING, BASE_NONE, NULL, 0,
6478 NULL, HFILL }
6480 { &hf_bpp_reference_printing_rui_supported,
6481 { "Reference Printing RUI Supported","btsdp.service.bpp.reference_printing_rui_supported",
6482 FT_BOOLEAN, BASE_NONE, NULL, 0,
6483 NULL, HFILL }
6485 { &hf_bpp_direct_printing_rui_supported,
6486 { "Direct Printing RUI Supported", "btsdp.service.bpp.direct_printing_rui_supported",
6487 FT_BOOLEAN, BASE_NONE, NULL, 0,
6488 NULL, HFILL }
6490 { &hf_bpp_reference_printing_top_url,
6491 { "Reference Printing Top URL", "btsdp.service.bpp.reference_printing_top_url",
6492 FT_STRING, BASE_NONE, NULL, 0,
6493 NULL, HFILL }
6495 { &hf_bpp_direct_printing_top_url,
6496 { "Direct Printing Top URL", "btsdp.service.bpp.direct_printing_top_url",
6497 FT_STRING, BASE_NONE, NULL, 0,
6498 NULL, HFILL }
6500 { &hf_bpp_device_name,
6501 { "Device Name", "btsdp.service.bpp.device_name",
6502 FT_STRING, BASE_NONE, NULL, 0,
6503 NULL, HFILL }
6505 { &hf_bpp_printer_admin_rui_top_url,
6506 { "Printer Admin RUI Top URL", "btsdp.service.bpp.printer_admin_rui_top_url",
6507 FT_STRING, BASE_NONE, NULL, 0,
6508 NULL, HFILL }
6512 static int *ett[] = {
6513 &ett_btsdp,
6514 &ett_btsdp_ssr,
6515 &ett_btsdp_des,
6516 &ett_btsdp_attribute,
6517 &ett_btsdp_attribute_id,
6518 &ett_btsdp_attribute_value,
6519 &ett_btsdp_service_search_pattern,
6520 &ett_btsdp_attribute_idlist,
6521 &ett_btsdp_continuation_state,
6522 &ett_btsdp_data_element,
6523 &ett_btsdp_data_element_value,
6524 &ett_btsdp_reassembled,
6525 &ett_btsdp_supported_features,
6526 &ett_btsdp_supported_features_mdep_id,
6527 &ett_btsdp_supported_features_mdep_data_type,
6528 &ett_btsdp_supported_features_mdep_role,
6529 &ett_btsdp_supported_features_mdep_description,
6530 &ett_btsdp_protocol
6533 static ei_register_info ei[] = {
6534 { &ei_btsdp_continuation_state_none, { "btsdp.expert.continuation_state_none", PI_MALFORMED, PI_WARN, "There is no Continuation State", EXPFILL }},
6535 { &ei_btsdp_continuation_state_large, { "btsdp.expert.continuation_state_large", PI_MALFORMED, PI_WARN, "Continuation State data is longer then 16", EXPFILL }},
6536 { &ei_data_element_value_large, { "btsdp.expert.data_element.value.large", PI_MALFORMED, PI_WARN, "Data size exceeds the length of payload", EXPFILL }},
6537 { &ei_length_bad, { "btsdp.expert.length.bad", PI_MALFORMED, PI_WARN, "Invalid length", EXPFILL }},
6540 proto_btsdp = proto_register_protocol("Bluetooth SDP Protocol", "BT SDP", "btsdp");
6541 btsdp_handle = register_dissector("btsdp", dissect_btsdp, proto_btsdp);
6543 proto_register_field_array(proto_btsdp, hf, array_length(hf));
6544 proto_register_subtree_array(ett, array_length(ett));
6545 expert_btsdp = expert_register_protocol(proto_btsdp);
6546 expert_register_field_array(expert_btsdp, ei, array_length(ei));
6548 tid_requests = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
6549 continuation_states = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
6550 record_handle_services = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
6552 service_infos = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
6554 module = prefs_register_protocol_subtree("Bluetooth", proto_btsdp, NULL);
6555 prefs_register_static_text_preference(module, "bnep.version",
6556 "Bluetooth Protocol SDP version from Core 4.0",
6557 "Version of protocol supported by this dissector.");
6561 void
6562 proto_reg_handoff_btsdp(void)
6564 dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_SDP, btsdp_handle);
6565 dissector_add_for_decode_as("btl2cap.cid", btsdp_handle);
6569 * Editor modelines - https://www.wireshark.org/tools/modelines.html
6571 * Local variables:
6572 * c-basic-offset: 4
6573 * tab-width: 8
6574 * indent-tabs-mode: nil
6575 * End:
6577 * vi: set shiftwidth=4 tabstop=8 expandtab:
6578 * :indentSize=4:tabSize=8:noTabs=true: