Changed Init Router message to have DER = true.
This commit is contained in:
@@ -43,11 +43,12 @@
|
||||
|
||||
static void npdu_encode_npdu_network(
|
||||
BACNET_NPDU_DATA * npdu_data,
|
||||
BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
bool data_expecting_reply,
|
||||
BACNET_MESSAGE_PRIORITY priority)
|
||||
{
|
||||
if (npdu_data) {
|
||||
npdu_data->data_expecting_reply = false;
|
||||
npdu_data->data_expecting_reply = data_expecting_reply;
|
||||
npdu_data->protocol_version = BACNET_PROTOCOL_VERSION;
|
||||
npdu_data->network_layer_message = true; /* false if APDU */
|
||||
npdu_data->network_message_type = network_message_type; /* optional */
|
||||
@@ -68,7 +69,9 @@ void Send_Who_Is_Router_To_Network(
|
||||
BACNET_NPDU_DATA npdu_data;
|
||||
|
||||
npdu_encode_npdu_network(&npdu_data,
|
||||
NETWORK_MESSAGE_WHO_IS_ROUTER_TO_NETWORK, MESSAGE_PRIORITY_NORMAL);
|
||||
NETWORK_MESSAGE_WHO_IS_ROUTER_TO_NETWORK,
|
||||
false,
|
||||
MESSAGE_PRIORITY_NORMAL);
|
||||
/* fixme: should dnet/dlen/dadr be set in NPDU? */
|
||||
pdu_len =
|
||||
npdu_encode_pdu(&Handler_Transmit_Buffer[0], NULL, NULL, &npdu_data);
|
||||
@@ -109,7 +112,9 @@ void Send_I_Am_Router_To_Network(
|
||||
unsigned index = 0;
|
||||
|
||||
npdu_encode_npdu_network(&npdu_data,
|
||||
NETWORK_MESSAGE_I_AM_ROUTER_TO_NETWORK, MESSAGE_PRIORITY_NORMAL);
|
||||
NETWORK_MESSAGE_I_AM_ROUTER_TO_NETWORK,
|
||||
false,
|
||||
MESSAGE_PRIORITY_NORMAL);
|
||||
pdu_len =
|
||||
npdu_encode_pdu(&Handler_Transmit_Buffer[0], NULL, NULL, &npdu_data);
|
||||
/* encode the optional DNET list portion of the packet */
|
||||
@@ -152,7 +157,9 @@ void Send_Initialize_Routing_Table(
|
||||
BACNET_ROUTER_PORT *router_port;
|
||||
unsigned i = 0; /* counter */
|
||||
|
||||
npdu_encode_npdu_network(&npdu_data, NETWORK_MESSAGE_INIT_RT_TABLE,
|
||||
npdu_encode_npdu_network(&npdu_data,
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE,
|
||||
true,
|
||||
MESSAGE_PRIORITY_NORMAL);
|
||||
pdu_len =
|
||||
npdu_encode_pdu(&Handler_Transmit_Buffer[0], NULL, NULL, &npdu_data);
|
||||
@@ -201,7 +208,9 @@ void Send_Initialize_Routing_Table_Ack(
|
||||
int bytes_sent = 0;
|
||||
BACNET_NPDU_DATA npdu_data;
|
||||
|
||||
npdu_encode_npdu_network(&npdu_data, NETWORK_MESSAGE_INIT_RT_TABLE_ACK,
|
||||
npdu_encode_npdu_network(&npdu_data,
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE_ACK,
|
||||
false,
|
||||
MESSAGE_PRIORITY_NORMAL);
|
||||
pdu_len =
|
||||
npdu_encode_pdu(&Handler_Transmit_Buffer[0], NULL, NULL, &npdu_data);
|
||||
|
||||
@@ -229,7 +229,7 @@ static void address_parse(BACNET_ADDRESS * dst,
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
if (argc < 2) {
|
||||
printf("Usage: %s address number-of-ports [DNET ID Len Info]\r\n",
|
||||
printf("Usage: %s address [DNET ID Len Info]\r\n",
|
||||
filename_remove_path(argv[0]));
|
||||
return 0;
|
||||
}
|
||||
@@ -239,13 +239,20 @@ int main(int argc, char *argv[]) {
|
||||
"--help") == 0)) {
|
||||
printf("Send BACnet Initialize-Routing-Table message to a network\r\n"
|
||||
"and wait for responses. Displays their network information.\r\n"
|
||||
"\r\n" "address:\r\n"
|
||||
"\r\n"
|
||||
"address:\r\n"
|
||||
"MAC address in xx:xx:xx:xx:xx:xx format or IP x.x.x.x:port\r\n"
|
||||
"number-of-ports:\r\n"
|
||||
"Number of ports to update along with port-info data\r\n"
|
||||
"To query the complete routing table, use 0.\r\n"
|
||||
"DNET ID Len Info:\r\n"
|
||||
"Port-info data:\r\n"
|
||||
" DNET:\r\n"
|
||||
" Destination network number 0-65534\r\n"
|
||||
" ID:\r\n"
|
||||
" Port Identifier number 0-255\r\n"
|
||||
" Info:\r\n"
|
||||
" Octet string of data, up to 255 octets\r\n"
|
||||
"To query the complete routing table, do not include any port-info.\r\n"
|
||||
"To query using Initialize-Routing-Table message to 192.168.0.18:\r\n"
|
||||
"%s 192.168.0.18:47808 0\r\n", filename_remove_path(argv[0]));
|
||||
"%s 192.168.0.18:47808\r\n", filename_remove_path(argv[0]));
|
||||
return 0;
|
||||
}
|
||||
/* decode the command line parameters */
|
||||
|
||||
Reference in New Issue
Block a user