aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zvt.c
AgeCommit message (Collapse)AuthorFilesLines
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-2/+2
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> 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-02Use col_append_sep_str() for fixed stringsStig Bjørlykke1-2/+2
Change from col_append_sep_fstr() to col_append_sep_str() when appending strings without formatting. Change-Id: I315aca9b815c204a5bc78f7326402c40d1325f0e Reviewed-on: https://code.wireshark.org/review/20846 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>
2017-01-20zvt: add shutdown routine.Dario Lombardo1-0/+9
Change-Id: Ied5ab457a372a74c1a7216002f5ea615ea2a5252 Reviewed-on: https://code.wireshark.org/review/19701 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-29zvt: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
Change-Id: I0f7a620e5fbdab4a4c6b62b1b7bc884073bc0f45 Reviewed-on: https://code.wireshark.org/review/19447 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-29zvt: mark some functions as inlineMartin Kaiser1-10/+10
Change-Id: I2637fc18b1eeda5e567ee62c8ed53c6757c259bd Reviewed-on: https://code.wireshark.org/review/19457 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-29zvt: dissect card type and result code bitmapsMartin Kaiser1-2/+39
Change-Id: I26a7821642224c707dc4542a35b2b5b5aee159d5 Reviewed-on: https://code.wireshark.org/review/19456 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-29zvt: dissect the text lines TLV data objectMartin Kaiser1-1/+20
Change-Id: I3d54b4568b883b95294e29347bde0736b78157e1 Reviewed-on: https://code.wireshark.org/review/19455 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-29zvt: dissect the status apdu, add some more bitmapsMartin Kaiser1-2/+29
Change-Id: If74221dd55d61c5794f570daf38c88771f4a2f38 Reviewed-on: https://code.wireshark.org/review/19454 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-29zvt: add some more tag namesMartin Kaiser1-1/+21
Change-Id: If181a22f2794fb9fe812719593f8a7eb642bce42 Reviewed-on: https://code.wireshark.org/review/19453 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-29zvt: print the tag name in the tree headerMartin Kaiser1-1/+3
Change-Id: Iac0744f830020a54790a39820abab9fb756ffa9f Reviewed-on: https://code.wireshark.org/review/19452 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-26zvt: dissect the TLV container's payloadMartin Kaiser1-26/+121
add a function to dissect the sequence of TLV elements use a hash table for payload functions like we do for the bitmaps add two tags whose payload is another TLV sequence Change-Id: Ibb19fd7af2f58e201174d07d410557dc315c652a Reviewed-on: https://code.wireshark.org/review/19435 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-12-24zvt: len is used in dissect_zvt_int_status()Martin Kaiser1-1/+1
Change-Id: I8937dc605abf0414159acfc75ee05ccac89658fb Reviewed-on: https://code.wireshark.org/review/19410 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-30/+8
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-06zvt: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
Change-Id: I68b4fa08a7f65b92e56a6e72a6bb113e72ee33da Reviewed-on: https://code.wireshark.org/review/17524 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-09-04zvt: dissect Initialisation messageMartin Kaiser1-5/+16
It contains the same password field that appears in the Registration message. Make this field generic and reuse it here. Change-Id: I7be9a99b5da1713937ffca5624be66150ff453d1 Reviewed-on: https://code.wireshark.org/review/17489 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-09-04zvt: start dissecting Intermediate Status InformationMartin Kaiser1-1/+22
Change-Id: I351621f1def5ad6da577a9b0d1b2c5ab49018564 Reviewed-on: https://code.wireshark.org/review/17488 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-09-04zvt: dissect the currency code bitmapMartin Kaiser1-6/+19
add the value for euro Change-Id: Id8624e356ad4fcddcf77483a721428782c6bb0b2 Reviewed-on: https://code.wireshark.org/review/17487 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-07-24zvt: use a hash table for the bitmapsMartin Kaiser1-68/+81
table entries contain the length (if known and constant) and a function to dissect the payload this should clean up the code for bitmap dissection and make it easier to add new entries Change-Id: Id0ef5ff9e53c82171789c8a3352e56d3997d82b9 Reviewed-on: https://code.wireshark.org/review/16632 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-07-24zvt: rename dissect_zvt_bitmap_apdu() to dissect_zvt_bitmap_seq()Martin Kaiser1-6/+7
the sequence of bitmaps can either be the complete APDU payload or a part of it Change-Id: I3e3d176f29a5c2a0ad2c7fb61102c46255f436da Reviewed-on: https://code.wireshark.org/review/16631 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-07-24zvt: rename bitmap to bmpMartin Kaiser1-4/+4
It looks like the specs call the first byte BMP and the whole record (BMP + content) is called the bitmap. Change-Id: I60ce75b131b3cddc59f614b8ca156ceacc890cf8 Reviewed-on: https://code.wireshark.org/review/16630 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-01zvt: return -1 if we need more data from tcpMartin Kaiser1-0/+1
0 means that the dissector rejected the packet. Change-Id: I9e04443a5f378198f94038e0e67b2e1fde8054be Reviewed-on: https://code.wireshark.org/review/15210 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-04-06zvt: fix parsing of the 3-byte length fieldMartin Kaiser1-1/+1
if the first length byte is 0xff, the actual length is the last two bytes interpreted as little endian Change-Id: I098ce428888147ad9ca0a30c3ed451d1f89eace7 Reviewed-on: https://code.wireshark.org/review/14834 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-16const gpointer -> gconstpointerJoão Valverde1-1/+1
'const gpointer' is the same as 'void *const'. Replace with gconstpointer where straightforward (assuming that was the intent) and use gpointer everywhere else for clarity (that does not change *API* constness contract; it just means a variable is not declared immutable inside the called funtion). Change-Id: Iad2ef13205bfb4ff0056b2bce056353b58942267 Reviewed-on: https://code.wireshark.org/review/13945 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-8/+8
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-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-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-4/+4
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-15zvt: handle multi-byte tagsMartin Kaiser1-10/+54
and dissect the components of a tag add a global true-false string for constructed vs. primitive Change-Id: If10ecf97cde59e2be9ff5e3163073f6d14e6c61e Reviewed-on: https://code.wireshark.org/review/9636 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-23[zvt] the TLV container starts with an overall length fieldMartin Kaiser1-20/+47
new function dissect_zvt_tlv_len(), use it for the total length and for each tlv entry's length field Change-Id: I2b7ba6939ddf0326b014c565ffbe5d16e3a88282 Reviewed-on: https://code.wireshark.org/review/9059 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-23wmem_tree_new_autoreset() never returns NULLMartin Kaiser1-23/+16
Change-Id: I497b77dec1eb4617179d492838ecd7d267539ba4 Reviewed-on: https://code.wireshark.org/review/9043 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-14ZVT: add the transaction struct as an argument to the payload functionsMartin Kaiser1-15/+16
Change-Id: Idec2ca4f2db7a10e96c7acb030e0619c4f607b73 Reviewed-on: https://code.wireshark.org/review/8920 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-14ZVT: check the minimum apdu lengthMartin Kaiser1-5/+25
Change-Id: Ie86519345556b4a674ff1c7b4527de7219b2a539 Reviewed-on: https://code.wireshark.org/review/8919 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-10ZVT: use the transaction info to set source and destination addressMartin Kaiser1-9/+34
Change-Id: Ieef2747ce7cc42f0f1b56dd48268d65b1875a5d6 Reviewed-on: https://code.wireshark.org/review/8879 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-06ZVT: call zvt_set_addresses() for each apduMartin Kaiser1-5/+3
the pinfo parameter is not unused btw Change-Id: Id038979cb64e858aa0b7b44ca8c6e3d4b7d2d05e Reviewed-on: https://code.wireshark.org/review/8798 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-06ZVT: match requests and responsesMartin Kaiser1-9/+68
Change-Id: Idc6fc8fb21ee2e096e92e590c9b27c8363fced4f Reviewed-on: https://code.wireshark.org/review/8797 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-04ZVT: start dissecting the tlv containerMartin Kaiser1-9/+109
Change-Id: I555e4f487fb5aafa61dabfcab784dad5e71510ec Reviewed-on: https://code.wireshark.org/review/8769 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-05-10ZVT: show positive, negative completion in the info columnMartin Kaiser1-2/+8
Change-Id: I2488a505e6634da5cbcaf2e86505414d34823b8e Reviewed-on: https://code.wireshark.org/review/8381 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-03-01zvt: functions for dissecting a bitmap and an apdu as a sequence of bitmapsMartin Kaiser1-97/+118
Change-Id: I87233df8fc17ac0aca0d9daefcebd95f47699808 Reviewed-on: https://code.wireshark.org/review/7450 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2015-02-17[zvt] dissect some more fieldsMartin Kaiser1-1/+28
Change-Id: I93ffcfddd59a196a7e4f9f354b99884a7f5a814c Reviewed-on: https://code.wireshark.org/review/7208 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2015-02-08[ZVT] start dissecting the registration apduMartin Kaiser1-1/+22
Change-Id: Ic8f93913396de3d97cdba4473e6837056c8250a6 Reviewed-on: https://code.wireshark.org/review/7030 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-19add some more apdus to the apdu tableMartin Kaiser1-5/+15
Change-Id: Id5e5efea46e9ff6196607e56f0212fb083e8635c Reviewed-on: https://code.wireshark.org/review/6670 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-19start dissecting the ZVT authentication apduMartin Kaiser1-3/+104
add a length paramenter to the body dissection functions in the apdu table Change-Id: I4abbd9078fd36385a816963ab042f443e3c26b60 Reviewed-on: https://code.wireshark.org/review/6669 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-19display the control field text in the info colMartin Kaiser1-0/+2
Change-Id: I3dc0f58b4861a08be687214cae9c6681ebcac286 Reviewed-on: https://code.wireshark.org/review/6668 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-19continue the dissection of ZVT APDUsMartin Kaiser1-22/+90
define an apdu table with the direction, minimum length and a fuction to dissect the apdu payload set the source and destination address columns depending on the apdu add some entries to the apdu table Change-Id: I52bd15bfab7bbe6c97dfe64084e69a51e65a8a6e Reviewed-on: https://code.wireshark.org/review/6667 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-17dissect CCRC, APRC and the APDU body's dataMartin Kaiser1-2/+28
Change-Id: I21f7420286ed3e668ce4dc0eac06bbf4172039d6 Reviewed-on: https://code.wireshark.org/review/6588 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-17dissect the serial characters and the CRCMartin Kaiser1-2/+35
Change-Id: I64af822f30b02d313f5242014ff5e40a73dffa35 Reviewed-on: https://code.wireshark.org/review/6587 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-15remove the executable bits from packet-zvt.cMartin Kaiser1-0/+0
(I should not use git on cygwin for adding new files) Change-Id: I314d78073f1ebd633a20ff7c9ac3d0b236b3906a Reviewed-on: https://code.wireshark.org/review/6547 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-01-15start a dissector for ZVT KassenschnittstelleMartin Kaiser1-0/+353
this is a protocol between payment terminals and electronic cash-register systems / vending machines Change-Id: Ieac87c0af8e15f2dfe8b4a6274f3b56d652a5b1f Reviewed-on: https://code.wireshark.org/review/6531 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>