Go to the documentation of this file.
32 #define TRACE_LEVEL NDP_TRACE_LEVEL
41 #if (IPV6_SUPPORT == ENABLED && NDP_ROUTER_ADV_SUPPORT == ENABLED)
134 TRACE_INFO(
"Initializing Router Advertisement service...\r\n");
137 if(!context || !settings)
148 interface = settings->interface;
153 context->settings = *settings;
156 context->running =
FALSE;
158 interface->ndpRouterAdvContext = context;
184 TRACE_INFO(
"Starting Router Advertisement service...\r\n");
190 if(!context->running)
193 interface = context->settings.interface;
204 context->timeout = 0;
205 context->routerAdvCount = 0;
208 interface->ipv6Context.isRouter =
TRUE;
211 if(context->settings.curHopLimit != 0)
213 interface->ipv6Context.curHopLimit = context->settings.curHopLimit;
217 if(context->settings.reachableTime != 0)
219 interface->ndpContext.reachableTime = context->settings.reachableTime;
223 if(context->settings.retransTimer != 0)
225 interface->ndpContext.retransTimer = context->settings.retransTimer;
229 context->running =
TRUE;
262 TRACE_INFO(
"Stopping Router Advertisement service...\r\n");
271 interface = context->settings.interface;
282 interface->ipv6Context.curHopLimit = interface->ipv6Context.defaultHopLimit;
287 context->running =
FALSE;
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.
#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.
NetInterface * netGetDefaultInterface(void)
Get default network interface.
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 osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
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.
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.