diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index 0350058dc9..85f77e9235 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -967,6 +967,7 @@ DISSECTOR_INCLUDES = \ packet-umts_rrc.h \ packet-umts_rrc_ies.h \ packet-umts_rrc_pdu_def.h \ + packet-usb.h \ packet-vines.h \ packet-vlan.h \ packet-wap.h \ diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 064b7774de..71b5a967cf 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -39,6 +39,7 @@ #include #include #include +#include "packet-usb.h" /* protocols and header fields */ static int proto_usb = -1; @@ -104,36 +105,7 @@ static gint ett_descriptor_device = -1; */ #define NO_ENDPOINT 0xffff -/* there is one such structure for each device/endpoint conversation */ -typedef struct _usb_conv_info_t { - guint16 class; /* class for this conversation */ - emem_tree_t *transactions; -} usb_conv_info_t; -/* there is one such structure for each request/response */ -typedef struct _usb_trans_info_t { - guint32 request_in; - guint32 response_in; - guint8 requesttype; - guint8 request; - union { - struct { - guint8 type; - guint8 index; - } get_descriptor; - }; - - - /* used to pass the interface class from the - * interface descriptor onto the endpoint - * descriptors so that we can create a - * conversation with the appropriate class - * once we know the endpoint. - */ - usb_conv_info_t *interface_info; - - -} usb_trans_info_t; typedef enum { URB_CONTROL_INPUT, @@ -169,8 +141,6 @@ static const value_string usb_langid_vals[] = { {0, NULL} }; -#define IF_CLASS_UNKNOWN 0xffff -#define IF_CLASS_MASSTORAGE 0x08 static const value_string usb_interfaceclass_vals[] = { {IF_CLASS_MASSTORAGE, "Mass Storage Class"}, {0, NULL} @@ -918,7 +888,7 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent) { proto_item *item; - item=proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 1, usb_conv_info->class); + item=proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->class); PROTO_ITEM_SET_GENERATED(item); } break; @@ -926,7 +896,7 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent) { proto_item *item; - item=proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 1, usb_conv_info->class); + item=proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->class); PROTO_ITEM_SET_GENERATED(item); } break; diff --git a/epan/dissectors/packet-usb.h b/epan/dissectors/packet-usb.h new file mode 100644 index 0000000000..c0004df45d --- /dev/null +++ b/epan/dissectors/packet-usb.h @@ -0,0 +1,59 @@ +/* packet-usb.h + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PACKET_USB_H__ +#define __PACKET_USB_H__ + +/* there is one such structure for each device/endpoint conversation */ +typedef struct _usb_conv_info_t { + guint16 class; /* class for this conversation */ + emem_tree_t *transactions; +} usb_conv_info_t; + +/* there is one such structure for each request/response */ +typedef struct _usb_trans_info_t { + guint32 request_in; + guint32 response_in; + guint8 requesttype; + guint8 request; + union { + struct { + guint8 type; + guint8 index; + } get_descriptor; + }; + + + /* used to pass the interface class from the + * interface descriptor onto the endpoint + * descriptors so that we can create a + * conversation with the appropriate class + * once we know the endpoint. + */ + usb_conv_info_t *interface_info; +} usb_trans_info_t; + +#define IF_CLASS_UNKNOWN 0xffff +#define IF_CLASS_MASSTORAGE 0x08 + +#endif