aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dnp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-07-17Remove all preferences related to enabling/disabling heuristic dissectors.Michael Mann1-18/+32
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-2/+2
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-07-03Call reassembly_table_destroy and move g_hash_table_destroyPeter Wu1-5/+8
This patch moves g_hash_table_destroy calls from the init routine to the cleanup routine. Besides that, the conditional check for the hash table has been removed, assuming that init is always paired with a cleanup call. If reassembly_table_init is found, a reassembly_table_destroy call is prepended to the cleanup function as well. Comments have been removed from the init function as well as these did not seem to have additional value ("destroy hash table" is clear from the context). The changes were automatically generated using https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4d11f07180d9c115eb14bd860e9a47d82d3d1dcd Manually edited files (for assignment auditing): dvbci, ositp, sccp, tcp. Other files that needed special attention due to the use of register_postseq_cleanup_routine: - ipx: keep call, do not add another cleanup routine. - ncp: remove empty mncp_postseq_cleanup. mncp_hash_lookup is used even if a frame is visited before (see dissect_ncp_common), hence the hash table cannot be destroyed here. Do it in cleanup instead. - ndps: add cleanup routine to kill reassembly table, but do not destroy the hash table as it is already done in ndps_postseq_cleanup. Change-Id: I95a72b3df2978b2c13fefff6bd6821442193d0ed Reviewed-on: https://code.wireshark.org/review/9223 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-23Remove more deprecated tvb_lengthEvan Huus1-5/+5
Change-Id: Iac23a6c804ad3720d37186559477909b2ff33eb2 Reviewed-on: https://code.wireshark.org/review/9042 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-22Fix make distcheck buildbotAlexis La Goutte1-5/+1
packet-dnp.c:2735:28: error: variable 'al_filename' set but not used [-Werror=unused-but-set-variable] packet-dnp.c:1843:32: error: variable 'al_filename_offs' set but not used [-Werror=unused-but-set-variable] Change-Id: Ia84b270aa8f56fb4104fb875339dc3d39c6105c6 Reviewed-on: https://code.wireshark.org/review/9020 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-22Eliminate proto_tree_add_text from some dissectors.Michael Mann1-26/+54
Change-Id: I979990e9385182870ce4809a7e6fa16e598cb2be Reviewed-on: https://code.wireshark.org/review/9016 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-08Remove RTAC Serial preference that doubled for Decode As.Michael Mann1-2/+1
Just use Decode As directly. Change-Id: Iab03a6ff8a70c3c6b0406f426e622eb52bb34ba7 Reviewed-on: https://code.wireshark.org/review/7902 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-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>
2015-01-01Added DNP3 support for g13 and g43, output command eventsGraham Bloice1-9/+117
Bug: 10347 Change-Id: Ic173f31d8cf3fd002454f4c22b85c19bae42d544 Reviewed-on: https://code.wireshark.org/review/6175 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-2/+0
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9 Reviewed-on: https://code.wireshark.org/review/5997 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/+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-12-01Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.Michael Mann1-20/+22
Part 2 of many Change-Id: I50815e7738b011382392f3078a7107d3d9eec4ec Reviewed-on: https://code.wireshark.org/review/5542 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-10DNP3 Protocol Bugfix / Enhancementcbontje1-14/+17
- Fix for Single-bit Objects offset-pointer - Enhancement for Obj 12 Var 2 (Pattern Control Block) and Var 3 (Pattern Mask) Decoding Bug: 10558 Change-Id: I8d3f6cee4acbab09d0b93dab6b868cddd842b682 Reviewed-on: https://code.wireshark.org/review/4597 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-07Create subdissector table for RTAC Serial and have dissectors register with ↵Michael Mann1-1/+3
it, rather than have the RTAC Serial dissector go find all of the dissectors its interested in. Change-Id: I6b6a05ec242e4798fb56ffa43c661ec277aca955 Reviewed-on: https://code.wireshark.org/review/3984 Reviewed-by: Chris Bontje <cbontje@gmail.com> 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-08-08Fix compiler warning.Guy Harris1-1/+1
Change-Id: Idf275d89591558fd2ea082c886ce07e62523807a Reviewed-on: https://code.wireshark.org/review/3506 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08Add routines for CRC-16 with a polynomial of 0x3D65.Guy Harris1-66/+12
There are routines that take a buffer and a length and that take a tvbuff, offset, and length; use those routines in the DNP dissector (which no longer needs its own table and loop), and use the tvbuff routine instead of calling tvb_get_ptr(). Change-Id: Ic67b0f3b65b94ea47c0fdc2f3d3b6f88df77f9c6 Reviewed-on: https://code.wireshark.org/review/3505 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-27Added function dnp3_header_check() to check the validity of a DNP3Graham Bloice1-10/+40
packet as far as possible, called from both dissect_dnp3_tcp and dissect_dnp3_udp. Bug: 10287 Change-Id: Iaa988258b3614cb1b408dec41a987fbd61c9727c Reviewed-on: https://code.wireshark.org/review/3096 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-17When DNP3 heuristics are disabled, relax the conditions onGraham Bloice1-2/+2
accepting a packet as DNP3. Bug: 10287 Change-Id: I222ec885186447c8a72eaf11cebacff8b9b79fad Reviewed-on: https://code.wireshark.org/review/3092 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-06-25convert to proto_tree_add_subtree[_format]Michael Mann1-43/+23
Change-Id: I2ea1892b5963cc5578cbdd2b03029ca8424f2267 Reviewed-on: https://code.wireshark.org/review/2640 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-7/+7
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-7/+7
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-3/+3
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-6/+6
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-17remove duplicated entries.AndersBroman1-4/+0
Change-Id: I1fcbda17cbc444eee04e975d60b371fc2fa4754c Reviewed-on: https://code.wireshark.org/review/1184 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17From Graham Bloice:AndersBroman1-8/+12
Fix A mismatch in the dnp3_al_obj_vals value string fixes bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9945 Change-Id: I3d0a423d7d2e4a711533debbd950e2976dd5115e Reviewed-on: https://code.wireshark.org/review/1183 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-04-01Fixed display of IIN during reads and writes of IIN object.Graham Bloice1-17/+28
Added (hidden) dnp3.addr field set by both source and destination dnp3 addresses to allow easier filtering. Change-Id: I04980c24c1b9f30a2ee5a0d5ea4ac32ae877504e Reviewed-on: https://code.wireshark.org/review/908 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Graham Bloice <graham.bloice@trihedral.com>
2014-03-07Fix DNP3 Dissector DNP3 Read Requests and Direct Op No ACKscbontje1-39/+49
This corrects a couple issues with the DNP3 Dissector: - Refactored Read Object String lookups to use value_string - Corrected issue with multiple object types in a single read not being processed - Added processing for Direct Operate No ACK Messages Fixes issues noted in Bug 9839 Change-Id: I9895e509a8d3931c805ce53b718a4951f8f8039e Reviewed-on: https://code.wireshark.org/review/538 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-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-6/+6
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-13Fix Visual Studio Code Analysis warning C6001: Using uninitialized memory ↵Chris Maynard1-1/+1
'obj_type' svn path=/trunk/; revision=54008
2013-11-17From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9442 :Pascal Quantin1-24/+26
DNP3 bug fix for analog data sign bit bandling svn path=/trunk/; revision=53399
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-6/+8
"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-10-04Updated email address for Chris Bontje and myself.Graham Bloice1-5/+4
svn path=/trunk/; revision=52369
2013-10-04From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9195:Graham Bloice1-15/+230
Added object decoding for Device Attributes Added object decoding for IIN read Improved decoding of Counter Freeze objects svn path=/trunk/; revision=52353
2013-09-22emem -> wmem conversion:Pascal Quantin1-1/+1
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-6/+6
hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly. The script didn't catch as many as I would have liked, but it's a start. The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum. svn path=/trunk/; revision=52045
2013-09-14Convert some dissectors to wmem (leaving uat-like memory with emem for now)Pascal Quantin1-3/+3
svn path=/trunk/; revision=52031
2013-09-05From Chris Bontje:Anders Broman1-17/+89
Changes include: - Detect previously-unknown object types. No dissection is attempted of response messages, but at least the types are documented and labelled. As Graham notes, if some examples are provided we can attempt a little more here. - Change up info_column object label handling to add some of the new objects. Also added in a few that would be present in 'write' messages. - Add expert info field for abnormal IIN bits. This will help me in my job of detecting unknown objects and unsupported function codes and will easily flag to the user that 'something is up' due to the color changes. - Only detect Application Layer if we are on the Final Transport Layer frame. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9056 svn path=/trunk/; revision=51768
2013-08-19Change some dissectors to use pinfo memory pool instead of malloc if it can ↵Pascal Quantin1-3/+1
trigger an exception between between buffer allocation and tvb_set_free_cb call svn path=/trunk/; revision=51427
2013-07-28Improved info column with multiple pdu's in a frameGraham Bloice1-5/+17
svn path=/trunk/; revision=50966
2013-07-17Remove fragment_data, add fragment_head, fragment_item - for now alias it to ↵Jakub Zawadzki1-1/+1
the same structure. This is begin of work to split fragment head and fragments items. svn path=/trunk/; revision=50708
2013-07-03Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=50355
2013-06-09Batch of filterable expert infos.Michael Mann1-2/+12
svn path=/trunk/; revision=49853
2013-03-22Don't wire into the reassembly code the notion that reassemblies shouldGuy Harris1-7/+5
be done on flows from one address to another; reassembly for protocols running atop TCP should be done on flows from one TCP endpoint to another. We do this by: adding "reassembly table" as a data structure; associating hash tables for both in-progress reassemblies and completed reassemblies with that data structure (currently, not all reassemblies use the latter; they might keep completed reassemblies in the first table); having functions to create and destroy keys in that table; offering standard routines for doing address-based and address-and-port-based flow processing, so that dissectors not needing their own specialized flow processing can just use them. This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where the second YPALL response is processed as if it were a continuation of a previous response between different endpoints, even though said response is already reassembled), and also allows the DCE RPC-specific stuff to be moved out of epan/reassembly.c into the DCE RPC dissector. svn path=/trunk/; revision=48491
2013-03-16[-Wmissing-prototypes]Anders Broman1-3/+6
Use explicit casts. svn path=/trunk/; revision=48341
2013-02-14Get rid of unused string to squelch warning.Guy Harris1-2/+1
svn path=/trunk/; revision=47661
2013-02-14From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8333 :Pascal Quantin1-14/+24
Corrections to Recent DNP3 Control Code Changes in Bug ID 7865 svn path=/trunk/; revision=47660
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-11-27Fix [-Wuninitialized] warning.Bill Meier1-1/+1
svn path=/trunk/; revision=46237