aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-usb.h
AgeCommit message (Collapse)AuthorFilesLines
2016-02-28u3v: use interface class and subclass in heuristic checksMartin Kaiser1-0/+2
don't access the class-specific conversation structure before we know that the packet is a U3V packet the USB dissector should fill interfaceClass and interfaceSubclass with correct values - if it doesn't that's another bug to be fixed Bug:12194 Change-Id: Ic9e73e7cb05c8887fee794e4735936caad1b7f49 Reviewed-on: https://code.wireshark.org/review/14224 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-16USBIP: add USBIP Protocol dissectorChristian Lamparter1-2/+7
This patch adds support for the USBIP protocol [0]. A document describing the protocol in detail is available from the linux kernel source [1]. The USBIP protocol mimics a USB HCD on a client PC that tunnels USB data over TCP/IP between the client and the host where the physical USB device is connected. A testcase has been submitted to bug.wireshark.org [2]. [0] <http://usbip.sourceforge.net/> [1] <https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/usbip/usbip_protocol.txt> [2] <https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=12127> Bug: 12127 Change-Id: I4e557dc274017eb029c7af2717a62be4b00aebda Reviewed-on: https://code.wireshark.org/review/13797 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-13Enable USB sub-dissectors for MA USB.Sean O. Stalley1-26/+17
MA USB packets with USB payload are now passed into the USB dissector. This allows the payload to be dissected by the USB sub-dissectors. 1. Refactor dissect_usb_common() and put the code needed for finding USB subdissectors into a seperate helper function. 2. Add dissect_usb_payload() call 3. Add dissect_mausb_pkt_common() helper function 4. Put code for dissecting all types of MA USB packets into helper function dissect_mausb_pkt(). 5. Add dissect_mausb_pkt_data() helper function 6. Put code for dissecting MA USB datapacket-specific fields into helper function dissect_mausb_pkt(). 7. Use proto_tree_add_bitmask() call for MA USB bitfields. 8. Create packet-mausb.h to expose MA definitions to USB dissector 9. Dissect MA USB payload with USB subdissectors 10. Undeclare USB calls no longer used by MA USB dissector Change-Id: I456714572cd8dfc9982b087670ca73c17e25a26c Signed-off-by: Sean O. Stalley <sean.stalley@intel.com> Reviewed-on: https://code.wireshark.org/review/13187 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-11usb: fix 'index' var nameDario Lombardo1-1/+1
As pointed out by checkAPI.pl Change-Id: I1599a420cee168997102bf9c06d36a230fdd3c9e Reviewed-on: https://code.wireshark.org/review/10467 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-03-26USB: use URB/IRP ID for request/response trackingPascal Quantin1-1/+3
Bug: 11072 Change-Id: I5f1824d602e4b88c9c5c8520b0aac9945206f093 Reviewed-on: https://code.wireshark.org/review/7781 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-05USB: add support for alternate setting selectionPascal Quantin1-0/+2
With this, the traffic of a device implementing both NCM and MBIM protocols is properly identified as MBIM when selected by the host Bug: 11018 Change-Id: I438ab1917945d9c5ba13329d515abc7e2cd13896 Reviewed-on: https://code.wireshark.org/review/7519 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-07dissect a get descriptor request and response for the HID report descriptorMartin Kaiser1-0/+16
treat those two messages as class-specific control messages, handle them inside the USB HID dissector Change-Id: I42d201df4a8fdb94c947b6118c0b50945c306423 Reviewed-on: https://code.wireshark.org/review/7006 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-28Make the USB header information an enumerated type.Guy Harris1-8/+13
It's not really a bitset, it's a choice of one of four types of USB pseudo-header. Make it an enum. Change-Id: I4ea994e1606c23e0a0f08b1b61357eea40a2535e Reviewed-on: https://code.wireshark.org/review/6830 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-10USB: Fix Conversation/Endpoint filtersMichal Labedzki1-1/+1
There were not fields for that, so simple add them. Change-Id: I489bae24ac96ea0baf395add731f4d62ccf19352 Reviewed-on: https://code.wireshark.org/review/6401 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-09convert variables that were static just because of SET_ADDRESS macro to use ↵Michael Mann1-2/+1
the proper pinfo->pool instead. Change-Id: I914918d9629f654ead497dddac0f412b690e4409 Reviewed-on: https://code.wireshark.org/review/6430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-08remove parent parameter from dissect_usb_setup_response()Martin Kaiser1-1/+1
Change-Id: Ib4a5cc3b783d3a4a1477624678964a9627d582e6 Reviewed-on: https://code.wireshark.org/review/5191 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-11-08remove parent parameter from dissect_usb_setup_request()Martin Kaiser1-1/+1
Change-Id: I5a24de9a12e301d472e701140299304e2cb4fcfc Reviewed-on: https://code.wireshark.org/review/5190 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-09-17Show endpoint direction based on EPHandle bitSean O. Stalley1-0/+3
Interpret the meaning of the endpoint handle direction bit, instead of just saying if it is set. Change-Id: I9fc0d6f95f6c3a94d6db90c8394fe3ca8fc83715 Reviewed-on: https://code.wireshark.org/review/4119 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-26Have dissect_usb_setup_request handle non-standard requestsSean O. Stalley1-2/+5
Moved code for parsing non-standard setup requests from dissect_usb_common() to dissect_usb_setup_request(). Also added header_info flag USB_HEADER_IS_MAUSB & updated mausb dissector. Change-Id: Ifa8abccbd57bf4dd3965f582872952383e6f737d Reviewed-on: https://code.wireshark.org/review/3851 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-25remove trans_info parameter from dissect_usb_endpoint_descriptor()Martin Kaiser1-2/+1
(remove it in the call from mausb as well) add NULL checks for usb_conv_info, usb_trans_info Change-Id: I95d52b85e3fa0d42b6a20047053259aaca8754fe Reviewed-on: https://code.wireshark.org/review/3784 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-25remove trans_info parameter from dissect_usb_unknown_descriptor()Martin Kaiser1-1/+0
remove now unused trans_info variable in mausb Change-Id: I99df8a1ed039134c9448546d0f1a738f203f9610 Reviewed-on: https://code.wireshark.org/review/3785 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-21set usb_conv_info->endpoint to "no endpoint" for interface conversationsMartin Kaiser1-5/+5
Change-Id: I625d20cc2c874f5b28c063590878077f8aa80196 Reviewed-on: https://code.wireshark.org/review/3780 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-19clear the temporary components of usb_conv_info_t before we dissect aMartin Kaiser1-0/+1
new packet this fixes the fuzz failures in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10386 Change-Id: I8c0ba8c8da9af8d7a3ef9cdd7781769b9966f1a2 Reviewed-on: https://code.wireshark.org/review/3727 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-31this is the _URB_ transfer type - which is different from theMartin Kaiser1-1/+1
transfer type in the endpoint descriptor Change-Id: I9e23d9825efb30311cd3e04d01548c03b163c276 Reviewed-on: https://code.wireshark.org/review/3299 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-15MAUSB dissection of control transfer responsesSean O. Stalley1-0/+6
The MAUSB dissector can now dissect transfer responses for control endpoints. Change-Id: Ic488ccb308365d072bbbf0eaf128b198caf74eca Reviewed-on: https://code.wireshark.org/review/2960 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04Add Bus ID to USB Address ColumnSean O. Stalley1-2/+3
USB Addresses are now in the format of: bus_id.device_address.endpoint This makes it much easier to read traces that captured traffic on more than one bus. Change-Id: I264db2ceea712d94632d5d08d05d3af22a4a03fe Reviewed-on: https://code.wireshark.org/review/2833 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-09Dissection of USB setup data in MA USB data packetsSean O. Stalley1-0/+12
This patch adds support for dissection of USB setup data contained inside of MA USB data packets. The MAUSB Dissector calls the same function used by the USB dissector to dissect the setup data. This patch also (and a bit unintentionally) adds transfer following. TransferReq & TransferAck packets now show a link & a time delta to their TransferReq (ie [Request in: XXX] & [Time from request: XXX]. TransferReq packets have a [Response in: XXX] tag, but it erronously points to the TransferAck, not the TransferResponse. Change-Id: I01041de3c38ea6248e9d34506b0b012518a1e6d8 Reviewed-on: https://code.wireshark.org/review/1548 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-04MAUSB dissector uses USB addressesSean O. Stalley1-0/+12
The MAUSB dissector now prints the USB address for MAUSB data packets in the Source & Destination columns. Before, the IP address was printed. All MAUSB data packets are now part of USB Conversations. Like the USB dissector, all data to & from one endpoint are part of the same conversation. Issues that need to be resolved: - In the case where multiple MAUSB packets exist in one TCP packet, only one USB address can be printed. - The USB conversations do not appear in the conversations window. They should appear under the USB conversations tab. Change-Id: I042daf7889cf70b3bbc450f9ccd974a0f93f4798 Reviewed-on: https://code.wireshark.org/review/1943 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06fix dissect_usb_endpoint_descriptorSean O. Stalley1-1/+1
dissect_usb_endpoint_descriptor uses usb_trans_info, but the signature contains a _U_ macro. Change-Id: I87fe6d91d5f8cf15926bf2dfd6381a256cd0785d Reviewed-on: https://code.wireshark.org/review/1537 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-05Media Agnostic USB Packet DissectorSean O. Stalley1-0/+11
This dissector dissects MA USB Packets. It is capable of dissecting Media Agnostic packets both in a TCP stream as well as packets sent over SNAP (referred to in spec as "Raw Ethernet" mode). Change-Id: I3ad4e1beb891f9c2835adff320095e7e738241eb Signed-off-by: Sean O. Stalley <sean.stalley@intel.com> Reviewed-on: https://code.wireshark.org/review/1252 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-08USB device addresses need to be 16-bit.Guy Harris1-1/+1
They are 16-bit in the Windows header; make them that way everywhere, so that we don't get "shortening 16 bits to 8 bits" warnings. Change-Id: I18f4c4254f224d76a90f3e87bc2f28cba011b5a3 Reviewed-on: https://code.wireshark.org/review/1021 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-25MBIM: fix dissection of control packets when capturing with usbmonPascal Quantin1-1/+6
Change-Id: Ie20fcb8d393a85d47ba78f6cb70de77fedda2587 Reviewed-on: https://code.wireshark.org/review/829 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-23From Michal Labedzki via ↵Alexis La Goutte1-0/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9562 USB: Add support for Bluetooth Ubertooth with initial version of Low Energy Link Layer protocol and NFC ACR122 USB: Make setup request to be able decoding by next dissector Most devices use them as commands, so we can dissect this protocol (class, vendor). Also update "hci_usb" to decode these informations. svn path=/trunk/; revision=54401
2013-12-14Use proto_tree_add_item() for UTF-16 strings when dissecting stringGuy Harris1-3/+3
descriptors. Make sure the length in string descriptors is at least 2, so that we have a valid string or string-list length. svn path=/trunk/; revision=54084
2013-11-12Remove usb_conv_info_t from packet_info and pass the data directly into the ↵Michael Mann1-6/+7
subdissectors. Bug 9413 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9413) svn path=/trunk/; revision=53274
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-09-02dissect_usb_descriptor_header() takes an additional value_stringMartin Kaiser1-1/+4
parameter to intrepret the descriptor type depending on the class per default, the list of standard descriptor types is used svn path=/trunk/; revision=51642
2013-07-31Convert the USB dissectors to wmem.Evan Huus1-1/+3
svn path=/trunk/; revision=51042
2013-03-07From Max Baker via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8431Evan Huus1-4/+11
Add a few member variables to the USB conversation structure, necessary for a USB PTP dissector. svn path=/trunk/; revision=48184
2013-03-01From Steve Magnani via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8338Evan Huus1-0/+3
Centralize logic related to per-interface conversations, and expose it for use by class-specific dissectors. Class-specific descriptor dissectors also need to know the interface in whose context they are called to work. This is a prerequisite for a USB Video Class dissector, which needs to decode many class-specific descriptors. svn path=/trunk/; revision=47990
2013-02-15From Steve Magnani via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8264Evan Huus1-0/+1
Improve handling of truncated USB Configuration descriptors. In contrast to other descriptor types, configuration descriptors have varying lengths and may be quite long. This makes them much more prone to truncation by a host that is cautious about reading large descriptors. A real-world case has arisen where a host requests a partial configuration descriptor of a USB webcam, and wireshark improperly reports that the response is malformed. Change configuration descriptor dissection to distinguish between truncation induced by the host, which is not an error, and descriptor truncation or reporting of invalid descriptor lengths by the device, which are. This patch also relieves class-specific dissectors of the burden of checking that the descriptor length and type fields are available, and that all the bytes claimed by the descriptor length are also available. svn path=/trunk/; revision=47676
2012-11-29From Michal Labedzki:Anders Broman1-0/+7
USB: Add support for vendor_id/product_id, bus_id/device_address and class/subclass/protocol tables USB subdissectors can be decoded by class/subclass/protocol. If fail try vendor_id/product_id. bus_id/device_address is intented to use by DecodeBy, so user can decode specified device as need. Part of: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5032 svn path=/trunk/; revision=46283
2012-11-29From Michal Labedzki:Anders Broman1-21/+25
USB: Update some descriptions found in USB 3.0 specification Part of: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5032 svn path=/trunk/; revision=46279
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-04-27From Steve Magnani:Anders Broman1-0/+7
Add decoding of fields within endpoint descriptor wMaxPacketSize https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7206 svn path=/trunk/; revision=42286
2012-03-21From Steve Magnani:Anders Broman1-2/+19
USB: incorrect generated bInterfaceClass for composite device CONTROL transactions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6964 svn path=/trunk/; revision=41715
2012-03-17From Steve Magnani via ↵Jeff Morriss1-2/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6963 : Conversation address generation during processing of endpoint descriptors is not being done in a manner consistent with that of general USB packet dissection. I am not aware of any observable manifestation of this bug. svn path=/trunk/; revision=41634
2012-03-10From Steve Magnani: USB: centralize some common dissection code for class ↵Anders Broman1-0/+3
reuse. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6930 svn path=/trunk/; revision=41458
2012-02-12From Steve Magnani:Anders Broman1-0/+2
USB: add infrastructure for dissecting class-specific descriptors. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6825 svn path=/trunk/; revision=40979
2010-05-16Attempt to handle isochronous descriptors between the 64-byte header andGuy Harris1-0/+20
the payload. Should fix bug 4401. svn path=/trunk/; revision=32828
2010-04-21From Chris Maynard:Guy Harris1-0/+1
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
2009-10-29From Marton Nemeth via bug 4173:Stig Bjørlykke1-0/+15
Move bmRequestType field constants to header file. svn path=/trunk/; revision=30761
2007-03-25From a Jon Smirl patch Ronnie Sahlberg1-1/+1
rename the conversation field "class" to "interfaceClass" svn path=/trunk/; revision=21194
2007-03-25From Jon SmirlRonnie Sahlberg1-1/+1
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