Commit Graph

81 Commits

Author SHA1 Message Date
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Chris Maynard 6003c15d6f From Marton Nemeth via bug #5490: Cleanup USB endpoint direction display.
svn path=/trunk/; revision=35182
2010-12-13 15:59:14 +00:00
Chris Maynard dbe63e9730 Add support for USB isochronous. From Marton Nemeth via bug #5370.
svn path=/trunk/; revision=35025
2010-11-24 17:33:58 +00:00
Bill Meier e52c685b2a Use value_string_ext fcns to access a value_string array;
Sort value_string array to be in ascending order by value;
Minor whitespace cleanup.

svn path=/trunk/; revision=34729
2010-10-30 20:03:58 +00:00
Guy Harris 149ccb3b68 Attempt to handle isochronous descriptors between the 64-byte header and
the payload.  Should fix bug 4401.

svn path=/trunk/; revision=32828
2010-05-16 03:19:40 +00:00
Bill Meier 10ffd14b8f Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
2010-05-10 15:54:57 +00:00
Guy Harris 21a210b777 From Chris Maynard:
Support PPP-over-USB.

	Don't remove the USB pseudo-header from the packet data for
	Linux USB packets, just byte-swap it if necessary and have the
	USB dissector fetch the pseudo-header from the raw packet data.

	Update USB language ID values.

svn path=/trunk/; revision=32534
2010-04-21 20:51:22 +00:00
Bill Meier 055dd62063 #include <string.h> not needed.
svn path=/trunk/; revision=32410
2010-04-06 21:14:01 +00:00
Bill Meier 73eb16d678 Fix some gcc -Wshadow warnings
svn path=/trunk/; revision=31623
2010-01-22 17:41:47 +00:00
Anders Broman c4dd31cd87 From Didier Gautheron:
col_clear.diff 
Remove calls to col_clear :
- called twice.
- before functions which also clear the column
- by replacing col_clear + col_append_xxx with col_add_xxx
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394

svn path=/trunk/; revision=31517
2010-01-13 20:25:10 +00:00
Jaap Keuter 134e77034e From Márton Németh:
When an unknown requests arrives try to parse it using the usual request format.

svn path=/trunk/; revision=30775
2009-10-30 22:46:30 +00:00
Stig Bjørlykke 1e20ff2638 From Marton Nemeth via bug 4181:
Take the USB descriptor length from packet.

svn path=/trunk/; revision=30763
2009-10-29 21:51:20 +00:00
Stig Bjørlykke 373fff9846 From Marton Nemeth via bug 4173:
Move bmRequestType field constants to header file.

svn path=/trunk/; revision=30761
2009-10-29 21:32:21 +00:00
Stig Bjørlykke 337896f4c6 From Marton Nemeth via bug 4163:
Add support for input URBs.

svn path=/trunk/; revision=30690
2009-10-25 10:45:15 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Guy Harris f846e15d40 Fix indentation, get rid of a comment that might no longer apply (dump
*what* as hex?  The stuff we now display as generic fields?).

svn path=/trunk/; revision=29257
2009-07-31 23:38:02 +00:00
Gerald Combs 62b8aa0837 From Adam Nielsen via bug 3659:
Here is a patch against SVN that implements preliminary support for USB HID
devices.  At the moment it only dissects the initial set up packets (which you
will see if you hotplug a keyboard or mouse.)

The patch also fixes a minor bug in the USB dissector code which reported
certain packets as malformed due to miscounting bytes, and it reports control
packet data and padding data in a more user-friendly manner.

svn path=/trunk/; revision=29256
2009-07-31 22:16:29 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Gerald Combs e718dc79ea From Roberto Mariani via bug 3324:
- Removed heuristic for find if is_request and used event_type

- URB_INTERRUPT don't goes in reverse direction... fixed

svn path=/trunk/; revision=28477
2009-05-26 00:32:16 +00:00
Guy Harris f6f84ae1dc Name changes to match libpcap name change of the corresponding DLT_
value.

svn path=/trunk/; revision=27113
2008-12-24 20:18:01 +00:00
Guy Harris d2cbbe0a2a Handle the new DLT_USB_LINUX_MMAP link-layer type.
svn path=/trunk/; revision=27099
2008-12-23 19:50:21 +00:00
Guy Harris dbd150e948 Have descriptors start out with a length of "to the end of the packet",
so that if they're cut short, they appear to be the length of the
remaining data in the packet, rather than zero-length.

svn path=/trunk/; revision=27049
2008-12-18 19:03:25 +00:00
Guy Harris 57f910e107 The "8 mysterious bytes" are bytes reserved for a setup header - with
the Linux USB capture mechanism, there are always 8 bytes of setup
header after the URB, regardless of whether there's a setup header or
not; if there is no setup header, we just skip those 8 bytes.

Don't skip them *twice*, however.

svn path=/trunk/; revision=27046
2008-12-18 09:17:16 +00:00
Guy Harris 27808f5b82 Have separate dissectors for setup requests and responses.
Provide dissectors for most other setup packets.  (Still some more work
needed on them.)

Show descriptor types as decimal, as they are in the USB 2.0 spec.

svn path=/trunk/; revision=27036
2008-12-17 12:23:42 +00:00
Guy Harris c0a8829bfd Display the CONTROL response data only if there *is* CONTROL response data.
svn path=/trunk/; revision=27034
2008-12-17 10:09:40 +00:00
Guy Harris c04cd4c91c Define all the standard request code values from the USB 2.0 spec, and
put them into the setup_request_names_vals value_string.

When processing a response, use the request type value, so we only
dissect standard replies when it's a reply to a standard request.

Display the bRequest value in decimal, as that's how they're specified
in the USB 2.0 spec.

svn path=/trunk/; revision=27033
2008-12-17 09:47:43 +00:00
Guy Harris ec71844d5b Include the string as part of a string descriptor.
Have setup dissectors return the offset past the end of what they
dissect, and have their caller set its offset based on that.

Use tvb_reported_length_remaining(), not tvb_length_remaining(), to
decide whether there's more data, so that we throw an exception if the
packet was cut short by a snapshot length.

Add "Application Data" only if there's extra data to be added.

svn path=/trunk/; revision=27020
2008-12-16 10:22:56 +00:00
Guy Harris 237ac18903 Don't make the pseudo-header fields look as if they're part of the USB
data; at best, that can be a bit confusing, and, at worst, if the field
isn't long enough, or the offset is wrong, it can cause an exception to
be thrown and the dissection to fail.

svn path=/trunk/; revision=26868
2008-11-27 20:11:59 +00:00
Gerald Combs 98df50f70b Make sure any data structures we allocate are properly initialized. Fixes
bug 2922.

svn path=/trunk/; revision=26333
2008-10-02 04:55:51 +00:00
Bill Meier 77b81b391b #include <prefs.h> not req'd
svn path=/trunk/; revision=26089
2008-08-25 22:06:20 +00:00
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