aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iec104.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-22IEC104: Added checking of correct ApduLen in context of ASDU typeJiří Engelthaler1-0/+19
Added displaying of raw data for unknown ASDU type Change-Id: I17e2ae048dbec61718610dd86d6878cdc0563ef0 Reviewed-on: https://code.wireshark.org/review/22341 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>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-1/+1
This emphasizes that there is no such thing as *the* routine to construct a subset tvbuff; you need to choose one of tvb_new_subset_remaining() (if you want a new tvbuff that contains everything past a certain point in an existing tvbuff), tvb_new_subset_length() (if you want a subset that contains everything past a certain point, for some number of bytes, in an existing tvbuff), and tvb_new_subset_length_caplen() (for all other cases). Many of the calls to tvb_new_subset_length_caplen() should really be calling one of the other routines; that's the next step. (This also makes it easier to find the calls that need fixing.) Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b Reviewed-on: https://code.wireshark.org/review/19597 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-22Add prefs_get_uint_value and prefs_get_range_valueMichael Mann1-3/+1
This allows dissectors to not need to know about the internal preference structure. Change-Id: I1ae67248cd0b0132aefc225ea0a9befaf9afdde2 Reviewed-on: https://code.wireshark.org/review/18864 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-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-33/+19
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-05-11Create IEC401 source TCP port preference.Jaap Keuter1-7/+27
In order to decode IEC401 over TCP/IP it's not always the case that the source port is the default 2404. Makeing this port a preference addresses the decoding issue and src/dst determination. Bug: 12407 Change-Id: Ifaee829e014a5e0ce449d047d9e0e44c470cd2f5 Ping-Bug: 10933 Reviewed-on: https://code.wireshark.org/review/15321 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-01-17Fix build [-Werror=maybe-uninitialized]João Valverde1-0/+1
Found building with GCC 5.3.0 and CFLAGS="-g -Og". Change-Id: I5bc29b6e91cc98332a513c9d03b02d2f6906608d Reviewed-on: https://code.wireshark.org/review/13362 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-18/+18
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>
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-11-16create_dissector_handle -> new_create_dissector_handleMichael Mann1-5/+6
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I96aa9cf53533cbb07105aa400d42922baf3016b3 Reviewed-on: https://code.wireshark.org/review/11860 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-06-23Replace more deprecated tvb_length callsEvan Huus1-3/+3
The return values of new-style dissectors always use the captured length, so replace those automagically with sed. Change-Id: Ic43072ee4a80d433cd4264444583a0e670adc26a Reviewed-on: https://code.wireshark.org/review/9065 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-05-07packet-iec104: make object number filterable if SQ flag is setJiří Engelthaler1-0/+3
Make object number filterable again if SQ flag is set which breaks my commit 785fab7f Sample capture https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=IEC104_SQ.pcapng Change-Id: I450b86452876fab26e1a9f1bfc2f729573c52124 Reviewed-on: https://code.wireshark.org/review/8313 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-25packet-iec104: fix showing information objects if SQ flag is setJiří Engelthaler1-5/+6
IOA of information object is shown only for first object in sequence, corrected byte count for information object. Change-Id: Id428ce3b9d98da0be0315f2a880e5c025e076183 Reviewed-on: https://code.wireshark.org/review/7821 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-02-11packet-iec104: fix packet information textJiří Engelthaler1-9/+11
Change I6abc157368a78e1abfde672728b88a36ba6e76cc adds break in "switch case" but there was missing break deliberately. Code modified to let break on his place - copied code from the following condition. Change-Id: Id008955fbc122c0f8cfe06af2b96f0b643e9417f Reviewed-on: https://code.wireshark.org/review/7066 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-1/+2
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus() to make TCP-based dissection easier. Bug: 9851 Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3 Reviewed-on: https://code.wireshark.org/review/6778 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-2/+0
Third batch (packet-icmpv6.c -> packet-mac-lte.c). Will look at cleaning up and committing script afterwards. Change-Id: Ib91e36ad200db01c3000605f6a7a21125b96a640 Reviewed-on: https://code.wireshark.org/review/6018 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+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-07iec104: Missing break in switch (CID 280459)Alexis La Goutte1-0/+1
Change-Id: I6abc157368a78e1abfde672728b88a36ba6e76cc Reviewed-on: https://code.wireshark.org/review/5656 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-06Adjust indentation to match editor modelines; Do other minor whitespace changes.Bill Meier1-207/+207
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353 Reviewed-on: https://code.wireshark.org/review/4502 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-10Eliminate proto_tree_add_text from some dissectors.Michael Mann1-1/+6
Other minor cleanup while in the neighborhood. Change-Id: Ib76f4a9f89b5933425760af0a980c6a549031b8f Reviewed-on: https://code.wireshark.org/review/3537 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29proto_tree_add_subtree[_format]Michael Mann1-2/+2
Change-Id: I7e016f10fcfdc0523bf2fe8c11295c0334f7c332 Reviewed-on: https://code.wireshark.org/review/2694 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-4/+4
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-4/+4
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-24Fixed mausb valid bit & added invalid_valid TFSSean O. Stalley1-1/+0
Fixed valid bit check for MAUSB EPHandleResp packet. the valid bit is active low (ie: valid = 0, invalid = 1). I noticed Some other dissectors also defined an tfs_invalid_valid, so got rid of their local definitions & added it to epan/tfs.c. Change-Id: Ifd78325f9c7c046224073fc9b29e0cc60dc5c286 Reviewed-on: https://code.wireshark.org/review/1766 Reviewed-by: Alexis La Goutte <alexis.lagoutte@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>
2014-01-30IEC60870-5-104: Added decoding of integrated totals without time tag, fixed ↵Jiri Engelthaler1-28/+32
inverted logic of "Overflow" and "Adjusted" bits, some minor code style changes. Change-Id: I76af5eabfd08f312f37547bcc10e3ffe10b17f2a
2014-01-05Dissect the remainder of IEC104 integrated totals, including the binary counterEvan Huus1-8/+44
reading and the various flags. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9596 svn path=/trunk/; revision=54600
2014-01-03Add partial dissection of IEC104 M_IT_TB_1.Evan Huus1-0/+17
For https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9596 Also add modelines. svn path=/trunk/; revision=54583
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+4
svn path=/trunk/; revision=54135
2013-12-14Fix const warnings.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=54092
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-6/+7
"new" style dissectors. Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198
2013-11-09Replace STRINGIFY with glib version.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=53193
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-12/+12
svn path=/trunk/; revision=52591
2013-09-15More wmem conversion (leaving uat related functions aside)Pascal Quantin1-24/+25
svn path=/trunk/; revision=52055
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-1/+1
svn path=/trunk/; revision=51852
2013-08-27From Jiri Engelthaler via ↵Pascal Quantin1-18/+22
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8849 : IEC104: fix dissection of VTI Value and Normalised value svn path=/trunk/; revision=51536
2013-07-16Improve iec104 dissector. Bug 8849 ↵Michael Mann1-389/+544
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8849) 1) Decoding type 70 - End of initialization 2) Decoding qualifier of interrogation for type 100 3) Table of data length for all object types => checking length on one place 4) Setting correct number of selected bytes for IOA From Jiří Engelthaler svn path=/trunk/; revision=50664
2013-06-25Bugfix iec104 dissector, bug 8849 ↵Michael Mann1-39/+32
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8849) From Jiří Engelthaler 1) Wrong bits definitions for SIQ.BL, SIQ.SB, SIQ.NT, SIQ.IV, QDS.BL, QDS.SB, QDS.NT, QDS.IV 2) Invalid field abbrev for VTI Transient 3) Wrong bit size for SCO.QU, DCO.QU, RCO.QU 4) Changes from BASE_DEC to BASE_HEX 5) Several code style changes svn path=/trunk/; revision=50145
2013-05-26Batch of filterable expert infos.Michael Mann1-33/+45
svn path=/trunk/; revision=49584
2013-04-21General cleanup.Michael Mann1-723/+597
Converted to proto_tree_add_text to proto_tree_add_item/expert_info Allow columns/tree/(sub)dissectors/expert_info to be called at all of the proper times. COL_INFO data still seems a bit verbose when errors occur, but I left it alone, just cleaning up the sequence of events. Removed some structure definitions where the variables that used them were effectively "useless" once proto_tree_add_item was added (although they weren't that useful before that) svn path=/trunk/; revision=48958
2013-03-19From beroset:Anders Broman1-2/+2
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48426
2013-02-26Fix spelling/typos found using a list of commonly misspelled words.Bill Meier1-17/+17
The misspellings were mostly in comments but some were in text strings visible to the user. svn path=/trunk/; revision=47899
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-3/+3
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-4/+4
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-05-05Fix decoding of CP56Time2a timestamp. Resolves bug 5889.Chris Maynard1-2/+2
svn path=/trunk/; revision=36997
2010-12-22From Jiří Engelthaler:Jaap Keuter1-16/+186
Fixes computing of milliseconds in CP56time2a and add "bitstring of 32 bits" and "step position" support (ASDU types 5,7,32,33,47,51,60 and 64). svn path=/trunk/; revision=35249
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-1/+1
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) svn path=/trunk/; revision=35224
2010-10-10Define some fcns & vars as static; Some #includes not req'd; packet-mikey.h ↵Bill Meier1-18/+24
not req'd. svn path=/trunk/; revision=34464
2010-09-23Replace blurbs that match the name (case insensitive) with NULL.Jeff Morriss1-106/+106
svn path=/trunk/; revision=34227