Commit Graph

503 Commits

Author SHA1 Message Date
skarg 9914f30a65 Merged revision(s) 3181 from branches/releases/bacnet-stack-0-8-0:
Added BDT backup and restore to file option API. Thank you to Mario de Sousa for the patch.
........
2018-06-10 02:25:47 +00:00
skarg 51e672dd9a Fixed unit test for Load Control object and Address module. Thank you to Chris Ellec for the patches. 2018-05-31 00:37:20 +00:00
skarg 7fc3060dbf Added environment variables to enhance BBMD behavior in the example server demo.
BACNET_BDT_ADDR_1 - dotted IPv4 address of the BBMD table entry 1..128
BACNET_BDT_PORT_1 - UDP port of the BBMD table entry 1..128 (optional)
BACNET_BDT_MASK_1 - dotted IPv4 mask of the BBMD table
    entry 1..128 (optional)

Added environment variable to allow setting of the public NAT address.
BACNET_IP_NAT_ADDR - dotted IPv4 address of the public facing router
2018-04-19 20:10:45 +00:00
skarg a46fcc37d5 Fixed buffer overflow in BACnet/IP BVLC packet handling by properly checking the size of the packets at each function. Thank you, Marlies Ruck! 2018-04-18 18:24:15 +00:00
skarg b0f1107a57 Updated MS/TP FSM to not reply to Broadcast PFM. Thank you, Iqbal Hassan! 2018-03-01 00:08:43 +00:00
skarg ebcd9bc494 address_cache file was inadvertently disabled for command line demo tools. Fixed. Thank you, Martin Tremblay! Syncing with 0.8.x branch. 2017-08-24 17:55:46 +00:00
skarg 0b5a514cf7 Adds two new functions to the ring buffer implementation, one to walk the ring by getting a pointer to the next element in the ring, and the other to Pop (remove) a specified element from somewhere in the ring and then move any elements up towards the head to fill the gap left. With these new functions in place, the Linux MS/TP datalink MSTP_Get_Reply() has been updated to walk the ring buffer to try to find the matching reply. If it is found then it is processed in the same way as usual, and then removed from the ring.
When a packet is received which expects a reply a copy is stored in the PDU ring buffer so it can be matched with the reply. Unfortunately when the reply is received it is only checked against the first entry in the ring buffer. This can cause a failure if a second packet expecting a reply has been received while waiting for the first reply to arrive.
This is a known issue in the bacnet-stack open source stack, and there is a outstanding FIXME in the latest version of the source code:

        /* The ANSWER_DATA_REQUEST state is entered when a  */
        /* BACnet Data Expecting Reply, a Test_Request, or  */
        /* a proprietary frame that expects a reply is received. */
        /* FIXME: MSTP_Get_Reply waits for a matching reply, but
           if the next queued message doesn't match, then we
           sit here for Treply_delay doing nothing */

