Commit Graph

50 Commits

Author SHA1 Message Date
Anders Broman c1e67bc6d0 From Márton Németh:
Clean up the Linux USB pseudoheader dissection.

svn path=/trunk/; revision=25990
2008-08-12 20:24:50 +00:00
Jaap Keuter 006d1c446e From Márton Németh:
When an ISOCHRONOUS URB was captured the packet-usb.c does not handle it.
Case URB_ISOCHRONOUS was added at two different places to handle it also.

svn path=/trunk/; revision=23817
2007-12-09 10:59:09 +00:00
Gerald Combs 1064a1df35 Make sure we fully initialize a struct. Fixes bug 2021.
svn path=/trunk/; revision=23613
2007-11-27 00:36:41 +00:00
Gerald Combs 118f23a08a Catch a bad bLength, which may cause a loop. Fixes bug 2012.
svn path=/trunk/; revision=23557
2007-11-23 23:31:21 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Ronnie Sahlberg 29440eb4a9 from Jon Smirl
add defines for data direction (which direction in/out is data being transferred for this particylar request/response pair)
and a mask for which bits of the byte contains the type.



svn path=/trunk/; revision=21207
2007-03-26 07:58:17 +00:00
Ronnie Sahlberg 80fe723473 From Jon Smirl
add a whole bunch of new descriptor types


svn path=/trunk/; revision=21199
2007-03-26 01:59:02 +00:00
Ronnie Sahlberg f88aa196a0 From
Charles Lepple


This patch enables packet-usb.c to display all descriptors in the GET
CONFIGURATION request, regardless of whether we know how to decode
them. (All descriptors in that request share the same first two
bytes.)

It also adds the HID descriptor type (not the report descriptor,
though - that is buried in a class request, not a device request). I
am still working on actually decoding this descriptor.



svn path=/trunk/; revision=21197
2007-03-26 01:41:50 +00:00
Ronnie Sahlberg 09814fac51 From a Jon Smirl patch
rename the conversation field "class" to "interfaceClass"


svn path=/trunk/; revision=21194
2007-03-25 23:51:40 +00:00
Ronnie Sahlberg 747b009566 From Jon Smirl
change the private data pointer name from  masstorage to class_data
since there will be future class specific dissectors that will also want to hang
some extra data off these structures



svn path=/trunk/; revision=21193
2007-03-25 22:53:35 +00:00
Ronnie Sahlberg 58b174de83 take the address to the structure and not the address to the first element of the structure when doing a SET_ADDRESS
svn path=/trunk/; revision=21178
2007-03-25 11:20:09 +00:00
Ronnie Sahlberg ab407b08cf Change USB address structure back to 8 bytes in length.
It is suboptimal to have the endpoint both being the "port" and also 4 bytes out of the address.
But it looks better to have addresses as <device>.<endpoint> .


svn path=/trunk/; revision=21177
2007-03-25 11:15:09 +00:00
Ronnie Sahlberg 1053745b1c create a tap for usb so that we can do conversation/host lists
svn path=/trunk/; revision=21176
2007-03-25 09:55:49 +00:00
Ronnie Sahlberg 3689e6f460 unbreaking the usb dissector
since dlt189 was introduced   the dissector has been suboptimal


assuming the capture   usb_memory_stick.pcap on the wiki shows what this linktype
should look like, this patch
- adds request in/response in/time  generated fields to the dissect pane
- fixes the tracking of what is a request and what is a response (the old code just can not have worked!)
- fixes conversation tracking to work (dont add the port/endpoint into the length of the address)
- handles some mysterious extra 8 bytes prepended to a lot of different packets.



svn path=/trunk/; revision=21173
2007-03-25 05:20:56 +00:00
Ronnie Sahlberg 8d8f94f1ae fix a bug (found by compiler warning) where we initialize the wrong variable.
svn path=/trunk/; revision=21169
2007-03-24 21:56:14 +00:00
Guy Harris 7c7ccebace From Charles Lepple: in a Get Descriptor message, the descriptor index
comes before the descriptor type.

svn path=/trunk/; revision=21061
2007-03-19 00:03:17 +00:00
Guy Harris 9633ac8fee From Paolo Abeni: update to support the new DLT_USB_LINUX format header.
Modified to support the header as a pseudo_header rather than as part of
the packet data.

