Remove and fix old usage of MAX_HEADER (#331)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2022-08-25 09:53:10 -05:00
committed by GitHub
parent abe4642189
commit 0cff12214b
4 changed files with 6 additions and 10 deletions
-2
View File
@@ -56,8 +56,6 @@
#include "bacnet/datalink/bvlc6.h"
#include "bacnet/datalink/bip6.h"
#include "bacnet/basic/bbmd6/h_bbmd6.h"
#undef MAX_HEADER
#undef MAX_MPDU
#include "bacnet/datalink/bip.h"
#include "bacnet/datalink/bvlc.h"
#include "bacnet/basic/bbmd/h_bbmd.h"
-2
View File
@@ -54,8 +54,6 @@
#include "bacport.h"
/* our datalink layers */
#include "bacnet/datalink/dlmstp.h"
#undef MAX_HEADER
#undef MAX_MPDU
#include "bacnet/datalink/bip.h"
#include "bacnet/datalink/bvlc.h"
#include "bacnet/basic/bbmd/h_bbmd.h"
+3 -3
View File
@@ -126,7 +126,7 @@ int dlmstp_send_pdu(BACNET_ADDRESS *dest, /* destination address */
Transmit_Packet.pdu[i] = pdu[i];
}
bacnet_address_copy(&Transmit_Packet.address, dest);
bytes_sent = pdu_len + MAX_HEADER;
bytes_sent = pdu_len + DLMSTP_HEADER_MAX;
Transmit_Packet.ready = true;
}
@@ -282,7 +282,7 @@ uint16_t MSTP_Get_Send(
} else {
destination = MSTP_BROADCAST_ADDRESS;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
if ((DLMSTP_HEADER_MAX + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
return 0;
}
/* convert the PDU into the MSTP Frame */
@@ -421,7 +421,7 @@ uint16_t MSTP_Get_Reply(
} else {
return 0;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
if ((DLMSTP_HEADER_MAX + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
return 0;
}
/* is this the reply to the DER? */
+3 -3
View File
@@ -111,7 +111,7 @@ int dlmstp_send_pdu(BACNET_ADDRESS *dest, /* destination address */
Transmit_Packet.pdu[i] = pdu[i];
}
bacnet_address_copy(&Transmit_Packet.address, dest);
bytes_sent = pdu_len + MAX_HEADER;
bytes_sent = pdu_len + DLMSTP_HEADER_MAX;
Transmit_Packet.ready = true;
}
@@ -267,7 +267,7 @@ uint16_t MSTP_Get_Send(
} else {
destination = MSTP_BROADCAST_ADDRESS;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
if ((DLMSTP_HEADER_MAX + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
return 0;
}
/* convert the PDU into the MSTP Frame */
@@ -407,7 +407,7 @@ uint16_t MSTP_Get_Reply(
} else {
return 0;
}
if ((MAX_HEADER + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
if ((DLMSTP_HEADER_MAX + Transmit_Packet.pdu_len) > DLMSTP_MPDU_MAX) {
return 0;
}
/* is this the reply to the DER? */