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

Add UT for FreeRTOS_DNS_Cache (#884)

* Add Ufor FreeRTOS_DNS_Cache

* Add UT for FreeRTOS_DNS_Cache

* Fix build error

* Fix coverage :100%
This commit is contained in:
kar-rahul-aws
2023-05-31 17:33:38 +05:30
committed by GitHub
parent cd25e41a49
commit 41222595cd
7 changed files with 471 additions and 28 deletions

15
source/include/FreeRTOS_DNS_Cache.h Normal file → Executable file
View File

@@ -38,6 +38,21 @@
#if ( ( ipconfigUSE_DNS_CACHE == 1 ) && ( ipconfigUSE_DNS != 0 ) )
/**
* @brief cache entry format structure
*/
typedef struct xDNS_CACHE_TABLE_ROW
{
IPv46_Address_t xAddresses[ ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY ]; /*!< The IP address(es) of an ARP cache entry. */
char pcName[ ipconfigDNS_CACHE_NAME_LENGTH ]; /*!< The name of the host */
uint32_t ulTTL; /*!< Time-to-Live (in seconds) from the DNS server. */
uint32_t ulTimeWhenAddedInSeconds; /*!< time at which the entry was added */
#if ( ipconfigDNS_CACHE_ADDRESSES_PER_ENTRY > 1 )
uint8_t ucNumIPAddresses; /*!< number of ip addresses for the same entry */
uint8_t ucCurrentIPAddress; /*!< current ip address index */
#endif
} DNSCacheRow_t;
/* Look for the indicated host name in the DNS cache. Returns the IPv4
* address if present, or 0x0 otherwise. */
uint32_t FreeRTOS_dnslookup( const char * pcHostName );