diff --git a/source/FreeRTOS_ARP.c b/source/FreeRTOS_ARP.c index 8fd9672fa9..1e1fa615e4 100644 --- a/source/FreeRTOS_ARP.c +++ b/source/FreeRTOS_ARP.c @@ -244,7 +244,7 @@ _static ARPCacheRow_t xARPCache[ ipconfigARP_CACHE_ENTRIES ]; /* Process received ARP frame to see if there is a clash. */ #if ( ipconfigARP_USE_CLASH_DETECTION != 0 ) { - NetworkEndPoint_t * pxSourceEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulSenderProtocolAddress, 2 ); + NetworkEndPoint_t * pxSourceEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulSenderProtocolAddress ); if( ( pxSourceEndPoint != NULL ) && ( pxSourceEndPoint->ipv4_settings.ulIPAddress == ulSenderProtocolAddress ) ) { @@ -699,7 +699,7 @@ void vARPRefreshCacheEntry( const MACAddress_t * pxMACAddress, { #if ( ipconfigARP_STORES_REMOTE_ADDRESSES == 0 ) /* Only process the IP address if it is on the local network. */ - BaseType_t xAddressIsLocal = ( FreeRTOS_FindEndPointOnNetMask( ulIPAddress, 2 ) != NULL ) ? 1 : 0; /* ARP remote address. */ + BaseType_t xAddressIsLocal = ( FreeRTOS_FindEndPointOnNetMask( ulIPAddress ) != NULL ) ? 1 : 0; /* ARP remote address. */ /* Only process the IP address if it matches with one of the end-points. */ if( xAddressIsLocal != 0 ) @@ -789,7 +789,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, BaseType_t xReturn = pdFALSE; #if ( ipconfigARP_STORES_REMOTE_ADDRESSES != 0 ) - BaseType_t xAddressIsLocal = ( FreeRTOS_FindEndPointOnNetMask( ulIPAddress, 2 ) != NULL ) ? 1 : 0; /* ARP remote address. */ + BaseType_t xAddressIsLocal = ( FreeRTOS_FindEndPointOnNetMask( ulIPAddress ) != NULL ) ? 1 : 0; /* ARP remote address. */ #endif /* Start with the maximum possible number. */ @@ -855,7 +855,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, /* If ARP stores the MAC address of IP addresses outside the * network, than the MAC address of the gateway should not be * overwritten. */ - BaseType_t xOtherIsLocal = ( FreeRTOS_FindEndPointOnNetMask( xARPCache[ x ].ulIPAddress, 3 ) != NULL ) ? 1 : 0; /* ARP remote address. */ + BaseType_t xOtherIsLocal = ( FreeRTOS_FindEndPointOnNetMask( xARPCache[ x ].ulIPAddress ) != NULL ) ? 1 : 0; /* ARP remote address. */ if( xAddressIsLocal == xOtherIsLocal ) { @@ -972,7 +972,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, *( ppxEndPoint ) = NULL; ulAddressToLookup = *pulIPAddress; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulAddressToLookup, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulAddressToLookup ); if( xIsIPv4Multicast( ulAddressToLookup ) != 0 ) { @@ -999,7 +999,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, { /* This is a broadcast so it uses the broadcast MAC address. */ ( void ) memcpy( pxMACAddress->ucBytes, xBroadcastMACAddress.ucBytes, sizeof( MACAddress_t ) ); - pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulAddressToLookup, 4 ); + pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulAddressToLookup ); if( pxEndPoint != NULL ) { @@ -1036,7 +1036,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, /* It is assumed that devices with the same netmask are on the same * LAN and don't need a gateway. */ - pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulAddressToLookup, 4 ); + pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulAddressToLookup ); if( pxEndPoint == NULL ) { @@ -1346,7 +1346,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, /* Its assumed that IPv4 endpoints belonging to different physical interface * in the system will have a different subnet, but endpoints on same interface * may have it. */ - NetworkEndPoint_t * pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulIPAddress, 12 ); + NetworkEndPoint_t * pxEndPoint = FreeRTOS_FindEndPointOnNetMask( ulIPAddress ); if( pxEndPoint != NULL ) { diff --git a/source/FreeRTOS_IP.c b/source/FreeRTOS_IP.c index 5c82bd1fea..6419b3ec9f 100644 --- a/source/FreeRTOS_IP.c +++ b/source/FreeRTOS_IP.c @@ -2123,7 +2123,7 @@ void vReturnEthernetFrame( NetworkBufferDescriptor_t * pxNetworkBuffer, #if ( ipconfigUSE_IPv4 != 0 ) case ipIPv4_FRAME_TYPE: - pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxIPPacket->xIPHeader.ulDestinationIPAddress, 7 ); + pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxIPPacket->xIPHeader.ulDestinationIPAddress ); break; #endif /* ( ipconfigUSE_IPv4 != 0 ) */ diff --git a/source/FreeRTOS_IPv4.c b/source/FreeRTOS_IPv4.c index d095f1266e..bd8ab19197 100644 --- a/source/FreeRTOS_IPv4.c +++ b/source/FreeRTOS_IPv4.c @@ -318,7 +318,7 @@ enum eFrameProcessingResult prvAllowIPPacketIPv4( const struct xIP_PACKET * cons } } else if( - ( FreeRTOS_FindEndPointOnIP_IPv4( ulDestinationIPAddress, 4 ) == NULL ) && + ( FreeRTOS_FindEndPointOnIP_IPv4( ulDestinationIPAddress ) == NULL ) && /* Is it an IPv4 broadcast address x.x.x.255 ? */ ( ( FreeRTOS_ntohl( ulDestinationIPAddress ) & 0xffU ) != 0xffU ) && ( xIsIPv4Multicast( ulDestinationIPAddress ) == pdFALSE ) && diff --git a/source/FreeRTOS_Routing.c b/source/FreeRTOS_Routing.c index 5d342c83e0..6d89ed1863 100644 --- a/source/FreeRTOS_Routing.c +++ b/source/FreeRTOS_Routing.c @@ -140,12 +140,6 @@ struct xIPv6_Couple #if ( ipconfigCOMPATIBLE_WITH_SINGLE == 0 ) - #if ( ipconfigHAS_ROUTING_STATISTICS == 1 ) - RoutingStats_t xRoutingStatistics; - #endif - -/*-----------------------------------------------------------*/ - /** * @brief Add a network interface to the list of interfaces. Check if the interface was * already added in an earlier call. @@ -379,29 +373,13 @@ struct xIPv6_Couple * @brief Find the end-point which has a given IPv4 address. * * @param[in] ulIPAddress The IP-address of interest, or 0 if any IPv4 end-point may be returned. - * @param[in] ulWhere For maintaining routing statistics ulWhere acts as an index to the data structure - * that keep track of the number of times 'FreeRTOS_FindEndPointOnIP_IPv4()' - * has been called from a particular location. Used only if - * ipconfigHAS_ROUTING_STATISTICS is enabled. * * @return The end-point found or NULL. */ - NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv4( uint32_t ulIPAddress, - uint32_t ulWhere ) + NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv4( uint32_t ulIPAddress ) { NetworkEndPoint_t * pxEndPoint = pxNetworkEndPoints; - #if ( ipconfigHAS_ROUTING_STATISTICS == 1 ) - uint32_t ulLocationCount = ( uint32_t ) ( sizeof( xRoutingStatistics.ulLocationsIP ) / sizeof( xRoutingStatistics.ulLocationsIP[ 0 ] ) ); - - xRoutingStatistics.ulOnIp++; - - if( ulWhere < ulLocationCount ) - { - xRoutingStatistics.ulLocationsIP[ ulWhere ]++; - } - #endif /* ( ipconfigHAS_ROUTING_STATISTICS == 1 ) */ - while( pxEndPoint != NULL ) { #if ( ipconfigUSE_IPv4 != 0 ) @@ -456,12 +434,6 @@ struct xIPv6_Couple { NetworkEndPoint_t * pxEndPoint = pxNetworkEndPoints; - #if ( ipconfigHAS_ROUTING_STATISTICS == 1 ) - { - xRoutingStatistics.ulOnMAC++; - } - #endif - /* If input MAC address is NULL, return NULL. */ if( pxMACAddress == NULL ) { @@ -495,18 +467,12 @@ struct xIPv6_Couple * @brief Find an end-point that handles a given IPv4-address. * * @param[in] ulIPAddress The IP-address for which an end-point is looked-up. - * @param[in] ulWhere For maintaining routing statistics ulWhere acts as an index to the data structure - * that keep track of the number of times 'FreeRTOS_InterfaceEndPointOnNetMask()' - * has been called from a particular location. Used only if - * ipconfigHAS_ROUTING_STATISTICS is enabled. * * @return An end-point that has the same network mask as the given IP-address. */ - NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress, - uint32_t ulWhere ) + NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress ) { - /* The 'ulWhere' parameter is only for debugging purposes. */ - return FreeRTOS_InterfaceEndPointOnNetMask( NULL, ulIPAddress, ulWhere ); + return FreeRTOS_InterfaceEndPointOnNetMask( NULL, ulIPAddress ); } /*-----------------------------------------------------------*/ @@ -517,30 +483,13 @@ struct xIPv6_Couple * pxInterface is NULL. * @param[in] ulIPAddress The IP-address for which an end-point is looked-up. * - * @param[in] ulWhere For maintaining routing statistics ulWhere acts as an index to the data structure - * that keep track of the number of times 'FreeRTOS_InterfaceEndPointOnNetMask()' - * has been called from a particular location. Used only if - * ipconfigHAS_ROUTING_STATISTICS is enabled. - * * @return An end-point that has the same network mask as the given IP-address. */ NetworkEndPoint_t * FreeRTOS_InterfaceEndPointOnNetMask( const NetworkInterface_t * pxInterface, - uint32_t ulIPAddress, - uint32_t ulWhere ) + uint32_t ulIPAddress ) { NetworkEndPoint_t * pxEndPoint = pxNetworkEndPoints; - #if ( ipconfigHAS_ROUTING_STATISTICS == 1 ) - uint32_t ulLocationCount = ( uint32_t ) ( sizeof( xRoutingStatistics.ulLocations ) / sizeof( xRoutingStatistics.ulLocations[ 0 ] ) ); - - xRoutingStatistics.ulOnNetMask++; - - if( ulWhere < ulLocationCount ) - { - xRoutingStatistics.ulLocations[ ulWhere ]++; - } - #endif /* ( ipconfigHAS_ROUTING_STATISTICS == 1 ) */ - /* Find the best fitting end-point to reach a given IP-address. */ /*_RB_ Presumably then a broadcast reply could go out on a different end point to that on @@ -572,8 +521,8 @@ struct xIPv6_Couple /* This was only for debugging. */ if( pxEndPoint == NULL ) { - FreeRTOS_debug_printf( ( "FreeRTOS_FindEndPointOnNetMask[%d]: No match for %xip\n", - ( unsigned ) ulWhere, ( unsigned ) FreeRTOS_ntohl( ulIPAddress ) ) ); + FreeRTOS_debug_printf( ( "FreeRTOS_FindEndPointOnNetMask: No match for %xip\n", + ( unsigned ) FreeRTOS_ntohl( ulIPAddress ) ) ); } return pxEndPoint; @@ -930,12 +879,6 @@ struct xIPv6_Couple * defined end-point has the best match. */ - #if ( ipconfigHAS_ROUTING_STATISTICS == 1 ) - { - /* Some stats while developing. */ - xRoutingStatistics.ulMatching++; - } - #endif { uint16_t usFrameType = pxPacket->xUDPPacket.xEthernetHeader.usFrameType; IP_Address_t xIPAddressFrom; @@ -1216,13 +1159,11 @@ struct xIPv6_Couple * * @return The end-point found or NULL. */ - NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv4( uint32_t ulIPAddress, - uint32_t ulWhere ) + NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv4( uint32_t ulIPAddress ) { NetworkEndPoint_t * pxResult = NULL; ( void ) ulIPAddress; - ( void ) ulWhere; if( ( ulIPAddress == 0U ) || ( pxNetworkEndPoints->ipv4_settings.ulIPAddress == ulIPAddress ) ) { @@ -1265,10 +1206,9 @@ struct xIPv6_Couple * * @return An end-point that has the same network mask as the given IP-address. */ - NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress, - uint32_t ulWhere ) + NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress ) { - return FreeRTOS_InterfaceEndPointOnNetMask( NULL, ulIPAddress, ulWhere ); + return FreeRTOS_InterfaceEndPointOnNetMask( NULL, ulIPAddress ); } /*-----------------------------------------------------------*/ @@ -1337,13 +1277,11 @@ struct xIPv6_Couple * @return An end-point that has the same network mask as the given IP-address. */ NetworkEndPoint_t * FreeRTOS_InterfaceEndPointOnNetMask( const NetworkInterface_t * pxInterface, - uint32_t ulIPAddress, - uint32_t ulWhere ) + uint32_t ulIPAddress ) { NetworkEndPoint_t * pxResult = NULL; ( void ) pxInterface; - ( void ) ulWhere; if( ( ( ulIPAddress ^ pxNetworkEndPoints->ipv4_settings.ulIPAddress ) & pxNetworkEndPoints->ipv4_settings.ulNetMask ) == 0U ) { diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index 48e3a63dfa..971180f7bc 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -1821,7 +1821,7 @@ static BaseType_t prvSocketBindAdd( FreeRTOS_Socket_t * pxSocket, #if ( ipconfigUSE_IPv4 != 0 ) if( pxAddress->sin_address.ulIP_IPv4 != FREERTOS_INADDR_ANY ) { - pxSocket->pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( pxAddress->sin_address.ulIP_IPv4, 7 ); + pxSocket->pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( pxAddress->sin_address.ulIP_IPv4 ); } else #endif /* ( ipconfigUSE_IPv4 != 0 ) */ diff --git a/source/FreeRTOS_TCP_Transmission.c b/source/FreeRTOS_TCP_Transmission.c index bdfbe4e190..543ba2bcd0 100644 --- a/source/FreeRTOS_TCP_Transmission.c +++ b/source/FreeRTOS_TCP_Transmission.c @@ -756,7 +756,7 @@ /* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-113 */ /* coverity[misra_c_2012_rule_11_3_violation] */ pxIPHeader = ( ( IPHeader_t * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipSIZE_OF_ETH_HEADER ] ) ); - pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxIPHeader->ulDestinationIPAddress, 8 ); + pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxIPHeader->ulDestinationIPAddress ); if( pxNetworkBuffer->pxEndPoint == NULL ) { diff --git a/source/FreeRTOS_UDP_IPv4.c b/source/FreeRTOS_UDP_IPv4.c index ceed53e93d..ac601d52d0 100644 --- a/source/FreeRTOS_UDP_IPv4.c +++ b/source/FreeRTOS_UDP_IPv4.c @@ -274,7 +274,7 @@ void vProcessGeneratedUDPPacket_IPv4( NetworkBufferDescriptor_t * const pxNetwor /* 'ulIPAddress' might have become the address of the Gateway. * Find the route again. */ - pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxNetworkBuffer->xIPAddress.ulIP_IPv4, 11 ); + pxNetworkBuffer->pxEndPoint = FreeRTOS_FindEndPointOnNetMask( pxNetworkBuffer->xIPAddress.ulIP_IPv4 ); if( pxNetworkBuffer->pxEndPoint == NULL ) { diff --git a/source/include/FreeRTOSIPConfigDefaults.h b/source/include/FreeRTOSIPConfigDefaults.h index 50810ada78..ec99bfbb12 100644 --- a/source/include/FreeRTOSIPConfigDefaults.h +++ b/source/include/FreeRTOSIPConfigDefaults.h @@ -3056,22 +3056,6 @@ STATIC_ASSERT( ipconfigDNS_SEND_BLOCK_TIME_TICKS <= portMAX_DELAY ); /*---------------------------------------------------------------------------*/ -/* - * ipconfigHAS_ROUTING_STATISTICS - * - * Type: BaseType_t ( ipconfigENABLE | ipconfigDISABLE ) - */ - -#ifndef ipconfigHAS_ROUTING_STATISTICS - #define ipconfigHAS_ROUTING_STATISTICS ipconfigENABLE -#endif - -#if ( ( ipconfigHAS_ROUTING_STATISTICS != ipconfigDISABLE ) && ( ipconfigHAS_ROUTING_STATISTICS != ipconfigENABLE ) ) - #error Invalid ipconfigHAS_ROUTING_STATISTICS configuration -#endif - -/*---------------------------------------------------------------------------*/ - /*===========================================================================*/ /* ROUTING CONFIG */ /*===========================================================================*/ diff --git a/source/include/FreeRTOS_Routing.h b/source/include/FreeRTOS_Routing.h index 4a68bb3196..106db7f915 100644 --- a/source/include/FreeRTOS_Routing.h +++ b/source/include/FreeRTOS_Routing.h @@ -265,8 +265,7 @@ /* * Find the end-point with given IP-address. */ - NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv4( uint32_t ulIPAddress, - uint32_t ulWhere ); + NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv4( uint32_t ulIPAddress ); #if ( ipconfigUSE_IPv6 != 0 ) /* Find the end-point with given IP-address. */ @@ -283,18 +282,14 @@ /* * Find the best fitting end-point to reach a given IP-address. * Find an end-point whose IP-address is in the same network as the IP-address provided. - * 'ulWhere' is temporary and or debugging only. */ - NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress, - uint32_t ulWhere ); + NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress ); /* * Find the best fitting IPv4 end-point to reach a given IP-address on a given interface - * 'ulWhere' is temporary and or debugging only. */ NetworkEndPoint_t * FreeRTOS_InterfaceEndPointOnNetMask( const NetworkInterface_t * pxInterface, - uint32_t ulIPAddress, - uint32_t ulWhere ); + uint32_t ulIPAddress ); /* * Finds an endpoint on the given interface which is in the same subnet as the @@ -345,21 +340,6 @@ const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] ); #endif - #if ( ipconfigHAS_ROUTING_STATISTICS == 1 ) -/** @brief Some simple network statistics. */ - typedef struct xRoutingStats - { - UBaseType_t ulOnIp; /**< The number of times 'FreeRTOS_FindEndPointOnIP_IPv4()' has been called. */ - UBaseType_t ulOnMAC; /**< The number of times 'FreeRTOS_FindEndPointOnMAC()' has been called. */ - UBaseType_t ulOnNetMask; /**< The number of times 'FreeRTOS_InterfaceEndPointOnNetMask()' has been called. */ - UBaseType_t ulMatching; /**< The number of times 'FreeRTOS_MatchingEndpoint()' has been called. */ - UBaseType_t ulLocations[ 14 ]; /**< The number of times 'FreeRTOS_InterfaceEndPointOnNetMask()' has been called from a particular location. */ - UBaseType_t ulLocationsIP[ 8 ]; /**< The number of times 'FreeRTOS_FindEndPointOnIP_IPv4()' has been called from a particular location. */ - } RoutingStats_t; - - extern RoutingStats_t xRoutingStatistics; - #endif /* ( ipconfigHAS_ROUTING_STATISTICS == 1 ) */ - NetworkEndPoint_t * pxGetSocketEndpoint( ConstSocket_t xSocket ); void vSetSocketEndpoint( Socket_t xSocket, NetworkEndPoint_t * pxEndPoint ); diff --git a/test/cbmc/proofs/DNS/prepareReplyDNSMessage/prepareReplyDNSMessage_harness.c b/test/cbmc/proofs/DNS/prepareReplyDNSMessage/prepareReplyDNSMessage_harness.c index 851bd44744..d753329458 100644 --- a/test/cbmc/proofs/DNS/prepareReplyDNSMessage/prepareReplyDNSMessage_harness.c +++ b/test/cbmc/proofs/DNS/prepareReplyDNSMessage/prepareReplyDNSMessage_harness.c @@ -53,8 +53,7 @@ NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask_IPv6( const IPv6_Address_t * /* Stub FreeRTOS_FindEndPointOnNetMask_IPv6 as its not relevant to the * correctness of the proof */ -NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress, - uint32_t ulWhere ) +NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress ) { /* Assume at least one end-point is available */ return pxNetworkEndPoint_Temp; diff --git a/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c b/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c index 7a35020383..772f225b74 100644 --- a/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c +++ b/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c @@ -2374,7 +2374,7 @@ void test_vARPAgeCache( void ) xARPCache[ ucEntryToCheck ].ulIPAddress = 0xAAAAAAAA; xARPCache[ ucEntryToCheck ].pxEndPoint = &xEndPoint; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( xARPCache[ ucEntryToCheck ].ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( xARPCache[ ucEntryToCheck ].ulIPAddress, &xEndPoint ); /* The function which calls 'pxGetNetworkBufferWithDescriptor' is 'FreeRTOS_OutputARPRequest'. * It doesn't return anything and will be tested separately. */ @@ -2397,7 +2397,7 @@ void test_vARPAgeCache( void ) /* Set an IP address */ xARPCache[ ucEntryToCheck ].ulIPAddress = 0xAAAAAAAA; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( xARPCache[ ucEntryToCheck ].ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( xARPCache[ ucEntryToCheck ].ulIPAddress, &xEndPoint ); /* The function which calls 'pxGetNetworkBufferWithDescriptor' is 'FreeRTOS_OutputARPRequest'. * It doesn't return anything and will be tested separately. */ @@ -2503,7 +2503,7 @@ void test_FreeRTOS_OutputARPRequest( void ) /* =================================================== */ - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); @@ -2516,7 +2516,7 @@ void test_FreeRTOS_OutputARPRequest( void ) xNetworkInterfaceOutput_ARP_STUB_CallCount = 0; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); @@ -2530,7 +2530,7 @@ void test_FreeRTOS_OutputARPRequest( void ) /* =================================================== */ xNetworkInterfaceOutput_ARP_STUB_CallCount = 0; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); xIsCallingFromIPTask_IgnoreAndReturn( pdFALSE ); @@ -2546,7 +2546,7 @@ void test_FreeRTOS_OutputARPRequest( void ) /* =================================================== */ xEndPoint.pxNetworkInterface = NULL; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); xIsCallingFromIPTask_IgnoreAndReturn( pdTRUE ); @@ -2561,7 +2561,7 @@ void test_FreeRTOS_OutputARPRequest( void ) /* =================================================== */ xNetworkBuffer.xDataLength = ( size_t ) ipconfigETHERNET_MINIMUM_PACKET_BYTES; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); xIsCallingFromIPTask_IgnoreAndReturn( pdTRUE ); @@ -2577,7 +2577,7 @@ void test_FreeRTOS_OutputARPRequest( void ) /* =================================================== */ xEndPoint.bits.bIPv6 = 1; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); FreeRTOS_OutputARPRequest( ulIPAddress ); TEST_ASSERT_EQUAL( xNetworkInterfaceOutput_ARP_STUB_CallCount, 0 ); @@ -2589,7 +2589,7 @@ void test_FreeRTOS_OutputARPRequest( void ) xEndPoint.bits.bIPv6 = 0; xEndPoint.ipv4_settings.ulIPAddress = 0U; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); FreeRTOS_OutputARPRequest( ulIPAddress ); TEST_ASSERT_EQUAL( xNetworkInterfaceOutput_ARP_STUB_CallCount, 0 ); @@ -2603,7 +2603,7 @@ void test_FreeRTOS_OutputARPRequest_NullEndpoint( void ) { uint32_t ulIPAddress = 0x1234ABCD; - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, NULL ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, NULL ); FreeRTOS_OutputARPRequest( ulIPAddress ); } @@ -2684,7 +2684,7 @@ void test_xARPWaitResolution_GNWFailsNoTimeout( void ) /* Make sure that there are enough stubs for all the repetitive calls. */ for( i = 0; i < ipconfigMAX_ARP_RETRANSMISSIONS; i++ ) { - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); @@ -2735,7 +2735,7 @@ void test_xARPWaitResolution( void ) /* Make sure that there are enough stubs for all the repetitive calls. */ for( i = 0; i < ( ipconfigMAX_ARP_RETRANSMISSIONS - 1 ); i++ ) { - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); @@ -2744,7 +2744,7 @@ void test_xARPWaitResolution( void ) xTaskCheckForTimeOut_IgnoreAndReturn( pdFALSE ); } - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); @@ -2783,7 +2783,7 @@ void test_xARPWaitResolution( void ) /* Make sure that there are enough stubs for all the repetitive calls. */ for( i = 0; i < ( ipconfigMAX_ARP_RETRANSMISSIONS - 2 ); i++ ) { - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); @@ -2792,7 +2792,7 @@ void test_xARPWaitResolution( void ) xTaskCheckForTimeOut_IgnoreAndReturn( pdFALSE ); } - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); diff --git a/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOS_ARP_DataLenLessThanMinPacket_utest.c b/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOS_ARP_DataLenLessThanMinPacket_utest.c index 34b55c43b4..75b5515015 100644 --- a/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOS_ARP_DataLenLessThanMinPacket_utest.c +++ b/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOS_ARP_DataLenLessThanMinPacket_utest.c @@ -54,7 +54,7 @@ void test_FreeRTOS_OutputARPRequest_MinimumPacketSizeLessThanARPPacket( void ) /* =================================================== */ - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, 12, &xEndPoint ); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( ulIPAddress, &xEndPoint ); pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); xIsCallingFromIPTask_IgnoreAndReturn( pdTRUE ); diff --git a/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h index 317cc58abc..a3ed8a1a01 100644 --- a/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h @@ -40,8 +40,6 @@ #define ipconfigCOMPATIBLE_WITH_SINGLE ( 0 ) -#define ipconfigHAS_ROUTING_STATISTICS ( 1 ) - /* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to * 1 then FreeRTOS_debug_printf should be defined to the function used to print * out the debugging messages. */ diff --git a/test/unit-test/FreeRTOS_Routing/FreeRTOS_Routing_utest.c b/test/unit-test/FreeRTOS_Routing/FreeRTOS_Routing_utest.c index 13525f1357..8b7d4361ed 100644 --- a/test/unit-test/FreeRTOS_Routing/FreeRTOS_Routing_utest.c +++ b/test/unit-test/FreeRTOS_Routing/FreeRTOS_Routing_utest.c @@ -65,7 +65,6 @@ /* Default IPv4 netmask is 192.168.123.1, which is 0x017BA8C0. */ #define IPV4_DEFAULT_DNS_SERVER ( 0x017BA8C0 ) -extern RoutingStats_t xRoutingStatistics; const struct xIPv6_Address FreeRTOS_in6addr_any; const struct xIPv6_Address FreeRTOS_in6addr_loopback; @@ -1331,7 +1330,7 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_HappyPath( void ) pxNetworkEndPoints = &xEndPoint; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -1352,7 +1351,6 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_NotFound( void ) { NetworkEndPoint_t xEndPoint[ 2 ]; NetworkEndPoint_t * pxEndPoint = NULL; - uint32_t ulWhere; /* Initialize e0. */ memset( &xEndPoint[ 0 ], 0, sizeof( NetworkEndPoint_t ) ); @@ -1365,9 +1363,7 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_NotFound( void ) xEndPoint[ 1 ].bits.bIPv6 = pdTRUE; pxNetworkEndPoints->pxNext = &xEndPoint[ 1 ]; - /* Set ulWhere to boundary of array size to toggle corner case. */ - ulWhere = sizeof( xRoutingStatistics.ulLocationsIP ) / sizeof( xRoutingStatistics.ulLocationsIP[ 0 ] ); - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY, ulWhere ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } @@ -1399,13 +1395,13 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_MultipleEndpoints( void ) xEndPoint[ 1 ].ipv4_settings.ulIPAddress = IPV4_DEFAULT_GATEWAY; pxNetworkEndPoints->pxNext = &xEndPoint[ 1 ]; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS ); TEST_ASSERT_EQUAL( &xEndPoint[ 0 ], pxEndPoint ); - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY ); TEST_ASSERT_EQUAL( &xEndPoint[ 1 ], pxEndPoint ); - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_DNS_SERVER, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_DNS_SERVER ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } @@ -1433,7 +1429,7 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_AnyEndpoint( void ) xEndPoint[ 1 ].ipv4_settings.ulIPAddress = IPV4_DEFAULT_GATEWAY; pxNetworkEndPoints->pxNext = &xEndPoint[ 1 ]; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( 0, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( 0 ); TEST_ASSERT_EQUAL( &xEndPoint[ 0 ], pxEndPoint ); } @@ -1459,9 +1455,9 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_ZeroAddressEndpoint( void ) xEndPoint.ipv4_settings.ulIPAddress = 0; pxNetworkEndPoints = &xEndPoint; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -1794,7 +1790,7 @@ void test_FreeRTOS_FindEndPointOnNetMask_HappyPath( void ) pxNetworkEndPoints = &xEndPoint; /* IPV4_DEFAULT_DNS_SERVER is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_FindEndPointOnNetMask( IPV4_DEFAULT_DNS_SERVER, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnNetMask( IPV4_DEFAULT_DNS_SERVER ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -1823,7 +1819,7 @@ void test_FreeRTOS_FindEndPointOnNetMask_NotFound( void ) pxNetworkEndPoints = &xEndPoint; /* 192.168.1.1 is 0x0101A8C0. */ - pxEndPoint = FreeRTOS_FindEndPointOnNetMask( 0x0101A8C0, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnNetMask( 0x0101A8C0 ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } @@ -1921,7 +1917,6 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_HappyPath( void ) NetworkEndPoint_t xEndPoint; NetworkEndPoint_t * pxEndPoint = NULL; NetworkInterface_t xNetworkInterface; - uint32_t ulWhere; /* Initialize network interface and add it to the list. */ memset( &xNetworkInterface, 0, sizeof( NetworkInterface_t ) ); @@ -1934,10 +1929,8 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_HappyPath( void ) xEndPoint.pxNetworkInterface = &xNetworkInterface; pxNetworkEndPoints = &xEndPoint; - /* Set ulWhere to boundary of array size to toggle corner case. */ - ulWhere = sizeof( xRoutingStatistics.ulLocations ) / sizeof( xRoutingStatistics.ulLocations[ 0 ] ); /* IPV4_DEFAULT_ADDRESS is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, IPV4_DEFAULT_DNS_SERVER, ulWhere ); + pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, IPV4_DEFAULT_DNS_SERVER ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -1964,7 +1957,6 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_DifferentInterface( void ) NetworkEndPoint_t xEndPoint[ 2 ]; NetworkEndPoint_t * pxEndPoint = NULL; NetworkInterface_t xNetworkInterface[ 2 ]; - uint32_t ulWhere; /* 192.168.124.223 is 0xDF7CA8C0. */ uint32_t ulE1IPAddress = 0xDF7CA8C0; /* 192.168.124.1 is 0x017CA8C0. */ @@ -1990,10 +1982,8 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_DifferentInterface( void ) xEndPoint[ 1 ].pxNetworkInterface = &xNetworkInterface[ 1 ]; pxNetworkEndPoints->pxNext = &xEndPoint[ 1 ]; - /* Set ulWhere to boundary of array size to toggle corner case. */ - ulWhere = sizeof( xRoutingStatistics.ulLocations ) / sizeof( xRoutingStatistics.ulLocations[ 0 ] ); /* IPV4_DEFAULT_ADDRESS is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface[ 1 ], ulQueryIPAddress, ulWhere ); + pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface[ 1 ], ulQueryIPAddress ); TEST_ASSERT_EQUAL( &xEndPoint[ 1 ], pxEndPoint ); } @@ -2031,7 +2021,7 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_NotFound( void ) pxNetworkEndPoints = &xEndPoint; /* IPV4_DEFAULT_ADDRESS is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, IPV4_DEFAULT_DNS_SERVER, 0 ); + pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, IPV4_DEFAULT_DNS_SERVER ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } @@ -2078,7 +2068,7 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_Broadcast( void ) pxNetworkEndPoints->pxNext = &xEndPoint[ 1 ]; /* IPV4_DEFAULT_ADDRESS is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, 0xFFFFFFFF, 0 ); + pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, 0xFFFFFFFF ); TEST_ASSERT_EQUAL( &xEndPoint[ 1 ], pxEndPoint ); } diff --git a/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h index 9d550f5d2e..2f38e010f4 100644 --- a/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h @@ -42,8 +42,6 @@ #define ipconfigCOMPATIBLE_WITH_SINGLE ( 1 ) -#define ipconfigHAS_ROUTING_STATISTICS ( 0 ) - #define ipconfigPROCESS_CUSTOM_ETHERNET_FRAMES ( 0 ) /* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to diff --git a/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOS_Routing_ConfigCompatibleWithSingle_utest.c b/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOS_Routing_ConfigCompatibleWithSingle_utest.c index 4b3145f32c..0ab121e620 100644 --- a/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOS_Routing_ConfigCompatibleWithSingle_utest.c +++ b/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOS_Routing_ConfigCompatibleWithSingle_utest.c @@ -740,7 +740,7 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_HappyPath( void ) pxNetworkEndPoints = &xEndPoint; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_ADDRESS ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -766,7 +766,7 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_NotFound( void ) xEndPoint.ipv4_settings.ulIPAddress = IPV4_DEFAULT_ADDRESS; pxNetworkEndPoints = &xEndPoint; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( IPV4_DEFAULT_GATEWAY ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } @@ -790,7 +790,7 @@ void test_FreeRTOS_FindEndPointOnIP_IPv4_AnyEndpoint( void ) xEndPoint.ipv4_settings.ulIPAddress = IPV4_DEFAULT_ADDRESS; pxNetworkEndPoints = &xEndPoint; - pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( 0, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( 0 ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -917,7 +917,7 @@ void test_FreeRTOS_FindEndPointOnNetMask_HappyPath( void ) pxNetworkEndPoints = &xEndPoint; /* IPV4_DEFAULT_DNS_SERVER is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_FindEndPointOnNetMask( IPV4_DEFAULT_DNS_SERVER, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnNetMask( IPV4_DEFAULT_DNS_SERVER ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -946,7 +946,7 @@ void test_FreeRTOS_FindEndPointOnNetMask_NotFound( void ) pxNetworkEndPoints = &xEndPoint; /* 192.168.1.1 is 0x0101A8C0. */ - pxEndPoint = FreeRTOS_FindEndPointOnNetMask( 0x0101A8C0, 0 ); + pxEndPoint = FreeRTOS_FindEndPointOnNetMask( 0x0101A8C0 ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } @@ -981,7 +981,7 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_HappyPath( void ) pxNetworkEndPoints = &xEndPoint; /* IPV4_DEFAULT_ADDRESS is 192.168.123.1 within the network region. */ - pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, IPV4_DEFAULT_DNS_SERVER, 0 ); + pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, IPV4_DEFAULT_DNS_SERVER ); TEST_ASSERT_EQUAL( &xEndPoint, pxEndPoint ); } @@ -1016,7 +1016,7 @@ void test_FreeRTOS_InterfaceEndPointOnNetMask_NotFound( void ) pxNetworkEndPoints = &xEndPoint; /* 192.168.122.1 is not in the network region. */ - pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, 0x017AA8C0, 0 ); + pxEndPoint = FreeRTOS_InterfaceEndPointOnNetMask( &xNetworkInterface, 0x017AA8C0 ); TEST_ASSERT_EQUAL( NULL, pxEndPoint ); } diff --git a/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h index 47838e9c67..53c48bdeff 100644 --- a/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h @@ -44,8 +44,6 @@ #define ipconfigCOMPATIBLE_WITH_SINGLE ( 0 ) -#define ipconfigHAS_ROUTING_STATISTICS ( 1 ) - #define ipconfigPROCESS_CUSTOM_ETHERNET_FRAMES ( 1 ) /* Set to 1 to print out debug messages. If ipconfigHAS_DEBUG_PRINTF is set to diff --git a/test/unit-test/FreeRTOS_TCP_Transmission/TCP_Transmission_list_macros.h b/test/unit-test/FreeRTOS_TCP_Transmission/TCP_Transmission_list_macros.h index b59f487a75..1db6ff4328 100644 --- a/test/unit-test/FreeRTOS_TCP_Transmission/TCP_Transmission_list_macros.h +++ b/test/unit-test/FreeRTOS_TCP_Transmission/TCP_Transmission_list_macros.h @@ -50,9 +50,7 @@ NetworkEndPoint_t * FreeRTOS_FindEndPointOnIP_IPv6( const IPv6_Address_t * pxIPA /* * Find the best fitting end-point to reach a given IP-address. * Find an end-point whose IP-address is in the same network as the IP-address provided. - * 'ulWhere' is temporary and or debugging only. */ -NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress, - uint32_t ulWhere ); +NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress ); #endif /* ifndef LIST_MACRO_H */ diff --git a/test/unit-test/FreeRTOS_UDP_IP/FreeRTOS_UDP_IP_list_macros.h b/test/unit-test/FreeRTOS_UDP_IP/FreeRTOS_UDP_IP_list_macros.h index a520eec33c..0342e9d1e1 100644 --- a/test/unit-test/FreeRTOS_UDP_IP/FreeRTOS_UDP_IP_list_macros.h +++ b/test/unit-test/FreeRTOS_UDP_IP/FreeRTOS_UDP_IP_list_macros.h @@ -86,6 +86,6 @@ BaseType_t xProcessReceivedUDPPacket_IPv6( NetworkBufferDescriptor_t * pxNetwork uint16_t usPort, BaseType_t * pxIsWaitingForARPResolution ); -NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress, - uint32_t ulWhere ); +NetworkEndPoint_t * FreeRTOS_FindEndPointOnNetMask( uint32_t ulIPAddress ); + #endif /* ifndef LIST_MACRO_H */ diff --git a/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOS_UDP_IPv4_utest.c b/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOS_UDP_IPv4_utest.c index 04e860be84..1df9d111a6 100644 --- a/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOS_UDP_IPv4_utest.c +++ b/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOS_UDP_IPv4_utest.c @@ -1658,8 +1658,7 @@ void test_vProcessGeneratedUDPPacket_IPv4_UDPCacheMissEndPointFound() eARPGetCacheEntry_IgnoreArg_pulIPAddress(); vARPRefreshCacheEntry_Expect( NULL, pxNetworkBuffer->xIPAddress.ulIP_IPv4, NULL ); - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( pxNetworkBuffer->xIPAddress.ulIP_IPv4, 0, pxEndPoint ); - FreeRTOS_FindEndPointOnNetMask_IgnoreArg_ulWhere(); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( pxNetworkBuffer->xIPAddress.ulIP_IPv4, pxEndPoint ); vARPGenerateRequestPacket_Expect( pxNetworkBuffer ); @@ -1691,8 +1690,7 @@ void test_vProcessGeneratedUDPPacket_IPv4_UDPCacheMissEndPointNotFound() eARPGetCacheEntry_IgnoreArg_pulIPAddress(); vARPRefreshCacheEntry_Expect( NULL, pxNetworkBuffer->xIPAddress.ulIP_IPv4, NULL ); - FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( pxNetworkBuffer->xIPAddress.ulIP_IPv4, 0, NULL ); - FreeRTOS_FindEndPointOnNetMask_IgnoreArg_ulWhere(); + FreeRTOS_FindEndPointOnNetMask_ExpectAndReturn( pxNetworkBuffer->xIPAddress.ulIP_IPv4, NULL ); vReleaseNetworkBufferAndDescriptor_Expect( pxNetworkBuffer ); vProcessGeneratedUDPPacket_IPv4( pxNetworkBuffer );