fixing gateway demo for MS/TP
This commit is contained in:
@@ -183,20 +183,20 @@ static void Initialize_Device_Addresses(
|
|||||||
uint32_t virtual_mac = 0;
|
uint32_t virtual_mac = 0;
|
||||||
DEVICE_OBJECT_DATA *pDev = NULL;
|
DEVICE_OBJECT_DATA *pDev = NULL;
|
||||||
/* Setup info for the main gateway device first */
|
/* Setup info for the main gateway device first */
|
||||||
|
pDev = Get_Routed_Device_Object(i);
|
||||||
#if defined(BACDL_BIP)
|
#if defined(BACDL_BIP)
|
||||||
uint16_t myPort;
|
uint16_t myPort;
|
||||||
struct in_addr *netPtr; /* Lets us cast to this type */
|
struct in_addr *netPtr; /* Lets us cast to this type */
|
||||||
uint8_t *gatewayMac = NULL;
|
uint8_t *gatewayMac = NULL;
|
||||||
uint32_t myAddr = bip_get_addr();
|
uint32_t myAddr = bip_get_addr();
|
||||||
pDev = Get_Routed_Device_Object(i);
|
|
||||||
gatewayMac = pDev->bacDevAddr.mac; /* Keep pointer to the main MAC */
|
gatewayMac = pDev->bacDevAddr.mac; /* Keep pointer to the main MAC */
|
||||||
memcpy(pDev->bacDevAddr.mac, &myAddr, 4);
|
memcpy(pDev->bacDevAddr.mac, &myAddr, 4);
|
||||||
myPort = bip_get_port();
|
myPort = bip_get_port();
|
||||||
memcpy(&pDev->bacDevAddr.mac[4], &myPort, 2);
|
memcpy(&pDev->bacDevAddr.mac[4], &myPort, 2);
|
||||||
pDev->bacDevAddr.mac_len = 6;
|
pDev->bacDevAddr.mac_len = 6;
|
||||||
#elif defined(BACDL_MSTP)
|
#elif defined(BACDL_MSTP)
|
||||||
/* Todo: */
|
pDev->bacDevAddr.mac_len = 1;
|
||||||
pDev->bacDevAddr.mac_len = 2;
|
pDev->bacDevAddr.mac[0] = dlmstp_mac_address();
|
||||||
#else
|
#else
|
||||||
#error "No support for this Data Link Layer type "
|
#error "No support for this Data Link Layer type "
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user