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.
........
This commit is contained in:
skarg
2016-10-01 20:23:03 +00:00
parent e9a2bfcbef
commit c9d152bf15
24 changed files with 6597 additions and 20 deletions
+15 -4
View File
@@ -30,11 +30,13 @@
/* declare a single physical layer using your compiler define.
see datalink.h for possible defines. */
#if !(defined(BACDL_ETHERNET) || defined(BACDL_ARCNET) || defined(BACDL_MSTP) || defined(BACDL_BIP) || defined(BACDL_TEST) || defined(BACDL_ALL))
#if !(defined(BACDL_ETHERNET) || defined(BACDL_ARCNET) || \
defined(BACDL_MSTP) || defined(BACDL_BIP) || defined(BACDL_BIP6) || \
defined(BACDL_TEST) || defined(BACDL_ALL))
#define BACDL_BIP
#endif
/* optional configuration for BACnet/IP datalink layers */
/* optional configuration for BACnet/IP datalink layer */
#if (defined(BACDL_BIP) || defined(BACDL_ALL))
/* other BIP defines (define as 1 to enable):
USE_INADDR - uses INADDR_BROADCAST for broadcast and binds using INADDR_ANY
@@ -45,6 +47,13 @@
#endif
#endif
/* optional configuration for BACnet/IPv6 datalink layer */
#if defined(BACDL_BIP6)
#if !defined(BBMD6_ENABLED)
#define BBMD6_ENABLED 0
#endif
#endif
/* Enable the Gateway (Routing) functionality here, if desired. */
#if !defined(MAX_NUM_DEVICES)
#ifdef BAC_ROUTING
@@ -80,8 +89,10 @@
/* #define MAX_APDU 1476 */
#if defined(BACDL_BIP)
#define MAX_APDU 1476
/* #define MAX_APDU 128 enable this IP for testing readrange so you get the More Follows flag set */
/* #define MAX_APDU 128 enable this IP for testing
readrange so you get the More Follows flag set */
#elif defined(BACDL_BIP6)
#define MAX_APDU 1476
#elif defined (BACDL_ETHERNET)
#if defined(BACNET_SECURITY)
#define MAX_APDU 1420
+11
View File
@@ -79,6 +79,17 @@ extern void routed_get_my_address(
#define datalink_get_my_address bip_get_my_address
#endif
#elif defined(BACDL_BIP6)
#include "bip6.h"
#include "bvlc6.h"
#define datalink_init bip6_init
#define datalink_send_pdu bip6_send_pdu
#define datalink_receive bip6_receive
#define datalink_cleanup bip6_cleanup
#define datalink_get_broadcast_address bip6_get_broadcast_address
#define datalink_get_my_address bip6_get_my_address
#else /* Ie, BACDL_ALL */
#include "npdu.h"
+52
View File
@@ -0,0 +1,52 @@
/**
* @file
* @author Steve Karg
* @date 2016
*/
#ifndef VMAC_H
#define VMAC_H
#include <stdint.h>
#include <stdbool.h>
/* define the max MAC as big as IPv6 + port number */
#define VMAC_MAC_MAX 18
/**
* VMAC data structure
*
* @{
*/
struct vmac_data {
uint8_t mac[18];
uint8_t mac_len;
};
/** @} */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
unsigned int VMAC_Count(void);
struct vmac_data *VMAC_Find_By_Key(uint32_t device_id);
bool VMAC_Find_By_Data(struct vmac_data *vmac, uint32_t *device_id);
bool VMAC_Add(uint32_t device_id, struct vmac_data *pVMAC);
bool VMAC_Delete(uint32_t device_id);
bool VMAC_Different(
struct vmac_data *vmac1,
struct vmac_data *vmac2);
bool VMAC_Match(
struct vmac_data *vmac1,
struct vmac_data *vmac2);
void VMAC_Cleanup(void);
void VMAC_Init(void);
#ifdef TEST
#include "ctest.h"
void testVMAC(
Test * pTest);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif