diff options
author | Sean O. Stalley <sean.stalley@intel.com> | 2014-07-07 11:38:45 -0700 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-07-15 22:55:19 +0000 |
commit | 91f627b7e73e5679872bc147bc0aac19c83a4ea1 (patch) | |
tree | 420120c58a294d1d259249f82e9a3c9ec15e4bde /epan | |
parent | 9335faa6a2a3daeb6a096e442a9fbb2186fafd13 (diff) |
MAUSB dissection of control transfer responses
The MAUSB dissector can now dissect transfer responses for control
endpoints.
Change-Id: Ic488ccb308365d072bbbf0eaf128b198caf74eca
Reviewed-on: https://code.wireshark.org/review/2960
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mausb.c | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-usb.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-usb.h | 6 |
3 files changed, 23 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mausb.c b/epan/dissectors/packet-mausb.c index 3999dde1dc..bfeb9cc974 100644 --- a/epan/dissectors/packet-mausb.c +++ b/epan/dissectors/packet-mausb.c @@ -541,6 +541,18 @@ static gboolean mausb_has_setup_data(struct mausb_header *header) return FALSE; } +static gboolean mausb_is_setup_response(struct mausb_header *header) +{ + if ((TransferResp == header->type) && + (!mausb_is_from_host(header)) && + (MAUSB_TX_TYPE_CTRL == mausb_tx_type(header))) { + + return TRUE; + } + return FALSE; +} + + /*** EP Handle parsing helper functions */ static guint8 mausb_ep_handle_ep_num(guint16 handle) { @@ -1175,6 +1187,10 @@ dissect_mausb_pkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, usb_conv_info, &setup_tree); } + if (mausb_is_setup_response(&header)) { + offset = dissect_usb_setup_response(pinfo, mausb_tree, mausb_tree, tvb, + offset, URB_COMPLETE, usb_conv_info); + } /* * TODO: dissect MA USB Payload with USB class dissectors * (ex: MBIM, USB Audio, etc.) diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index d9dbdbc8ef..e94cf8d9d7 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -2594,7 +2594,7 @@ try_dissect_next_protocol(proto_tree *tree, proto_tree *parent, tvbuff_t *next_t } -static int +int dissect_usb_setup_response(packet_info *pinfo, proto_tree *tree, proto_tree *parent, tvbuff_t *tvb, int offset, guint8 urb_type, usb_conv_info_t *usb_conv_info) diff --git a/epan/dissectors/packet-usb.h b/epan/dissectors/packet-usb.h index 40c9cd489b..fac36b4ea8 100644 --- a/epan/dissectors/packet-usb.h +++ b/epan/dissectors/packet-usb.h @@ -224,9 +224,15 @@ dissect_usb_unknown_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, usb_conv_info_t *usb_conv_info _U_); int +dissect_usb_setup_response(packet_info *pinfo, proto_tree *tree, + proto_tree *parent, tvbuff_t *tvb, int offset, + guint8 urb_type, usb_conv_info_t *usb_conv_info); + +int dissect_usb_setup_request(packet_info *pinfo, proto_tree *parent, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info, proto_tree **setup_tree); + void usb_set_addr(packet_info *pinfo, usb_address_t *src_addr, usb_address_t *dst_addr, guint16 bus_id, guint16 device_address, |