DNP3 Source Code Library

Our ANSI C source code library provides a quick and cost effective way to implement a DNP3 master or outstation.  A .NET component version is also available. 

For 25 years, Triangle has provided the diagnostic tools and protocol expertise to  our customers to support all their conformance  & certification needs. We will work with you to ensure that your implementation of our source code libraries will pass all industry related certification and conformance testing.

Related Products

What's New

Current Release: v3.27.1
Release Date:  September 2020

Newest Features in this Release

  • Changed “configuration signature” to “configuration digest” for default Device
    Attribute Object 0 Variations 200 and 201 as directed by TB2013-004b. Affects
    Diagnostics and #defines only.
  • In LinIoTarg use localIpAddress when a TCP Client binds to the connect socket.
  • Allow “::” in addition to “*.*.*.*” for the IPV6 Ip Address to indicate that ANY MDNP
    device may connect to this channel.
  • Added session configuration unsolOfflineDelayOnce to allow
    unsolOfflineRetryDelay to be used once and then to revert back to unsolRetryDelay
    until the next time the retry count is exceeded.
  • Allow compile time code that can be configured per session to allow read requests
    between select operate requests. This is not compliant with the DNP Specification
    and would fail DNP Conformance tests. However, it was required for certain
    gateway customers to allow DNP Masters that don’t follow the rules.
  • Changed “configuration signature” to “configuration digest” for default Device
    Attribute Object 0 Variations 200 and 201 as directed by TB2013-004b. Affects
    Diagnostics and #defines only.
  • If file name is longer than configured maximum DNPCNFG_MAX_FILENAME, stop
    parsing the request sending an error response to the Master. Using a truncated
    filename should not work and it could access a different file than intended.
  • In LinIoTarg use localIpAddress when a TCP Client binds to the connect socket.

Key Additions to Recent Releases

v3.26.00:

  • Decrement unsolicited pending count of events for an event class when an event is
    removed from the event queue because of event mode or other reasons. 
  • Improved the sDNP SA example to show authority interaction and asymmetric key
    change methods. Enhanced tmwcrypto simulated crypto database to support
    multiple sessions and sectors to make it clear what configuration in the exampe
    code applies only to the simulated crypto database and is not used by the SCLs. 
  • Changed “configuration signature” to “configuration digest” for default Device
    Attribute Object 0 Variations 200 and 201 as directed by TB2013-004b. Affects
    sDNP simulated database description. 
  • Added virtual terminal and string point names to the generated sDNP Device Profile
    current values.
  • Add any missing pChannel and pSession to DNPDIAG_ERROR where they are
    available.
  • Created additional SDNP example, sdnpDer implementing DER Application Note
    2018-001 DNP3 Profile for Communications with Distributed Energy Resources
    DERs). This serves as a starting point for developing DER devices that use DNP.

v3.25.00:

  • Created an implementation guide for SCLs.  
  • Added support DNP File Transfer in Simulated Database for Linux.  The target layers for Linux and Windows have been updated to include File I/O functions to support DNP. They reside in mdnptarg.c and sdnptarg.c with their common prototypes defined in dnp/mdnptarg.h and dnp/sdnptarg.h. sdnpdata.c have been updated to call these functions to support file operations even when the simulated database is not enabled.   
  • Support for Freeze and Freeze at Time FC 11 and 12 with obj50v2 has been implemented. The Device Profile has been updated to show support for these. 
  • Added session configuration parameter unsolSendByClass. When set to true, only unsolicited events for the class whose timer expires or count is exceeded will be sent. Otherwise, unsolicited events for all classes will be sent. 
  • Support User Managed Events for g33, g115, g120, and g122 events.
  • Support for start-stop qualifiers has been added to write operations for Object Groups 34, 110, & 114 and the Device Profiles updated accordingly. 
  • Better support for optional the g120v7 event on another DNP Association with optional error text that does not fit in current or any response fragment.
  • Generate a session statistic when a Link Status Request is received. 
  • Provide tmwcrypto_verifyUserCertificate function using OpenSSL to verify received X.509 Certificate.
  • The SCL sample target layers now support a common serial configuration structure.
  • The SCL has been updated to work with OpenSSL 1.1.x while retaining backward compatibility with version 1.0.x. For Windows builds a new define has been added, TMWCNFG_USE_OPENSSL_1_0_2 that should be defined when running with the legacy version. 
  • Added event driven receive data support for Windows serial channel. 
  • WinIoTarg now uses the Channel thread to check for received data eliminating the need for a separate CheckForInput thread/class. 
  • The wintoolkit samples now include TLS support. The samples include certificates that are compatible with those used by the Test Harness and the default configurations for both Linux and Windows are set to use them. Only a single define USE_TLS which defaults to false needs to be updated to configure the sample to use TLS for both DNP and 101/4 Secure Authentication builds. 
  • Updated Linux target layer to use consistent logging technique
  • Added TLS support to the Linux target layer.
  • LinIoTarg now creates a thread per channel (when not configured to run in polled mode). Once the channel has been opened, this thread will establish/listen for the channel connection and wait on the data socket for incoming data. This eliminates the latency when polling for received data. Also, locking has been reduced by eliminating the linked list of TCP Channels which required locking each time the list was accessed. 
  • Updated linTCP_transmit to check the error code returned by send. If its EAGAIN indicating that the socket is busy, wait for the socket to become writable and retry the send instead of disconnecting immediately. 
  • The Linux target layer has been updated to provide a basis for porting a target layer to another OS: 

    • The dependency on threads has been removed.
    • The Linux target layer will conditionally support poll and select. The Linux target layer will default to use epoll/poll which is more efficient than select and correctly handles file descriptors greater than 1024. However, select will continue to be supported by using a conditional so that it can be tested with Linux and provide a porting example for OS's that only support select.
    • A tmwtargcnfg.h file has been added to both the Linux and Windows target layer implementations. This configuration file defines which features a given target layer supports. This will allow customers porting the Linux target layer to other OS's to easily identify code that may be unnecessary for their application and remove it instead of wasting time porting it. Target layer features currently defined in this file are:
    1. RS232
    2. TCP
    3. UDP (Only required for DNP)
    4. TLS
    5. EPOLL

  • In addition, SampleIoTarg has been created. This Sample target layer is a target layer example that can be compiled and linked with the wintoolkit C example programs that has no OS dependencies. It can be used as a baseline target layer to help port the library to another OS or RTOS.  It can be built by specifying build=sample from the Linux command line.

