aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-usb-hid.c
AgeCommit message (Collapse)AuthorFilesLines
2020-03-23fix typo found by lintian (Unkown => Unknown)Alexis La Goutte1-1/+1
Change-Id: I32f636c5a8de652303fbe03668bf937004f2e6a8 Reviewed-on: https://code.wireshark.org/review/36543 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-15USB HID: add missing usage pagesFilipe Laíns1-28/+850
- Haptics - Eye and Head Tracker - Sensor - Brailie Display - Lighting and Illumination - Gaming Device - FIDO Alliance Change-Id: I1e90bd8544b8327f376143226c7a1ea427c01277 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36410 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-15More modeline fixes to put HT tab stops every 8 characters.Guy Harris1-2/+2
Change-Id: If3ea65f24e33b89784b3d9a1e7009d09728d4f7a Reviewed-on: https://code.wireshark.org/review/36437 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-15Tab stops are always always always always always every 8 spaces.Guy Harris1-1/+1
That is the rule of UN*X, engraved on stone by Ken and Dennis, and there's plenty of software used to display and edit Wireshark source that hardwires the tab stops there.(including Boring Old cat And more). Pick any indent you want, but do *not* put tab stops every 4 spaces, even if putting them every 8 spaces requires you to hit your IDE over the head to accept that. Change-Id: I58f7c459ce2d72096f67e650afe74f2637f38649 Reviewed-on: https://code.wireshark.org/review/36434 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-03-15USB HID: update modelines to match the current code styleFilipe Laíns1-3/+3
Change-Id: Id106b1cc94038879a17970b5e9722f04bfb35df2 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36423 Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-15USB HID: fix incorrect format string when annotating top level rdesc itemsFilipe Laíns1-5/+5
Change-Id: Iaac5f85e75e93278e2c485bd2e52756ac23f6e9a Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36390 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-14USB HID: fix interpretation of unit exponent fieldFilipe Laíns1-1/+1
Change-Id: Id9752da61cca8a00e98049d7cf3f990e9199a684 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36395 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-14USB HID: dissect the missing fields from input/output/feature itemsFilipe Laíns1-2/+15
We try to provide as much useful information as we can in the top level item without it being too much. The approach on how to handle theese items was copied from hid-tools. Change-Id: I1c6b24c6fcd989b5188391cad8e7a629c58beebb Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36391 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-14USB HID: provide item string for the unicode usage pageFilipe Laíns1-0/+3
Change-Id: Ib3db8854cc05c716ae4951b03caf452683c2e917 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36393 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-14USB HID: have a consistent styleFilipe Laíns1-434/+383
Change-Id: I2c2b89e6f7d2bce6af3043365d3f4c771044420b Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36392 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-14USB HID: fix bug where logical min/max were being dissected as unsignedFilipe Laíns1-12/+13
Change-Id: Icf1b1b591ad76e2082b14344db19f1c0e8601455 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36389 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-13USB HID: make the dissection tree look as in the specFilipe Laíns1-25/+70
Currently, the top dissection tree looks like this: Global item (Usage Page) Local item (Usage) Main item (Collection) This approach is not great: it provides little relevant information. The item type (Main,Global,Local) is most of the time not relevant, it is used to differentiate items within the spec and is not useful to the end user. The item name (Usage Page, Usage, Collection, etc.) and its value is much more relevant to the end user. We show the name, which is great, but we don't show the value, forcing the user to open the subtree to access it. The report descriptors described in the spec are annotated like this: Usage Page (Generic Desktop) Usage (Mouse) Collection (Application) This patch makes the dissection tree look like that. All the information is still present in the tree but we put the information most people are actually interested in in the top level item. Change-Id: Idbfb0f137bc82b5e69787ee524585d18eb697340 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36374 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-11USB HID: use the correct names from the specFilipe Laíns1-18/+18
It's mostly identation but we also fix an incorrect spec name: Usage Pages. Usage Pages and Usages are different things, but the we currently call them both "Usages", which is wrong and confusing. Change-Id: I7e83fbe7dbd4c22a713ecbba136a2caf5d61e2fd Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36365 Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com>
2020-03-11USB HID: refactor usage page identificationFilipe Laíns1-1978/+1978
The current approach to identify the the usage page and usage page usages is not great. It joins both the usage pages and the usages which are supposed to be individual values. The HID usage tables declarations also become harder to read as they hold the constructed value, not the value from the spec. This patch changes the HID usage table declartions from range_string to value_string, making them less bulky and easier to read, and splits out the usage page from the usages. Change-Id: I018406267fae43683d68c1349049e2c7c26f8ad6 Signed-off-by: Filipe Laíns <lains@archlinux.org> Reviewed-on: https://code.wireshark.org/review/36362 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-24Fix Usb HID Report descriptor Local item Usage parsingAndrey1-4/+1941
Add usage values taken from "HID Usage Tables 1.12". Fix Global item Usage Page and Local item Usage concatenation. Change-Id: Ifeb09b60875460bd4bea0641dfa932479ffe6bbf Reviewed-on: https://code.wireshark.org/review/29253 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-03Use col_append_str() for fixed stringsStig Bjørlykke1-8/+8
Change from col_append_fstr() to col_append_str() when appending strings without formatting. Change-Id: I8975704c246f2b9a1301ed5f96273aa9d61c6f44 Reviewed-on: https://code.wireshark.org/review/20857 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-13USB HID: add dissector to USB Device 'Decode As' listPascal Quantin1-0/+2
Ping-Bug: 12511 Change-Id: I6193e3bb084adf9925bb6800a756804164030630 Reviewed-on: https://code.wireshark.org/review/15857 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-1/+1
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-3/+3
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-2/+2
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> 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-06-23Remove more deprecated tvb_length callsEvan Huus1-4/+4
Change-Id: Ie40a195db622ebfb096fa5088c5467a1385e69bf Reviewed-on: https://code.wireshark.org/review/9062 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-02-08USB HID: fix no previous prototype for ↵Alexis La Goutte1-0/+1
'dissect_usb_hid_get_report_descriptor' [-Wmissing-prototypes] Change-Id: Icb7fec658f895e91069e51bab50d57a0a93f5cba Reviewed-on: https://code.wireshark.org/review/7031 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-07set protocol to USBHID for get descriptor request and responseMartin Kaiser1-0/+2
if they're dealing with HID descriptors Change-Id: Ia529fe373653ddf18e05e8ad148a2f5b5686fa95 Reviewed-on: https://code.wireshark.org/review/7010 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-02-07use the value string for HID descriptor typeMartin Kaiser1-1/+2
Change-Id: I19544eeccd5206de88fe480f9b02bc57fcc278bd Reviewed-on: https://code.wireshark.org/review/7009 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-02-07dissect a get descriptor request and response for the HID report descriptorMartin Kaiser1-26/+114
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-02-03Bluetooth/USB HID: Move boot form of reports from bthid to usbhidMichal Labedzki1-2/+736
Then call it as new dissectors from bthid and btatt. In future they will be used in usbhid, because they are part of HID. Change-Id: I9cb545f3079c27945b17bf8791ba4e3736c29e7c Reviewed-on: https://code.wireshark.org/review/6912 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-03Bluetooth: ATT: Decode some HOGP attributesMichal Labedzki1-1/+3
Change-Id: I169f767b699a2f95e5a1553f1380f0b88cd7c67d Reviewed-on: https://code.wireshark.org/review/6908 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-21usb-hid: fix 2 minor bugs and some dead initializersBill Meier1-12/+10
One bug was introduced in g4d58904 Change-Id: I16a5e83f11f48038945e957c7e6ce9d50b4aec46 Reviewed-on: https://code.wireshark.org/review/6721 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-19tvb_length() -> tvb_captured_length()Martin Kaiser1-1/+1
Change-Id: I520b38ed37b2d16d9a15f57b8e83b0b59c9a528c Reviewed-on: https://code.wireshark.org/review/6666 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-18make things a bit easier to read...Martin Kaiser1-3/+4
Change-Id: I3499c2f9e07a960f8bdf83973693bdeb4fb4ebd9 Reviewed-on: https://code.wireshark.org/review/6630 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-18remove trans_info parameter from dissect_usb_hid_report_item()Martin Kaiser1-6/+3
Change-Id: I04eba644be7dd3e64b67c7d42c596bcdcf6a1942 Reviewed-on: https://code.wireshark.org/review/6628 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-18clean up the functions that dissect the hid requestsMartin Kaiser1-80/+80
Change-Id: Ie4d52b62824a8c0c777ffce3988fbe1fd4e5b4a4 Reviewed-on: https://code.wireshark.org/review/6627 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-18remove redundant (and unused) paramter usb_trans_infoMartin Kaiser1-8/+8
Change-Id: Ibb683f6d42125b13417aceb06949102a9821d626 Reviewed-on: https://code.wireshark.org/review/6626 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-02USB HID: fix report descriptor main items dissectionPascal Quantin1-9/+9
true_false_string definitions were inverted While we are at it, use the exact same wording as in the spec Bug: 10825 Change-Id: Ia391b310e92eb88a9a144a2fb0974701a460afc8 Reviewed-on: https://code.wireshark.org/review/6251 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+2
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-08Eliminate proto_tree_add_text from some of the dissectors.Michael Mann1-4/+2
Other minor cleanups while in the area. Change-Id: I623d941e53128f169e55dfc629547b4221fa72fc Reviewed-on: https://code.wireshark.org/review/4021 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: Evan Huus <eapache@gmail.com>
2014-08-19remove the usb_trans_info parameter from dissect_usb_hid_get_report_descriptor()Martin Kaiser1-1/+5
Change-Id: If14357a02a60eff5fc7e50567c2c6bfc6ee3dcc6 Reviewed-on: https://code.wireshark.org/review/3732 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-07convert to proto_tree_add_subtree[_format]Michael Mann1-7/+5
Change-Id: Ie10ac4f5f04a23344d183e095bbafb23c6409144 Reviewed-on: https://code.wireshark.org/review/2904 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-2/+2
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-2/+2
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@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-14Fix [-Wmissing-prototypes]Jakub Zawadzki1-1/+5
svn path=/trunk/; revision=54095
2013-12-10Reject packets if data (and usb_trans_info) are NULL. Also, new-syle ↵Chris Maynard1-7/+13
dissectors return the number of bytes dissected, not TRUE/FALSE. svn path=/trunk/; revision=53922
2013-11-12Remove usb_conv_info_t from packet_info and pass the data directly into the ↵Michael Mann1-6/+3
subdissectors. Bug 9413 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9413) svn path=/trunk/; revision=53274
2013-09-02descriptor type value string for HIDMartin Kaiser1-1/+13
svn path=/trunk/; revision=51643
2013-09-02dissect_usb_descriptor_header() takes an additional value_stringMartin Kaiser1-1/+1
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