1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-23 01:18:54 +08:00

Uncrustify (#730)

* uncrustify

* Uncrustify: triggered by comment.

* Update FreeRTOS_ARP.c

* Fix whitespace changes

---------

Co-authored-by: Holden <holden-zenithaerotech.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com>
This commit is contained in:
holden-zenith
2023-02-17 01:36:39 -05:00
committed by GitHub
parent 883dd778f4
commit 3062666f80
7 changed files with 26 additions and 19 deletions

View File

@@ -56,6 +56,7 @@
#include "FreeRTOS_Routing.h" #include "FreeRTOS_Routing.h"
#include "FreeRTOS_ND.h" #include "FreeRTOS_ND.h"
/** @brief When the age of an entry in the ARP table reaches this value (it counts down /** @brief When the age of an entry in the ARP table reaches this value (it counts down
* to zero, so this is an old entry) an ARP request will be sent to see if the * to zero, so this is an old entry) an ARP request will be sent to see if the
* entry is still valid and can therefore be refreshed. */ * entry is still valid and can therefore be refreshed. */

View File

@@ -1003,7 +1003,6 @@
/* Important: tell NIC driver how many bytes must be sent */ /* Important: tell NIC driver how many bytes must be sent */
pxNetworkBuffer->xDataLength = uxDataLength; pxNetworkBuffer->xDataLength = uxDataLength;
} }
#endif /* ipconfigUSE_NBNS == 1 || ipconfigUSE_LLMNR == 1 */ #endif /* ipconfigUSE_NBNS == 1 || ipconfigUSE_LLMNR == 1 */

View File