v3.24.00:
  • Implement DNP String and Vterm changes spelled out in TB2015-001 including adding support for Extended String Object Groups 114 & 115.
  • Support for Frozen Analog Input Event Object Groups 31 and 33 has been added.
  • Modified handle in .NET libraries to be an IntPtr to avoid warnings with 64 bit build and to provide better 64 bit functionality.
  • Made improvements to target layer timer examples.
  • Implemented event driven receive data in winiotarg so channels don’t have to be polled. This is also available in liniotarg.
  • Updated the Linux target layer, replaced LINIOCNFG_EVENT_DRIVEN conditional with polledMode configuration.
  • Made improvements to target layer timer examples.
  • Implemented event driven receive data in winiotarg so channels don’t have to be polled. This is also available in liniotarg.
  • Updated the Linux target layer, replaced LINIOCNFG_EVENT_DRIVEN conditional.
  • Support for epoll has been added to the Linux target layer. This support is controlled by the preprocessor conditional LINIOTARG_SUPPORT_EPOLL. If this is not defined, select is used. The select option has been left in place so we continue to have an example that can be ported to OS’s that do not support epoll.
  • Added configuration to sDNP SCL to disable sending the initial Null Unsolicited Response (UR) at startup and therefore not require it to be application confirmed by the master. This is non-standard behavior differs from the DNP specification, but facilitates interoperability with a non-compliant master that does not process the Initial Null UR correctly, but does handle subsequent URs containing DNP events.
  • Improved sDNP user manual and sample code with respect to event generation. Updated slave examples to include add event for DNP, 101,102, 103, and 104.
  • Include files to allow SCL customers to generate Windows project files for different versions of Visual Studio.
  • Support for 64-bit versions of the .NET Protocol Components has been added.
  • Added configuration for the generation of diagnostic messages per sector, session, and channel to allow maximum flexibility. Maximum performance can be achieved by configuring each mask to zero so no diagnostic messages are generated, thus no messages would be forwarded to the .NET code. This also would allow a user to enable diagnostic messages on a single sector, session, etc. in a large configuration on a problem connection and avoid having to filter out diagnostic messages from all other connections.

v3.23.00:

  • Added support for TLS v1.2 in the Windows target layer
  • Included support for 64 bit builds in the example project and solution files provided for Visual Studio
  • Updated Device Profile Current Values section for Outstations to schema Version 2.11 April 2016
  • Added x.509 certificates and support for DNP Secure Authentication g120v8 requests
  • Updated simulated database for Outstation example to support DNP Technical Bulletin TB2017-001 Supervisory Mode
  • Resolved warnings when compiling on Linux with strict checking turned on
  • Improved Secure Authentication Version 2 to better support the expiration and updating of User Session Keys (in the same way as described in the SAv5 specification) 
  • Added capability in Master to notify the application via a callback if commands or secure authentication requests time out
  • Improved the algorithm in the Master for managing multiple sessions in a single channel
  • Several other enhancements (see release notes)
