mikroSDK Reference Manual
ndp_router_adv.h
Go to the documentation of this file.
1
31#ifndef _NDP_ROUTER_ADV_H
32#define _NDP_ROUTER_ADV_H
33
34//Dependencies
35#include "core/net.h"
36#include "ipv6/ipv6.h"
37
38//RA service support
39#ifndef NDP_ROUTER_ADV_SUPPORT
40 #define NDP_ROUTER_ADV_SUPPORT DISABLED
41#elif (NDP_ROUTER_ADV_SUPPORT != ENABLED && NDP_ROUTER_ADV_SUPPORT != DISABLED)
42 #error NDP_ROUTER_ADV_SUPPORT parameter is not valid
43#endif
44
45//RA service tick interval
46#ifndef NDP_ROUTER_ADV_TICK_INTERVAL
47 #define NDP_ROUTER_ADV_TICK_INTERVAL 100
48#elif (NDP_ROUTER_ADV_TICK_INTERVAL < 10)
49 #error NDP_ROUTER_ADV_TICK_INTERVAL parameter is not valid
50#endif
51
52//Application specific context
53#ifndef NDP_ROUTER_ADV_PRIVATE_CONTEXT
54 #define NDP_ROUTER_ADV_PRIVATE_CONTEXT
55#endif
56
57//Forward declaration of NdpRouterAdvContext structure
59#define NdpRouterAdvContext struct _NdpRouterAdvContext
60
61//C++ guard
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66
71typedef void (*NdpRouterAddOptionsCallback)(NdpRouterAdvContext *context,
72 NdpRouterAdvMessage *message, size_t *length);
73
74
79typedef struct
80{
81 Ipv6Addr prefix;
82 uint8_t length;
83 bool_t onLinkFlag;
84 bool_t autonomousFlag;
85 uint32_t validLifetime;
86 uint32_t preferredLifetime;
88
89
94typedef struct
95{
96 Ipv6Addr prefix;
97 uint8_t length;
98 uint8_t preference;
99 uint32_t routeLifetime;
101
102
107typedef struct
108{
109 uint8_t cid;
110 Ipv6Addr prefix;
111 uint8_t length;
112 bool_t compression;
113 uint16_t validLifetime;
115
116
144
145
159
160
161//Tick counter to handle periodic operations
162extern systime_t ndpRouterAdvTickCounter;
163
164//RA service related functions
165void ndpRouterAdvGetDefaultSettings(NdpRouterAdvSettings *settings);
166
167error_t ndpRouterAdvInit(NdpRouterAdvContext *context,
168 const NdpRouterAdvSettings *settings);
169
170error_t ndpRouterAdvStart(NdpRouterAdvContext *context);
171error_t ndpRouterAdvStop(NdpRouterAdvContext *context);
172
173//C++ guard
174#ifdef __cplusplus
175}
176#endif
177
178#endif
error_t
Error codes.
Definition error.h:43
IPv6 (Internet Protocol Version 6)
void(* NdpRouterAddOptionsCallback)(NdpRouterAdvContext *context, NdpRouterAdvMessage *message, size_t *length)
Add Router Advertisement options callback.
Definition ndp_router_adv.h:71
TCP/IP stack core.
uint32_t systime_t
System time.
Definition os_port_none.h:90
Context information for 6LoWPAN header compression.
Definition ndp_router_adv.h:108
IPv6 prefix information.
Definition ndp_router_adv.h:80
Route information.
Definition ndp_router_adv.h:95
RA service settings.
Definition ndp_router_adv.h:122
uint32_t retransTimer
Value of the Retrans Timer field.
Definition ndp_router_adv.h:134
NetInterface * interface
Underlying network interface.
Definition ndp_router_adv.h:123
NdpRouterAdvPrefixInfo * prefixList
List of prefixes (PIO option)
Definition ndp_router_adv.h:136
uint8_t preference
Value of the Router Selection Preferences field.
Definition ndp_router_adv.h:130
bool_t proxyFlag
Value of the Neighbor Discovery Proxy flag.
Definition ndp_router_adv.h:131
NdpRouterAdvRouteInfo * routeList
List of routes (RIO option)
Definition ndp_router_adv.h:138
bool_t otherConfigFlag
Other Configuration flag.
Definition ndp_router_adv.h:128
bool_t homeAgentFlag
Mobile IPv6 Home Agent flag.
Definition ndp_router_adv.h:129
uint32_t linkMtu
Recommended MTU for the link (MTU option)
Definition ndp_router_adv.h:135
uint8_t curHopLimit
Value of the Cur Hop Limit field.
Definition ndp_router_adv.h:126
bool_t managedFlag
Managed Address Configuration flag.
Definition ndp_router_adv.h:127
uint_t prefixListLength
Number of prefixes in the list.
Definition ndp_router_adv.h:137
uint32_t reachableTime
Value of the Reachable Time field.
Definition ndp_router_adv.h:133
uint_t routeListLength
Number of routes in the list.
Definition ndp_router_adv.h:139
uint_t contextListLength
Number of compression contexts in the list.
Definition ndp_router_adv.h:141
NdpRouterAddOptionsCallback addOptionsCallback
Add Router Advertisement options callback.
Definition ndp_router_adv.h:142
systime_t maxRtrAdvInterval
Minimum time between unsolicited Router Advertisements.
Definition ndp_router_adv.h:124
NdpRouterAdvContextInfo * contextList
List of compression contexts (6CO option)
Definition ndp_router_adv.h:140
systime_t minRtrAdvInterval
Maximum time between unsolicited Router Advertisements.
Definition ndp_router_adv.h:125
uint16_t defaultLifetime
Value of the Router Lifetime field.
Definition ndp_router_adv.h:132
RA service context.
Definition ndp_router_adv.h:151
systime_t timeout
Timeout value.
Definition ndp_router_adv.h:155
NdpRouterAdvSettings settings
RA service settings.
Definition ndp_router_adv.h:152
systime_t timestamp
Timestamp to manage retransmissions.
Definition ndp_router_adv.h:154
uint_t routerAdvCount
Router Advertisement message counter.
Definition ndp_router_adv.h:156
bool_t running
This flag tells whether the RA service is running.
Definition ndp_router_adv.h:153