aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-10-17 09:14:16 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-10-17 09:14:16 +0000
commit5bbcf2e2caac51c5497f2e584a567987c31253a6 (patch)
treefd2caa649b943931196210590f1a8b6140e99afe /epan
parentccca31102bb8311ebfed875bfa3fc81902d73ade (diff)
add a define for the "no endpoint" constant used to represent unknown or host side endpoint used for conversations
ansp provide the desired port/endpoints in the call to get/create a conversation so that we later when we see the a descriptor that says Endpoint X is using class Y we need tis to register that certain endpoints are used for mass storage (or other applications) svn path=/trunk/; revision=19573
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-usb.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 787cda601a..f2a412837f 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -98,6 +98,12 @@ static gint ett_usb_setup_bmrequesttype = -1;
static gint ett_descriptor_device = -1;
+/* This is the endpoint number user for "no endpoint" or the fake endpoint
+ * for the host side since we need two endpoints to manage conversations
+ * properly.
+ */
+#define NO_ENDPOINT 0xffff
+
/* there is one such structure for each device/endpoint conversation */
typedef struct _usb_conv_info_t {
emem_tree_t *transactions;
@@ -192,7 +198,7 @@ static const value_string descriptor_type_vals[] = {
static conversation_t *
-get_usb_conversation(packet_info *pinfo)
+get_usb_conversation(packet_info *pinfo, guint32 src_endpoint, guint32 dst_endpoint)
{
conversation_t *conversation;
@@ -202,7 +208,7 @@ get_usb_conversation(packet_info *pinfo)
conversation = find_conversation(pinfo->fd->num,
&pinfo->src, &pinfo->dst,
pinfo->ptype,
- pinfo->srcport, pinfo->destport, 0);
+ src_endpoint, dst_endpoint, 0);
if(conversation){
return conversation;
}
@@ -211,7 +217,7 @@ get_usb_conversation(packet_info *pinfo)
conversation = conversation_new(pinfo->fd->num,
&pinfo->src, &pinfo->dst,
pinfo->ptype,
- pinfo->srcport, pinfo->destport, 0);
+ src_endpoint, dst_endpoint, 0);
return conversation;
}
@@ -759,15 +765,15 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent)
*/
if(setup){
src_addr=0xffffffff;
+ src_port=NO_ENDPOINT;
dst_addr=tmp_addr;
- src_port=0xffff;
dst_port=endpoint;
is_request=TRUE;
} else {
src_addr=tmp_addr;
- dst_addr=0xffffffff;
src_port=endpoint;
- dst_port=0xffff;
+ dst_addr=0xffffffff;
+ dst_port=NO_ENDPOINT;
is_request=FALSE;
}
break;
@@ -775,8 +781,8 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent)
/* dont know */
src_addr=0xffffffff;
dst_addr=0xffffffff;
- src_port=0xffff;
- dst_port=0xffff;
+ src_port=NO_ENDPOINT;
+ dst_port=NO_ENDPOINT;
is_request=FALSE;
}
SET_ADDRESS(&pinfo->net_src, AT_USB, USB_ADDR_LEN, (char *)&src_addr);
@@ -788,7 +794,7 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent)
pinfo->destport=dst_port;
- conversation=get_usb_conversation(pinfo);
+ conversation=get_usb_conversation(pinfo, pinfo->srcport, pinfo->destport);
/* do we have conversation specific data ? */
usb_conv_info = conversation_get_proto_data(conversation, proto_usb);