aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dnp.c
AgeCommit message (Collapse)AuthorFilesLines
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
2012-11-27General cleanup:Bill Meier1-435/+918
- create/use extended variable string; - #if 0 unused value_string arrays (instead of marking with _U_); - "localize" some variable definitions; - remove some uneeded variable initializers; - reformat hf[] entries; - do some whitespace and formatting changes to use a consistent style. svn path=/trunk/; revision=46236
2012-11-16From Chris Bontje:Anders Broman1-5/+24
DNP3 - Incorrect Information Column Display for "Read" Function Code. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7977 svn path=/trunk/; revision=46039
2012-10-31The heuristic is to weak, add a preference if heuristics shoulld be used or ↵Anders Broman1-2/+13
not and default it to not used. svn path=/trunk/; revision=45847
2012-10-16Enhancements to DNP3.0 Control Code Dissection ↵Michael Mann1-9/+11
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7865) minor updates to checked in patch (from rev 45583) svn path=/trunk/; revision=45584
2012-10-16From Benjamin Stocks:Anders Broman1-31/+54
Enhancements to DNP3.0 Control Code Dissection. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7865 svn path=/trunk/; revision=45583
2012-09-26replaced decode_boolean_bitfield calls with itemized filtersMichael Mann1-22/+52
svn path=/trunk/; revision=45152
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-2/+2
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-09-07From Robert Bullen via ↵Jeff Morriss1-5/+7
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 : The reassembled fragments tree in the Packet Details view is awesome, but it lacks one thing: a field that exposes the reassembled data. tcp.data already exists for exposing a single TCP segment's payload as a byte array. It would be handy to have something similar for a single application layer PDU when TCP segment reassembly is involved. I propose tcp.reassembled.data, named and placed after the already existing field tcp.reassembled.length. My primary use case for this feature is outputting tcp.reassembled.data with tshark for further processing with a script. The attached patch implements this very feature. Because the reassembled fragment tree code is general purpose, i.e. not specific to just TCP, any dissector that relies upon it can add a similar field very cheaply. In that vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which expose reassembled fragment data as a single byte stream for IPv4 and IPv6, respectively. All other protocols that use the reassembly code have been left alone, other than inserting NULL into their initializer lists for the newly introduced struct field reassemble.h:fragment_items.hf_reassembled_data. svn path=/trunk/; revision=44802