added global address setup to correctly configure global sends

This commit is contained in:
skarg
2005-03-23 15:57:09 +00:00
parent a185a3ed43
commit 32562856b8
2 changed files with 30 additions and 1 deletions
+2
View File
@@ -46,6 +46,8 @@
bool ethernet_valid(void);
void ethernet_cleanup(void);
bool ethernet_init(char *interface_name);
void ethernet_set_broadcast_address(
BACNET_ADDRESS *dest); // destination address
/* function to send a packet out the 802.2 socket */
/* returns 0 on success, non-zero on failure */
+28 -1
View File
@@ -350,13 +350,40 @@ void ethernet_get_my_address(BACNET_ADDRESS *my_address)
int i = 0;
my_address->mac_len = 0;
my_address->net = 0; // local only, no routing
for (i = 0; i < 6; i++)
{
my_address->mac[i] = Ethernet_MAC_Address[i];
my_address->mac_len++;
}
my_address->net = 0; // local only, no routing
my_address->len = 0;
for (i = 0; i < MAX_MAC_LEN; i++)
{
my_address->adr[i] = 0;
}
return;
}
void ethernet_set_broadcast_address(
BACNET_ADDRESS *dest) // destination address
{
int i = 0; // counter
if (dest)
{
for (i = 0; i < 6; i++)
{
dest->mac[i] = 0xFF;
}
dest->mac_len = 6;
dest->net = BACNET_BROADCAST_NETWORK;
dest->len = 0; // denotes broadcast address
for (i = 0; i < MAX_MAC_LEN; i++)
{
dest->adr[i] = 0;
}
}
return;
}