diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-10-18 09:30:28 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2006-10-18 09:30:28 +0000 |
commit | e527431ad27a6046198087ef859c9db7f9f43981 (patch) | |
tree | 2a33083e54f8a19575f0b114db7c21901b1ab102 /epan/dissectors/packet-usb.c | |
parent | 6a4c7ba0cffb567729a4825b5cf7089b14e6ba9f (diff) |
create a dissector table for the bulk input/output packet types
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19588 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-usb.c')
-rw-r--r-- | epan/dissectors/packet-usb.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 71b5a967cf..f46ca3e453 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -99,6 +99,9 @@ static gint ett_usb_setup_bmrequesttype = -1; static gint ett_descriptor_device = -1; +static dissector_table_t usb_bulk_dissector_table; + + /* 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. @@ -890,6 +893,15 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent) item=proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->class); PROTO_ITEM_SET_GENERATED(item); + if(tvb_length_remaining(tvb, offset)){ + tvbuff_t *next_tvb; + + pinfo->usb_conv_info=usb_conv_info; + next_tvb=tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_reported_length_remaining(tvb, offset)); + if(dissector_try_port(usb_bulk_dissector_table, usb_conv_info->class, next_tvb, pinfo, parent)){ + return; + } + } } break; case URB_BULK_OUTPUT: @@ -898,6 +910,15 @@ dissect_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent) item=proto_tree_add_uint(tree, hf_usb_bInterfaceClass, tvb, offset, 0, usb_conv_info->class); PROTO_ITEM_SET_GENERATED(item); + if(tvb_length_remaining(tvb, offset)){ + tvbuff_t *next_tvb; + + pinfo->usb_conv_info=usb_conv_info; + next_tvb=tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), tvb_reported_length_remaining(tvb, offset)); + if(dissector_try_port(usb_bulk_dissector_table, usb_conv_info->class, next_tvb, pinfo, parent)){ + return; + } + } } break; case URB_CONTROL_INPUT: @@ -1243,6 +1264,10 @@ proto_register_usb(void) proto_register_subtree_array(usb_subtrees, array_length(usb_subtrees)); register_dissector("usb", dissect_usb, proto_usb); + + usb_bulk_dissector_table = register_dissector_table("usb.bulk", + "USB bulk endpoint", FT_UINT8, BASE_DEC); + } void |