v3.22.00:
  • Improved performance of database interface and other library functions
  • Restructured directories and sample code for Windows and Linux target layer libraries
  • Added support for IPv6 in Linux target layer
  • Expanded Windows target layer support for resolving IP address from destination host name
  • Updated Linux sample makefiles to generate debug information by default
  • Added multiple enhancements to Secure Authentication library and documentation

v3.21

  • Improved Linux® makefiles and Windows® solution and project files
  • Improved integration with OpenSSL library
  • Added parsing of Object 91 response for DNP3 Master
  • Added GetRxBuf() method for DNP3 Master so that application can view the entire received message
  • Added capability to configure use of Aggressive Mode for Secure Authentication critical functions launched from the “Auto Request Mask” for DNP3 Master 
  • Added capability for DNP3 channel to skip offline sessions for specified amount of time
  • Several improvements to DNP3 Secure Authentication
  • Improved DNP3 Dual End Point mode

v3.20.00:
  • Implemented several improvements to DNP3 Secure Authentication including all items suggested in TB2016-002, addressing some deficiencies in DNP3-SAv5
  • Added a configurable feature that would allow the user to issue two separate BRM commands, holding off other automatic behavior
  • Added statistic indicating Link Status was received
  • Made improvements to DNP3 Device Profile

v3.19.00:
  • Added support for Assign Class Function Code for Virtual Terminal object group
  • Added Session Statistic event to indicate a Link Status response is received
  • Added configuration to disable default behavior required on TCP by the DNP specification to disconnect and reconnect when a link status request times out
  • Modified code to allow use of either UNICODE or MBCS character set

v3.18.00:
  • Updated the DNP3 libraries to include DNP3 Device Profile November 2014 version 2.10
  • Improved the handling of DNP messages with the wrong link address
  • DNP Secure Authentication improvements including a configurable 4-32 byte challenge data object, a new device attribute for the version of Secure Authentication that is supported by the Outstation, corrected session statistics, and improved aggressive mode support
  • Exposed DNP Unsolicited class mask for .NET components (propertyUnsolnitialClassMask)
  • Added multiple new DNP3 device attributes in the default simulated database
  • Improved support of Linux® networking layer for UDP
  • Added ability to disable function codes for device specific addresses as described in AN2014-001
  • Implemented DNP device attribute time type described in TB2013-004
  • Updated the code to use C99 standard types for 16 bit and 32 bit types for improved Linux® implementations
  • Improved handling of unsolicited messages under special cases
  • Improved support of DNP3 points set to local mode

v3.17.00:
  • Additional support for DNP3 device profile, including secure authentication, control broadcast configuration, and other fields
  • Added cryptography interface for Secure Authentication V2 (the Library already has this interface for SAv5)
  • Enhanced the tolerance for restart in Master and Outstation with Secure Authentication, including initialization of keys
  • Added compile time choice of using either standard or Microsoft “safe” string functions that include the length of the buffer to be written to (ie strcpy or strcpy_s)
  • Added more checking to discard improperly formatted messages

v3.16.01 - Corrected an issue where DNP3 transport layer would reject a message 

v3.16.00:
  • Addressed all items associated with ICS-CERT Advisory (ICSA-13-240-01)
  • Improved input verification
  • Made improvements to DNP3 Secure Authentication interface
  • Enhanced Assign Class functions
  • Added configuration option to disable support for receiving broadcast messages

v3.14 - Enhanced DNP3 SAv5 implementation

v3.07 - Added sample Linux® and Windows® target implementation

v3.05.01 - Added updates to DNP3 SA approved by DNP3 TC

v3.01.01 - Added ability to keep time on a per-session basis

v3.01.00 - Added support for DNP3 SAv2

v3.00.44 - Updates to Data Sets

v3.00.43 - Added support for Data Sets and Object 0 (Device Description)

v3.00.38 - Added support for Double Bit data types and Self Address Discovery mechanism

v3.00.36 - Added support for File Transfer Event Mode

v3.00.35 - Added memory alignment support

v3.00.32 - Added support for multiple threads


 

 TMWLogo

 
Quick Links  Contact Us:
Home
Products
Videos
Training
Support
Reference
About Us

Triangle MicroWorks, Inc.
Sales: +1 919.870.5101
Support: +1 919.781.1931
Fax: +1 919.870.6692
sales@TriangleMicroWorks.com
support@TriangleMicroWorks.com

Follow us on YouTube Follow us on Facebook Visit us on LinkedIn Follow us on Twitter

 
Copyright © 2013-2019 Triangle MicroWorks, Inc. All Rights Reserved