diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-08-11 11:48:10 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-08-13 21:03:37 +0000 |
commit | 152c6b06f1bb8193b6d2682ae40c61a1d642b7c1 (patch) | |
tree | 7c3432e1fa8f7da33488a0c1e70613d1ee41791a /epan/dissectors/packet-usb-audio.c | |
parent | 7cd4e8930454b3afa8e73eacd62bafc6f029022b (diff) |
dissect as interface general descr for v1.00
Change-Id: I338ce8d6eb0865af9d0f5669c44389ade2bf0f49
Reviewed-on: https://code.wireshark.org/review/3582
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-usb-audio.c')
-rw-r--r-- | epan/dissectors/packet-usb-audio.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/epan/dissectors/packet-usb-audio.c b/epan/dissectors/packet-usb-audio.c index 6af489952f..de5d27226b 100644 --- a/epan/dissectors/packet-usb-audio.c +++ b/epan/dissectors/packet-usb-audio.c @@ -49,6 +49,9 @@ 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; @@ -351,6 +354,36 @@ 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) { @@ -423,6 +456,8 @@ 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; @@ -534,6 +569,15 @@ 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 }}, |