aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-usb-ccid.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-25Fix lots of spellingsMartin Mathieson1-4/+4
2023-11-20Remove init of proto variablesStig Bjørlykke1-99/+99
Remove init of proto, header field, expert info and subtree variables. This will reduces the binary size by approximate 1266320 bytes due to using .bss to zero-initialize the fields. The conversion is done using the tools/convert-proto-init.py script.
2023-11-14Fix (or disable) more dissector item warningsMartin Mathieson1-1/+1
2023-09-19Use `register_dissector()` for more protocolsDavid Perry1-4/+3
Changes several calls of `create_dissector_handle()` to instead call `register_dissector()` with a name for the dissector. This should handle all dissectors in `epan/` from `packet-p*` to `packet-v*`. This change allows affected dissectors to be findable by calls to `find_dissector()`. In turn, this opens up more command-line use for these protocols, including fuzzshark and rawshark, as well as lua use via `Dissector.get()`. Where needed, move the call from the protocol handoff function to the protocol register function, save the result in a static variable, and use that variable in the handoff function. There were some calls to `create_dissector_handle()` or `register_dissector()` which passed `-1` as the protocol argument. When I saw those I corrected them to pass the actual `proto_foo` identifier instead. Partially addresses #5612
2022-12-15tools/check_typed_item_calls: check FT_BOOLEAN mask lengthMartin Mathieson1-12/+12
2022-12-13usb-ccid: fix mask found by check_typed_items_callsAlexis La Goutte1-3/+3
epan/dissectors/packet-usb-ccid.c filter= usbccid.dwFeatures.stopIccClk - mask has odd number of digits 0x100 expected max for FT_BOOLEAN is 8 epan/dissectors/packet-usb-ccid.c filter= usbccid.dwFeatures.nadValNot0accept - mask has odd number of digits 0x200 expected max for FT_BOOLEAN is 8 epan/dissectors/packet-usb-ccid.c filter= usbccid.dwFeatures.autoIfsd - mask has odd number of digits 0x400 expected max for FT_BOOLEAN is 8
2022-12-13usb-ccid: fix typo found by check_typed_item_callsAlexis La Goutte1-1/+1
packet-usb-ccid.c:598 proto_tree_add_item called for hf_ccid_wLevelParameter - item type is FT_UINT8 but call has len 2
2022-12-11CCID USB: decode PC_RDR_SET_PARAMS & RDR_PC_PARAMSLudovic Rousseau1-3/+104
Add decoding of the abProtocolDataStructure part of the command and the response.
2022-12-11CCID USB: Correctrly identify protocol numberLudovic Rousseau1-1/+1
The bProtocolNum field is at offset 9, not 8. Offset 8 is already used for bError.
2020-08-31More spelling fixes, last part of 2nd pass of dissectors.Martin Mathieson1-4/+4
2020-07-14ccid: dissect interrupt notifications for 8 slotsEric Wild1-2/+53
This was previously limited to one byte (=4 slots), and afaik no readers existed that supported more slots until now - now there is the sysmocom octsim that as the name implies offers 8 slots. Change-Id: I5eccc7b6fb0d3c12ef7d7379d3ee88b5e7c45b71 Reviewed-on: https://code.wireshark.org/review/37816 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-6/+6
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> 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>
2019-06-13register_decode_as_next_proto: remove the "title" parameterMartin Kaiser1-1/+1
Remove the "title" parameter from the register_decode_as_next_proto() function. This parameter is no longer required since decode_as_t does not have a title any more. Change-Id: I300c755bd465453aa91703b53ce9adc954e38c00 Reviewed-on: https://code.wireshark.org/review/33579 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> 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-09-16Have register_decode_as_next_proto create dissector table.Michael Mann1-6/+3
For protocols that have don't have a unique identifier for their payload, have register_decode_as_next_proto be a one stop shop to create Decode As functionality and a dissector table of type FT_NONE. Change-Id: Ic1f2e9ed0aee0554a4eb8f232630b99c0604dfc0 Reviewed-on: https://code.wireshark.org/review/22575 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-11Expand register_decode_as_next_proto to include prompt string.Michael Mann1-2/+1
Many dissectors don't have an identifier to pass to a dissector table. When using Decode As they all have a "value" function that returns 0 just so something is returned. A first step to a cleaner refactor of the functionality is to allow dissectors to provide a "prompt" function when registering Decode As with register_decode_as_next_proto() so that the text exposed in the GUI can vary, but the function that returns 0 (nothing) can be consolidated under decode as registration functionality. This casts a wider net for register_decode_as_next_proto() use. Change-Id: I2995b3c251dae70f5f529b672473d25c6288ed5c Reviewed-on: https://code.wireshark.org/review/22562 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-25USB CCID: use register_decode_as_next_proto()Martin Kaiser1-19/+4
Change-Id: Ib583470ba612ef24da4d9360f7bbc0e33fb19bd9 Reviewed-on: https://code.wireshark.org/review/22377 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-23USB CCID: register obosolete preferenceMartin Kaiser1-0/+5
In 082e3e346f69f0c2134064e80dcc104c18111c55, we dropped the prtype preference in favour of Descode As. Register prtype as an obsolete preference to make sure that it's not removed from the preferences file. The way, the preferences file is still usable with older wireshark versions. Change-Id: I8feed6080b58dd5443898e2c5b12732b0b3a0a4f Reviewed-on: https://code.wireshark.org/review/22373 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2017-06-23USB CCID: use Decode As to select the payload protocolMartin Kaiser1-52/+23
Remove the special case for vid 0x072F, pid 0x2200. We should be able to set Decode As for this (vid, pid) to USB CCID and then use the new Decode As mechanism to select the next protocol. Register GSM SIM, ISO7816, PN532 and ACR122 as possible payloads for USB CCID. Change-Id: I8237cc9123655d3b289b0564ffb83a32434bebfc Reviewed-on: https://code.wireshark.org/review/22290 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21GSM SIM: define a dissector for both request and responseMartin Kaiser1-7/+5
Define a dissector that can handle both requests and responses. Look at pino->p2p_dir to detect if we have a request or repsonse. (At the moment, there's a dissector for request+response in one packet and two other dissectors for request and response messages.) Use the new mechanism for USB CCID. Change-Id: I7eb9861802b4244f92770602179f39642eb28641 Reviewed-on: https://code.wireshark.org/review/22289 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-06-21USB CCID: unify the code to call subdissectorsMartin Kaiser1-49/+37
Prepare the USB CCID code for replacing the "next protocol" preference with Decode As. USB CCID has a length field for the payload data. Use this field to create the next_tvb. There's no need for different payload lengths depending on the next protocol. Use call_data_dissector() instead of referencing data_handle. Set pinfo->p2p_dir regardless of the next protocol. Change-Id: I042ecc9bd75245ee1d4d8a94532c9fd1de83e859 Reviewed-on: https://code.wireshark.org/review/22288 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-01-27Delete unsed variable in ccidThomas PORTASSAU1-11/+0
Change-Id: I4c9eff4248f25c15ef4d525e0a4360bf3bdb480c Reviewed-on: https://code.wireshark.org/review/19813 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-01-26CCID added dwFeatures, bStatus bitmasks and IFSD in class descriptionThomas PORTASSAU1-6/+119
Change-Id: I2855c83c6b5e9add3f34d72a2f2ed3394bf79b78 Reviewed-on: https://code.wireshark.org/review/19761 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: Anders Broman <a.broman58@gmail.com>
2016-12-16Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.Michael Mann1-6/+4
Many proto_item_append_text calls were just adding a unit string to a field. There's a better way to do that now. Change-Id: Id18d5ac1ea4d8ecdc4cbe7ebaec07fbd2eab6e78 Reviewed-on: https://code.wireshark.org/review/19289 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-12USB CCID added Interrupt IN and PC2RDR_paramsThomas PORTASSAU1-2/+93
Change-Id: I77a88b910fa51e09f9d5bdb541170de76ffb3708 Reviewed-on: https://code.wireshark.org/review/16386 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-5/+5
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
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-1/+1
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-06-22Remove a bunch of deprecated tvb_length callsEvan Huus1-1/+1
Change-Id: I9362e0fdc4519ba5f3d656152966e7030f478839 Reviewed-on: https://code.wireshark.org/review/9022 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-03-29smart card dev class descriptor: use a bit field for the supported protocolsMartin Kaiser1-3/+19
Change-Id: Icf1d71f0aa90ed418264cd4f349e2a514f1ae2f9 Reviewed-on: https://code.wireshark.org/review/7847 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-03-29dissect two more features in the smart card device class descriptorMartin Kaiser1-0/+12
Change-Id: Ia442cbf7a30c1f1054a3fa8e814d595867e2c034 Reviewed-on: https://code.wireshark.org/review/7846 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+1
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-12-13Use ENC_LITTLE_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-1/+1
(for some dissectors which fetch all other integral fields using ENC_LITTLE_ENDIAN). Change-Id: Ica72a68ac560f2920d61e0769de83130557c46fd Reviewed-on: https://code.wireshark.org/review/5752 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-16use supported/unsupported for the bitfield elementsMartin Kaiser1-24/+24
order them from MSB to LSB Change-Id: Ie758285c2cf5d19e00d6d256c49acca15ce81168 Reviewed-on: https://code.wireshark.org/review/4746 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-16smartcard descriptor: start a bitfield for the featuresMartin Kaiser1-2/+23
Change-Id: I636cfdfcd61d6d5dc041f9dbc657244d94e88b7f Reviewed-on: https://code.wireshark.org/review/4745 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-13smartcard descriptor: bitmask for pin support fieldMartin Kaiser1-3/+19
Change-Id: If0e5cd90ff73bfbb211970f9a24974119c6ec550 Reviewed-on: https://code.wireshark.org/review/4664 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-13smartcard descriptor:Martin Kaiser1-2/+21
dissect number of lines, characters per line in the lcd layout Change-Id: I36c9c6f2e73cdfde8a9b7c4ad0450d93722fca2b Reviewed-on: https://code.wireshark.org/review/4663 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-10-13smartcard descriptor: the lcd layout is two bytes longMartin Kaiser1-1/+1
Change-Id: Ie8fd82d652a9a3fc1d3139ab610bbaa7a5ecd32d Reviewed-on: https://code.wireshark.org/review/4662 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-09-08Eliminate proto_tree_add_text from some of the dissectors.Michael Mann1-6/+10
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-07-07convert to proto_tree_add_subtree[_format]Michael Mann1-4/+3
Change-Id: Ie10ac4f5f04a23344d183e095bbafb23c6409144 Reviewed-on: https://code.wireshark.org/review/2904 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-3/+3
Hopefully that name makes it clear what the routiner's purpose is, and will encourage people to use it rather than using dissector_add_uint() with a bogus integer value. Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8 Reviewed-on: https://code.wireshark.org/review/2483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-1/+1
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-1/+1
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-1/+1
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 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-8/+8
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: CCID: Add ACR122 dissector to be autodetected by VendorId/ProductID svn path=/trunk/; revision=54407
2013-12-23From Michal Labedzki via ↵Alexis La Goutte1-37/+21
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 NFC: Add ACR122 USB dongle dissector ACS ACR122 is compatibile with PN532, but has its own API. Dissect it. svn path=/trunk/; revision=54406
2013-12-12remove unused dissector tablesMartin Kaiser1-5/+0
http://www.wireshark.org/lists/wireshark-dev/201312/msg00137.html svn path=/trunk/; revision=53977
2013-12-09Reject the packet if data is NULL without doing anything else.Chris Maynard1-2/+5
Note: We *might* want to do _something_ but that _something_ should be well-defined and consistent across all dissectors. Previously, some dissectors called proto_tree_add_text() to add some error message text to the tree, while others called DISSECTOR_ASSERT(). svn path=/trunk/; revision=53895