RA
RA stands for Router Advertisement.
Router Advertisement is a part of IPv6 Neighbour Discovery protocol. Routers periodically send multicast messages to
inform devices about their presence and network configuration. RA allows dynamic address configuration, making it easier for devices to
connect to the network.
If ipconfigUSE_RA is set to 1 in FreeRTOSIPConfig.h
and if the bWantRA
bit in the bits
field of the endpoint structure is set during
the endpoint initialisation, then FreeRTOS-Plus-TCP will attempt to obtain the endpoint's IP address using Router advertisement.
Below is an example endpoint initialisation that enables RA:
IPv6_Address_t xIPAddress;
IPv6_Address_t xPrefix;
IPv6_Address_t xGateWay;
IPv6_Address_t xDNSServer1, xDNSServer2;
FreeRTOS_inet_pton6( "2001:470:ed44::", xPrefix.ucBytes );
FreeRTOS_CreateIPv6Address( &xIPAddress, &xPrefix, 64, pdTRUE );
FreeRTOS_inet_pton6( "fe80::ba27:ebff:fe5a:d751", xGateWay.ucBytes );
FreeRTOS_FillEndPoint_IPv6( &( xInterfaces[ 0 ] ),
&( xEndPoints[ xEndPointCount ] ),
&( xIPAddress ),
&( xPrefix ),
64uL,
&( xGateWay ),
NULL,
ucMACAddress );
FreeRTOS_inet_pton6( "2001:4860:4860::8888", xEndPoints[ xEndPointCount ].ipv6_settings.xDNSServerAddresses[ 0 ].ucBytes );
FreeRTOS_inet_pton6( "fe80::1", xEndPoints[ xEndPointCount ].ipv6_settings.xDNSServerAddresses[ 1 ].ucBytes );
FreeRTOS_inet_pton6( "2001:4860:4860::8888", xEndPoints[ xEndPointCount ].ipv6_defaults.xDNSServerAddresses[ 0 ].ucBytes );
FreeRTOS_inet_pton6( "fe80::1", xEndPoints[ xEndPointCount ].ipv6_defaults.xDNSServerAddresses[ 1 ].ucBytes );
#if ( ipconfigUSE_RA != 0 )
{
xEndPoints[ xEndPointCount ].bits.**bWantRA** = pdTRUE;
}
#endif
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.