diff options
Diffstat (limited to 'epan/dissectors/packet-usb.h')
-rw-r--r-- | epan/dissectors/packet-usb.h | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/epan/dissectors/packet-usb.h b/epan/dissectors/packet-usb.h index a2564a2627..e4e0f38f07 100644 --- a/epan/dissectors/packet-usb.h +++ b/epan/dissectors/packet-usb.h @@ -29,6 +29,16 @@ typedef struct _usb_address_t { typedef struct _usb_conv_info_t usb_conv_info_t; +/* Wireshark specific (i.e. numeric values are arbitrary) enum representing + * USB device speed. + */ +typedef enum { + USB_SPEED_UNKNOWN, /* Unknown, skip speed specific processing */ + USB_SPEED_LOW, + USB_SPEED_FULL, + USB_SPEED_HIGH, +} usb_speed_t; + /* header type */ typedef enum { USB_HEADER_LINUX_48_BYTES, @@ -49,6 +59,7 @@ typedef struct _usb_pseudo_urb_t { guint8 device_address; guint8 endpoint; guint16 bus_id; + usb_speed_t speed; } usb_pseudo_urb_t; /* there is one such structure for each request/response */ @@ -88,7 +99,15 @@ typedef struct _usb_trans_info_t { guint64 usb_id; } usb_trans_info_t; -enum usb_conv_class_data_type {USB_CONV_UNKNOWN = 0, USB_CONV_U3V, USB_CONV_AUDIO, USB_CONV_VIDEO, USB_CONV_MASS_STORAGE}; +enum usb_conv_class_data_type { + USB_CONV_UNKNOWN = 0, + USB_CONV_U3V, + USB_CONV_AUDIO, + USB_CONV_VIDEO, + USB_CONV_MASS_STORAGE_BOT, + USB_CONV_MASS_STORAGE_UASP, + USB_CONV_CDC_DATA, +}; /* Conversation Structure * there is one such structure for each device/endpoint conversation */ @@ -104,6 +123,7 @@ struct _usb_conv_info_t { gboolean is_request; gboolean is_setup; guint8 setup_requesttype; + usb_speed_t speed; guint16 interfaceClass; /* Interface Descriptor - class */ guint16 interfaceSubclass; /* Interface Descriptor - subclass */ @@ -192,6 +212,21 @@ typedef struct _usb_tap_data_t { #define IF_SUBCLASS_MISC_U3V 0x05 +#define IF_SUBCLASS_APP_DFU 0x01 + +#define IF_PROTOCOL_DFU_RUNTIME 0x01 +#define IF_PROTOCOL_DFU_MODE 0x02 + +/* Key to be used with "usb.control", "usb.bulk" and/or "usb.interrupt" + * dissector tables when the dissector only applies to specific triple. + * Use class code directly if the code is not shared with other specifications. + * + * MSB (bit 31) is arbitrarily chosen to ensure class registered dissectors + * won't clash with protocol key. + */ +#define USB_PROTOCOL_KEY(class, subclass, protocol) \ + (1u << 31 | (class & 0xff) << 16 | (subclass & 0xff) << 8 | (protocol & 0xff)) + /* bmRequestType values */ #define USB_DIR_OUT 0 /* to device */ #define USB_DIR_IN 0x80 /* to host */ @@ -273,11 +308,15 @@ proto_item * dissect_usb_descriptor_header(proto_tree *tree, void dissect_usb_endpoint_address(proto_tree *tree, tvbuff_t *tvb, int offset); +unsigned int +sanitize_usb_max_packet_size(guint8 ep_type, usb_speed_t speed, + unsigned int max_packet_size); + int dissect_usb_endpoint_descriptor(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, usb_conv_info_t *usb_conv_info, - guint8 *out_ep_type); + guint8 *out_ep_type, usb_speed_t speed); int dissect_usb_unknown_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree, @@ -293,6 +332,8 @@ void dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, usb_header_t header_type, void *extra_data); +void usb_lpm_besl_str(gchar *buf, guint32 value); + #endif /* |