Fixed some calls that fetch data from the USB packet to fetch it in
little-endian byte order.

Got rid of redundant code to get conversation-specific data (the
get_usb_conv_info() call already does that).

For control packets, only parse the setup information if setup_flag is
0.

Don't interpret a control packet as a standard request unless the setup
type is "Standard".

svn path=/trunk/; revision=20632
2007-01-30 20:07:55 +00:00
Jörg Mayer 6f7089fe26 Commit my USB changes (change address handling)
svn path=/trunk/; revision=20346
2007-01-08 14:32:10 +00:00
Ronnie Sahlberg 6a745262b4 from albert chin
The Solaris C compiler, among others, do not allow anonymous unions.
Patch attached.



thanks albert


svn path=/trunk/; revision=19852
2006-11-07 08:33:24 +00:00
Ronnie Sahlberg 34d319370e update the list of defined application classes and list all the official ones from www.usb.org
svn path=/trunk/; revision=19766
2006-11-01 09:54:48 +00:00
Ronnie Sahlberg aada156d87 break request/response matching to track transactions out from the CONTROL handler to use the same code for ALL pdu types
svn path=/trunk/; revision=19701
2006-10-26 08:37:39 +00:00
Ronnie Sahlberg ac67085436 add a dissector table for class specific control input/output pdus
implement class specific control commands : reset and getmaxlun for mass storage


now with a better understanding of the problem space for usb and device classes we can start cleaning the code up and make it nice



svn path=/trunk/; revision=19659
2006-10-22 11:49:23 +00:00
Ronnie Sahlberg 7a62c1f5fe add tracking of interface class for CONTROL_INPUT as well as existing support for BULK INPUT/OUTPUT
svn path=/trunk/; revision=19658
2006-10-22 09:38:59 +00:00
Ronnie Sahlberg bacb3d3ec5 fix some endianess issues
svn path=/trunk/; revision=19657
2006-10-22 05:21:37 +00:00
Ronnie Sahlberg 6ff555b31b dissect the individual bits in the CONFIDURATION descriptor field for the endpoint address
svn path=/trunk/; revision=19656
2006-10-22 01:21:20 +00:00
Ronnie Sahlberg de61ac3733 the flags are FT_BOOLEAN not FT_UINT8
svn path=/trunk/; revision=19650
2006-10-21 05:07:48 +00:00
Ronnie Sahlberg d421f8598d prettify the flags field and power consumption for CONFIGURATION DESCRIPTOR
dissect the self-powered and the remote-wakeup flags
show the powerconsumption in mA


svn path=/trunk/; revision=19649
2006-10-21 04:57:12 +00:00
Ronnie Sahlberg 232e884ca1 new dissector : usb mass storage
this is a wrapper protocol to store SCSI frames inside usb bulk data transfers

the dissector is far from complete but does
track ITL and ITLQ structures and will also call the SCSI dissector to 
dissect the SCSI CDB.


what is still missing is handling of data in/out and scsi responses


at least it will now display the SCSI CDB and dissect it. woohoo



svn path=/trunk/; revision=19589
2006-10-18 11:24:03 +00:00
Ronnie Sahlberg 6a75fbab65 create a dissector table for the bulk input/output packet types
svn path=/trunk/; revision=19588
2006-10-18 09:30:28 +00:00
Ronnie Sahlberg df75f29284 move some defines to packet-usb.h so that they can be shared with other dissectors
svn path=/trunk/; revision=19587
2006-10-18 09:10:14 +00:00
Ronnie Sahlberg 638f9eced7 now when we do dissect the descriptors:
add tracking so that when we find an interface descriptor which tells us the device class we also create a conversation for each and every endpoint for that interface and also let all conversations (one for each endpoint) share the same usb conversation info structure.


store the device type inside this conv_info structure


add the required code to manage BULK data pdus and have it for now only display what kind of bulk data is contained (interface class as snooped from the descriptors)



we now only need a class dissector table we can fork off into from the bulk dissector in usb    and then an external usb_masstorage dissector that registers itself as a mass storage device and we should be all set to dissect the scsi layer being transported atop usb





