Commit Graph

89 Commits

Author SHA1 Message Date
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Chris Maynard 3037a852a8 No need to check that usb_trans_info is not NULL here. The only way it could have been NULL is if se_alloc0() returned NULL, but then it would have already been dereferenced before now. Fixes Coverity CID 612, "REVERSE INULL".
svn path=/trunk/; revision=38417
2011-08-08 20:08:24 +00:00
Chris Maynard 261875b924 Allow both PPP and ISO/IEC 13818-1 over USB to be dissected using heuristics.
Resolves bug 4814.

svn path=/trunk/; revision=37039
2011-05-10 14:22:17 +00:00
Bill Meier 513a5f5154 Add #include <ctype.h> before #include "isprint.h";
Remove an unneeded line of code;
Do some indentation & whitespace cleanup.

svn path=/trunk/; revision=36785
2011-04-21 22:42:32 +00:00
Alexis La Goutte 0b097292d2 Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36765
2011-04-21 13:45:14 +00:00
Alexis La Goutte 7e979f95aa Fix Dead Store (Dead nested assignment) Warning found by Clang
svn path=/trunk/; revision=36761
2011-04-21 13:34:43 +00:00
Chris Maynard 28ef67fb39 Change urb_type from FT_STRING to FT_UINT8. This fixes the display filtering
for this field.  This change was prompted because of the following query:
    http://ask.wireshark.org/questions/3113/usburb_type-values

Also, remove 2 unused fields found by running tools/checkhf.pl.

svn path=/trunk/; revision=36331
2011-03-25 18:51:12 +00:00
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