diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-28 01:47:31 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-28 09:48:06 +0000 |
commit | 15c895dbc48cf5f74694888eb4c2250674922ae6 (patch) | |
tree | 41b37687bfc24f47d2eabf6e237fbeeae8b90e54 /epan/dissectors/packet-usb.h | |
parent | 53a5e4f6cbc018f6e480591715a863374617d7ad (diff) |
Make the USB header information an enumerated type.
It's not really a bitset, it's a choice of one of four types of USB
pseudo-header. Make it an enum.
Change-Id: I4ea994e1606c23e0a0f08b1b61357eea40a2535e
Reviewed-on: https://code.wireshark.org/review/6830
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-usb.h')
-rw-r--r-- | epan/dissectors/packet-usb.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/epan/dissectors/packet-usb.h b/epan/dissectors/packet-usb.h index b499132aad..840cdc95af 100644 --- a/epan/dissectors/packet-usb.h +++ b/epan/dissectors/packet-usb.h @@ -41,18 +41,23 @@ typedef struct _usb_address_t { typedef struct _usb_conv_info_t usb_conv_info_t; -/* header flags */ -#define USB_HEADER_IS_LINUX (1 << 0) -#define USB_HEADER_IS_64_BYTES (1 << 1) -#define USB_HEADER_IS_USBPCAP (1 << 2) -#define USB_HEADER_IS_MAUSB (1 << 3) +/* header type */ +typedef enum { + USB_HEADER_LINUX_48_BYTES, + USB_HEADER_LINUX_64_BYTES, + USB_HEADER_USBPCAP, + USB_HEADER_MAUSB +} usb_header_t; + +#define USB_HEADER_IS_LINUX(type) \ + ((type) == USB_HEADER_LINUX_48_BYTES || (type) == USB_HEADER_LINUX_64_BYTES) /* there is one such structure for each request/response */ typedef struct _usb_trans_info_t { guint32 request_in; guint32 response_in; nstime_t req_time; - guint8 header_info; + usb_header_t header_type; /* Valid only for SETUP transactions */ struct _usb_setup { @@ -235,7 +240,7 @@ int dissect_usb_setup_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, guint8 urb_type, usb_conv_info_t *usb_conv_info, - guint8 header_info); + usb_header_t header_type); void @@ -244,7 +249,7 @@ usb_set_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint16 bus_id usb_trans_info_t *usb_get_trans_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - guint8 header_info, usb_conv_info_t *usb_conv_info); + usb_header_t header_type, usb_conv_info_t *usb_conv_info); #endif |