diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-08-11 11:06:52 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-08-13 21:03:17 +0000 |
commit | 7cd4e8930454b3afa8e73eacd62bafc6f029022b (patch) | |
tree | eebc6251680353ed2b57d5853737329e5ba420a7 | |
parent | a2e99f5699e319420ce475b2bdf5ba48ffa639ea (diff) |
create audio-specific part of the usb conversation
store the major spec version there
Change-Id: I55564cbca7fb9faa307f1a684858d2e5d2393fc9
Reviewed-on: https://code.wireshark.org/review/3581
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
-rw-r--r-- | epan/dissectors/packet-usb-audio.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/epan/dissectors/packet-usb-audio.c b/epan/dissectors/packet-usb-audio.c index b338f30795..6af489952f 100644 --- a/epan/dissectors/packet-usb-audio.c +++ b/epan/dissectors/packet-usb-audio.c @@ -137,6 +137,11 @@ 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; @@ -295,13 +300,14 @@ 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 _U_) + proto_tree *tree, usb_conv_info_t *usb_conv_info) { 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; @@ -312,8 +318,14 @@ 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); - /* XXX - create an audio-specific conversation struct, - store the major version there */ + 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; offset += 2; /* version 1 refers to the Basic Audio Device specification, |