Skip to content

Commit

Permalink
API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-josi-aws committed Jun 6, 2024
1 parent 423eae1 commit 3282b35
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions source/FreeRTOS_DNS.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,35 @@

/*-----------------------------------------------------------*/

BaseType_t FreeRTOS_SetDNSIPPreference( IPPreference_t eIPPreference )
{
BaseType_t xReturn = pdPASS;
switch ( eIPPreference )
{

#if ( ipconfigUSE_IPv4 != 0 )
case xPreferenceIPv4:
xDNS_IP_Preference = xPreferenceIPv4;
break;
#endif

#if ( ipconfigUSE_IPv6 != 0 )
case xPreferenceIPv6:
xDNS_IP_Preference = xPreferenceIPv6;
break;
#endif

default:
xReturn = pdFAIL;
FreeRTOS_printf( ( "Invalid DNS IPPreference_t\n" ) );
break;
}

return xReturn;
}

/*-----------------------------------------------------------*/

#endif /* ipconfigUSE_DNS != 0 */

/*-----------------------------------------------------------*/
Expand Down
4 changes: 4 additions & 0 deletions source/include/FreeRTOS_DNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ BaseType_t FreeRTOS_getaddrinfo( const char * pcName, /* Th
*/
void FreeRTOS_freeaddrinfo( struct freertos_addrinfo * pxInfo );

/* Sets the DNS IP preference while doing DNS lookup to indicate the preference
* for a DNS server: either IPv4 or IPv6. Defaults to xPreferenceIPv4 */
BaseType_t FreeRTOS_SetDNSIPPreference( IPPreference_t eIPPreference );

#if ( ipconfigDNS_USE_CALLBACKS == 1 )

/*
Expand Down

0 comments on commit 3282b35

Please sign in to comment.