2 * Routines for Bluetooth AVDTP dissection
4 * Copyright 2012, Michal Labedzki for Tieto Corporation
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <epan/packet.h>
30 #include <epan/expert.h>
31 #include <epan/prefs.h>
32 #include <epan/wmem/wmem.h>
34 #include "packet-btl2cap.h"
35 #include "packet-btsdp.h"
36 #include "packet-btavdtp.h"
37 #include "packet-rtp.h"
39 #define AVDTP_MESSAGE_TYPE_MASK 0x03
40 #define AVDTP_PACKET_TYPE_MASK 0x0C
41 #define AVDTP_TRANSACTION_MASK 0xF0
42 #define AVDTP_SIGNAL_ID_MASK 0x3F
43 #define AVDTP_RFA0_MASK 0xC0
45 #define MESSAGE_TYPE_COMMAND 0x00
46 #define MESSAGE_TYPE_GENERAL_REJECT 0x01
47 #define MESSAGE_TYPE_ACCEPT 0x02
48 #define MESSAGE_TYPE_REJECT 0x03
50 #define PACKET_TYPE_SINGLE 0x00
51 #define PACKET_TYPE_START 0x01
52 #define PACKET_TYPE_CONTINUE 0x02
53 #define PACKET_TYPE_END 0x03
55 #define SIGNAL_ID_DISCOVER 0x01
56 #define SIGNAL_ID_GET_CAPABILITIES 0x02
57 #define SIGNAL_ID_SET_CONFIGURATION 0x03
58 #define SIGNAL_ID_GET_CONFIGURATION 0x04
59 #define SIGNAL_ID_RECONFIGURE 0x05
60 #define SIGNAL_ID_OPEN 0x06
61 #define SIGNAL_ID_START 0x07
62 #define SIGNAL_ID_CLOSE 0x08
63 #define SIGNAL_ID_SUSPEND 0x09
64 #define SIGNAL_ID_ABORT 0x0A
65 #define SIGNAL_ID_SECURITY_CONTROL 0x0B
66 #define SIGNAL_ID_GET_ALL_CAPABILITIES 0x0C
67 #define SIGNAL_ID_DELAY_REPORT 0x0D
69 #define SERVICE_CATEGORY_MEDIA_TRANSPORT 0x01
70 #define SERVICE_CATEGORY_REPORTING 0x02
71 #define SERVICE_CATEGORY_RECOVERY 0x03
72 #define SERVICE_CATEGORY_CONTENT_PROTECTION 0x04
73 #define SERVICE_CATEGORY_HEADER_COMPRESSION 0x05
74 #define SERVICE_CATEGORY_MULTIPLEXING 0x06
75 #define SERVICE_CATEGORY_MEDIA_CODEC 0x07
76 #define SERVICE_CATEGORY_DELAY_REPORTING 0x08
78 #define MEDIA_TYPE_AUDIO 0x00
79 #define MEDIA_TYPE_VIDEO 0x01
84 #define STREAM_TYPE_MEDIA 0x00
85 #define STREAM_TYPE_SIGNAL 0x01
87 #define CODEC_SBC 0x00
88 #define CODEC_MPEG12_AUDIO 0x01
89 #define CODEC_MPEG24_AAC 0x02
90 #define CODEC_ATRAC 0x04
92 #define CODEC_H263_BASELINE 0x01
93 #define CODEC_MPEG4_VSP 0x02
94 #define CODEC_H263_PROFILE_3 0x03
95 #define CODEC_H263_PROFILE_8 0x04
97 #define CODEC_VENDOR 0xFF
103 static int proto_btavdtp
= -1;
105 static int hf_btavdtp_data
= -1;
106 static int hf_btavdtp_message_type
= -1;
107 static int hf_btavdtp_packet_type
= -1;
108 static int hf_btavdtp_transaction
= -1;
109 static int hf_btavdtp_signal
= -1;
110 static int hf_btavdtp_signal_id
= -1;
111 static int hf_btavdtp_rfa0
= -1;
112 static int hf_btavdtp_number_of_signal_packets
= -1;
113 static int hf_btavdtp_sep_seid
= -1;
114 static int hf_btavdtp_sep_inuse
= -1;
115 static int hf_btavdtp_sep_rfa0
= -1;
116 static int hf_btavdtp_sep_media_type
= -1;
117 static int hf_btavdtp_sep_type
= -1;
118 static int hf_btavdtp_sep_rfa1
= -1;
119 static int hf_btavdtp_error_code
= -1;
120 static int hf_btavdtp_acp_sep
= -1;
121 static int hf_btavdtp_acp_seid_item
= -1;
122 static int hf_btavdtp_int_seid_item
= -1;
123 static int hf_btavdtp_acp_seid
= -1;
124 static int hf_btavdtp_int_seid
= -1;
125 static int hf_btavdtp_service_category
= -1;
126 static int hf_btavdtp_rfa_seid
= -1;
127 static int hf_btavdtp_delay
= -1;
128 static int hf_btavdtp_length_of_service_category
= -1;
129 static int hf_btavdtp_recovery_type
= -1;
130 static int hf_btavdtp_maximum_recovery_window_size
= -1;
131 static int hf_btavdtp_maximum_number_of_media_packet_in_parity_code
= -1;
132 static int hf_btavdtp_multiplexing_fragmentation
= -1;
133 static int hf_btavdtp_multiplexing_rfa
= -1;
134 static int hf_btavdtp_multiplexing_tsid
= -1;
135 static int hf_btavdtp_multiplexing_tcid
= -1;
136 static int hf_btavdtp_multiplexing_entry_rfa
= -1;
137 static int hf_btavdtp_header_compression_backch
= -1;
138 static int hf_btavdtp_header_compression_media
= -1;
139 static int hf_btavdtp_header_compression_recovery
= -1;
140 static int hf_btavdtp_header_compression_rfa
= -1;
141 static int hf_btavdtp_content_protection_type
= -1;
142 static int hf_btavdtp_media_codec_media_type
= -1;
143 static int hf_btavdtp_media_codec_rfa
= -1;
144 static int hf_btavdtp_media_codec_unknown_type
= -1;
145 static int hf_btavdtp_media_codec_audio_type
= -1;
146 static int hf_btavdtp_media_codec_video_type
= -1;
147 static int hf_btavdtp_sbc_sampling_frequency_16000
= -1;
148 static int hf_btavdtp_sbc_sampling_frequency_32000
= -1;
149 static int hf_btavdtp_sbc_sampling_frequency_44100
= -1;
150 static int hf_btavdtp_sbc_sampling_frequency_48000
= -1;
151 static int hf_btavdtp_sbc_channel_mode_mono
= -1;
152 static int hf_btavdtp_sbc_channel_mode_dual_channel
= -1;
153 static int hf_btavdtp_sbc_channel_mode_stereo
= -1;
154 static int hf_btavdtp_sbc_channel_mode_joint_stereo
= -1;
155 static int hf_btavdtp_sbc_block_4
= -1;
156 static int hf_btavdtp_sbc_block_8
= -1;
157 static int hf_btavdtp_sbc_block_12
= -1;
158 static int hf_btavdtp_sbc_block_16
= -1;
159 static int hf_btavdtp_sbc_subbands_4
= -1;
160 static int hf_btavdtp_sbc_subbands_8
= -1;
161 static int hf_btavdtp_sbc_allocation_method_snr
= -1;
162 static int hf_btavdtp_sbc_allocation_method_loudness
= -1;
163 static int hf_btavdtp_sbc_min_bitpool
= -1;
164 static int hf_btavdtp_sbc_max_bitpool
= -1;
165 static int hf_btavdtp_mpeg12_layer_1
= -1;
166 static int hf_btavdtp_mpeg12_layer_2
= -1;
167 static int hf_btavdtp_mpeg12_layer_3
= -1;
168 static int hf_btavdtp_mpeg12_crc_protection
= -1;
169 static int hf_btavdtp_mpeg12_channel_mode_mono
= -1;
170 static int hf_btavdtp_mpeg12_channel_mode_dual_channel
= -1;
171 static int hf_btavdtp_mpeg12_channel_mode_stereo
= -1;
172 static int hf_btavdtp_mpeg12_channel_mode_joint_stereo
= -1;
173 static int hf_btavdtp_mpeg12_rfa
= -1;
174 static int hf_btavdtp_mpeg12_mpf_2
= -1;
175 static int hf_btavdtp_mpeg12_sampling_frequency_16000
= -1;
176 static int hf_btavdtp_mpeg12_sampling_frequency_22050
= -1;
177 static int hf_btavdtp_mpeg12_sampling_frequency_24000
= -1;
178 static int hf_btavdtp_mpeg12_sampling_frequency_32000
= -1;
179 static int hf_btavdtp_mpeg12_sampling_frequency_44100
= -1;
180 static int hf_btavdtp_mpeg12_sampling_frequency_48000
= -1;
181 static int hf_btavdtp_mpeg12_vbr_supported
= -1;
182 static int hf_btavdtp_mpeg12_bit_rate
= -1;
183 static int hf_btavdtp_mpeg24_object_type_mpeg2_aac_lc
= -1;
184 static int hf_btavdtp_mpeg24_object_type_mpeg4_aac_lc
= -1;
185 static int hf_btavdtp_mpeg24_object_type_mpeg4_aac_ltp
= -1;
186 static int hf_btavdtp_mpeg24_object_type_mpeg4_aac_scalable
= -1;
187 static int hf_btavdtp_mpeg24_object_type_rfa
= -1;
188 static int hf_btavdtp_mpeg24_sampling_frequency_8000
= -1;
189 static int hf_btavdtp_mpeg24_sampling_frequency_11025
= -1;
190 static int hf_btavdtp_mpeg24_sampling_frequency_12000
= -1;
191 static int hf_btavdtp_mpeg24_sampling_frequency_16000
= -1;
192 static int hf_btavdtp_mpeg24_sampling_frequency_22050
= -1;
193 static int hf_btavdtp_mpeg24_sampling_frequency_24000
= -1;
194 static int hf_btavdtp_mpeg24_sampling_frequency_32000
= -1;
195 static int hf_btavdtp_mpeg24_sampling_frequency_44100
= -1;
196 static int hf_btavdtp_mpeg24_sampling_frequency_48000
= -1;
197 static int hf_btavdtp_mpeg24_sampling_frequency_64000
= -1;
198 static int hf_btavdtp_mpeg24_sampling_frequency_88200
= -1;
199 static int hf_btavdtp_mpeg24_sampling_frequency_96000
= -1;
200 static int hf_btavdtp_mpeg24_channels_1
= -1;
201 static int hf_btavdtp_mpeg24_channels_2
= -1;
202 static int hf_btavdtp_mpeg24_rfa
= -1;
203 static int hf_btavdtp_mpeg24_vbr_supported
= -1;
204 static int hf_btavdtp_mpeg24_bit_rate
= -1;
205 static int hf_btavdtp_atrac_version
= -1;
206 static int hf_btavdtp_atrac_channel_mode_single_channel
= -1;
207 static int hf_btavdtp_atrac_channel_mode_dual_channel
= -1;
208 static int hf_btavdtp_atrac_channel_mode_joint_stereo
= -1;
209 static int hf_btavdtp_atrac_rfa1
= -1;
210 static int hf_btavdtp_atrac_rfa2
= -1;
211 static int hf_btavdtp_atrac_sampling_frequency_44100
= -1;
212 static int hf_btavdtp_atrac_sampling_frequency_48000
= -1;
213 static int hf_btavdtp_atrac_vbr_supported
= -1;
214 static int hf_btavdtp_atrac_bit_rate
= -1;
215 static int hf_btavdtp_atrac_maximum_sul
= -1;
216 static int hf_btavdtp_atrac_rfa3
= -1;
217 static int hf_btavdtp_h263_level_10
= -1;
218 static int hf_btavdtp_h263_level_20
= -1;
219 static int hf_btavdtp_h263_level_30
= -1;
220 static int hf_btavdtp_h263_level_rfa
= -1;
221 static int hf_btavdtp_mpeg4_level_0
= -1;
222 static int hf_btavdtp_mpeg4_level_1
= -1;
223 static int hf_btavdtp_mpeg4_level_2
= -1;
224 static int hf_btavdtp_mpeg4_level_3
= -1;
225 static int hf_btavdtp_mpeg4_level_rfa
= -1;
226 static int hf_btavdtp_vendor_id
= -1;
227 static int hf_btavdtp_vendor_specific_codec_id
= -1;
228 static int hf_btavdtp_vendor_specific_value
= -1;
229 static int hf_btavdtp_capabilities
= -1;
230 static int hf_btavdtp_service
= -1;
231 static int hf_btavdtp_service_multiplexing_entry
= -1;
233 static gint ett_btavdtp
= -1;
234 static gint ett_btavdtp_sep
= -1;
235 static gint ett_btavdtp_capabilities
= -1;
236 static gint ett_btavdtp_service
= -1;
238 static expert_field ei_btavdtp_sbc_min_bitpool_out_of_range
= EI_INIT
;
239 static expert_field ei_btavdtp_sbc_max_bitpool_out_of_range
= EI_INIT
;
240 static expert_field ei_btavdtp_unexpected_losc_data
= EI_INIT
;
242 static gboolean force_avdtp
= FALSE
;
244 static dissector_handle_t btavdtp_handle
;
245 static dissector_handle_t bta2dp_handle
;
246 static dissector_handle_t btvdp_handle
;
247 static dissector_handle_t rtp_handle
;
249 static wmem_tree_t
*sep_list
= NULL
;
250 static wmem_tree_t
*sep_open
= NULL
;
251 static wmem_tree_t
*cid_to_type_table
= NULL
;
253 /* A2DP declarations */
254 static gint proto_bta2dp
= -1;
255 static gint ett_bta2dp
= -1;
256 static gint proto_bta2dp_cph_scms_t
= -1;
257 static gint ett_bta2dp_cph_scms_t
= -1;
259 static int hf_bta2dp_codec
= -1;
260 static int hf_bta2dp_content_protection
= -1;
261 static int hf_bta2dp_l_bit
= -1;
262 static int hf_bta2dp_cp_bit
= -1;
263 static int hf_bta2dp_reserved
= -1;
265 static dissector_handle_t sbc_handle
;
266 static dissector_handle_t mp2t_handle
;
267 static dissector_handle_t mpeg_audio_handle
;
268 static dissector_handle_t atrac_handle
;
270 static gboolean force_a2dp_scms_t
= FALSE
;
271 static gint force_a2dp_codec
= CODEC_SBC
;
273 static const enum_val_t pref_a2dp_codec
[] = {
274 { "sbc", "SBC", CODEC_SBC
},
275 { "mp2t", "MPEG12 AUDIO", CODEC_MPEG12_AUDIO
},
276 { "mpeg-audio", "MPEG24 AAC", CODEC_MPEG24_AAC
},
277 /* XXX: Not supported in Wireshark yet { "atrac", "ATRAC", CODEC_ATRAC },*/
282 /* VDP declarations */
283 static gint proto_btvdp
= -1;
284 static gint ett_btvdp
= -1;
285 static gint proto_btvdp_cph_scms_t
= -1;
286 static gint ett_btvdp_cph_scms_t
= -1;
288 static int hf_btvdp_codec
= -1;
289 static int hf_btvdp_content_protection
= -1;
290 static int hf_btvdp_l_bit
= -1;
291 static int hf_btvdp_cp_bit
= -1;
292 static int hf_btvdp_reserved
= -1;
294 static dissector_handle_t h263_handle
;
295 static dissector_handle_t mp4v_es_handle
;
297 static gboolean force_vdp_scms_t
= FALSE
;
298 static gint force_vdp_codec
= CODEC_H263_BASELINE
;
300 static const enum_val_t pref_vdp_codec
[] = {
301 { "h263", "H263", CODEC_H263_BASELINE
},
302 { "mp4v-es", "MPEG4 VSP", CODEC_MPEG4_VSP
},
307 static const value_string message_type_vals
[] = {
309 { 0x01, "GeneralReject" },
310 { 0x02, "ResponseAccept" },
311 { 0x03, "ResponseReject" },
315 static const value_string packet_type_vals
[] = {
318 { 0x02, "Continue" },
323 static const value_string signal_id_vals
[] = {
324 { 0x00, "Reserved" },
325 { 0x01, "Discover" },
326 { 0x02, "GetCapabilities" },
327 { 0x03, "SetConfiguration" },
328 { 0x04, "GetConfiguration" },
329 { 0x05, "Reconfigure" },
335 { 0x0B, "SecurityControl" },
336 { 0x0C, "GetAllCapabilities" },
337 { 0x0D, "DelayReport" },
341 static const value_string media_type_vals
[] = {
344 { 0x02, "Multimedia" },
348 static const value_string sep_type_vals
[] = {
354 static const value_string true_false
[] = {
360 static const value_string error_code_vals
[] = {
361 /* ACP to INT, Signal Response Header Error Codes */
362 { 0x01, "Bad Header Format" },
363 /* ACP to INT, Signal Response Payload Format Error Codes */
364 { 0x11, "Bad Length" },
365 { 0x12, "Bad ACP SEID" },
366 { 0x13, "SEP In Use" },
367 { 0x14, "SEP Not In Use" },
368 { 0x17, "Bad Service Category" },
369 { 0x18, "Bad Payload Format" },
370 { 0x19, "Not Supported Command" },
371 { 0x1A, "Invalid Capabilities" },
372 /* ACP to INT, Signal Response Transport Service Capabilities Error Codes */
373 { 0x22, "Bad Recovery Type" },
374 { 0x23, "Bad Media Transport Format" },
375 { 0x25, "Bad Recovery Format" },
376 { 0x26, "Bad Header Compression Format" },
377 { 0x27, "Bad Content Protection Format" },
378 { 0x28, "Bad Multiplexing Format" },
379 { 0x29, "Unsupported Configuration" },
380 /* ACP to INT, Procedure Error Codes */
381 { 0x31, "Bad State" },
385 static const value_string service_category_vals
[] = {
386 { 0x01, "Media Transport" },
387 { 0x02, "Reporting" },
388 { 0x03, "Recovery" },
389 { 0x04, "Content Protection" },
390 { 0x05, "Header Compression" },
391 { 0x06, "Multiplexing" },
392 { 0x07, "Media Codec" },
393 { 0x08, "Delay Reporting" },
397 static const value_string recovery_type_vals
[] = {
398 { 0x00, "Forbidden" },
403 static const value_string multiplexing_tsid_vals
[] = {
404 { 0x00, "Used for TSID query" },
409 static const value_string multiplexing_tcid_vals
[] = {
410 { 0x00, "Used for TCID query" },
415 static const value_string media_codec_audio_type_vals
[] = {
417 { 0x01, "MPEG-1,2 Audio" },
418 { 0x02, "MPEG-2,4 AAC" },
419 { 0x04, "ATRAC family" },
420 { 0xFF, "non-A2DP" },
424 static const value_string media_codec_video_type_vals
[] = {
425 { 0x01, "H.263 baseline" },
426 { 0x02, "MPEG-4 Visual Simple Profile" },
427 { 0x03, "H.263 profile 3" },
428 { 0x04, "H.263 profile 8" },
433 static const value_string content_protection_type_vals
[] = {
439 extern value_string_ext bthci_evt_comp_id_ext
;
447 typedef struct _sep_entry_t
{
452 gint content_protection_type
;
453 enum sep_state state
;
456 typedef struct _cid_type_data_t
{
463 typedef struct _sep_data_t
{
465 gint content_protection_type
;
468 void proto_register_btavdtp(void);
469 void proto_reg_handoff_btavdtp(void);
470 void proto_register_bta2dp(void);
471 void proto_reg_handoff_bta2dp(void);
472 void proto_register_bta2dp_content_protection_header_scms_t(void);
473 void proto_register_btvdp(void);
474 void proto_reg_handoff_btvdp(void);
475 void proto_register_btvdp_content_protection_header_scms_t(void);
478 get_sep_type(guint32 frame_number
, guint seid
)
481 wmem_tree_key_t key
[3];
483 guint32 t_frame_number
;
486 t_frame_number
= frame_number
;
489 key
[0].key
= &t_seid
;
491 key
[1].key
= &t_frame_number
;
495 sep
= (sep_entry_t
*)wmem_tree_lookup32_array_le(sep_list
, key
);
496 if (sep
&& sep
->seid
== seid
) {
497 return val_to_str_const(sep
->type
, sep_type_vals
, "unknown");
504 get_sep_media_type(guint32 frame_number
, guint seid
)
507 wmem_tree_key_t key
[3];
509 guint32 t_frame_number
;
512 t_frame_number
= frame_number
;
515 key
[0].key
= &t_seid
;
517 key
[1].key
= &t_frame_number
;
521 sep
= (sep_entry_t
*)wmem_tree_lookup32_array_le(sep_list
, key
);
522 if (sep
&& sep
->seid
== seid
) {
523 return val_to_str_const(sep
->media_type
, media_type_vals
, "unknown");
531 dissect_sep(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, gint offset
)
533 proto_tree
*sep_tree
;
534 proto_item
*sep_item
;
541 sep_entry_t
*sep_data
;
542 wmem_tree_key_t key
[3];
544 guint32 t_frame_number
;
546 items
= tvb_length_remaining(tvb
, offset
) / 2;
547 while (tvb_length_remaining(tvb
, offset
) > 0) {
548 seid
= tvb_get_guint8(tvb
, offset
);
549 in_use
= seid
& 0x02;
551 media_type
= tvb_get_guint8(tvb
, offset
+ 1) >> 4;
552 type
= (tvb_get_guint8(tvb
, offset
+ 1) & 0x08) >> 3;
553 sep_item
= proto_tree_add_none_format(tree
, hf_btavdtp_acp_sep
, tvb
, offset
, 2, "ACP SEP [%u - %s %s] item %u/%u",
554 seid
, val_to_str_const(media_type
, media_type_vals
, "unknown"),
555 val_to_str_const(type
, sep_type_vals
, "unknown"), i_sep
, items
);
556 sep_tree
= proto_item_add_subtree(sep_item
, ett_btavdtp_sep
);
558 proto_tree_add_item(sep_tree
, hf_btavdtp_sep_seid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
559 proto_tree_add_item(sep_tree
, hf_btavdtp_sep_inuse
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
560 proto_tree_add_item(sep_tree
, hf_btavdtp_sep_rfa0
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
563 proto_tree_add_item(sep_tree
, hf_btavdtp_sep_media_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
564 proto_tree_add_item(sep_tree
, hf_btavdtp_sep_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
565 proto_tree_add_item(sep_tree
, hf_btavdtp_sep_rfa1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
567 /* save information for later recognizing */
569 t_frame_number
= pinfo
->fd
->num
;
572 key
[0].key
= &t_seid
;
574 key
[1].key
= &t_frame_number
;
578 if (!pinfo
->fd
->flags
.visited
) {
579 sep_data
= wmem_new(wmem_file_scope(), sep_entry_t
);
580 sep_data
->seid
= seid
;
581 sep_data
->type
= type
;
582 sep_data
->codec
= -1;
583 sep_data
->content_protection_type
= 0;
584 sep_data
->media_type
= media_type
;
586 sep_data
->state
= SEP_STATE_IN_USE
;
588 sep_data
->state
= SEP_STATE_FREE
;
591 wmem_tree_insert32_array(sep_list
, key
, sep_data
);
598 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - items: %u", items
);
604 dissect_codec(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, gint offset
,
605 guint losc
, gint media_type
, gint media_codec_type
)
611 case MEDIA_TYPE_AUDIO
:
612 switch(media_codec_type
) {
614 proto_tree_add_item(tree
, hf_btavdtp_sbc_sampling_frequency_16000
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
615 proto_tree_add_item(tree
, hf_btavdtp_sbc_sampling_frequency_32000
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
616 proto_tree_add_item(tree
, hf_btavdtp_sbc_sampling_frequency_44100
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
617 proto_tree_add_item(tree
, hf_btavdtp_sbc_sampling_frequency_48000
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
618 proto_tree_add_item(tree
, hf_btavdtp_sbc_channel_mode_mono
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
619 proto_tree_add_item(tree
, hf_btavdtp_sbc_channel_mode_dual_channel
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
620 proto_tree_add_item(tree
, hf_btavdtp_sbc_channel_mode_stereo
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
621 proto_tree_add_item(tree
, hf_btavdtp_sbc_channel_mode_joint_stereo
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
623 proto_tree_add_item(tree
, hf_btavdtp_sbc_block_4
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
624 proto_tree_add_item(tree
, hf_btavdtp_sbc_block_8
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
625 proto_tree_add_item(tree
, hf_btavdtp_sbc_block_12
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
626 proto_tree_add_item(tree
, hf_btavdtp_sbc_block_16
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
627 proto_tree_add_item(tree
, hf_btavdtp_sbc_subbands_4
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
628 proto_tree_add_item(tree
, hf_btavdtp_sbc_subbands_8
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
629 proto_tree_add_item(tree
, hf_btavdtp_sbc_allocation_method_snr
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
630 proto_tree_add_item(tree
, hf_btavdtp_sbc_allocation_method_loudness
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
632 pitem
= proto_tree_add_item(tree
, hf_btavdtp_sbc_min_bitpool
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
633 bitpool
= tvb_get_guint8(tvb
, offset
+ 2);
634 if (bitpool
< 2 || bitpool
> 250) {
635 expert_add_info(pinfo
, pitem
, &ei_btavdtp_sbc_min_bitpool_out_of_range
);
638 pitem
= proto_tree_add_item(tree
, hf_btavdtp_sbc_max_bitpool
, tvb
, offset
+ 3, 1, ENC_BIG_ENDIAN
);
639 bitpool
= tvb_get_guint8(tvb
, offset
+ 3);
640 if (bitpool
< 2 || bitpool
> 250) {
641 expert_add_info(pinfo
, pitem
, &ei_btavdtp_sbc_max_bitpool_out_of_range
);
644 case CODEC_MPEG12_AUDIO
:
645 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_layer_1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
646 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_layer_2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
647 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_layer_3
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
648 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_crc_protection
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
649 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_channel_mode_mono
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
650 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_channel_mode_dual_channel
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
651 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_channel_mode_stereo
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
652 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_channel_mode_joint_stereo
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
654 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_rfa
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
655 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_mpf_2
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
656 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_sampling_frequency_16000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
657 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_sampling_frequency_22050
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
658 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_sampling_frequency_24000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
659 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_sampling_frequency_32000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
660 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_sampling_frequency_44100
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
661 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_sampling_frequency_48000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
663 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_vbr_supported
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
664 proto_tree_add_item(tree
, hf_btavdtp_mpeg12_bit_rate
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
666 case CODEC_MPEG24_AAC
:
667 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_object_type_mpeg2_aac_lc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
668 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_object_type_mpeg4_aac_lc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
669 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_object_type_mpeg4_aac_ltp
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
670 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_object_type_mpeg4_aac_scalable
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
671 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_object_type_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
673 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_8000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
674 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_11025
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
675 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_12000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
676 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_16000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
677 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_22050
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
678 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_24000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
679 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_32000
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
680 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_44100
, tvb
, offset
+ 1, 1, ENC_BIG_ENDIAN
);
682 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_48000
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
683 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_64000
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
684 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_88200
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
685 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_sampling_frequency_96000
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
686 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_channels_1
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
687 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_channels_2
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
688 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_rfa
, tvb
, offset
+ 2, 1, ENC_BIG_ENDIAN
);
690 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_vbr_supported
, tvb
, offset
+ 3, 3, ENC_BIG_ENDIAN
);
691 proto_tree_add_item(tree
, hf_btavdtp_mpeg24_bit_rate
, tvb
, offset
+ 3, 3, ENC_BIG_ENDIAN
);
694 proto_tree_add_item(tree
, hf_btavdtp_atrac_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
695 proto_tree_add_item(tree
, hf_btavdtp_atrac_channel_mode_single_channel
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
696 proto_tree_add_item(tree
, hf_btavdtp_atrac_channel_mode_dual_channel
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
697 proto_tree_add_item(tree
, hf_btavdtp_atrac_channel_mode_joint_stereo
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
698 proto_tree_add_item(tree
, hf_btavdtp_atrac_rfa1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
700 proto_tree_add_item(tree
, hf_btavdtp_atrac_rfa2
, tvb
, offset
+ 1, 3, ENC_BIG_ENDIAN
);
701 proto_tree_add_item(tree
, hf_btavdtp_atrac_sampling_frequency_44100
, tvb
, offset
+ 1, 3, ENC_BIG_ENDIAN
);
702 proto_tree_add_item(tree
, hf_btavdtp_atrac_sampling_frequency_48000
, tvb
, offset
+ 1, 3, ENC_BIG_ENDIAN
);
703 proto_tree_add_item(tree
, hf_btavdtp_atrac_vbr_supported
, tvb
, offset
+ 3, 3, ENC_BIG_ENDIAN
);
704 proto_tree_add_item(tree
, hf_btavdtp_atrac_bit_rate
, tvb
, offset
+ 3, 3, ENC_BIG_ENDIAN
);
706 proto_tree_add_item(tree
, hf_btavdtp_atrac_maximum_sul
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
708 proto_tree_add_item(tree
, hf_btavdtp_atrac_rfa3
, tvb
, offset
+ 6, 1, ENC_BIG_ENDIAN
);
710 case CODEC_VENDOR
: /* non-A2DP */
711 proto_tree_add_item(tree
, hf_btavdtp_vendor_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
712 proto_tree_add_item(tree
, hf_btavdtp_vendor_specific_codec_id
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
713 proto_tree_add_item(tree
, hf_btavdtp_vendor_specific_value
, tvb
, offset
+ 6, losc
- 6, ENC_NA
);
716 proto_tree_add_item(tree
, hf_btavdtp_data
, tvb
, offset
, losc
, ENC_NA
);
719 case MEDIA_TYPE_VIDEO
:
720 switch(media_codec_type
) {
721 case CODEC_H263_BASELINE
:
722 case CODEC_H263_PROFILE_3
:
723 case CODEC_H263_PROFILE_8
:
724 proto_tree_add_item(tree
, hf_btavdtp_h263_level_10
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
725 proto_tree_add_item(tree
, hf_btavdtp_h263_level_20
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
726 proto_tree_add_item(tree
, hf_btavdtp_h263_level_30
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
727 proto_tree_add_item(tree
, hf_btavdtp_h263_level_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
729 case CODEC_MPEG4_VSP
:
730 proto_tree_add_item(tree
, hf_btavdtp_mpeg4_level_0
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
731 proto_tree_add_item(tree
, hf_btavdtp_mpeg4_level_1
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
732 proto_tree_add_item(tree
, hf_btavdtp_mpeg4_level_2
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
733 proto_tree_add_item(tree
, hf_btavdtp_mpeg4_level_3
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
734 proto_tree_add_item(tree
, hf_btavdtp_mpeg4_level_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
736 case CODEC_VENDOR
: /* non-VDP */
737 proto_tree_add_item(tree
, hf_btavdtp_vendor_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
738 proto_tree_add_item(tree
, hf_btavdtp_vendor_specific_codec_id
, tvb
, offset
+ 4, 2, ENC_BIG_ENDIAN
);
739 proto_tree_add_item(tree
, hf_btavdtp_vendor_specific_value
, tvb
, offset
+ 6, losc
- 6, ENC_NA
);
742 proto_tree_add_item(tree
, hf_btavdtp_data
, tvb
, offset
, losc
, ENC_NA
);
746 proto_tree_add_item(tree
, hf_btavdtp_data
, tvb
, offset
, losc
, ENC_NA
);
756 dissect_capabilities(tvbuff_t
*tvb
, packet_info
*pinfo
,
757 proto_tree
*tree
, gint offset
, gint
*codec
,
758 gint
*content_protection_type
)
760 proto_item
*pitem
= NULL
;
761 proto_item
*ptree
= NULL
;
762 proto_tree
*capabilities_tree
;
763 proto_item
*capabilities_item
;
764 proto_tree
*service_tree
= NULL
;
765 proto_item
*service_item
= NULL
;
766 gint service_category
= 0;
768 gint recovery_type
= 0;
769 gint maximum_recovery_window_size
= 0;
770 gint maximum_number_of_media_packet_in_parity_code
= 0;
772 gint media_codec_type
= 0;
774 capabilities_item
= proto_tree_add_item(tree
, hf_btavdtp_capabilities
, tvb
, offset
, tvb_length(tvb
) - offset
, ENC_NA
);
775 capabilities_tree
= proto_item_add_subtree(capabilities_item
, ett_btavdtp_capabilities
);
781 while (tvb_length_remaining(tvb
, offset
) > 0) {
782 service_category
= tvb_get_guint8(tvb
, offset
);
783 losc
= tvb_get_guint8(tvb
, offset
+ 1);
784 service_item
= proto_tree_add_none_format(capabilities_tree
, hf_btavdtp_service
, tvb
, offset
, 2 + losc
, "Service: %s", val_to_str_const(service_category
, service_category_vals
, "RFD"));
785 service_tree
= proto_item_add_subtree(service_item
, ett_btavdtp_service
);
787 proto_tree_add_item(service_tree
, hf_btavdtp_service_category
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
790 proto_tree_add_item(service_tree
, hf_btavdtp_length_of_service_category
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
793 switch (service_category
) {
794 case SERVICE_CATEGORY_MEDIA_TRANSPORT
:
795 case SERVICE_CATEGORY_REPORTING
:
796 case SERVICE_CATEGORY_DELAY_REPORTING
:
797 /* losc should be 0*/
799 case SERVICE_CATEGORY_RECOVERY
:
800 recovery_type
= tvb_get_guint8(tvb
, offset
);
801 pitem
= proto_tree_add_item(service_tree
, hf_btavdtp_recovery_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
802 proto_item_append_text(pitem
, " (%s)", val_to_str_const(recovery_type
, recovery_type_vals
, "RFD"));
806 maximum_recovery_window_size
= tvb_get_guint8(tvb
, offset
);
807 pitem
= proto_tree_add_item(service_tree
, hf_btavdtp_maximum_recovery_window_size
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
808 if (maximum_recovery_window_size
== 0x00) {
809 proto_item_append_text(pitem
, " (Forbidden)");
810 } else if (maximum_recovery_window_size
>= 0x18) {
811 proto_item_append_text(pitem
, " (Undocumented)");
816 maximum_number_of_media_packet_in_parity_code
= tvb_get_guint8(tvb
, offset
);
817 proto_tree_add_item(service_tree
, hf_btavdtp_maximum_number_of_media_packet_in_parity_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
818 pitem
= proto_tree_add_item(service_tree
, hf_btavdtp_maximum_recovery_window_size
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
819 if (maximum_number_of_media_packet_in_parity_code
== 0x00) {
820 proto_item_append_text(pitem
, " (Forbidden)");
821 } else if (maximum_number_of_media_packet_in_parity_code
>= 0x18) {
822 proto_item_append_text(pitem
, " (Undocumented)");
827 case SERVICE_CATEGORY_MEDIA_CODEC
:
828 media_type
= tvb_get_guint8(tvb
, offset
) >> 4;
829 proto_tree_add_item(service_tree
, hf_btavdtp_media_codec_media_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
830 proto_tree_add_item(service_tree
, hf_btavdtp_media_codec_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
834 media_codec_type
= tvb_get_guint8(tvb
, offset
);
836 *codec
= media_codec_type
;
839 if (media_type
== MEDIA_TYPE_AUDIO
) {
840 proto_tree_add_item(service_tree
, hf_btavdtp_media_codec_audio_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
841 proto_item_append_text(service_item
, " - Audio %s",
842 val_to_str_const(media_codec_type
, media_codec_audio_type_vals
, "unknown codec"));
843 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - Audio %s",
844 val_to_str_const(media_codec_type
, media_codec_audio_type_vals
, "unknown codec"));
845 } else if (media_type
== MEDIA_TYPE_VIDEO
) {
846 proto_tree_add_item(service_tree
, hf_btavdtp_media_codec_video_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
847 proto_item_append_text(service_item
, " - Video %s",
848 val_to_str_const(media_codec_type
, media_codec_video_type_vals
, "unknown codec"));
849 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - Video %s",
850 val_to_str_const(media_codec_type
, media_codec_video_type_vals
, "unknown codec"));
852 proto_tree_add_item(service_tree
, hf_btavdtp_media_codec_unknown_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
853 proto_item_append_text(service_item
, " - Unknown 0x%02x", media_codec_type
);
854 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - Unknown 0x%02x", media_codec_type
);
859 offset
= dissect_codec(tvb
, pinfo
, service_tree
, offset
, losc
, media_type
, media_codec_type
);
862 case SERVICE_CATEGORY_CONTENT_PROTECTION
:
863 /* ENC_LITTLE_ENDIAN is correct here... */
864 proto_tree_add_item(service_tree
, hf_btavdtp_content_protection_type
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
865 if (content_protection_type
) {
866 *content_protection_type
= tvb_get_letohs(tvb
, offset
);
872 proto_tree_add_item(service_tree
, hf_btavdtp_data
, tvb
, offset
, losc
, ENC_NA
);
877 case SERVICE_CATEGORY_HEADER_COMPRESSION
:
878 proto_tree_add_item(service_tree
, hf_btavdtp_header_compression_backch
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
879 proto_tree_add_item(service_tree
, hf_btavdtp_header_compression_media
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
880 proto_tree_add_item(service_tree
, hf_btavdtp_header_compression_recovery
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
881 proto_tree_add_item(service_tree
, hf_btavdtp_header_compression_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
885 case SERVICE_CATEGORY_MULTIPLEXING
:
886 proto_tree_add_item(service_tree
, hf_btavdtp_multiplexing_fragmentation
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
887 proto_tree_add_item(service_tree
, hf_btavdtp_multiplexing_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
892 pitem
= proto_tree_add_none_format(service_tree
, hf_btavdtp_service_multiplexing_entry
, tvb
, offset
, 1 + losc
, "Entry: Media Transport Session");
893 ptree
= proto_item_add_subtree(pitem
, ett_btavdtp_service
);
895 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_tsid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
896 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_entry_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
899 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_tcid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
900 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_entry_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
906 pitem
= proto_tree_add_none_format(service_tree
, hf_btavdtp_service_multiplexing_entry
, tvb
, offset
, 1 + losc
, "Entry: Reporting Transport Session");
907 ptree
= proto_item_add_subtree(pitem
, ett_btavdtp_service
);
909 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_tsid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
910 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_entry_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
913 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_tcid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
914 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_entry_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
920 pitem
= proto_tree_add_none_format(service_tree
, hf_btavdtp_service_multiplexing_entry
, tvb
, offset
, 1 + losc
, "Entry: Recovery Transport Session");
921 ptree
= proto_item_add_subtree(pitem
, ett_btavdtp_service
);
923 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_tsid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
924 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_entry_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
927 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_tcid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
928 proto_tree_add_item(ptree
, hf_btavdtp_multiplexing_entry_rfa
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
934 proto_tree_add_item(service_tree
, hf_btavdtp_data
, tvb
, offset
, losc
, ENC_NA
);
940 pitem
= proto_tree_add_item(service_tree
, hf_btavdtp_data
, tvb
, offset
, losc
, ENC_NA
);
943 expert_add_info(pinfo
, pitem
, &ei_btavdtp_unexpected_losc_data
);
952 dissect_seid(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, gint offset
,
953 gint seid_side
, gint i_item
, guint32
*sep_seid
)
956 proto_tree
*seid_tree
= NULL
;
957 proto_item
*seid_item
= NULL
;
959 seid
= tvb_get_guint8(tvb
, offset
) >> 2;
964 if (seid_side
== SEID_ACP
) {
965 seid_item
= proto_tree_add_none_format(tree
, hf_btavdtp_acp_seid_item
, tvb
, offset
, 1,
966 "ACP SEID [%u - %s %s]", seid
, get_sep_media_type(pinfo
->fd
->num
, seid
), get_sep_type(pinfo
->fd
->num
, seid
));
967 seid_tree
= proto_item_add_subtree(seid_item
, ett_btavdtp_sep
);
968 proto_tree_add_item(seid_tree
, hf_btavdtp_acp_seid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
969 if (i_item
> 0) proto_item_append_text(seid_item
, " item %u", i_item
);
971 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - ACP SEID [%u - %s %s]",
972 seid
, get_sep_media_type(pinfo
->fd
->num
, seid
), get_sep_type(pinfo
->fd
->num
, seid
));
974 seid_item
= proto_tree_add_none_format(tree
, hf_btavdtp_int_seid_item
, tvb
, offset
, 1,
975 "INT SEID [%u - %s %s]", seid
, get_sep_media_type(pinfo
->fd
->num
, seid
), get_sep_type(pinfo
->fd
->num
, seid
));
976 seid_tree
= proto_item_add_subtree(seid_item
, ett_btavdtp_sep
);
977 proto_tree_add_item(seid_tree
, hf_btavdtp_int_seid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
978 if (i_item
> 0) proto_item_append_text(seid_item
, " item %u", i_item
);
980 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - INT SEID [%u - %s %s]",
981 seid
, get_sep_media_type(pinfo
->fd
->num
, seid
), get_sep_type(pinfo
->fd
->num
, seid
));
984 proto_tree_add_item(seid_tree
, hf_btavdtp_rfa_seid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
992 dissect_btavdtp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
995 proto_tree
*btavdtp_tree
= NULL
;
996 proto_tree
*signal_tree
= NULL
;
997 proto_item
*signal_item
= NULL
;
998 btl2cap_data_t
*l2cap_data
;
1001 gint packet_type
= 0;
1002 gint message_type
= 0;
1005 wmem_tree_key_t key
[4];
1008 guint32 t_frame_number
;
1009 cid_type_data_t
*cid_type_data
;
1015 gint content_protection_type
= 0;
1017 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "AVDTP");
1019 switch (pinfo
->p2p_dir
) {
1021 col_set_str(pinfo
->cinfo
, COL_INFO
, "Sent ");
1025 col_set_str(pinfo
->cinfo
, COL_INFO
, "Rcvd ");
1028 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Unknown direction %d ",
1034 l2cap_data
= (btl2cap_data_t
*) data
;
1035 DISSECTOR_ASSERT(l2cap_data
);
1037 if (!force_avdtp
&& !pinfo
->fd
->flags
.visited
&& (l2cap_data
->first_scid_frame
== pinfo
->fd
->num
||
1038 l2cap_data
->first_dcid_frame
== pinfo
->fd
->num
)) {
1039 cid_type_data
= wmem_new(wmem_file_scope(), cid_type_data_t
);
1040 cid_type_data
->type
= STREAM_TYPE_MEDIA
;
1041 cid_type_data
->cid
= l2cap_data
->cid
;
1042 cid_type_data
->sep
= NULL
;
1044 /* heuristics for recognize signal AVDTP: first packet must be Discover Command */
1045 if ((tvb_get_guint8(tvb
, offset
) & 0x0F) == 0x00 &&
1046 tvb_get_guint8(tvb
, offset
+ 1) == 0x01 &&
1047 tvb_length_remaining(tvb
, offset
) == HEADER_SIZE
) {
1048 /* It is AVDTP Signaling cmd side */
1049 cid_type_data
->type
= STREAM_TYPE_SIGNAL
;
1050 } else if ((tvb_get_guint8(tvb
, offset
) & 0x0F) == 0x02 &&
1051 tvb_get_guint8(tvb
, offset
+ 1) == 0x01 &&
1052 tvb_length_remaining(tvb
, offset
) <= SEP_MAX
* SEP_SIZE
+ HEADER_SIZE
&&
1053 !(tvb_length_remaining(tvb
, offset
) % SEP_SIZE
)) {
1054 /* It is AVDTP Signaling rsp side */
1055 cid_type_data
->type
= STREAM_TYPE_SIGNAL
;
1057 sep
= (sep_entry_t
*)wmem_tree_lookup32_le(sep_open
, pinfo
->fd
->num
);
1059 if (sep
&& sep
->state
== SEP_STATE_OPEN
) {
1060 sep
->state
= SEP_STATE_IN_USE
;
1061 cid_type_data
->sep
= sep
;
1065 t_type
= cid_type_data
->type
;
1066 t_cid
= cid_type_data
->cid
;
1067 t_frame_number
= pinfo
->fd
->num
;
1070 key
[0].key
= &t_cid
;
1072 key
[1].key
= &t_type
;
1074 key
[2].key
= &t_frame_number
;
1078 wmem_tree_insert32_array(cid_to_type_table
, key
, cid_type_data
);
1083 t_type
= STREAM_TYPE_SIGNAL
;
1084 t_cid
= l2cap_data
->cid
;
1085 t_frame_number
= pinfo
->fd
->num
;
1088 key
[0].key
= &t_cid
;
1090 key
[1].key
= &t_type
;
1092 key
[2].key
= &t_frame_number
;
1096 cid_type_data
= (cid_type_data_t
*)wmem_tree_lookup32_array_le(cid_to_type_table
, key
);
1097 if (cid_type_data
&& cid_type_data
->type
== STREAM_TYPE_MEDIA
&& cid_type_data
->cid
== l2cap_data
->cid
) {
1100 if (!cid_type_data
->sep
) {
1101 ti
= proto_tree_add_item(tree
, proto_btavdtp
, tvb
, offset
, -1, ENC_NA
);
1102 btavdtp_tree
= proto_item_add_subtree(ti
, ett_btavdtp
);
1104 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Media stream on cid=0x%04x", l2cap_data
->cid
);
1105 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_data
, tvb
, offset
, -1, ENC_NA
);
1107 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Media stream ACP SEID [%u - %s %s]",
1108 cid_type_data
->sep
->seid
, get_sep_media_type(pinfo
->fd
->num
, cid_type_data
->sep
->seid
),
1109 get_sep_type(pinfo
->fd
->num
, cid_type_data
->sep
->seid
));
1111 if (cid_type_data
->sep
->media_type
== MEDIA_TYPE_AUDIO
) {
1112 sep_data_t sep_data
;
1114 sep_data
.codec
= cid_type_data
->sep
->codec
;
1115 sep_data
.content_protection_type
= cid_type_data
->sep
->content_protection_type
;
1117 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
1118 call_dissector_with_data(bta2dp_handle
, next_tvb
, pinfo
, tree
, &sep_data
);
1119 } else if (cid_type_data
->sep
->media_type
== MEDIA_TYPE_VIDEO
) {
1120 sep_data_t sep_data
;
1122 sep_data
.codec
= cid_type_data
->sep
->codec
;
1123 sep_data
.content_protection_type
= cid_type_data
->sep
->content_protection_type
;
1125 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
1126 call_dissector_with_data(btvdp_handle
, next_tvb
, pinfo
, tree
, &sep_data
);
1128 ti
= proto_tree_add_item(tree
, proto_btavdtp
, tvb
, offset
, -1, ENC_NA
);
1129 btavdtp_tree
= proto_item_add_subtree(ti
, ett_btavdtp
);
1131 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Media stream on cid=0x%04x", l2cap_data
->cid
);
1132 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_data
, tvb
, offset
, -1, ENC_NA
);
1136 return tvb_length(tvb
);
1137 } else if (!(cid_type_data
&& cid_type_data
->type
== STREAM_TYPE_SIGNAL
&& cid_type_data
->cid
== l2cap_data
->cid
)) {
1138 /* AVDTP not signaling - Unknown Media stream */
1139 ti
= proto_tree_add_item(tree
, proto_btavdtp
, tvb
, offset
, -1, ENC_NA
);
1140 btavdtp_tree
= proto_item_add_subtree(ti
, ett_btavdtp
);
1142 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Unknown stream on cid=0x%04x", l2cap_data
->cid
);
1143 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_data
, tvb
, offset
, -1, ENC_NA
);
1144 return tvb_length(tvb
);
1148 ti
= proto_tree_add_item(tree
, proto_btavdtp
, tvb
, offset
, -1, ENC_NA
);
1149 btavdtp_tree
= proto_item_add_subtree(ti
, ett_btavdtp
);
1151 /* AVDTP signaling*/
1152 message_type
= (tvb_get_guint8(tvb
, offset
) & AVDTP_MESSAGE_TYPE_MASK
);
1153 packet_type
= (tvb_get_guint8(tvb
, offset
) & AVDTP_PACKET_TYPE_MASK
) >> 2;
1155 signal_item
= proto_tree_add_item(btavdtp_tree
, hf_btavdtp_signal
, tvb
, offset
,
1156 (packet_type
== PACKET_TYPE_START
) ? 3 : 2, ENC_NA
);
1157 signal_tree
= proto_item_add_subtree(signal_item
, ett_btavdtp_sep
);
1159 proto_tree_add_item(signal_tree
, hf_btavdtp_transaction
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1160 proto_tree_add_item(signal_tree
, hf_btavdtp_packet_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1161 proto_tree_add_item(signal_tree
, hf_btavdtp_message_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1163 if (packet_type
== PACKET_TYPE_START
) {
1165 proto_tree_add_item(signal_tree
, hf_btavdtp_number_of_signal_packets
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1168 if (packet_type
== PACKET_TYPE_CONTINUE
|| packet_type
== PACKET_TYPE_END
) goto LABEL_data
;
1171 proto_tree_add_item(signal_tree
, hf_btavdtp_rfa0
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1172 proto_tree_add_item(signal_tree
, hf_btavdtp_signal_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1174 signal_id
= tvb_get_guint8(tvb
, offset
) & AVDTP_SIGNAL_ID_MASK
;
1175 proto_item_append_text(signal_item
, ": %s (%s)",
1176 val_to_str_const(signal_id
, signal_id_vals
, "Unknown signal"),
1177 val_to_str_const(message_type
, message_type_vals
, "Unknown message type"));
1179 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s - %s",
1180 val_to_str_const(message_type
, message_type_vals
, "Unknown message type"),
1181 val_to_str_const(signal_id
, signal_id_vals
, "Unknown signal"));
1184 if (message_type
!= MESSAGE_TYPE_GENERAL_REJECT
) switch (signal_id
) {
1185 case SIGNAL_ID_DISCOVER
:
1186 if (message_type
== MESSAGE_TYPE_COMMAND
) break;
1187 if (message_type
== MESSAGE_TYPE_REJECT
) {
1188 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1192 offset
= dissect_sep(tvb
, pinfo
, btavdtp_tree
, offset
);
1194 case SIGNAL_ID_GET_CAPABILITIES
:
1195 case SIGNAL_ID_GET_ALL_CAPABILITIES
:
1196 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1197 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1200 if (message_type
== MESSAGE_TYPE_REJECT
) {
1201 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1204 offset
= dissect_capabilities(tvb
, pinfo
, btavdtp_tree
, offset
, NULL
, NULL
);
1206 case SIGNAL_ID_SET_CONFIGURATION
:
1207 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1208 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, &seid
);
1209 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_INT
, 0, NULL
);
1210 offset
= dissect_capabilities(tvb
, pinfo
, btavdtp_tree
, offset
, &codec
, &content_protection_type
);
1212 t_frame_number
= pinfo
->fd
->num
;
1216 key
[0].key
= &t_seid
;
1218 key
[1].key
= &t_frame_number
;
1222 sep
= (sep_entry_t
*)wmem_tree_lookup32_array_le(sep_list
, key
);
1223 if (sep
&& sep
->seid
== seid
) {
1225 sep
->content_protection_type
= content_protection_type
;
1230 if (message_type
== MESSAGE_TYPE_REJECT
) {
1231 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_service_category
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1233 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1237 case SIGNAL_ID_GET_CONFIGURATION
:
1238 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1239 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1242 if (message_type
== MESSAGE_TYPE_REJECT
) {
1243 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1246 offset
= dissect_capabilities(tvb
, pinfo
, btavdtp_tree
, offset
, NULL
, NULL
);
1248 case SIGNAL_ID_RECONFIGURE
:
1249 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1250 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, &seid
);
1251 offset
= dissect_capabilities(tvb
, pinfo
, btavdtp_tree
, offset
, &codec
, &content_protection_type
);
1253 t_frame_number
= pinfo
->fd
->num
;
1257 key
[0].key
= &t_seid
;
1259 key
[1].key
= &t_frame_number
;
1263 sep
= (sep_entry_t
*)wmem_tree_lookup32_array_le(sep_list
, key
);
1264 if (sep
&& sep
->seid
== seid
) {
1266 sep
->content_protection_type
= content_protection_type
;
1271 if (message_type
== MESSAGE_TYPE_REJECT
) {
1272 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_service_category
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1274 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1278 case SIGNAL_ID_OPEN
:
1279 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1280 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, &seid
);
1282 t_frame_number
= pinfo
->fd
->num
;
1286 key
[0].key
= &t_seid
;
1288 key
[1].key
= &t_frame_number
;
1292 sep
= (sep_entry_t
*)wmem_tree_lookup32_array_le(sep_list
, key
);
1293 if (sep
&& sep
->seid
== seid
) {
1294 sep
->state
= SEP_STATE_OPEN
;
1297 wmem_tree_insert32(sep_open
, pinfo
->fd
->num
, sep
);
1300 if (message_type
== MESSAGE_TYPE_REJECT
) {
1301 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1305 case SIGNAL_ID_START
:
1306 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1308 while (tvb_length_remaining(tvb
, offset
) > 0) {
1309 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, i_sep
, NULL
);
1314 if (message_type
== MESSAGE_TYPE_REJECT
) {
1315 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1316 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1320 case SIGNAL_ID_CLOSE
:
1321 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1322 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1325 if (message_type
== MESSAGE_TYPE_REJECT
) {
1326 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1330 case SIGNAL_ID_SUSPEND
:
1331 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1333 while (tvb_length_remaining(tvb
, offset
) > 0) {
1334 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, i_sep
, NULL
);
1339 if (message_type
== MESSAGE_TYPE_REJECT
) {
1340 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1341 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1345 case SIGNAL_ID_ABORT
:
1346 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1347 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1350 if (message_type
== MESSAGE_TYPE_REJECT
) {
1351 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1355 case SIGNAL_ID_SECURITY_CONTROL
:
1356 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1357 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1358 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_data
, tvb
, offset
, -1, ENC_NA
);
1359 offset
+= tvb_length_remaining(tvb
, offset
);
1362 if (message_type
== MESSAGE_TYPE_REJECT
) {
1363 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1367 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_data
, tvb
, offset
, -1, ENC_NA
);
1368 offset
+= tvb_length_remaining(tvb
, offset
);
1370 case SIGNAL_ID_DELAY_REPORT
:
1371 if (message_type
== MESSAGE_TYPE_COMMAND
) {
1373 delay
= tvb_get_ntohs(tvb
, offset
+ 1);
1374 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "(%u.%u ms)", delay
/10, delay
%10);
1375 offset
= dissect_seid(tvb
, pinfo
, btavdtp_tree
, offset
, SEID_ACP
, 0, NULL
);
1376 pitem
= proto_tree_add_item(btavdtp_tree
, hf_btavdtp_delay
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1377 proto_item_append_text(pitem
, " (1/10 ms)");
1381 if (message_type
== MESSAGE_TYPE_REJECT
) {
1382 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_error_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1390 if (tvb_length_remaining(tvb
, offset
) > 0) {
1391 proto_tree_add_item(btavdtp_tree
, hf_btavdtp_data
, tvb
, offset
, -1, ENC_NA
);
1399 proto_register_btavdtp(void)
1403 static hf_register_info hf
[] = {
1404 { &hf_btavdtp_signal
,
1405 { "Signal", "btavdtp.signal",
1406 FT_NONE
, BASE_NONE
, NULL
, 0x00,
1409 { &hf_btavdtp_message_type
,
1410 { "Message Type", "btavdtp.message_type",
1411 FT_UINT8
, BASE_HEX
, VALS(message_type_vals
), AVDTP_MESSAGE_TYPE_MASK
,
1414 { &hf_btavdtp_packet_type
,
1415 { "Packet Type", "btavdtp.packet_type",
1416 FT_UINT8
, BASE_HEX
, VALS(packet_type_vals
), AVDTP_PACKET_TYPE_MASK
,
1419 { &hf_btavdtp_transaction
,
1420 { "Transaction", "btavdtp.transaction",
1421 FT_UINT8
, BASE_HEX
, NULL
, AVDTP_TRANSACTION_MASK
,
1424 { &hf_btavdtp_signal_id
,
1425 { "Signal", "btavdtp.signal_id",
1426 FT_UINT8
, BASE_HEX
, VALS(signal_id_vals
), AVDTP_SIGNAL_ID_MASK
,
1430 { "RFA", "btavdtp.rfa0",
1431 FT_UINT8
, BASE_HEX
, NULL
, AVDTP_RFA0_MASK
,
1434 { &hf_btavdtp_number_of_signal_packets
,
1435 { "Number of signal packets", "btavdtp.num_signal_packets",
1436 FT_UINT8
, BASE_DEC
, NULL
, 0,
1439 { &hf_btavdtp_error_code
,
1440 { "Error Code", "btavdtp.error_code",
1441 FT_UINT8
, BASE_HEX
, VALS(error_code_vals
), 0x00,
1444 { &hf_btavdtp_sep_seid
,
1445 { "SEID", "btavdtp.sep_seid",
1446 FT_UINT8
, BASE_DEC
, NULL
, 0xFC,
1449 { &hf_btavdtp_sep_inuse
,
1450 { "In Use", "btavdtp.sep_inuse",
1451 FT_UINT8
, BASE_HEX
, VALS(true_false
), 0x02,
1454 { &hf_btavdtp_sep_rfa0
,
1455 { "RFA0", "btavdtp.sep_rfa0",
1456 FT_UINT8
, BASE_HEX
, NULL
, 0x01,
1459 { &hf_btavdtp_sep_media_type
,
1460 { "Media Type", "btavdtp.sep_media_type",
1461 FT_UINT8
, BASE_HEX
, VALS(media_type_vals
), 0xF0,
1464 { &hf_btavdtp_sep_type
,
1465 { "Type", "btavdtp.sep_type",
1466 FT_UINT8
, BASE_HEX
, VALS(sep_type_vals
), 0x08,
1469 { &hf_btavdtp_sep_rfa1
,
1470 { "RFA1", "btavdtp.sep_rfa1",
1471 FT_UINT8
, BASE_HEX
, NULL
, 0x07,
1474 { &hf_btavdtp_acp_sep
,
1475 { "ACP SEP", "btavdtp.acp_sep",
1476 FT_NONE
, BASE_NONE
, NULL
, 0x00,
1479 { &hf_btavdtp_acp_seid_item
,
1480 { "ACP SEID", "btavdtp.acp_seid_item",
1481 FT_NONE
, BASE_NONE
, NULL
, 0x00,
1484 { &hf_btavdtp_int_seid_item
,
1485 { "INT SEID", "btavdtp.int_seid_item",
1486 FT_NONE
, BASE_NONE
, NULL
, 0x00,
1489 { &hf_btavdtp_acp_seid
,
1490 { "ACP SEID", "btavdtp.acp_seid",
1491 FT_UINT8
, BASE_DEC
, NULL
, 0xFC,
1494 { &hf_btavdtp_int_seid
,
1495 { "INT SEID", "btavdtp.int_seid",
1496 FT_UINT8
, BASE_DEC
, NULL
, 0xFC,
1499 { &hf_btavdtp_rfa_seid
,
1500 { "RFA", "btavdtp.rfa_seid",
1501 FT_UINT8
, BASE_HEX
, NULL
, 0x03,
1504 { &hf_btavdtp_service_category
,
1505 { "Service Category", "btavdtp.service_category",
1506 FT_UINT8
, BASE_HEX
, VALS(service_category_vals
), 0x00,
1509 { &hf_btavdtp_length_of_service_category
,
1510 { "Length of Service Category", "btavdtp.length_of_service_category",
1511 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
1514 { &hf_btavdtp_delay
,
1515 { "Delay", "btavdtp.delay",
1516 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
1519 { &hf_btavdtp_recovery_type
,
1520 { "Service Category", "btavdtp.recovery_type",
1521 FT_UINT8
, BASE_HEX
, VALS(recovery_type_vals
), 0x00,
1524 { &hf_btavdtp_maximum_recovery_window_size
,
1525 { "Service Category", "btavdtp.maximum_recovery_window_size",
1526 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
1529 { &hf_btavdtp_maximum_number_of_media_packet_in_parity_code
,
1530 { "Service Category", "btavdtp.maximum_number_of_media_packet_in_parity_code",
1531 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
1534 { &hf_btavdtp_multiplexing_fragmentation
,
1535 { "Fragmentation", "btavdtp.multiplexing_fragmentation",
1536 FT_UINT8
, BASE_HEX
, VALS(true_false
), 0x80,
1539 { &hf_btavdtp_multiplexing_rfa
,
1540 { "RFA", "btavdtp.multiplexing_rfa",
1541 FT_UINT8
, BASE_HEX
, NULL
, 0x7F,
1544 { &hf_btavdtp_multiplexing_tsid
,
1545 { "TSID", "btavdtp.multiplexing_tsid",
1546 FT_UINT8
, BASE_HEX
, VALS(multiplexing_tsid_vals
), 0xF8,
1549 { &hf_btavdtp_multiplexing_tcid
,
1550 { "TCID", "btavdtp.multiplexing_tcid",
1551 FT_UINT8
, BASE_HEX
, VALS(multiplexing_tcid_vals
), 0xF8,
1554 { &hf_btavdtp_multiplexing_entry_rfa
,
1555 { "RFA", "btavdtp.multiplexing_entry_rfa",
1556 FT_UINT8
, BASE_HEX
, NULL
, 0x07,
1559 { &hf_btavdtp_header_compression_backch
,
1560 { "BackCh", "btavdtp.header_compression_backch",
1561 FT_UINT8
, BASE_HEX
, VALS(true_false
), 0x80,
1564 { &hf_btavdtp_header_compression_media
,
1565 { "Media", "btavdtp.header_compression_media",
1566 FT_UINT8
, BASE_HEX
, VALS(true_false
), 0x40,
1569 { &hf_btavdtp_header_compression_recovery
,
1570 { "Recovery", "btavdtp.header_compression_recovery",
1571 FT_UINT8
, BASE_HEX
, VALS(true_false
), 0x20,
1574 { &hf_btavdtp_header_compression_rfa
,
1575 { "RFA", "btavdtp.header_compression_rfa",
1576 FT_UINT8
, BASE_HEX
, NULL
, 0x1f,
1579 { &hf_btavdtp_content_protection_type
,
1580 { "Type", "btavdtp.content_protection_type",
1581 FT_UINT16
, BASE_HEX
, VALS(content_protection_type_vals
), 0x0000,
1584 { &hf_btavdtp_media_codec_media_type
,
1585 { "Media Type", "btavdtp.media_codec_media_type",
1586 FT_UINT8
, BASE_HEX
, VALS(media_type_vals
), 0xF0,
1589 { &hf_btavdtp_media_codec_rfa
,
1590 { "RFA", "btavdtp.media_codec_rfa",
1591 FT_UINT8
, BASE_HEX
, NULL
, 0x0F,
1594 { &hf_btavdtp_media_codec_audio_type
,
1595 { "Media Codec Audio Type", "btavdtp.media_codec_audio_type",
1596 FT_UINT8
, BASE_HEX
, VALS(media_codec_audio_type_vals
), 0x00,
1599 { &hf_btavdtp_media_codec_video_type
,
1600 { "Media Codec Video Type", "btavdtp.media_codec_video_type",
1601 FT_UINT8
, BASE_HEX
, VALS(media_codec_video_type_vals
), 0x00,
1604 { &hf_btavdtp_media_codec_unknown_type
,
1605 { "Media Codec Unknown Type", "btavdtp.media_codec_unknown_type",
1606 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
1609 { &hf_btavdtp_sbc_sampling_frequency_16000
,
1610 { "Sampling Frequency 16000 Hz", "btavdtp.codec.sbc.sampling_frequency.16000",
1611 FT_BOOLEAN
, 8, NULL
, 0x80,
1614 { &hf_btavdtp_sbc_sampling_frequency_32000
,
1615 { "Sampling Frequency 32000 Hz", "btavdtp.codec.sbc.sampling_frequency.32000",
1616 FT_BOOLEAN
, 8, NULL
, 0x40,
1619 { &hf_btavdtp_sbc_sampling_frequency_44100
,
1620 { "Sampling Frequency 44100 Hz", "btavdtp.codec.sbc.sampling_frequency.44100",
1621 FT_BOOLEAN
, 8, NULL
, 0x20,
1624 { &hf_btavdtp_sbc_sampling_frequency_48000
,
1625 { "Sampling Frequency 48000 Hz", "btavdtp.codec.sbc.sampling_frequency.48000",
1626 FT_BOOLEAN
, 8, NULL
, 0x10,
1629 { &hf_btavdtp_sbc_channel_mode_mono
,
1630 { "Channel Mode Mono", "btavdtp.codec.sbc.channel_mode.mono",
1631 FT_BOOLEAN
, 8, NULL
, 0x08,
1634 { &hf_btavdtp_sbc_channel_mode_dual_channel
,
1635 { "Channel Mode Dual Channel", "btavdtp.codec.sbc.channel_mode.dual_channel",
1636 FT_BOOLEAN
, 8, NULL
, 0x04,
1639 { &hf_btavdtp_sbc_channel_mode_stereo
,
1640 { "Channel Mode Stereo", "btavdtp.codec.sbc.channel_mode.stereo",
1641 FT_BOOLEAN
, 8, NULL
, 0x02,
1644 { &hf_btavdtp_sbc_channel_mode_joint_stereo
,
1645 { "Channel Mode Joint Stereo", "btavdtp.codec.sbc.channel_mode.joint_stereo",
1646 FT_BOOLEAN
, 8, NULL
, 0x01,
1649 { &hf_btavdtp_sbc_block_4
,
1650 { "Block Length 4", "btavdtp.codec.sbc.block_4",
1651 FT_BOOLEAN
, 8, NULL
, 0x80,
1654 { &hf_btavdtp_sbc_block_8
,
1655 { "Block Length 8", "btavdtp.codec.sbc.block_8",
1656 FT_BOOLEAN
, 8, NULL
, 0x40,
1659 { &hf_btavdtp_sbc_block_12
,
1660 { "Block Length 12", "btavdtp.codec.sbc.block_12",
1661 FT_BOOLEAN
, 8, NULL
, 0x20,
1664 { &hf_btavdtp_sbc_block_16
,
1665 { "Block Length 16", "btavdtp.codec.sbc.block_16",
1666 FT_BOOLEAN
, 8, NULL
, 0x10,
1669 { &hf_btavdtp_sbc_subbands_4
,
1670 { "Subbands 4", "btavdtp.codec.sbc.subbands_4",
1671 FT_BOOLEAN
, 8, NULL
, 0x08,
1674 { &hf_btavdtp_sbc_subbands_8
,
1675 { "Subbands 8", "btavdtp.codec.sbc.subbands_8",
1676 FT_BOOLEAN
, 8, NULL
, 0x04,
1679 { &hf_btavdtp_sbc_allocation_method_snr
,
1680 { "Allocation Method SNR", "btavdtp.codec.sbc.allocation_method_snr",
1681 FT_BOOLEAN
, 8, NULL
, 0x02,
1684 { &hf_btavdtp_sbc_allocation_method_loudness
,
1685 { "Allocation Method Loudness", "btavdtp.codec.sbc.allocation_method_loudness",
1686 FT_BOOLEAN
, 8, NULL
, 0x01,
1689 { &hf_btavdtp_sbc_min_bitpool
,
1690 { "Minumum Bitpool", "btavdtp.codec.sbc.minimum_bitpool",
1691 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
1694 { &hf_btavdtp_sbc_max_bitpool
,
1695 { "Maximum Bitpool", "btavdtp.codec.sbc.maximum_bitpool",
1696 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
1699 { &hf_btavdtp_mpeg12_layer_1
,
1700 { "MP1", "btavdtp.codec.mpeg12.layer_1",
1701 FT_BOOLEAN
, 8, NULL
, 0x80,
1702 "MPEG Layer 1", HFILL
}
1704 { &hf_btavdtp_mpeg12_layer_2
,
1705 { "MP2", "btavdtp.codec.mpeg12.layer_2",
1706 FT_BOOLEAN
, 8, NULL
, 0x40,
1707 "MPEG Layer 2", HFILL
}
1709 { &hf_btavdtp_mpeg12_layer_3
,
1710 { "MP3", "btavdtp.codec.mpeg12.layer_3",
1711 FT_BOOLEAN
, 8, NULL
, 0x20,
1712 "MPEG Layer 3", HFILL
}
1714 { &hf_btavdtp_mpeg12_crc_protection
,
1715 { "CRC Protection", "btavdtp.codec.mpeg12.crc_protection",
1716 FT_BOOLEAN
, 8, NULL
, 0x10,
1719 { &hf_btavdtp_mpeg12_channel_mode_mono
,
1720 { "Channel Mode Mono", "btavdtp.codec.mpeg12.channel_mode.mono",
1721 FT_BOOLEAN
, 8, NULL
, 0x08,
1724 { &hf_btavdtp_mpeg12_channel_mode_dual_channel
,
1725 { "Channel Mode Dual Channel", "btavdtp.codec.mpeg12.channel_mode.dual_channel",
1726 FT_BOOLEAN
, 8, NULL
, 0x04,
1729 { &hf_btavdtp_mpeg12_channel_mode_stereo
,
1730 { "Channel Mode Stereo", "btavdtp.codec.mpeg12.channel_mode.stereo",
1731 FT_BOOLEAN
, 8, NULL
, 0x02,
1734 { &hf_btavdtp_mpeg12_channel_mode_joint_stereo
,
1735 { "Channel Mode Joint Stereo", "btavdtp.codec.mpeg12.channel_mode.joint_stereo",
1736 FT_BOOLEAN
, 8, NULL
, 0x01,
1739 { &hf_btavdtp_mpeg12_rfa
,
1740 { "RFA", "btavdtp.codec.mpeg12.rfa",
1741 FT_BOOLEAN
, 8, NULL
, 0x80,
1744 { &hf_btavdtp_mpeg12_mpf_2
,
1745 { "MPF 2", "btavdtp.codec.mpeg12.mpf_2",
1746 FT_BOOLEAN
, 8, NULL
, 0x40,
1749 { &hf_btavdtp_mpeg12_sampling_frequency_16000
,
1750 { "Sampling Frequency 16000 Hz", "btavdtp.codec.sbc.sampling_frequency.16000",
1751 FT_BOOLEAN
, 8, NULL
, 0x20,
1754 { &hf_btavdtp_mpeg12_sampling_frequency_22050
,
1755 { "Sampling Frequency 22050 Hz", "btavdtp.codec.sbc.sampling_frequency.22050",
1756 FT_BOOLEAN
, 8, NULL
, 0x10,
1759 { &hf_btavdtp_mpeg12_sampling_frequency_24000
,
1760 { "Sampling Frequency 24000 Hz", "btavdtp.codec.sbc.sampling_frequency.24000",
1761 FT_BOOLEAN
, 8, NULL
, 0x08,
1764 { &hf_btavdtp_mpeg12_sampling_frequency_32000
,
1765 { "Sampling Frequency 32000 Hz", "btavdtp.codec.sbc.sampling_frequency.32000",
1766 FT_BOOLEAN
, 8, NULL
, 0x04,
1769 { &hf_btavdtp_mpeg12_sampling_frequency_44100
,
1770 { "Sampling Frequency 44100 Hz", "btavdtp.codec.sbc.sampling_frequency.44100",
1771 FT_BOOLEAN
, 8, NULL
, 0x02,
1774 { &hf_btavdtp_mpeg12_sampling_frequency_48000
,
1775 { "Sampling Frequency 48000 Hz", "btavdtp.codec.sbc.sampling_frequency.48000",
1776 FT_BOOLEAN
, 8, NULL
, 0x01,
1779 { &hf_btavdtp_mpeg12_vbr_supported
,
1780 { "VBR Supported", "btavdtp.codec.mpeg12.vbr",
1781 FT_BOOLEAN
, 16, NULL
, 0x8000,
1784 { &hf_btavdtp_mpeg12_bit_rate
,
1785 { "Bit Rate", "btavdtp.codec.mpeg12.bit_rate",
1786 FT_UINT16
, BASE_HEX
, NULL
, 0x7FFF,
1789 { &hf_btavdtp_mpeg24_object_type_mpeg2_aac_lc
,
1790 { "MPEG2 ACC LC", "btavdtp.codec.mpeg24.object_type.mpeg2_aac_lc",
1791 FT_UINT8
, BASE_HEX
, NULL
, 0x80,
1794 { &hf_btavdtp_mpeg24_object_type_mpeg4_aac_lc
,
1795 { "MPEG4 ACC LC", "btavdtp.codec.mpeg24.object_type.mpeg4_aac_lc",
1796 FT_UINT8
, BASE_HEX
, NULL
, 0x40,
1799 { &hf_btavdtp_mpeg24_object_type_mpeg4_aac_ltp
,
1800 { "MPEG4 ACC LTP", "btavdtp.codec.mpeg24.object_type.mpeg4_aac_ltp",
1801 FT_UINT8
, BASE_HEX
, NULL
, 0x20,
1804 { &hf_btavdtp_mpeg24_object_type_mpeg4_aac_scalable
,
1805 { "MPEG4 ACC Scalable", "btavdtp.codec.mpeg24.object_type.mpeg4_aac_scalable",
1806 FT_UINT8
, BASE_HEX
, NULL
, 0x10,
1809 { &hf_btavdtp_mpeg24_object_type_rfa
,
1810 { "RFA", "btavdtp.codec.mpeg24.object_type.rfa",
1811 FT_UINT8
, BASE_HEX
, NULL
, 0x0F,
1814 { &hf_btavdtp_mpeg24_sampling_frequency_8000
,
1815 { "Sampling Frequency 8000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.8000",
1816 FT_BOOLEAN
, 8, NULL
, 0x80,
1819 { &hf_btavdtp_mpeg24_sampling_frequency_11025
,
1820 { "Sampling Frequency 11025 Hz", "btavdtp.codec.mpeg24.sampling_frequency.11025",
1821 FT_BOOLEAN
, 8, NULL
, 0x40,
1824 { &hf_btavdtp_mpeg24_sampling_frequency_12000
,
1825 { "Sampling Frequency 12000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.12000",
1826 FT_BOOLEAN
, 8, NULL
, 0x20,
1829 { &hf_btavdtp_mpeg24_sampling_frequency_16000
,
1830 { "Sampling Frequency 16000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.16000",
1831 FT_BOOLEAN
, 8, NULL
, 0x10,
1834 { &hf_btavdtp_mpeg24_sampling_frequency_22050
,
1835 { "Sampling Frequency 22050 Hz", "btavdtp.codec.mpeg24.sampling_frequency.22050",
1836 FT_BOOLEAN
, 8, NULL
, 0x08,
1839 { &hf_btavdtp_mpeg24_sampling_frequency_24000
,
1840 { "Sampling Frequency 24000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.24000",
1841 FT_BOOLEAN
, 8, NULL
, 0x04,
1844 { &hf_btavdtp_mpeg24_sampling_frequency_32000
,
1845 { "Sampling Frequency 32000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.32000",
1846 FT_BOOLEAN
, 8, NULL
, 0x02,
1849 { &hf_btavdtp_mpeg24_sampling_frequency_44100
,
1850 { "Sampling Frequency 44100 Hz", "btavdtp.codec.mpeg24.sampling_frequency.44100",
1851 FT_BOOLEAN
, 8, NULL
, 0x01,
1854 { &hf_btavdtp_mpeg24_sampling_frequency_48000
,
1855 { "Sampling Frequency 48000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.48000",
1856 FT_BOOLEAN
, 8, NULL
, 0x80,
1859 { &hf_btavdtp_mpeg24_sampling_frequency_64000
,
1860 { "Sampling Frequency 64000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.64000",
1861 FT_BOOLEAN
, 8, NULL
, 0x40,
1864 { &hf_btavdtp_mpeg24_sampling_frequency_88200
,
1865 { "Sampling Frequency 88200 Hz", "btavdtp.codec.mpeg24.sampling_frequency.88200",
1866 FT_BOOLEAN
, 8, NULL
, 0x20,
1869 { &hf_btavdtp_mpeg24_sampling_frequency_96000
,
1870 { "Sampling Frequency 96000 Hz", "btavdtp.codec.mpeg24.sampling_frequency.96000",
1871 FT_BOOLEAN
, 8, NULL
, 0x10,
1874 { &hf_btavdtp_mpeg24_channels_1
,
1875 { "Channels 1", "btavdtp.codec.mpeg24.channels.1",
1876 FT_BOOLEAN
, 8, NULL
, 0x08,
1879 { &hf_btavdtp_mpeg24_channels_2
,
1880 { "Channels 2", "btavdtp.codec.mpeg24.channels.2",
1881 FT_BOOLEAN
, 8, NULL
, 0x04,
1884 { &hf_btavdtp_mpeg24_rfa
,
1885 { "RFA", "btavdtp.codec.mpeg24.rfa",
1886 FT_UINT8
, BASE_HEX
, NULL
, 0x03,
1889 { &hf_btavdtp_mpeg24_vbr_supported
,
1890 { "VBR Supported", "btavdtp.codec.mpeg24.vbr",
1891 FT_BOOLEAN
, 24, NULL
, 0x800000,
1894 { &hf_btavdtp_mpeg24_bit_rate
,
1895 { "Bit Rate", "btavdtp.codec.mpeg24.bit_rate",
1896 FT_UINT24
, BASE_HEX
, NULL
, 0x7FFFFF,
1899 { &hf_btavdtp_atrac_version
,
1900 { "Version", "btavdtp.codec.atrac.version",
1901 FT_UINT8
, BASE_DEC
, NULL
, 0xE0,
1904 { &hf_btavdtp_atrac_channel_mode_single_channel
,
1905 { "Channel Mode Single Channel", "btavdtp.codec.atrac.channel_mode.single_channel",
1906 FT_BOOLEAN
, 8, NULL
, 0x10,
1909 { &hf_btavdtp_atrac_channel_mode_dual_channel
,
1910 { "Channel Mode Dual Channel", "btavdtp.codec.atrac.channel_mode.dual_channel",
1911 FT_BOOLEAN
, 8, NULL
, 0x08,
1914 { &hf_btavdtp_atrac_channel_mode_joint_stereo
,
1915 { "Channel Mode Joint Stereo", "btavdtp.codec.atrac.channel_mode.joint_stereo",
1916 FT_BOOLEAN
, 8, NULL
, 0x04,
1919 { &hf_btavdtp_atrac_rfa1
,
1920 { "RFA", "btavdtp.codec.atrac.rfa1",
1921 FT_UINT8
, BASE_HEX
, NULL
, 0x03,
1924 { &hf_btavdtp_atrac_rfa2
,
1925 { "RFA", "btavdtp.codec.atrac.rfa2",
1926 FT_UINT24
, BASE_HEX
, NULL
, 0xC00000,
1929 { &hf_btavdtp_atrac_sampling_frequency_44100
,
1930 { "Sampling Frequency 44100 Hz", "btavdtp.codec.sbc.sampling_frequency.44100",
1931 FT_BOOLEAN
, 24, NULL
, 0x200000,
1934 { &hf_btavdtp_atrac_sampling_frequency_48000
,
1935 { "Sampling Frequency 48000 Hz", "btavdtp.codec.sbc.sampling_frequency.48000",
1936 FT_BOOLEAN
, 24, NULL
, 0x100000,
1939 { &hf_btavdtp_atrac_vbr_supported
,
1940 { "VBR Supported", "btavdtp.codec.atrac.vbr",
1941 FT_BOOLEAN
, 24, NULL
, 0x080000,
1944 { &hf_btavdtp_atrac_bit_rate
,
1945 { "Bit Rate", "btavdtp.codec.atrac.bit_rate",
1946 FT_UINT24
, BASE_HEX
, NULL
, 0x07FFFF,
1949 { &hf_btavdtp_atrac_maximum_sul
,
1950 { "Maximum SUL", "btavdtp.codec.atrac.maximum_sul",
1951 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
1952 "Sound Unit Length (SUL) is one of the parameters that determine bit rate of the audio stream.", HFILL
}
1954 { &hf_btavdtp_atrac_rfa3
,
1955 { "RFA", "btavdtp.codec.atrac.rfa3",
1956 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
1959 { &hf_btavdtp_h263_level_10
,
1960 { "H264 Level 10", "btavdtp.codec.h264.level.10",
1961 FT_BOOLEAN
, 8, NULL
, 0x80,
1964 { &hf_btavdtp_h263_level_20
,
1965 { "H264 Level 20", "btavdtp.codec.h264.level.20",
1966 FT_BOOLEAN
, 8, NULL
, 0x40,
1969 { &hf_btavdtp_h263_level_30
,
1970 { "H264 Level 30", "btavdtp.codec.h264.level.30",
1971 FT_BOOLEAN
, 8, NULL
, 0x20,
1974 { &hf_btavdtp_h263_level_rfa
,
1975 { "H264 Level RFA", "btavdtp.codec.h264.level.rfa",
1976 FT_UINT8
, BASE_HEX
, NULL
, 0x1F,
1979 { &hf_btavdtp_mpeg4_level_0
,
1980 { "MPEG Level 0", "btavdtp.codec.mpeg4.level.0",
1981 FT_BOOLEAN
, 8, NULL
, 0x80,
1984 { &hf_btavdtp_mpeg4_level_1
,
1985 { "MPEG Level 1", "btavdtp.codec.mpeg4.level.1",
1986 FT_BOOLEAN
, 8, NULL
, 0x40,
1989 { &hf_btavdtp_mpeg4_level_2
,
1990 { "MPEG Level 2", "btavdtp.codec.mpeg4.level.2",
1991 FT_BOOLEAN
, 8, NULL
, 0x20,
1994 { &hf_btavdtp_mpeg4_level_3
,
1995 { "MPEG4 Level 3", "btavdtp.codec.mpeg4.level.3",
1996 FT_BOOLEAN
, 8, NULL
, 0x10,
1999 { &hf_btavdtp_mpeg4_level_rfa
,
2000 { "MPEG4 Level RFA", "btavdtp.codec.mpeg4.level.rfa",
2001 FT_UINT8
, BASE_HEX
, NULL
, 0x0F,
2004 { &hf_btavdtp_vendor_id
,
2005 { "Vendor ID", "btavdtp.codec.vendor.vendor_id",
2006 FT_UINT32
, BASE_HEX
|BASE_EXT_STRING
, &bthci_evt_comp_id_ext
, 0x00,
2009 { &hf_btavdtp_vendor_specific_codec_id
,
2010 { "Codec", "btavdtp.codec.vendor.codec_id",
2011 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
2014 { &hf_btavdtp_vendor_specific_value
,
2015 { "Value", "btavdtp.codec.vendor.value",
2016 FT_NONE
, BASE_NONE
, NULL
, 0x00,
2019 { &hf_btavdtp_capabilities
,
2020 { "Capabilities", "btavdtp.capabilities",
2021 FT_NONE
, BASE_NONE
, NULL
, 0x0,
2024 { &hf_btavdtp_service
,
2025 { "Service", "btavdtp.service",
2026 FT_NONE
, BASE_NONE
, NULL
, 0x0,
2029 { &hf_btavdtp_service_multiplexing_entry
,
2030 { "Entry", "btavdtp.service_multiplexing_entry",
2031 FT_NONE
, BASE_NONE
, NULL
, 0x0,
2035 { "Data", "btavdtp.data",
2036 FT_NONE
, BASE_NONE
, NULL
, 0x0,
2041 static gint
*ett
[] = {
2044 &ett_btavdtp_capabilities
,
2045 &ett_btavdtp_service
,
2048 proto_btavdtp
= proto_register_protocol("Bluetooth AVDTP Protocol", "BT AVDTP", "btavdtp");
2049 new_register_dissector("btavdtp", dissect_btavdtp
, proto_btavdtp
);
2051 proto_register_field_array(proto_btavdtp
, hf
, array_length(hf
));
2052 proto_register_subtree_array(ett
, array_length(ett
));
2054 module
= prefs_register_protocol(proto_btavdtp
, NULL
);
2055 prefs_register_static_text_preference(module
, "avdtp.version",
2056 "Bluetooth Protocol AVDTP version: 1.3",
2057 "Version of protocol supported by this dissector.");
2059 prefs_register_bool_preference(module
, "avdtp.force",
2060 "Force decoding as AVDTP Signaling",
2061 "Force decoding as AVDTP Signaling",
2064 sep_list
= wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
2065 sep_open
= wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
2066 cid_to_type_table
= wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* cid: type */
2070 proto_reg_handoff_btavdtp(void)
2072 btavdtp_handle
= find_dissector("btavdtp");
2073 bta2dp_handle
= find_dissector("bta2dp");
2074 btvdp_handle
= find_dissector("btvdp");
2076 dissector_add_uint("btl2cap.service", BTSDP_AVDTP_PROTOCOL_UUID
, btavdtp_handle
);
2078 dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_AVDTP
, btavdtp_handle
);
2080 dissector_add_handle("btl2cap.cid", btavdtp_handle
);
2085 dissect_bta2dp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
2088 proto_tree
*bta2dp_tree
;
2091 dissector_handle_t codec_dissector
= NULL
;
2092 bta2dp_codec_info_t bta2dp_codec_info
;
2093 sep_data_t sep_data
;
2095 sep_data
.codec
= CODEC_SBC
;
2096 sep_data
.content_protection_type
= 0;
2098 if (force_a2dp_scms_t
|| force_a2dp_codec
) {
2099 if (force_a2dp_scms_t
)
2100 sep_data
.content_protection_type
= 2;
2102 sep_data
.content_protection_type
= ((sep_data_t
*) data
)->content_protection_type
;
2104 if (force_a2dp_codec
)
2105 sep_data
.codec
= force_a2dp_codec
;
2107 sep_data
.codec
= ((sep_data_t
*) data
)->codec
;
2110 sep_data
= *((sep_data_t
*) data
);
2113 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "A2DP");
2115 switch (pinfo
->p2p_dir
) {
2118 col_set_str(pinfo
->cinfo
, COL_INFO
, "Sent ");
2122 col_set_str(pinfo
->cinfo
, COL_INFO
, "Rcvd ");
2125 case P2P_DIR_UNKNOWN
:
2126 col_clear(pinfo
->cinfo
, COL_INFO
);
2130 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Unknown direction %d ",
2135 ti
= proto_tree_add_item(tree
, proto_bta2dp
, tvb
, offset
, -1, ENC_NA
);
2136 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Audio stream - %s",
2137 val_to_str_const(sep_data
.codec
, media_codec_audio_type_vals
, "unknown codec"));
2139 bta2dp_tree
= proto_item_add_subtree(ti
, ett_bta2dp
);
2141 pitem
= proto_tree_add_uint(bta2dp_tree
, hf_bta2dp_codec
, tvb
, offset
, 0, sep_data
.codec
);
2142 PROTO_ITEM_SET_GENERATED(pitem
);
2144 if (sep_data
.content_protection_type
> 0) {
2145 pitem
= proto_tree_add_uint(bta2dp_tree
, hf_bta2dp_content_protection
, tvb
, offset
, 0, sep_data
.content_protection_type
);
2146 PROTO_ITEM_SET_GENERATED(pitem
);
2149 switch (sep_data
.codec
) {
2151 codec_dissector
= sbc_handle
;
2153 case CODEC_MPEG12_AUDIO
:
2154 codec_dissector
= mp2t_handle
;
2156 case CODEC_MPEG24_AAC
:
2157 codec_dissector
= mpeg_audio_handle
;
2160 codec_dissector
= atrac_handle
;
2164 bta2dp_codec_info
.codec_dissector
= codec_dissector
;
2165 bta2dp_codec_info
.content_protection_type
= sep_data
.content_protection_type
;
2167 bluetooth_add_address(pinfo
, &pinfo
->net_dst
, "BT A2DP", pinfo
->fd
->num
, FALSE
, &bta2dp_codec_info
);
2168 call_dissector(rtp_handle
, tvb
, pinfo
, tree
);
2169 offset
+= tvb_length_remaining(tvb
, offset
);
2175 proto_register_bta2dp(void)
2179 static hf_register_info hf
[] = {
2181 { "Codec", "bta2dp.codec",
2182 FT_UINT8
, BASE_HEX
, VALS(media_codec_audio_type_vals
), 0x00,
2185 { &hf_bta2dp_content_protection
,
2186 { "Content Protection", "bta2dp.content_protection",
2187 FT_UINT16
, BASE_HEX
, VALS(content_protection_type_vals
), 0x0000,
2192 static gint
*ett
[] = {
2196 proto_bta2dp
= proto_register_protocol("Bluetooth A2DP Profile", "BT A2DP", "bta2dp");
2197 proto_register_field_array(proto_bta2dp
, hf
, array_length(hf
));
2198 proto_register_subtree_array(ett
, array_length(ett
));
2200 new_register_dissector("bta2dp", dissect_bta2dp
, proto_bta2dp
);
2202 module
= prefs_register_protocol(proto_bta2dp
, NULL
);
2203 prefs_register_static_text_preference(module
, "a2dp.version",
2204 "Bluetooth Profile A2DP version: 1.3",
2205 "Version of profile supported by this dissector.");
2207 prefs_register_bool_preference(module
, "a2dp.content_protection.scms_t",
2208 "Force SCMS-T decoding",
2209 "Force decoding stream as A2DP with Content Protection SCMS-T ",
2210 &force_a2dp_scms_t
);
2212 prefs_register_enum_preference(module
, "a2dp.codec",
2214 "Force decoding stream as A2DP with specified codec",
2215 &force_a2dp_codec
, pref_a2dp_codec
, FALSE
);
2219 proto_reg_handoff_bta2dp(void)
2221 sbc_handle
= find_dissector("sbc");
2222 mp2t_handle
= find_dissector("mp2t");
2223 mpeg_audio_handle
= find_dissector("mpeg-audio");
2224 /* TODO: ATRAC dissector does not exist yet */
2225 atrac_handle
= find_dissector("atrac");
2227 bta2dp_handle
= find_dissector("bta2dp");
2228 rtp_handle
= find_dissector("rtp");
2230 dissector_add_uint("btl2cap.service", BTSDP_A2DP_SOURCE_SERVICE_UUID
, bta2dp_handle
);
2231 dissector_add_uint("btl2cap.service", BTSDP_A2DP_SINK_SERVICE_UUID
, bta2dp_handle
);
2232 dissector_add_uint("btl2cap.service", BTSDP_A2DP_DISTRIBUTION_SERVICE_UUID
, bta2dp_handle
);
2233 dissector_add_handle("btl2cap.cid", bta2dp_handle
);
2237 dissect_btvdp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
2240 proto_tree
*btvdp_tree
;
2243 dissector_handle_t codec_dissector
= NULL
;
2244 btvdp_codec_info_t btvdp_codec_info
;
2245 sep_data_t sep_data
;
2247 sep_data
.codec
= CODEC_H263_BASELINE
;
2248 sep_data
.content_protection_type
= 0;
2250 if (force_vdp_scms_t
|| force_vdp_codec
) {
2251 if (force_vdp_scms_t
)
2252 sep_data
.content_protection_type
= 2;
2254 sep_data
.content_protection_type
= ((sep_data_t
*) data
)->content_protection_type
;
2256 if (force_vdp_codec
)
2257 sep_data
.codec
= force_vdp_codec
;
2259 sep_data
.codec
= ((sep_data_t
*) data
)->codec
;
2262 sep_data
= *((sep_data_t
*) data
);
2265 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "VDP");
2267 switch (pinfo
->p2p_dir
) {
2270 col_set_str(pinfo
->cinfo
, COL_INFO
, "Sent ");
2274 col_set_str(pinfo
->cinfo
, COL_INFO
, "Rcvd ");
2277 case P2P_DIR_UNKNOWN
:
2278 col_clear(pinfo
->cinfo
, COL_INFO
);
2282 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Unknown direction %d ",
2287 ti
= proto_tree_add_item(tree
, proto_btvdp
, tvb
, offset
, -1, ENC_NA
);
2288 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Video stream - %s",
2289 val_to_str_const(sep_data
.codec
, media_codec_video_type_vals
, "unknown codec"));
2291 btvdp_tree
= proto_item_add_subtree(ti
, ett_btvdp
);
2293 pitem
= proto_tree_add_uint(btvdp_tree
, hf_btvdp_codec
, tvb
, offset
, 0, sep_data
.codec
);
2294 PROTO_ITEM_SET_GENERATED(pitem
);
2296 if (sep_data
.content_protection_type
> 0) {
2297 pitem
= proto_tree_add_uint(btvdp_tree
, hf_btvdp_content_protection
, tvb
, offset
, 0, sep_data
.content_protection_type
);
2298 PROTO_ITEM_SET_GENERATED(pitem
);
2301 switch (sep_data
.codec
) {
2302 case CODEC_H263_BASELINE
:
2303 case CODEC_H263_PROFILE_3
:
2304 case CODEC_H263_PROFILE_8
:
2305 codec_dissector
= h263_handle
;
2307 case CODEC_MPEG4_VSP
:
2308 codec_dissector
= mp4v_es_handle
;
2312 btvdp_codec_info
.codec_dissector
= codec_dissector
;
2313 btvdp_codec_info
.content_protection_type
= sep_data
.content_protection_type
;
2315 bluetooth_add_address(pinfo
, &pinfo
->net_dst
, "BT VDP", pinfo
->fd
->num
, TRUE
, &btvdp_codec_info
);
2316 call_dissector(rtp_handle
, tvb
, pinfo
, tree
);
2317 offset
+= tvb_length_remaining(tvb
, offset
);
2323 proto_register_btvdp(void)
2326 expert_module_t
* expert_btavdtp
;
2328 static hf_register_info hf
[] = {
2330 { "Codec", "btvdp.codec",
2331 FT_UINT8
, BASE_HEX
, VALS(media_codec_video_type_vals
), 0x00,
2334 { &hf_btvdp_content_protection
,
2335 { "Content Protection", "btvdp.content_protection",
2336 FT_UINT16
, BASE_HEX
, VALS(content_protection_type_vals
), 0x0000,
2341 static gint
*ett
[] = {
2345 static ei_register_info ei
[] = {
2346 { &ei_btavdtp_sbc_min_bitpool_out_of_range
, { "btavdtp.codec.sbc.minimum_bitpool.out_of_range", PI_PROTOCOL
, PI_WARN
, "Bitpool is out of range. Should be 2..250.", EXPFILL
}},
2347 { &ei_btavdtp_sbc_max_bitpool_out_of_range
, { "btavdtp.codec.sbc.maximum_bitpool.out_of_range", PI_PROTOCOL
, PI_WARN
, "Bitpool is out of range. Should be 2..250.", EXPFILL
}},
2348 { &ei_btavdtp_unexpected_losc_data
, { "btavdtp.unexpected_losc_data", PI_PROTOCOL
, PI_WARN
, "Unexpected losc data", EXPFILL
}},
2351 proto_btvdp
= proto_register_protocol("Bluetooth VDP Profile", "BT VDP", "btvdp");
2352 new_register_dissector("btvdp", dissect_btvdp
, proto_btvdp
);
2353 proto_register_field_array(proto_bta2dp
, hf
, array_length(hf
));
2354 proto_register_subtree_array(ett
, array_length(ett
));
2355 expert_btavdtp
= expert_register_protocol(proto_btvdp
);
2356 expert_register_field_array(expert_btavdtp
, ei
, array_length(ei
));
2358 module
= prefs_register_protocol(proto_btvdp
, NULL
);
2359 prefs_register_static_text_preference(module
, "vdp.version",
2360 "Bluetooth Profile VDP version: 1.1",
2361 "Version of profile supported by this dissector.");
2363 prefs_register_bool_preference(module
, "vdp.content_protection.scms_t",
2364 "Force SCMS-T decoding",
2365 "Force decoding stream as VDP with Content Protection SCMS-T ",
2368 prefs_register_enum_preference(module
, "vdp.codec",
2370 "Force decoding stream as VDP with specified codec",
2371 &force_vdp_codec
, pref_vdp_codec
, FALSE
);
2375 proto_reg_handoff_btvdp(void)
2377 h263_handle
= find_dissector("h263");
2378 mp4v_es_handle
= find_dissector("mp4v-es");
2380 rtp_handle
= find_dissector("rtp");
2381 btvdp_handle
= find_dissector("btvdp");
2383 dissector_add_uint("btl2cap.service", BTSDP_VDP_SOURCE_SERVICE_UUID
, btvdp_handle
);
2384 dissector_add_uint("btl2cap.service", BTSDP_VDP_SINK_SERVICE_UUID
, btvdp_handle
);
2385 dissector_add_uint("btl2cap.service", BTSDP_VDP_DISTRIBUTION_SERVICE_UUID
, btvdp_handle
);
2386 dissector_add_handle("btl2cap.cid", btvdp_handle
);
2392 dissect_a2dp_cp_scms_t(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
2394 proto_item
*main_item
;
2395 proto_tree
*main_tree
;
2398 main_item
= proto_tree_add_item(tree
, proto_bta2dp_cph_scms_t
, tvb
, offset
, 1, ENC_NA
);
2399 main_tree
= proto_item_add_subtree(main_item
, ett_bta2dp_cph_scms_t
);
2401 proto_tree_add_item(main_tree
, hf_bta2dp_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2402 proto_tree_add_item(main_tree
, hf_bta2dp_cp_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2403 proto_tree_add_item(main_tree
, hf_bta2dp_l_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2410 proto_register_bta2dp_content_protection_header_scms_t(void)
2412 static hf_register_info hf
[] = {
2414 { "L-bit", "bta2dp.content_protection_header.scms_t.l_bit",
2415 FT_BOOLEAN
, 8, NULL
, 0x01,
2418 { &hf_bta2dp_cp_bit
,
2419 { "Cp-bit", "bta2dp.content_protection_header.scms_t.cp_bit",
2420 FT_BOOLEAN
, 8, NULL
, 0x02,
2423 { &hf_bta2dp_reserved
,
2424 { "Reserved", "bta2dp.content_protection_header.scms_t.reserved",
2425 FT_BOOLEAN
, 8, NULL
, 0xFC,
2430 static gint
*ett
[] = {
2431 &ett_bta2dp_cph_scms_t
2434 proto_bta2dp_cph_scms_t
= proto_register_protocol("Bluetooth A2DP Content Protection Header SCMS-T", "BT A2DP Content Protection Header SCMS-T", "bta2dp_content_protection_header_scms_t");
2435 proto_register_field_array(proto_bta2dp_cph_scms_t
, hf
, array_length(hf
));
2436 proto_register_subtree_array(ett
, array_length(ett
));
2438 new_register_dissector("bta2dp_content_protection_header_scms_t", dissect_a2dp_cp_scms_t
, proto_bta2dp_cph_scms_t
);
2442 dissect_vdp_cp_scms_t(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
2444 proto_item
*main_item
;
2445 proto_tree
*main_tree
;
2448 main_item
= proto_tree_add_item(tree
, proto_btvdp_cph_scms_t
, tvb
, offset
, 1, ENC_NA
);
2449 main_tree
= proto_item_add_subtree(main_item
, ett_btvdp_cph_scms_t
);
2451 proto_tree_add_item(main_tree
, hf_btvdp_reserved
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2452 proto_tree_add_item(main_tree
, hf_btvdp_cp_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2453 proto_tree_add_item(main_tree
, hf_btvdp_l_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2460 proto_register_btvdp_content_protection_header_scms_t(void)
2462 static hf_register_info hf
[] = {
2464 { "L-bit", "btvdp.content_protection_header.scms_t.l_bit",
2465 FT_BOOLEAN
, 8, NULL
, 0x01,
2469 { "Cp-bit", "btvdp.content_protection_header.scms_t.cp_bit",
2470 FT_BOOLEAN
, 8, NULL
, 0x02,
2473 { &hf_btvdp_reserved
,
2474 { "Reserved", "btvdp.content_protection_header.scms_t.reserved",
2475 FT_BOOLEAN
, 8, NULL
, 0xFC,
2480 static gint
*ett
[] = {
2481 &ett_btvdp_cph_scms_t
2484 proto_btvdp_cph_scms_t
= proto_register_protocol("Bluetooth VDP Content Protection Header SCMS-T", "BT VDP Content Protection Header SCMS-T", "btvdp_content_protection_header_scms_t");
2485 proto_register_field_array(proto_btvdp_cph_scms_t
, hf
, array_length(hf
));
2486 proto_register_subtree_array(ett
, array_length(ett
));
2488 new_register_dissector("btvdp_content_protection_header_scms_t", dissect_vdp_cp_scms_t
, proto_btvdp_cph_scms_t
);
2492 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2497 * indent-tabs-mode: nil
2500 * vi: set shiftwidth=4 tabstop=8 expandtab:
2501 * :indentSize=4:tabSize=8:noTabs=true: