Go to the documentation of this file.
32 #define TRACE_LEVEL NDP_TRACE_LEVEL
42 #if (IPV6_SUPPORT == ENABLED && NDP_ROUTER_ADV_SUPPORT == ENABLED)
135 TRACE_INFO(
"Initializing Router Advertisement service...\r\n");
138 if(context == NULL || settings == NULL)
146 interface = settings->interface;
152 context->netContext = settings->
interface->netContext;
155 context->interface = settings->
interface;
163 context->proxyFlag = settings->
proxyFlag;
167 context->linkMtu = settings->
linkMtu;
170 context->routeList = settings->
routeList;
177 context->running =
FALSE;
182 interface->ndpRouterAdvContext = context;
207 TRACE_INFO(
"Starting Router Advertisement service...\r\n");
213 if(!context->running)
216 interface = context->interface;
227 context->timeout = 0;
228 context->routerAdvCount = 0;
231 interface->ipv6Context.isRouter =
TRUE;
234 if(context->curHopLimit != 0)
236 interface->ipv6Context.curHopLimit = context->curHopLimit;
240 if(context->reachableTime != 0)
242 interface->ndpContext.reachableTime = context->reachableTime;
246 if(context->retransTimer != 0)
248 interface->ndpContext.retransTimer = context->retransTimer;
252 context->running =
TRUE;
285 TRACE_INFO(
"Stopping Router Advertisement service...\r\n");
294 interface = context->interface;
305 interface->ipv6Context.curHopLimit = interface->ipv6Context.defaultHopLimit;
310 context->running =
FALSE;
342 interface = context->interface;
344 interface->ndpRouterAdvContext = NULL;
void netUnlock(NetContext *context)
Release exclusive access to the core of the TCP/IP stack.
error_t ndpSendRouterAdv(NdpRouterAdvContext *context, uint16_t routerLifetime)
Send a Router Advertisement message.
@ NDP_ROUTER_SEL_PREFERENCE_MEDIUM
void ndpRouterAdvGetDefaultSettings(NdpRouterAdvSettings *settings)
Initialize settings with default values.
uint32_t reachableTime
Value of the Reachable Time field.
uint8_t preference
Value of the Router Selection Preferences field.
bool_t homeAgentFlag
Mobile IPv6 Home Agent flag.
bool_t proxyFlag
Value of the Neighbor Discovery Proxy flag.
uint32_t linkMtu
Recommended MTU for the link (MTU option)
NdpRouterAdvRouteInfo * routeList
List of routes (RIO option)
Router advertisement service.
IPv6 multicast filtering.
#define NdpRouterAdvContext
@ ERROR_INVALID_PARAMETER
Invalid parameter.
uint16_t defaultLifetime
Value of the Router Lifetime field.
error_t ipv6JoinMulticastGroup(NetInterface *interface, const Ipv6Addr *groupAddr)
Join an IPv6 multicast group.
bool_t managedFlag
Managed Address Configuration flag.
#define NDP_RETRANS_TIMER
error_t ndpRouterAdvInit(NdpRouterAdvContext *context, const NdpRouterAdvSettings *settings)
RA service initialization.
NdpRouterAddOptionsCallback addOptionsCallback
Add Router Advertisement options callback.
NdpRouterAdvContextInfo * contextList
List of compression contexts (6CO option)
error_t ndpRouterAdvStart(NdpRouterAdvContext *context)
Start RA service.
uint32_t retransTimer
Value of the Retrans Timer field.
systime_t minRtrAdvInterval
Maximum time between unsolicited Router Advertisements.
uint8_t curHopLimit
Value of the Cur Hop Limit field.
const Ipv6Addr IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR
void ndpRouterAdvDeinit(NdpRouterAdvContext *context)
Release RA service.
bool_t otherConfigFlag
Other Configuration flag.
uint_t routeListLength
Number of routes in the list.
error_t ipv6LeaveMulticastGroup(NetInterface *interface, const Ipv6Addr *groupAddr)
Leave an IPv6 multicast group.
NetInterface * interface
Underlying network interface.
uint_t contextListLength
Number of compression contexts in the list.
#define NDP_REACHABLE_TIME
#define NDP_MAX_RTR_ADVERT_INTERVAL
error_t ndpRouterAdvStop(NdpRouterAdvContext *context)
Stop RA service.
void netLock(NetContext *context)
Get exclusive access to the core of the TCP/IP stack.
uint_t prefixListLength
Number of prefixes in the list.
systime_t maxRtrAdvInterval
Minimum time between unsolicited Router Advertisements.
Helper functions for router advertisement service.
#define osMemset(p, value, length)
NdpRouterAdvPrefixInfo * prefixList
List of prefixes (PIO option)
systime_t osGetSystemTime(void)
Retrieve system time.