Wireshark-bugs: [Wireshark-bugs] [Bug 3324] Patch packet.usb.c: fixed is_request and reverse dir
Date: Thu, 12 Mar 2009 08:03:27 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3324





--- Comment #1 from Roberto Mariani <jelot-wireshark@xxxxxxxx>  2009-03-12 08:03:25 PDT ---
I would add some information about this patch, but sorry for my bad english ;)

This comment is false: Note that URB_INTERRUPT goes in the reverse direction
and thus the request comes from the device and not the host.

The URB_INTERRUPT don't goes in reverse direction, and for USB request is
always generated from host and response is always generated from device...

In support of this, I would quote some info from libusb documentation
<http://libusb.sourceforge.net/api-1.0/io.html>:

[quote]
At a logical level, USB transfers typically happen in two parts. For example,
when reading data from a endpoint:

   1. A request for data is sent to the device
   2. Some time later, the incoming data is received by the host

or when writing data to an endpoint:

   1. The data is sent to the device
   2. Some time later, the host receives acknowledgement from the device that
the data has been transferred.

There may be an indefinite delay between the two steps. Consider a fictional
USB input device with a button that the user can press. In order to determine
when the button is pressed, you would likely submit a request to read data on a
bulk or interrupt endpoint and wait for data to arrive. Data will arrive when
the button is pressed by the user, which is potentially hours later.
[/quote]

So, for conversation tracking is correct to use "event_type".


The flag direction = endpoint & URB_TRANSFER_IN; don't is broken, but it is
usefull for traking data direction INBOUND or OUTBOUND... this flag don't have
part on conversations...

for example if we would like filter packet for: 

- show only submit/complete (request/response) that may have originated data
inbound, we could add this filter in wireshark: usb.endpoint_number >= 0x80

- show only submit/complete (request/response) that may have originated data
outbound, we could add this filter in wireshark: usb.endpoint_number < 0x80


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.