The fix for this is to check all the messages in the PDU queue to see if any of them match, and if one does then handle it in the normal way. Thank you to Ian Smith of Abelon Systems Ltd. for the patch!
2017-06-25 18:06:27 +00:00
skarg c9742a594c Fixed VMAC for routed address match on compare. Thank you, Arne Nickel! 2017-04-10 14:43:31 +00:00
skarg fa445a1251 Fixed warnings detected by splint 2017-02-15 21:50:06 +00:00
skarg dba03d47bd Fixed warnings found via splint. 2017-02-14 18:14:58 +00:00
skarg e0d302cf31 Fixed warnings found via splint. 2017-02-14 17:59:26 +00:00
skarg eec96e8f5d Merge splint warning fixes. 2017-02-14 17:35:54 +00:00
koby3101 5e5c2d616a Return value from snprintf is type int 2017-01-09 13:35:45 +00:00
skarg 134c628041 Fixed compilation of unit tests. 2017-01-01 05:42:55 +00:00
skarg e317b253f4 Fixed compiler warnings and error. 2017-01-01 05:27:03 +00:00
skarg 2f393c13c2 Added cast to fix compiler warning. 2017-01-01 05:22:17 +00:00
skarg 53d4ab31d7 Fixed spelling of variable deviceIdentifier. 2017-01-01 05:21:33 +00:00
skarg f2b754336d Updated ringbuffer library to remove alloc and include data-peek and data-put. 2017-01-01 05:20:13 +00:00
skarg 55e77695c8 Changed order of checking in MS/TP LostToken transition to handle case of OS that is really late. 2017-01-01 05:19:28 +00:00
skarg 98d919546c Refactored memcopy range check. 2017-01-01 05:18:13 +00:00
skarg aad3c42b82 Added wildcard date comparison functions. 2017-01-01 05:15:28 +00:00
skarg 93834e7c45 Added DCC enum text names. 2017-01-01 05:13:55 +00:00
skarg f0c727ff29 Added functions to encode/decode unsigned64 values. 2017-01-01 05:12:59 +00:00
skarg 8afd5669f7 Added encode/decode for BACnet address. 2017-01-01 05:12:06 +00:00
skarg 7bf98e590a Added buffer size to COV handler function parameters. 2017-01-01 05:07:10 +00:00
skarg c9d152bf15 Merged revision(s) 3044 from branches/releases/bacnet-stack-0-8-0:
Added BACnet/IPv6 datalink layer and example BACnet/IPv4 to BACnet/IPv6 router.
BVLC6 layer is working on Linux port without BBMD features yet. Win32 is implemented, untested.
Tested during BACnet North American Plugfest 2016.
........
2016-10-01 20:23:03 +00:00
skarg 8e573aed89 Changed structure copy to explicit copy. 2016-09-28 21:21:13 +00:00
skarg 10aa414351 Fixed line endings and SVN props with fixup.sh script 2016-09-08 15:56:11 +00:00
skarg 27a3c1ff0f Fixed compile errors 2016-09-08 15:51:11 +00:00
skarg 964085d458 Merged revision(s) 3031 from branches/releases/bacnet-stack-0-8-0:
Added checks for OPTIONAL context tagged decoding to be sure it is not a closing tag.
Added makefile for unit test in bacdevobjpropref.c module, and improved unit test.
https://sourceforge.net/p/bacnet/bugs/49/
........
2016-09-07 21:06:17 +00:00
skarg 278af89fa2 Added enhancement to address cache: Top Protected Entry: entries from 0 to Top_Protected_Entry are not removed by address_remove_oldest()function. When I-am attack occurs only entries between Top_Protected_Entry and MAX_ADDRESS_CACHE can be removed. 2016-08-12 21:57:57 +00:00
skarg a8ad8f4d5c Changed error code from SERVICE/NO_SPACE_FOR_OBJECT to ABORT/SEGMENTATION_NOT_SUPPORTED to be consistent with the BACnet standard. Thank you, lo pe! [bugs:#41] 2016-08-12 20:45:08 +00:00
skarg 1302c1be7b Nikola Jelić implemented the Access Objects for BACnet (Access Door, Access Point, Access Credential, Access Rights, Access User, Access Zone, and Credential Data Input). 2016-07-17 19:23:19 +00:00
skarg 80a720b431 [Bug #46] Fixed potential buffer overflow in BVLC BACnet/IP forwarded NPDU encoding. 2016-06-29 20:20:27 +00:00
skarg f8bcd58cea Fixed some warnings detected by CSTAT.
Consolidated some unit tests and added a single test prototype to header file.
2016-06-08 21:55:12 +00:00
skarg b47afd500d Added UnconfirmedEventNotification demo application to generate Wireshark captures 2016-05-19 02:18:41 +00:00
skarg 3362eecdff Added security for BACnet stack, based on the BACnet 2012 standard, clause 24.
Implemented the majority of functionalities presented in the standard, but there are several features that this patch currently lacks:
- Set-Master-Key message has a specific order of key adding and decoding which is not covered
- There is no general secure-apdu-handler function
- Checks for the type of keys used for signing/encryption of specific messages is not implemented
- The status of encrypted flag during the calculation of the signature is ambiguous
There is a Linux implementation using the OpenSSL library, with function prototypes broad enough to allow for different implementations.
Thank you, Nikola Jelić!
2016-04-20 17:00:51 +00:00
skarg 0f2399fd21 BTL found the issue with proplist.c: When the number of required array elements are counted, the 3 excluded mandatory properties are subtracted from ”count”, but ”count” is later overwritten, causing the encoded to miss the ”correct by 3” part of the code. - Thank you, Rasmus B. Nielsen! 2016-01-21 17:35:40 +00:00
skarg 0697065030 Fixed some warnings flagged by IAR C-STAT static analysis tool. 2016-01-07 21:31:38 +00:00
skarg cce0df1a7c Removed max-master timeout in NO TOKEN state as this was causing issues and didn't have any basis in the standard. Thank you, Michael Hall. 2015-12-15 17:31:20 +00:00
skarg 94dbe3d429 Added BACnetTimeValue functions. Added demo Schedule object. Integrated new objects with demo server and unit tests. Thank you, Nikola Jelić! 2015-11-24 22:22:17 +00:00
skarg 23fb73fefc Added Date Time Wildcard compare functions and unit tests. Thank you, Nikola Jelić! 2015-11-24 20:34:54 +00:00
skarg 8a48241e14 Fixed the unit tests after integration of property-list property and device-object-property-reference properties. Thank you for noticing it was broken, Nikola Jelić, and for sending in fixes. 2015-11-04 16:53:21 +00:00
skarg b5e860dbe4 Fixed the AtomicReadFile unit test for Record Access. 2015-11-04 16:21:14 +00:00
skarg 4db370cc3a Un-refactored property-list module to lower resource requirements on small devices. 2015-10-18 03:39:28 +00:00
skarg 5a0ed5a9e0 Merged revision(s) 2898 from branches/releases/bacnet-stack-0-8-0:
Cleanup of unit test exports.
........
2015-10-18 00:27:09 +00:00
ekh 38a723bafb Committing minor changes (comments only) as an exercise in contributing.. 2015-09-26 19:45:56 +00:00
skarg 504b7c3713 Added BVLC to dynamic datalink module. Thanks, Kim Taylor! 2015-09-17 17:12:23 +00:00
skarg 07bf4eba3b Deprecated Ringbuf_Alloc, and replaced with Ringbuf_Data_Peek() and Ringbuf_Data_Put() functions. Ringbuf_Alloc() was not interrupt or thread safe. 2015-09-09 14:54:02 +00:00
skarg 458d563aaf Improved AtomicReadFile and AtomicWriteFile error detection. Eliminated redundancy in the octetstring_init function. 2015-09-01 22:24:34 +00:00