diff options
-rw-r--r-- | epan/dissectors/packet-u3v.c | 13 | ||||
-rw-r--r-- | epan/dissectors/packet-usb.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-usb.h | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/epan/dissectors/packet-u3v.c b/epan/dissectors/packet-u3v.c index 3918da4b85..8e85a0965e 100644 --- a/epan/dissectors/packet-u3v.c +++ b/epan/dissectors/packet-u3v.c @@ -1685,11 +1685,6 @@ dissect_u3v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) usb_conv_info->class_data = u3v_conv_info; } - /* it should be possible to also match on - * usb_conv_info->interfaceSubclass and usb_conv_info->interfaceProtocol - * but it seems that this information is not correctly setup during - * descriptor parsing - */ prefix = tvb_get_letohl(tvb, 0); if ((tvb_reported_length(tvb) >= 4) && ( ( U3V_CONTROL_PREFIX == prefix ) || ( U3V_EVENT_PREFIX == prefix ) ) ) { control_detected = TRUE; @@ -1883,7 +1878,6 @@ dissect_u3v_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data { guint32 prefix; usb_conv_info_t *usb_conv_info; - u3v_conv_info_t *u3v_conv_info; /* all control and meta data packets of U3V contain at least the prefix */ if (tvb_reported_length(tvb) < 4) @@ -1894,12 +1888,13 @@ dissect_u3v_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data usb_conv_info = (usb_conv_info_t *)data; if (!usb_conv_info) return FALSE; - u3v_conv_info = (u3v_conv_info_t *)usb_conv_info->class_data; - /* either right prefix or the endpoint of the current transfer has been recognized as stream endpoint already */ + /* either right prefix or the endpoint of the interface descriptor + set the correct class and subclass */ if ((U3V_STREAM_LEADER_PREFIX == prefix) || (U3V_STREAM_TRAILER_PREFIX == prefix) || (U3V_CONTROL_PREFIX == prefix) || (U3V_EVENT_PREFIX == prefix) || - ( u3v_conv_info && (usb_conv_info->endpoint == u3v_conv_info->ep_stream))) { + ((usb_conv_info->interfaceClass == IF_CLASS_MISCELLANEOUS && + usb_conv_info->interfaceSubclass == IF_SUBCLASS_MISC_U3V))) { dissect_u3v(tvb, pinfo, tree, data); return TRUE; } diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 0235060f24..1e092a9b13 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -1217,7 +1217,7 @@ static value_string_ext usb_hid_boot_protocol_vals_ext = VALUE_STRING_EXT_INIT(u static const value_string usb_misc_subclass_vals[] = { {0x03, "Cable Based Association Framework"}, {0x04, "RNDIS"}, - {0x05, "USB3 Vision"}, + {IF_SUBCLASS_MISC_U3V, "USB3 Vision"}, {0x06, "Stream Transport Efficient Protocol"}, {0, NULL} }; diff --git a/epan/dissectors/packet-usb.h b/epan/dissectors/packet-usb.h index c12d5d0e03..20ecc80b04 100644 --- a/epan/dissectors/packet-usb.h +++ b/epan/dissectors/packet-usb.h @@ -184,6 +184,8 @@ typedef struct _usb_tap_data_t { #define DEV_VENDOR_UNKNOWN 0x0000 /* this id is unassigned */ #define DEV_PRODUCT_UNKNOWN 0xfffffff /* 0x0000 and 0xffff are used values by vendors, so MSBs encode unknown */ +#define IF_SUBCLASS_MISC_U3V 0x05 + /* bmRequestType values */ #define USB_DIR_OUT 0 /* to device */ #define USB_DIR_IN 0x80 /* to host */ |