@@ -1607,8 +1607,8 @@ static eFrameProcessingResult_t prvProcessUDPPacket( NetworkBufferDescriptor_t *
eReturn = eReleaseBuffer; eReturn = eReleaseBuffer;
} }
else if( ( pxUDPPacket->xEthernetHeader.usFrameType == ipIPv4_FRAME_TYPE ) && else if( ( pxUDPPacket->xEthernetHeader.usFrameType == ipIPv4_FRAME_TYPE ) &&
( ipFIRST_LOOPBACK_IPv4 <= ( FreeRTOS_ntohl( pxUDPPacket->xIPHeader.ulDestinationIPAddress ) ) ) && ( ipFIRST_LOOPBACK_IPv4 <= ( FreeRTOS_ntohl( pxUDPPacket->xIPHeader.ulDestinationIPAddress ) ) ) &&
( ( FreeRTOS_ntohl( pxUDPPacket->xIPHeader.ulDestinationIPAddress ) ) < ipLAST_LOOPBACK_IPv4 ) ) ( ( FreeRTOS_ntohl( pxUDPPacket->xIPHeader.ulDestinationIPAddress ) ) < ipLAST_LOOPBACK_IPv4 ) )
{ {
/* The local loopback addresses must never appear outside a host. See RFC 1122 /* The local loopback addresses must never appear outside a host. See RFC 1122
* section 3.2.1.3. */ * section 3.2.1.3. */
@@ -1812,9 +1812,7 @@ static eFrameProcessingResult_t prvProcessIPPacket( const IPPacket_t * pxIPPacke
* went wrong because it will not be able to validate what it * went wrong because it will not be able to validate what it
* receives. */ * receives. */
#if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) #if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )
{ eReturn = ProcessICMPPacket( pxNetworkBuffer );
eReturn = ProcessICMPPacket( pxNetworkBuffer );
}
#endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */ #endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */
break; break;

View File

@@ -45,13 +45,13 @@
/* Constants defining the current version of the FreeRTOS+TCP /* Constants defining the current version of the FreeRTOS+TCP
* network stack. */ * network stack. */
#define ipFR_TCP_VERSION_NUMBER "V3.0.999" #define ipFR_TCP_VERSION_NUMBER "V3.0.999"
#define ipFR_TCP_VERSION_MAJOR 3 #define ipFR_TCP_VERSION_MAJOR 3
#define ipFR_TCP_VERSION_MINOR 0 #define ipFR_TCP_VERSION_MINOR 0
/* Development builds are always version 999. */ /* Development builds are always version 999. */
#define ipFR_TCP_VERSION_BUILD 999 #define ipFR_TCP_VERSION_BUILD 999
/* Using TCP version to support backward compatibility in the Demo files. */ /* Using TCP version to support backward compatibility in the Demo files. */
#define FREERTOS_PLUS_TCP_VERSION 10 #define FREERTOS_PLUS_TCP_VERSION 10
/* Some constants defining the sizes of several parts of a packet. /* Some constants defining the sizes of several parts of a packet.
* These defines come before including the configuration header files. */ * These defines come before including the configuration header files. */

View File

@@ -56,8 +56,8 @@ set( TCP_INCLUDES "${MODULE_ROOT_DIR}/source/include/FreeRTOS_IP.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_IPv4.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_IPv4.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_IPv6.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_IPv6.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_IP_Common.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_IP_Common.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_ND.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_ND.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_ARP.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_ARP.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_ARP.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_ARP.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_ICMP.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_ICMP.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_IP_Timers.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_IP_Timers.h"
@@ -78,8 +78,8 @@ set( TCP_INCLUDES "${MODULE_ROOT_DIR}/source/include/FreeRTOS_IP.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_DNS_Callback.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_DNS_Callback.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_DNS_Networking.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_DNS_Networking.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_DNS_Parser.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_DNS_Parser.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_Routing.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_Routing.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_ND.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_ND.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_TCP_IP.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_TCP_IP.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_TCP_Transmission.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_TCP_Transmission.h"
"${MODULE_ROOT_DIR}/source/include/FreeRTOS_TCP_Reception.h" "${MODULE_ROOT_DIR}/source/include/FreeRTOS_TCP_Reception.h"

View File

@@ -362,6 +362,7 @@ void test_eARPProcessPacket_IPIsLocalLoopBack( void )
xARPFrame.xARPHeader.ucProtocolAddressLength = ipIP_ADDRESS_LENGTH_BYTES; xARPFrame.xARPHeader.ucProtocolAddressLength = ipIP_ADDRESS_LENGTH_BYTES;
uint32_t ulSenderProtocolAddress = FreeRTOS_htonl( ipFIRST_LOOPBACK_IPv4 + 10 ); uint32_t ulSenderProtocolAddress = FreeRTOS_htonl( ipFIRST_LOOPBACK_IPv4 + 10 );
memcpy( xARPFrame.xARPHeader.ucSenderProtocolAddress, memcpy( xARPFrame.xARPHeader.ucSenderProtocolAddress,
&ulSenderProtocolAddress, &ulSenderProtocolAddress,
sizeof( ulSenderProtocolAddress ) ); sizeof( ulSenderProtocolAddress ) );
@@ -391,6 +392,7 @@ void test_eARPProcessPacket_SenderIPLessThanLoopBack( void )
xARPFrame.xARPHeader.ucProtocolAddressLength = ipIP_ADDRESS_LENGTH_BYTES; xARPFrame.xARPHeader.ucProtocolAddressLength = ipIP_ADDRESS_LENGTH_BYTES;
uint32_t ulSenderProtocolAddress = FreeRTOS_htonl( ipFIRST_LOOPBACK_IPv4 - 10 ); uint32_t ulSenderProtocolAddress = FreeRTOS_htonl( ipFIRST_LOOPBACK_IPv4 - 10 );
memcpy( xARPFrame.xARPHeader.ucSenderProtocolAddress, memcpy( xARPFrame.xARPHeader.ucSenderProtocolAddress,
&ulSenderProtocolAddress, &ulSenderProtocolAddress,
sizeof( ulSenderProtocolAddress ) ); sizeof( ulSenderProtocolAddress ) );
@@ -634,6 +636,7 @@ void test_eARPProcessPacket_Reply_TargetIPSameAsLocalIP( void )
xARPFrame.xARPHeader.ulTargetProtocolAddress = *ipLOCAL_IP_ADDRESS_POINTER; xARPFrame.xARPHeader.ulTargetProtocolAddress = *ipLOCAL_IP_ADDRESS_POINTER;
uint32_t ulSenderProtocolAddress = 0xFFAAEEBB; uint32_t ulSenderProtocolAddress = 0xFFAAEEBB;
memcpy( &( xARPFrame.xARPHeader.ucSenderProtocolAddress ), &ulSenderProtocolAddress, sizeof( uint32_t ) ); memcpy( &( xARPFrame.xARPHeader.ucSenderProtocolAddress ), &ulSenderProtocolAddress, sizeof( uint32_t ) );
/* Reset the private variable uxARPClashCounter. */ /* Reset the private variable uxARPClashCounter. */
@@ -681,6 +684,7 @@ void test_eARPProcessPacket_Reply_TargetIPNotSameAsLocalIP_ButEntryInCache( void
xARPFrame.xARPHeader.ulTargetProtocolAddress = *ipLOCAL_IP_ADDRESS_POINTER + 1; xARPFrame.xARPHeader.ulTargetProtocolAddress = *ipLOCAL_IP_ADDRESS_POINTER + 1;
uint32_t ulSenderProtocolAddress = 0xFFAAEEBB; uint32_t ulSenderProtocolAddress = 0xFFAAEEBB;
memcpy( &( xARPFrame.xARPHeader.ucSenderProtocolAddress ), &ulSenderProtocolAddress, sizeof( uint32_t ) ); memcpy( &( xARPFrame.xARPHeader.ucSenderProtocolAddress ), &ulSenderProtocolAddress, sizeof( uint32_t ) );
xARPCache[ 0 ].ulIPAddress = ulSenderProtocolAddress; xARPCache[ 0 ].ulIPAddress = ulSenderProtocolAddress;
@@ -1393,6 +1397,7 @@ void test_vARPRefreshCacheEntry_IPAndMACInDifferentLocations( void )
TEST_ASSERT_EQUAL( ( uint8_t ) pdTRUE, xARPCache[ xUseEntry + 1 ].ucValid ); TEST_ASSERT_EQUAL( ( uint8_t ) pdTRUE, xARPCache[ xUseEntry + 1 ].ucValid );
uint8_t MemoryCompare[ sizeof( ARPCacheRow_t ) ]; uint8_t MemoryCompare[ sizeof( ARPCacheRow_t ) ];
memset( MemoryCompare, 0, sizeof( ARPCacheRow_t ) ); memset( MemoryCompare, 0, sizeof( ARPCacheRow_t ) );
TEST_ASSERT_EQUAL_MEMORY( MemoryCompare, &xARPCache[ xUseEntry ], sizeof( ARPCacheRow_t ) ); TEST_ASSERT_EQUAL_MEMORY( MemoryCompare, &xARPCache[ xUseEntry ], sizeof( ARPCacheRow_t ) );
/* =================================================== */ /* =================================================== */
@@ -1550,8 +1555,8 @@ void test_eARPGetCacheEntry_IPMatchesOtherBroadcastAddr( void )
/* =================================================== */ /* =================================================== */
} }
// TODO: _TJ_: For the timebeing test_eARPGetCacheEntry_LocalIPIsZero and test_eARPGetCacheEntry_LocalIPMatchesReceivedIP /* TODO: _TJ_: For the timebeing test_eARPGetCacheEntry_LocalIPIsZero and test_eARPGetCacheEntry_LocalIPMatchesReceivedIP */
// test cases are removed as we need to reevaluate if those cases are required for IPv6 /* test cases are removed as we need to reevaluate if those cases are required for IPv6 */
void test_eARPGetCacheEntry_MatchingInvalidEntry( void ) void test_eARPGetCacheEntry_MatchingInvalidEntry( void )
{ {
@@ -1936,6 +1941,7 @@ void test_xARPWaitResolution_GNWFailsNoTimeout( void )
xEndPoint.bits.bIPv6 = pdFALSE_UNSIGNED; xEndPoint.bits.bIPv6 = pdFALSE_UNSIGNED;
xEndPoint.ipv4_settings.ulIPAddress = 0xC0C0C0C0; xEndPoint.ipv4_settings.ulIPAddress = 0xC0C0C0C0;
/* Make the resolution fail with maximum tryouts. */ /* Make the resolution fail with maximum tryouts. */
/* =================================================== */ /* =================================================== */
/* Make sure that no address matches the IP address. */ /* Make sure that no address matches the IP address. */
@@ -1986,6 +1992,7 @@ void test_xARPWaitResolution( void )
xEndPoint.bits.bIPv6 = pdFALSE_UNSIGNED; xEndPoint.bits.bIPv6 = pdFALSE_UNSIGNED;
xEndPoint.ipv4_settings.ulIPAddress = 0xC0C0C0C0; xEndPoint.ipv4_settings.ulIPAddress = 0xC0C0C0C0;
/* Make the resolution fail after some attempts due to timeout. */ /* Make the resolution fail after some attempts due to timeout. */
/* =================================================== */ /* =================================================== */
/* Make sure that no address matches the IP address. */ /* Make sure that no address matches the IP address. */

View File

@@ -343,7 +343,7 @@ void test_FreeRTOS_gethostbyname_fail_send_dns_reply_zero( void )
uint32_t ulNumber = 0; uint32_t ulNumber = 0;
NetworkEndPoint_t xEndPoint; NetworkEndPoint_t xEndPoint;
struct xSOCKET xDNSSocket; struct xSOCKET xDNSSocket;
uint8_t pucPayloadBuffer_Arr[300]; uint8_t pucPayloadBuffer_Arr[ 300 ];
uint8_t buffer[ 2280 + ipBUFFER_PADDING ]; uint8_t buffer[ 2280 + ipBUFFER_PADDING ];
@@ -354,6 +354,7 @@ void test_FreeRTOS_gethostbyname_fail_send_dns_reply_zero( void )
xReceiveBuffer.uxPayloadLength = 300; xReceiveBuffer.uxPayloadLength = 300;
memset( xReceiveBuffer.pucPayloadBuffer, 0x00, 300 ); memset( xReceiveBuffer.pucPayloadBuffer, 0x00, 300 );
DNSMessage_t * header = ( DNSMessage_t * ) xReceiveBuffer.pucPayloadBuffer; DNSMessage_t * header = ( DNSMessage_t * ) xReceiveBuffer.pucPayloadBuffer;
header->usIdentifier = 0; header->usIdentifier = 0;
xNetworkBuffer.xDataLength = 2280; xNetworkBuffer.xDataLength = 2280;
@@ -391,7 +392,6 @@ void test_FreeRTOS_gethostbyname_fail_send_dns_reply_zero( void )
TEST_ASSERT_EQUAL( 0, ret ); TEST_ASSERT_EQUAL( 0, ret );
xNetworkBuffer.pucEthernetBuffer -= ipBUFFER_PADDING; xNetworkBuffer.pucEthernetBuffer -= ipBUFFER_PADDING;
} }
/** /**
@@ -416,6 +416,7 @@ void test_FreeRTOS_gethostbyname_succes( void )
xReceiveBuffer.uxPayloadLength = 300; xReceiveBuffer.uxPayloadLength = 300;
memset( xReceiveBuffer.pucPayloadBuffer, 0x00, 300 ); memset( xReceiveBuffer.pucPayloadBuffer, 0x00, 300 );
DNSMessage_t * header = ( DNSMessage_t * ) xReceiveBuffer.pucPayloadBuffer; DNSMessage_t * header = ( DNSMessage_t * ) xReceiveBuffer.pucPayloadBuffer;
header->usIdentifier = 0; header->usIdentifier = 0;
xDNSSocket.usLocalPort = 0; xDNSSocket.usLocalPort = 0;
@@ -666,6 +667,7 @@ void test_FreeRTOS_gethostbyname_a_no_callback_retry_once( void )
( void ) memset( xNetworkBuffer.pucEthernetBuffer, 0x00, uxBytesNeeded ); ( void ) memset( xNetworkBuffer.pucEthernetBuffer, 0x00, uxBytesNeeded );
( void ) memset( xReceiveBuffer.pucPayloadBuffer, 0x00, 300 ); ( void ) memset( xReceiveBuffer.pucPayloadBuffer, 0x00, 300 );
DNSMessage_t * header = ( DNSMessage_t * ) xReceiveBuffer.pucPayloadBuffer; DNSMessage_t * header = ( DNSMessage_t * ) xReceiveBuffer.pucPayloadBuffer;
header->usIdentifier = 12; header->usIdentifier = 12;
xDNSSocket.usLocalPort = 0; xDNSSocket.usLocalPort = 0;
xEndPoint.bits.bIPv6 = pdFALSE; xEndPoint.bits.bIPv6 = pdFALSE;