aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-s7comm.c
AgeCommit message (Collapse)AuthorFilesLines
2018-02-18S7comm: fix range check to prevent infinite loop when upper bound is 255Pascal Quantin1-11/+11
While we are at it, fix identification of not last element in a few places Bug: 14423 Change-Id: I568530949d09ddfd8c5c58d24050dfed32ce10f5 Reviewed-on: https://code.wireshark.org/review/25851 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
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-10-31s7comm: Several minor improvementsThomas Wiens1-85/+170
This patch includes several minor improvements: - Special (only for Sinumerik NC): allow NCK address description in data-part - Userdata parameter part: add text definition for second req/res - Don't add data tree in userdata telegrams, when there is no data in there - Cyclic functions: add new subfunction - Alarming: add SCAN message decoding - Improve info column display when there are multiple PDUs in one frame Change-Id: Ib9afd0c6b14cf97ed645084e095f79fb40b07f43 Reviewed-on: https://code.wireshark.org/review/24170 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-27s7comm: Syntax-id decoding of frequency inverter parametersThomas Wiens1-192/+275
Add Syntax-id decoding for accessing frequency inverter parameters. Moved the decoding of all other syntax-ids to separate functions. Change-Id: Iba41f0631c4aeaf31a4ec6f73ffc42ca0b76f00d Reviewed-on: https://code.wireshark.org/review/24102 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-03Use col_append_str() for fixed stringsStig Bjørlykke1-10/+10
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-11-03Fix lintian found spelling error "occured" -> "occurred"Michael Mann1-2/+2
Change-Id: I6010669b880b772ba4a22f13ba03fe48b438e8b7 Reviewed-on: https://code.wireshark.org/review/18644 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-03Fix lintian found spelling error "splitted" -> "split"Michael Mann1-4/+4
Change-Id: I4b00ef460ae1792cd6f14856493f7a58ab8e0b9a Reviewed-on: https://code.wireshark.org/review/18645 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-27s7comm: fix fix spelling typo found by lintianAlexis La Goutte1-1/+1
Change-Id: I38da03260d082aaf977f4f32e9206d07e55c1432 Reviewed-on: https://code.wireshark.org/review/18509 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-08s7comm: use ws_stroi function.Dario Lombardo1-18/+63
Change-Id: I0d27c2aa7d896c4c6048dff963910ad7f88b07ee Reviewed-on: https://code.wireshark.org/review/18085 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-21Add proto_tree_add_checksum.Michael Mann1-1/+1
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-01s7comm: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+0
Change-Id: I296d11ec43b3817d30920432239632f86b9f773f Reviewed-on: https://code.wireshark.org/review/16227 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Thomas Wiens <th.wiens@gmx.de> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-27tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_stringMichael Mann1-16/+11
Also some other tricks to remove unnecessary tvb_get_string_enc calls. Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914 Reviewed-on: https://code.wireshark.org/review/16158 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-27s7comm: Sinumerik NC file transferThomas Wiens1-1/+117
Added decoding of up-/downloading files from/to a Sinumerik NC CNC control machine. Change-Id: If7939e56e972fc2b8feb12150c4184a880b0cdae Reviewed-on: https://code.wireshark.org/review/16129 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-05-14s7comm: fix warning found by clang analyzerThomas Wiens1-38/+37
Fixed warnings about Dead store / Dead assignment found by clang analyzer. Fixed encoding to be compatible to hf-type. Change-Id: Iba93abe21f87029d53cd1db111b372cd4bd76229 Reviewed-on: https://code.wireshark.org/review/15418 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-11s7comm: block/file up-/download redesignThomas Wiens1-235/+1210
Redesigned the block/file up- and download, using new informations from PI-Services. Changed the block-info items, as it's in general a string, which can be further dissected if it's a PLC program block. Other types of Siemens automation hardware may use this as a simple filename for filetransfer. Changed the display-style for block name/number in info-column, to be more compact. Change-Id: Ie7c3a285d25897f8516ed8827041a5dbdf80679e Reviewed-on: https://code.wireshark.org/review/15275 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-05-05s7comm: Add errorcode descriptions, extended list values, style cleanupThomas Wiens1-165/+300
Added new errorcodes, changed to extended value-string. Removed the defines as they are and will not be used in the code. Add errorcode to info column, if there is an error. Removed the functioncall-tree comment, as it was not up to date. Change-Id: I0abe8eb046b9b2f28e32cf71e214704daa0aa843 Reviewed-on: https://code.wireshark.org/review/15260 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-12s7comm: fix 's7comm.cpu.msg.events.modetrans' exists multiple times with NOT ↵Alexis La Goutte1-1/+1
compatible types: FT_BOOLEAN and FT_UINT8 Change-Id: I1fea29ab8813ec69339550a477eb3203f3b5f3aa Reviewed-on: https://code.wireshark.org/review/14421 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-6/+6
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.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>
2016-01-04Added/extended handling of CPU message systemThomas Wiens1-31/+1459
The message system includes mode-transition and alarm events by PLC programmed blocks. The IDs in the mode-transition events are the same as used in a SZL response, so I used the same decoding function. Change-Id: If00990c21190ba0bed7933d6c8cfb590c6d8eab2 Reviewed-on: https://code.wireshark.org/review/13032 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>
2015-12-07Spelling fixes for errors found by lintianBalint Reczey1-2/+2
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20 Reviewed-on: https://code.wireshark.org/review/11945 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-03Added cotp_is to heuristic dissector list for ISO transport.Thomas Wiens1-0/+1
S7 communication is also possible without TCP/IP. This ISO transport uses the following protocols: LLC->ISO8473->ISO8073->s7comm. The cotp dissector has two subdissector lists. cotp is uses with ISO-on-TCP, cotp_is with ISO transport. Change-Id: Ife543bee8331184d2181b347e683dfc1c2e4a05a Reviewed-on: https://code.wireshark.org/review/10771 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17Remove all preferences related to enabling/disabling heuristic dissectors.Michael Mann1-1/+1
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector. Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled. Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22 Reviewed-on: https://code.wireshark.org/review/9610 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12Add "user presentable" and "unique string ids" to heuristic table entries.Michael Mann1-1/+1
This allows better presentation of heuristic dissectors to the end user. Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6 Reviewed-on: https://code.wireshark.org/review/9602 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-23Added syntax id 0x82 for NCK data accessThomas Wiens1-0/+184
Change-Id: Iaff4551f87fa8d74a09a99c3c772c8abbdf60198 Reviewed-on: https://code.wireshark.org/review/8168 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-04-23Added decoding of BSEND/BRECV communicationThomas Wiens1-0/+53
Change-Id: Ie02f809e69cf9e7980d90ab02a2d4f34a465e0cd Reviewed-on: https://code.wireshark.org/review/8170 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-04-23Added display and filteroptions for byte- and bitaddressThomas Wiens1-1/+21
Change-Id: I48f39c148006e25fa98b75656cbb11496bce9d25 Reviewed-on: https://code.wireshark.org/review/8169 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-22Added transport size double-integerThomas Wiens1-0/+2
Change-Id: I3b5452ef8cfd4fac414b2c5bdd7926ea679b8029 Reviewed-on: https://code.wireshark.org/review/8167 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-1/+0
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-09Fix some spelling & grammar.Bill Meier1-5/+5
Change-Id: Iedeaa411caa0823922dd79c27897a2349d4e6907 Reviewed-on: https://code.wireshark.org/review/4054 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-04Fix Mac OS X buildbotAlexis La Goutte1-20/+20
packet-s7comm.c:962: warning: declaration of 'time' shadows a global declaration Change-Id: I4020b780e787a91c42f08f7b7b1c7feabcabdc62 Reviewed-on: https://code.wireshark.org/review/3987 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-09-04s7comm: Add dissector for S7 CommunicationThomas Wiens1-0/+3216
S7 Communication is a Siemens proprietary protocol that runs between programmable logic controllers (PLC) of the Siemens S7-300/400 family. Dissector T.125 has to be disabled to let this dissector work. Change-Id: I578cf270a4ae567f8e20dbabec1ce1e13fc08e6e Reviewed-on: https://code.wireshark.org/review/3777 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.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>