svn path=/trunk/; revision=19575
2006-10-17 13:40:26 +00:00
Ronnie Sahlberg 5bbcf2e2ca 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
2006-10-17 09:14:16 +00:00
Ronnie Sahlberg 40ee68e3d4 correct the little / big endian comment
svn path=/trunk/; revision=19558
2006-10-16 14:54:20 +00:00
Ronnie Sahlberg 2cb017d84f dissect a lot more of the descriptors so that we can finally see which endpoints are used for what purpose
svn path=/trunk/; revision=19557
2006-10-16 14:43:35 +00:00
Jörg Mayer a32f396008 Display the skipped 4 bytes from the header as setup (see
struct usb_header). Just display it as a big endian number
(I don't have a spec at hand).


svn path=/trunk/; revision=19556
2006-10-16 14:24:24 +00:00
Ronnie Sahlberg ff7e652235 break finding/creating a conversation out into its own helper (which makes it easier later when we find an endpoint description that tells us some other endpoint is used for massstorage)
implement some more descriptors


svn path=/trunk/; revision=19555
2006-10-16 13:42:59 +00:00
Ronnie Sahlberg af000bdaa6 Finish dissection of GET DESCRIPTOR for the devicetype: DEVICE.
This dissector should be extended to dissect all other descriptors for all other device types as well.





svn path=/trunk/; revision=19554
2006-10-16 10:33:46 +00:00
Ronnie Sahlberg c5480555fd add some variables to the task structure so that we can pass TYPE/INDEX from the GET DESCRIPTOR request to the response dissector
(we need this in order to know how to dissect the response?)



svn path=/trunk/; revision=19553
2006-10-16 08:47:48 +00:00
Jörg Mayer b9582da89f - gcc dies on "default: }", add a ;
- proto_register usb instead of eth.

svn path=/trunk/; revision=19542
2006-10-15 12:27:51 +00:00
Ronnie Sahlberg d0bea0954e populate the info column with the request type and whetehr it is a request or a response
svn path=/trunk/; revision=19541
2006-10-15 08:21:56 +00:00
Ronnie Sahlberg a78a49b057 add tracking of request/responses for CONTROL INPUT so we can start passing parameters from request to response and dissect response data
svn path=/trunk/; revision=19540
2006-10-15 08:12:41 +00:00
Ronnie Sahlberg 714ce64b12 add a new port type for usb endpoints
start introducing conversations to the usb dissector so that we can start tracking requests/responses
which we need to in order to dissect for example the data returned by a device to a GET DESCRIPTORS call



svn path=/trunk/; revision=19539
2006-10-15 06:10:59 +00:00
Ronnie Sahlberg 077e03a549 start dissecting the setup headers
dissect GET DESCRIPTOR as an example on how to add such dissectors


svn path=/trunk/; revision=19538
2006-10-15 03:49:27 +00:00
Ronnie Sahlberg cfaf149ae8 rename some fields in the setup blob to use the same names as in the standard
add dissection of the bmRequestType bitmap



svn path=/trunk/; revision=19527
2006-10-14 10:09:32 +00:00
Ronnie Sahlberg f1f76a1817 put the packet type in the summary line
svn path=/trunk/; revision=19526
2006-10-14 09:43:17 +00:00
Ronnie Sahlberg 24ef4fcef0 create a new address type AT_USB and start populating the packet list
with nice data




svn path=/trunk/; revision=19524
2006-10-14 05:02:40 +00:00
Jaap Keuter 804bed87e6 From Paolo Abeni:
The attached patch fix parsing of the setup header in the usb dissector.
Currently the size of the field specified into proto_tree_add_item call
was wrong.

svn path=/trunk/; revision=19503
2006-10-12 08:04:11 +00:00
Ronnie Sahlberg 72817cf7bd from Paolo A
update the usb dissector to reflect the recent change in the pcap format


svn path=/trunk/; revision=19491
2006-10-11 09:47:27 +00:00
Anders Broman cec6d51774 u_int32_t gives error on Windows assuming guint32 will do.
svn path=/trunk/; revision=19482
2006-10-10 21:46:44 +00:00
Ronnie Sahlberg 26f642778f From Paolo Abeni
USB dissector


svn path=/trunk/; revision=19480
2006-10-10 21:00:35 +00:00