Go to the documentation of this file.
39 #define NDP_SUPPORT ENABLED
40 #elif (NDP_SUPPORT != ENABLED && NDP_SUPPORT != DISABLED)
41 #error NDP_SUPPORT parameter is not valid
45 #ifndef NDP_TICK_INTERVAL
46 #define NDP_TICK_INTERVAL 200
47 #elif (NDP_TICK_INTERVAL < 10)
48 #error NDP_TICK_INTERVAL parameter is not valid
52 #ifndef NDP_NEIGHBOR_CACHE_SIZE
53 #define NDP_NEIGHBOR_CACHE_SIZE 8
54 #elif (NDP_NEIGHBOR_CACHE_SIZE < 1)
55 #error NDP_NEIGHBOR_CACHE_SIZE parameter is not valid
59 #ifndef NDP_DEST_CACHE_SIZE
60 #define NDP_DEST_CACHE_SIZE 8
61 #elif (NDP_DEST_CACHE_SIZE < 1)
62 #error NDP_DEST_CACHE_SIZE parameter is not valid
66 #ifndef NDP_MAX_PENDING_PACKETS
67 #define NDP_MAX_PENDING_PACKETS 2
68 #elif (NDP_MAX_PENDING_PACKETS < 1)
69 #error NDP_MAX_PENDING_PACKETS parameter is not valid
73 #ifndef NDP_MAX_RTR_ADVERT_INTERVAL
74 #define NDP_MAX_RTR_ADVERT_INTERVAL 600000
75 #elif (NDP_MAX_RTR_ADVERT_INTERVAL < 1000)
76 #error NDP_MAX_RTR_ADVERT_INTERVAL parameter is not valid
80 #ifndef NDP_MAX_INITIAL_RTR_ADVERT_INTERVAL
81 #define NDP_MAX_INITIAL_RTR_ADVERT_INTERVAL 16000
82 #elif (NDP_MAX_INITIAL_RTR_ADVERT_INTERVAL < 1000)
83 #error NDP_MAX_INITIAL_RTR_ADVERT_INTERVAL parameter is not valid
87 #ifndef NDP_MAX_INITIAL_RTR_ADVERTISEMENTS
88 #define NDP_MAX_INITIAL_RTR_ADVERTISEMENTS 3
89 #elif (NDP_MAX_INITIAL_RTR_ADVERTISEMENTS < 1)
90 #error NDP_MAX_INITIAL_RTR_ADVERTISEMENTS parameter is not valid
94 #ifndef NDP_MAX_FINAL_RTR_ADVERTISEMENTS
95 #define NDP_MAX_FINAL_RTR_ADVERTISEMENTS 3
96 #elif (NDP_MAX_FINAL_RTR_ADVERTISEMENTS < 1)
97 #error NDP_MAX_FINAL_RTR_ADVERTISEMENTS parameter is not valid
101 #ifndef NDP_MIN_DELAY_BETWEEN_RAS
102 #define NDP_MIN_DELAY_BETWEEN_RAS 3000
103 #elif (NDP_MIN_DELAY_BETWEEN_RAS < 1000)
104 #error NDP_MIN_DELAY_BETWEEN_RAS parameter is not valid
108 #ifndef NDP_MAX_RA_DELAY_TIME
109 #define NDP_MAX_RA_DELAY_TIME 500
110 #elif (NDP_MAX_RA_DELAY_TIME < 100)
111 #error NDP_MAX_RA_DELAY_TIME parameter is not valid
115 #ifndef NDP_MIN_RTR_SOLICITATION_DELAY
116 #define NDP_MIN_RTR_SOLICITATION_DELAY 0
117 #elif (NDP_MIN_RTR_SOLICITATION_DELAY < 0)
118 #error NDP_MIN_RTR_SOLICITATION_DELAY parameter is not valid
122 #ifndef NDP_MAX_RTR_SOLICITATION_DELAY
123 #define NDP_MAX_RTR_SOLICITATION_DELAY 1000
124 #elif (NDP_MAX_RTR_SOLICITATION_DELAY < 0)
125 #error NDP_MAX_RTR_SOLICITATION_DELAY parameter is not valid
129 #ifndef NDP_RTR_SOLICITATION_INTERVAL
130 #define NDP_RTR_SOLICITATION_INTERVAL 4000
131 #elif (NDP_RTR_SOLICITATION_INTERVAL < 1000)
132 #error NDP_RTR_SOLICITATION_INTERVAL parameter is not valid
136 #ifndef NDP_MAX_RTR_SOLICITATIONS
137 #define NDP_MAX_RTR_SOLICITATIONS 3
138 #elif (NDP_MAX_RTR_SOLICITATIONS < 1)
139 #error NDP_MAX_RTR_SOLICITATIONS parameter is not valid
143 #ifndef NDP_MAX_MULTICAST_SOLICIT
144 #define NDP_MAX_MULTICAST_SOLICIT 3
145 #elif (NDP_MAX_MULTICAST_SOLICIT < 1)
146 #error NDP_MAX_MULTICAST_SOLICIT parameter is not valid
150 #ifndef NDP_MAX_UNICAST_SOLICIT
151 #define NDP_MAX_UNICAST_SOLICIT 3
152 #elif (NDP_MAX_UNICAST_SOLICIT < 1)
153 #error NDP_MAX_UNICAST_SOLICIT parameter is not valid
157 #ifndef NDP_DUP_ADDR_DETECT_TRANSMITS
158 #define NDP_DUP_ADDR_DETECT_TRANSMITS 1
159 #elif (NDP_DUP_ADDR_DETECT_TRANSMITS < 0)
160 #error NDP_DUP_ADDR_DETECT_TRANSMITS parameter is not valid
164 #ifndef NDP_MAX_ANYCAST_DELAY_TIME
165 #define NDP_MAX_ANYCAST_DELAY_TIME 1000
166 #elif (NDP_MAX_ANYCAST_DELAY_TIME < 100)
167 #error NDP_MAX_ANYCAST_DELAY_TIME parameter is not valid
171 #ifndef NDP_MAX_NEIGHBOR_ADVERTISEMENT
172 #define NDP_MAX_NEIGHBOR_ADVERTISEMENT 3
173 #elif (NDP_MAX_NEIGHBOR_ADVERTISEMENT < 0)
174 #error NDP_MAX_NEIGHBOR_ADVERTISEMENT parameter is not valid
178 #ifndef NDP_REACHABLE_TIME
179 #define NDP_REACHABLE_TIME 30000
180 #elif (NDP_REACHABLE_TIME < 1000)
181 #error NDP_REACHABLE_TIME parameter is not valid
185 #ifndef NDP_RETRANS_TIMER
186 #define NDP_RETRANS_TIMER 1000
187 #elif (NDP_RETRANS_TIMER < 100)
188 #error NDP_RETRANS_TIMER parameter is not valid
192 #ifndef NDP_DELAY_FIRST_PROBE_TIME
193 #define NDP_DELAY_FIRST_PROBE_TIME 5000
194 #elif (NDP_DELAY_FIRST_PROBE_TIME < 1000)
195 #error NDP_DELAY_FIRST_PROBE_TIME parameter is not valid
199 #define NDP_HOP_LIMIT 255
202 #define NDP_INFINITE_LIFETIME 0xFFFFFFFF
260 #if defined(__CCRX__)
262 #elif defined(__CWCC__) || defined(_WIN32)
263 #pragma pack(push, 1)
291 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
337 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
403 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
457 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
508 #if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
524 #if defined(__CCRX__)
526 #elif defined(__CWCC__) || defined(_WIN32)
NdpRouterSelPreference
Router selection preferences.
@ NDP_ROUTER_SEL_PREFERENCE_MEDIUM
typedef __packed_struct
Router Solicitation message.
void ndpProcessRouterAdv(NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary)
Router Advertisement message processing.
error_t ndpSendNeighborSol(NetInterface *interface, const Ipv6Addr *targetIpAddr, bool_t multicast)
Send a Neighbor Solicitation message.
#define NDP_MAX_PENDING_PACKETS
void ndpLinkChangeEvent(NetInterface *interface)
Callback function for link change event.
error_t ndpEnqueuePacket(NetInterface *srcInterface, NetInterface *destInterface, const Ipv6Addr *ipAddr, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Enqueue an IPv6 packet waiting for address resolution.
Structure describing a buffer that spans multiple chunks.
@ NDP_ROUTER_SEL_PREFERENCE_LOW
uint32_t reachableTime
The time a node assumes a neighbor is reachable.
NetTxAncillary ancillary
Additional options.
bool_t rtrAdvReceived
Valid RA message received.
#define NDP_NEIGHBOR_CACHE_SIZE
@ NDP_OPT_SOURCE_LINK_LAYER_ADDR
void ndpDumpRouterSolMessage(const NdpRouterSolMessage *message)
Dump Router Solicitation message for debugging purpose.
systime_t rtrSolicitationInterval
Time interval between retransmissions of RS messages.
uint_t queueSize
Number of queued packets.
systime_t minRtrSolicitationDelay
Minimum delay before transmitting the first RS message.
void ndpDumpRouterAdvMessage(const NdpRouterAdvMessage *message)
Dump Router Advertisement message for debugging purpose.
Ipv6Addr destAddr
Destination IPv6 address.
error_t ndpInit(NetInterface *interface)
Neighbor cache initialization.
size_t offset
Offset to the first byte of the packet.
error_t ndpRemoveStaticEntry(NetInterface *interface, const Ipv6Addr *ipAddr)
Remove a static entry from the Neighbor cache.
@ NDP_OPT_RECURSIVE_DNS_SERVER
systime_t timestamp
Timestamp to manage entry lifetime.
@ NDP_OPT_TARGET_LINK_LAYER_ADDR
uint_t dupAddrDetectTransmits
Maximum number of NS messages sent while performing DAD.
void ndpDumpNeighborSolMessage(const NdpNeighborSolMessage *message)
Dump Neighbor Solicitation message for debugging purpose.
error_t ndpSendRedirect(NetInterface *interface, const Ipv6Addr *targetAddr, const NetBuffer *ipPacket, size_t ipPacketOffset)
Send a Redirect message.
MacAddr macAddr
Link layer address associated with the IPv6 address.
systime_t timestamp
Timestamp to manage entry lifetime.
systime_t timestamp
Timestamp to manage retransmissions.
@ NDP_OPT_DNS_SEARCH_LIST
void ndpProcessRedirect(NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary)
Redirect message processing.
bool_t enable
Enable address resolution using Neighbor Discovery protocol.
NdpState
Neighbor cache entry states.
uint_t maxRtrSolicitations
Number of retransmissions for RS messages.
void ndpProcessNeighborSol(NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary)
Neighbor Solicitation message processing.
#define NDP_DEST_CACHE_SIZE
NdpRedirectedHeaderOption
uint32_t systime_t
System time.
uint32_t retransTimer
The time between retransmissions of NS messages.
Ipv6Addr ipAddr
Unicast IPv6 address.
NetInterface * srcInterface
Interface from which the packet has been received.
@ NDP_ROUTER_SEL_PREFERENCE_HIGH
systime_t maxRtrSolicitationDelay
Maximum delay before transmitting the first RS message.
error_t ndpResolve(NetInterface *interface, const Ipv6Addr *ipAddr, MacAddr *macAddr)
Address resolution using Neighbor Discovery protocol.
@ NDP_OPT_ROUTE_INFORMATION
NdpState state
Reachability state.
@ NDP_OPT_REDIRECTED_HEADER
@ NDP_OPT_PREFIX_INFORMATION
error_t ndpAddStaticEntry(NetInterface *interface, const Ipv6Addr *ipAddr, const MacAddr *macAddr)
Add a static entry in the Neighbor cache.
void ndpProcessNeighborAdv(NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary)
Neighbor Advertisement message processing.
uint_t retransmitCount
Retransmission counter.
void ndpDumpRedirectMessage(const NdpRedirectMessage *message)
Dump Redirect message for debugging purpose.
NetBuffer * buffer
Packet waiting for address resolution.
NdpOptionType
Neighbor Discovery options.
systime_t timeout
Timeout value.
uint32_t preferredLifetime
void ndpDumpNeighborAdvMessage(const NdpNeighborAdvMessage *message)
Dump Neighbor Advertisement message for debugging purpose.
uint_t rtrSolicitationCount
Retransmission counter for RS messages.
error_t ndpEnable(NetInterface *interface, bool_t enable)
Enable address resolution using Neighbor Discovery protocol.
void ndpTick(NetInterface *interface)
NDP timer handler.
error_t ndpSendNeighborAdv(NetInterface *interface, const Ipv6Addr *targetIpAddr, const Ipv6Addr *destIpAddr)
Send a Neighbor Advertisement message.
error_t ndpSendRouterSol(NetInterface *interface)
Send a Router Solicitation message.
@ NDP_OPT_6LOWPAN_CONTEXT
systime_t timeout
Timeout value.
bool_t isRouter
A flag indicating whether the neighbor is a router or a host.
Ipv6Addr nextHop
IPv6 address of the next-hop neighbor.
@ NDP_ROUTER_SEL_PREFERENCE_RESERVED