forked from osmocom/wireshark
Revert "create audio-specific part of the usb conversation"
Also revert "dissect as interface general descr for v1.00" This reverts commit7cd4e89304
and commit152c6b06f1
to fix the fuzz failures while we work out a proper solution. Ping-Bug:10386 Change-Id: I6302b95c103f17bb2b48d43f8fc06352587b9e95 Reviewed-on: https://code.wireshark.org/review/3662 Reviewed-by: Evan Huus <eapache@gmail.com>
This commit is contained in:
parent
fc2d1bdeb5
commit
22e10bea0c
|
@ -48,9 +48,6 @@ static int hf_ac_if_hdr_total_len = -1;
|
|||
static int hf_ac_if_hdr_bInCollection = -1;
|
||||
static int hf_ac_if_hdr_if_num = -1;
|
||||
static int hf_as_if_desc_subtype = -1;
|
||||
static int hf_as_if_gen_term_id = -1;
|
||||
static int hf_as_if_gen_delay = -1;
|
||||
static int hf_as_if_gen_format = -1;
|
||||
static int hf_as_ep_desc_subtype = -1;
|
||||
|
||||
static reassembly_table midi_data_reassembly_table;
|
||||
|
@ -139,11 +136,6 @@ static const value_string as_subtype_vals[] = {
|
|||
static value_string_ext as_subtype_vals_ext =
|
||||
VALUE_STRING_EXT_INIT(as_subtype_vals);
|
||||
|
||||
typedef struct _audio_conv_info_t {
|
||||
/* the major version of the USB audio class specification,
|
||||
taken from the AC header descriptor */
|
||||
guint8 ver_major;
|
||||
} audio_conv_info_t;
|
||||
|
||||
static int hf_sysex_msg_fragments = -1;
|
||||
static int hf_sysex_msg_fragment = -1;
|
||||
|
@ -302,14 +294,13 @@ dissect_usb_midi_event(tvbuff_t *tvb, packet_info *pinfo,
|
|||
body's length) */
|
||||
static gint
|
||||
dissect_ac_if_hdr_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
||||
proto_tree *tree, usb_conv_info_t *usb_conv_info)
|
||||
proto_tree *tree, usb_conv_info_t *usb_conv_info _U_)
|
||||
{
|
||||
gint offset_start;
|
||||
guint16 bcdADC;
|
||||
guint8 ver_major;
|
||||
double ver;
|
||||
guint8 if_in_collection, i;
|
||||
audio_conv_info_t *audio_conv_info;
|
||||
|
||||
|
||||
offset_start = offset;
|
||||
|
@ -320,14 +311,8 @@ dissect_ac_if_hdr_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
|||
|
||||
proto_tree_add_double_format_value(tree, hf_ac_if_hdr_ver,
|
||||
tvb, offset, 2, ver, "%2.2f", ver);
|
||||
audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data;
|
||||
if(!audio_conv_info) {
|
||||
audio_conv_info = wmem_new(wmem_file_scope(), audio_conv_info_t);
|
||||
usb_conv_info->class_data = audio_conv_info;
|
||||
/* XXX - set reasonable default values for all components
|
||||
that are not filled in by this function */
|
||||
}
|
||||
audio_conv_info->ver_major = ver_major;
|
||||
/* XXX - create an audio-specific conversation struct,
|
||||
store the major version there */
|
||||
offset += 2;
|
||||
|
||||
/* version 1 refers to the Basic Audio Device specification,
|
||||
|
@ -352,36 +337,6 @@ dissect_ac_if_hdr_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
|||
}
|
||||
|
||||
|
||||
static gint
|
||||
dissect_as_if_general_body(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
|
||||
proto_tree *tree, usb_conv_info_t *usb_conv_info)
|
||||
{
|
||||
audio_conv_info_t *audio_conv_info;
|
||||
gint offset_start;
|
||||
|
||||
/* the caller has already checked that usb_conv_info!=NULL */
|
||||
audio_conv_info = (audio_conv_info_t *)usb_conv_info->class_data;
|
||||
if (!audio_conv_info)
|
||||
return 0;
|
||||
|
||||
offset_start = offset;
|
||||
|
||||
if (audio_conv_info->ver_major==1) {
|
||||
proto_tree_add_item(tree, hf_as_if_gen_term_id,
|
||||
tvb, offset, 1, ENC_LITTLE_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(tree, hf_as_if_gen_delay,
|
||||
tvb, offset, 1, ENC_LITTLE_ENDIAN);
|
||||
offset++;
|
||||
proto_tree_add_item(tree, hf_as_if_gen_format,
|
||||
tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
||||
offset += 2;
|
||||
}
|
||||
|
||||
return offset-offset_start;
|
||||
}
|
||||
|
||||
|
||||
static gint
|
||||
dissect_usb_audio_descriptor(tvbuff_t *tvb, packet_info *pinfo,
|
||||
proto_tree *tree, void *data)
|
||||
|
@ -455,8 +410,6 @@ dissect_usb_audio_descriptor(tvbuff_t *tvb, packet_info *pinfo,
|
|||
|
||||
switch(desc_subtype) {
|
||||
case AS_SUBTYPE_GENERAL:
|
||||
dissect_as_if_general_body(tvb, offset, pinfo,
|
||||
desc_tree, usb_conv_info);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -568,15 +521,6 @@ proto_register_usb_audio(void)
|
|||
{ &hf_as_if_desc_subtype,
|
||||
{ "Subtype", "usbaudio.as_if_subtype", FT_UINT8, BASE_HEX|BASE_EXT_STRING,
|
||||
&as_subtype_vals_ext, 0x00, "bDescriptorSubtype", HFILL }},
|
||||
{ &hf_as_if_gen_term_id,
|
||||
{ "Terminal ID", "usbaudio.as_if_gen.bTerminalLink",
|
||||
FT_UINT8, BASE_DEC, NULL, 0x00, "bTerminalLink", HFILL }},
|
||||
{ &hf_as_if_gen_delay,
|
||||
{ "Interface delay in frames", "usbaudio.as_if_gen.bDelay",
|
||||
FT_UINT8, BASE_DEC, NULL, 0x00, "bDelay", HFILL }},
|
||||
{ &hf_as_if_gen_format,
|
||||
{ "Format", "usbaudio.as_if_gen.wFormatTag",
|
||||
FT_UINT16, BASE_HEX, NULL, 0x00, "wFormatTag", HFILL }},
|
||||
{ &hf_as_ep_desc_subtype,
|
||||
{ "Subtype", "usbaudio.as_ep_subtype", FT_UINT8,
|
||||
BASE_HEX, NULL, 0x00, "bDescriptorSubtype", HFILL }},
|
||||
|
|
Loading…
Reference in New Issue