Contiki-NG
uip-nd6.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006, Swedish Institute of Computer Science.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  *
31  */
32 
33 /**
34  * \addtogroup uip
35  * @{
36  */
37 
38 /**
39  * \file
40  * Header file for IPv6 Neighbor discovery (RFC 4861)
41  * \author Julien Abeille <jabeille@cisco.com>
42  * \author Mathilde Durvy <mdurvy@cisco.com>
43  */
44 
45 #ifndef UIP_ND6_H_
46 #define UIP_ND6_H_
47 
48 #include "net/ipv6/uip.h"
49 #include "sys/stimer.h"
50 /**
51  * \name General
52  * @{
53  */
54 /** \brief HOP LIMIT to be used when sending ND messages (255) */
55 #define UIP_ND6_HOP_LIMIT 255
56 /** \brief INFINITE lifetime */
57 #define UIP_ND6_INFINITE_LIFETIME 0xFFFFFFFF
58 /** @} */
59 
60 /** \name RFC 4861 Host constant */
61 /** @{ */
62 /** \brief Maximum router solicitation delay */
63 #ifndef UIP_CONF_ND6_MAX_RTR_SOLICITATION_DELAY
64 #define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1
65 #else
66 #define UIP_ND6_MAX_RTR_SOLICITATION_DELAY UIP_CONF_ND6_MAX_RTR_SOLICITATION_DELAY
67 #endif
68 /** \brief Router solicitation interval */
69 #ifndef UIP_CONF_ND6_RTR_SOLICITATION_INTERVAL
70 #define UIP_ND6_RTR_SOLICITATION_INTERVAL 4
71 #else
72 #define UIP_ND6_RTR_SOLICITATION_INTERVAL UIP_CONF_ND6_RTR_SOLICITATION_INTERVAL
73 #endif
74 /** \brief Maximum router solicitations */
75 #ifndef UIP_CONF_ND6_MAX_RTR_SOLICITATIONS
76 #define UIP_ND6_MAX_RTR_SOLICITATIONS 3
77 #else
78 #define UIP_ND6_MAX_RTR_SOLICITATIONS UIP_CONF_ND6_MAX_RTR_SOLICITATIONS
79 #endif
80 /** @} */
81 
82 /** \name RFC 4861 Router constants */
83 /** @{ */
84 #ifndef UIP_CONF_ND6_SEND_RA
85 #define UIP_ND6_SEND_RA 1 /* enable/disable RA sending */
86 #else
87 #define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
88 #endif
89 #ifndef UIP_CONF_ND6_SEND_NS
90 #define UIP_ND6_SEND_NS 1 /* enable/disable NS sending */
91 #else
92 #define UIP_ND6_SEND_NS UIP_CONF_ND6_SEND_NS
93 #endif
94 #ifndef UIP_CONF_ND6_SEND_NA
95 #define UIP_ND6_SEND_NA 1 /* enable/disable NA sending */
96 #else
97 #define UIP_ND6_SEND_NA UIP_CONF_ND6_SEND_NA
98 #endif
99 #ifndef UIP_CONF_ND6_AUTOFILL_NBR_CACHE
100 /* Neighbor not found in cache? Derive its link-layer address from it's
101 link-local IPv6, assuming it used autoconfiguration. This is not
102 standard-compliant but this is a convenient way to keep the
103 neighbor cache out of the way in cases ND is not used.
104 Note that this is not standard-compliant (RFC 4861), as neighbors will
105 be added regardless of their reachability and liveness. */
106 #define UIP_ND6_AUTOFILL_NBR_CACHE 0
107 #else
108 #define UIP_ND6_AUTOFILL_NBR_CACHE UIP_CONF_ND6_AUTOFILL_NBR_CACHE
109 #endif
110 #ifndef UIP_CONF_ND6_MAX_RA_INTERVAL
111 #define UIP_ND6_MAX_RA_INTERVAL 600
112 #else
113 #define UIP_ND6_MAX_RA_INTERVAL UIP_CONF_ND6_MAX_RA_INTERVAL
114 #endif
115 #ifndef UIP_CONF_ND6_MIN_RA_INTERVAL
116 #define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3)
117 #else
118 #define UIP_ND6_MIN_RA_INTERVAL UIP_CONF_ND6_MIN_RA_INTERVAL
119 #endif
120 #define UIP_ND6_M_FLAG 0
121 #define UIP_ND6_O_FLAG 0
122 #ifndef UIP_CONF_ROUTER_LIFETIME
123 #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL
124 #else
125 #define UIP_ND6_ROUTER_LIFETIME UIP_CONF_ROUTER_LIFETIME
126 #endif
127 
128 #define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/
129 #define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/
130 #ifndef UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS
131 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/
132 #else
133 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS
134 #endif
135 //#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/
136 #define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/
137 /** @} */
138 
139 #ifndef UIP_CONF_ND6_DEF_MAXDADNS
140 /** \brief Do not try DAD when using EUI-64 as allowed by draft-ietf-6lowpan-nd-15 section 8.2 */
141 #if UIP_CONF_LL_802154
142 #define UIP_ND6_DEF_MAXDADNS 0
143 #else /* UIP_CONF_LL_802154 */
144 #define UIP_ND6_DEF_MAXDADNS UIP_ND6_SEND_NS
145 #endif /* UIP_CONF_LL_802154 */
146 #else /* UIP_CONF_ND6_DEF_MAXDADNS */
147 #define UIP_ND6_DEF_MAXDADNS UIP_CONF_ND6_DEF_MAXDADNS
148 #endif /* UIP_CONF_ND6_DEF_MAXDADNS */
149 
150 /** \name RFC 4861 Node constant */
151 #define UIP_ND6_MAX_MULTICAST_SOLICIT 3
152 
153 #ifdef UIP_CONF_ND6_MAX_UNICAST_SOLICIT
154 #define UIP_ND6_MAX_UNICAST_SOLICIT UIP_CONF_ND6_MAX_UNICAST_SOLICIT
155 #else /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
156 #define UIP_ND6_MAX_UNICAST_SOLICIT 3
157 #endif /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
158 
159 #ifdef UIP_CONF_ND6_REACHABLE_TIME
160 #define UIP_ND6_REACHABLE_TIME UIP_CONF_ND6_REACHABLE_TIME
161 #else
162 #define UIP_ND6_REACHABLE_TIME 60000
163 #endif
164 
165 #ifdef UIP_CONF_ND6_RETRANS_TIMER
166 #define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER
167 #else
168 #define UIP_ND6_RETRANS_TIMER 1000
169 #endif
170 
171 #define UIP_ND6_DELAY_FIRST_PROBE_TIME 5
172 #define UIP_ND6_MIN_RANDOM_FACTOR(x) (x / 2)
173 #define UIP_ND6_MAX_RANDOM_FACTOR(x) ((x) + (x) / 2)
174 /** @} */
175 
176 
177 /** \name RFC 6106 RA DNS Options Constants */
178 /** @{ */
179 #ifndef UIP_CONF_ND6_RA_RDNSS
180 #define UIP_ND6_RA_RDNSS 0
181 #else
182 #define UIP_ND6_RA_RDNSS UIP_CONF_ND6_RA_RDNSS
183 #endif
184 
185 #ifndef UIP_CONF_ND6_RA_DNSSL
186 #define UIP_ND6_RA_DNSSL 0
187 #else
188 #error Not implemented
189 #define UIP_ND6_RA_DNSSL UIP_CONF_ND6_RA_DNSSL
190 #endif
191 /** @} */
192 
193 
194 /** \name ND6 option types */
195 /** @{ */
196 #define UIP_ND6_OPT_SLLAO 1
197 #define UIP_ND6_OPT_TLLAO 2
198 #define UIP_ND6_OPT_PREFIX_INFO 3
199 #define UIP_ND6_OPT_REDIRECTED_HDR 4
200 #define UIP_ND6_OPT_MTU 5
201 #define UIP_ND6_OPT_RDNSS 25
202 #define UIP_ND6_OPT_DNSSL 31
203 /** @} */
204 
205 /** \name ND6 option types */
206 /** @{ */
207 #define UIP_ND6_OPT_TYPE_OFFSET 0
208 #define UIP_ND6_OPT_LEN_OFFSET 1
209 #define UIP_ND6_OPT_DATA_OFFSET 2
210 
211 /** \name ND6 message length (excluding options) */
212 /** @{ */
213 #define UIP_ND6_NA_LEN 20
214 #define UIP_ND6_NS_LEN 20
215 #define UIP_ND6_RA_LEN 12
216 #define UIP_ND6_RS_LEN 4
217 /** @} */
218 
219 
220 /** \name ND6 option length in bytes */
221 /** @{ */
222 #define UIP_ND6_OPT_HDR_LEN 2
223 #define UIP_ND6_OPT_PREFIX_INFO_LEN 32
224 #define UIP_ND6_OPT_MTU_LEN 8
225 #define UIP_ND6_OPT_RDNSS_LEN 1
226 #define UIP_ND6_OPT_DNSSL_LEN 1
227 
228 
229 /* Length of TLLAO and SLLAO options, it is L2 dependant */
230 #if UIP_CONF_LL_802154
231 /* If the interface is 802.15.4. For now we use only long addresses */
232 #define UIP_ND6_OPT_SHORT_LLAO_LEN 8
233 #define UIP_ND6_OPT_LONG_LLAO_LEN 16
234 /** \brief length of a ND6 LLAO option for 802.15.4 */
235 #define UIP_ND6_OPT_LLAO_LEN UIP_ND6_OPT_LONG_LLAO_LEN
236 #else /*UIP_CONF_LL_802154*/
237 #if UIP_CONF_LL_80211
238 /* If the interface is 802.11 */
239 /** \brief length of a ND6 LLAO option for 802.11 */
240 #define UIP_ND6_OPT_LLAO_LEN 8
241 #else /*UIP_CONF_LL_80211*/
242 /** \brief length of a ND6 LLAO option for default L2 type (e.g. Ethernet) */
243 #define UIP_ND6_OPT_LLAO_LEN 8
244 #endif /*UIP_CONF_LL_80211*/
245 #endif /*UIP_CONF_LL_802154*/
246 /** @} */
247 
248 
249 /** \name Neighbor Advertisement flags masks */
250 /** @{ */
251 #define UIP_ND6_NA_FLAG_ROUTER 0x80
252 #define UIP_ND6_NA_FLAG_SOLICITED 0x40
253 #define UIP_ND6_NA_FLAG_OVERRIDE 0x20
254 #define UIP_ND6_RA_FLAG_ONLINK 0x80
255 #define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40
256 /** @} */
257 
258 /**
259  * \name ND message structures
260  * @{
261  */
262 
263 /**
264  * \brief A neighbor solicitation constant part
265  *
266  * Possible option is: SLLAO
267  */
268 typedef struct uip_nd6_ns {
269  uint32_t reserved;
270  uip_ipaddr_t tgtipaddr;
271 } uip_nd6_ns;
272 
273 /**
274  * \brief A neighbor advertisement constant part.
275  *
276  * Possible option is: TLLAO
277  */
278 typedef struct uip_nd6_na {
279  uint8_t flagsreserved;
280  uint8_t reserved[3];
281  uip_ipaddr_t tgtipaddr;
282 } uip_nd6_na;
283 
284 /**
285  * \brief A router solicitation constant part
286  *
287  * Possible option is: SLLAO
288  */
289 typedef struct uip_nd6_rs {
290  uint32_t reserved;
291 } uip_nd6_rs;
292 
293 /**
294  * \brief A router advertisement constant part
295  *
296  * Possible options are: SLLAO, MTU, Prefix Information
297  */
298 typedef struct uip_nd6_ra {
299  uint8_t cur_ttl;
300  uint8_t flags_reserved;
301  uint16_t router_lifetime;
302  uint32_t reachable_time;
303  uint32_t retrans_timer;
304 } uip_nd6_ra;
305 
306 /**
307  * \brief A redirect message constant part
308  *
309  * Possible options are: TLLAO, redirected header
310  */
311 typedef struct uip_nd6_redirect {
312  uint32_t reserved;
313  uip_ipaddr_t tgtipaddress;
314  uip_ipaddr_t destipaddress;
316 /** @} */
317 
318 /**
319  * \name ND Option structures
320  * @{
321  */
322 
323 /** \brief ND option header */
324 typedef struct uip_nd6_opt_hdr {
325  uint8_t type;
326  uint8_t len;
328 
329 /** \brief ND option prefix information */
330 typedef struct uip_nd6_opt_prefix_info {
331  uint8_t type;
332  uint8_t len;
333  uint8_t preflen;
334  uint8_t flagsreserved1;
335  uint32_t validlt;
336  uint32_t preferredlt;
337  uint32_t reserved2;
338  uip_ipaddr_t prefix;
340 
341 /** \brief ND option MTU */
342 typedef struct uip_nd6_opt_mtu {
343  uint8_t type;
344  uint8_t len;
345  uint16_t reserved;
346  uint32_t mtu;
348 
349 /** \brief ND option RDNSS */
350 typedef struct uip_nd6_opt_dns {
351  uint8_t type;
352  uint8_t len;
353  uint16_t reserved;
354  uint32_t lifetime;
355  uip_ipaddr_t ip;
357 
358 /** \struct Redirected header option */
359 typedef struct uip_nd6_opt_redirected_hdr {
360  uint8_t type;
361  uint8_t len;
362  uint8_t reserved[6];
363 } uip_nd6_opt_redirected_hdr;
364 /** @} */
365 
366 /**
367  * \name ND Messages Processing and Generation
368  * @{
369  */
370  /**
371  * \brief Send a neighbor solicitation, send a Neighbor Advertisement
372  * \param src pointer to the src of the NS if known
373  * \param dest pointer to ip address to send the NS, for DAD or ADDR Resol,
374  * MUST be NULL, for NUD, must be correct unicast dest
375  * \param tgt pointer to ip address to fill the target address field, must
376  * not be NULL
377  *
378  * - RFC 4861, 7.2.2 :
379  * "If the source address of the packet prompting the solicitation is the
380  * same as one of the addresses assigned to the outgoing interface, that
381  * address SHOULD be placed in the IP Source Address of the outgoing
382  * solicitation. Otherwise, any one of the addresses assigned to the
383  * interface should be used."
384  * This is why we have a src ip address as argument. If NULL, we will do
385  * src address selection, otherwise we use the argument.
386  *
387  * - we check if it is a NS for Address resolution or NUD, if yes we include
388  * a SLLAO option, otherwise no.
389  */
390 void
391 uip_nd6_ns_output(uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt);
392 
393 #if UIP_CONF_ROUTER
394 #if UIP_ND6_SEND_RA
395 /**
396  * \brief send a Router Advertisement
397  *
398  * Only for router, for periodic as well as sollicited RA
399  */
400 void uip_nd6_ra_output(uip_ipaddr_t *dest);
401 #endif /* UIP_ND6_SEND_RA */
402 #endif /*UIP_CONF_ROUTER*/
403 
404 /**
405  * \brief Send a Router Solicitation
406  *
407  * src is chosen through the uip_netif_select_src function. If src is
408  * unspecified (i.e. we do not have a preferred address yet), then we do not
409  * put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.
410  *
411  * RS message format,
412  * possible option is SLLAO, MUST NOT be included if source = unspecified
413  * SHOULD be included otherwise
414  */
415 void uip_nd6_rs_output(void);
416 
417 /**
418  * \brief Initialise the uIP ND core
419  */
420 void uip_nd6_init(void);
421 /** @} */
422 
423 
424 void
425 uip_appserver_addr_get(uip_ipaddr_t *ipaddr);
426 /*--------------------------------------*/
427 /******* ANNEX - message formats ********/
428 /*--------------------------------------*/
429 
430 /*
431  * RS format. possible option is SLLAO
432  * 0 1 2 3
433  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
434  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
435  * | Type | Code | Checksum |
436  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
437  * | Reserved |
438  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
439  * | Options ...
440  * +-+-+-+-+-+-+-+-+-+-+-+-
441  *
442  *
443  * RA format. possible options: prefix information, MTU, SLLAO
444  * 0 1 2 3
445  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
446  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
447  * | Type | Code | Checksum |
448  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
449  * | Cur Hop Limit |M|O| Reserved | Router Lifetime |
450  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
451  * | Reachable Time |
452  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
453  * | Retrans Timer |
454  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
455  * | Options ...
456  * +-+-+-+-+-+-+-+-+-+-+-+-
457  *
458  *
459  * NS format: options should be SLLAO
460  * 0 1 2 3
461  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
462  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
463  * | Type | Code | Checksum |
464  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
465  * | Reserved |
466  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
467  * | |
468  * + +
469  * | |
470  * + Target Address +
471  * | |
472  * + +
473  * | |
474  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
475  * | Options ...
476  * +-+-+-+-+-+-+-+-+-+-+-+-
477  *
478  *
479  * NA message format. possible options is TLLAO
480  *
481  * 0 1 2 3
482  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
483  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
484  * | Type | Code | Checksum |
485  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
486  * |R|S|O| Reserved |
487  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
488  * | |
489  * + +
490  * | |
491  * + Target Address +
492  * | |
493  * + +
494  * | |
495  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
496  * | Options ...
497  * +-+-+-+-+-+-+-+-+-+-+-+-
498  *
499  *
500  * Redirect message format. Possible options are TLLAO and Redirected header
501  *
502  * 0 1 2 3
503  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
504  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
505  * | Type | Code | Checksum |
506  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
507  * | Reserved |
508  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
509  * | |
510  * + +
511  * | |
512  * + Target Address +
513  * | |
514  * + +
515  * | |
516  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
517  * | |
518  * + +
519  * | |
520  * + Destination Address +
521  * | |
522  * + +
523  * | |
524  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
525  * | Options ...
526  * +-+-+-+-+-+-+-+-+-+-+-+-
527  *
528  *
529  * SLLAO/TLLAO option:
530  * 0 1 2 3
531  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
532  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
533  * | Type | Length | Link-Layer Address ...
534  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
535  *
536  *
537  * Prefix information option
538  * 0 1 2 3
539  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
540  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
541  * | Type | Length | Prefix Length |L|A| Reserved1 |
542  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
543  * | Valid Lifetime |
544  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
545  * | Preferred Lifetime |
546  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
547  * | Reserved2 |
548  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
549  * | |
550  * + +
551  * | |
552  * + Prefix +
553  * | |
554  * + +
555  * | |
556  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
557  *
558  *
559  * MTU option
560  * 0 1 2 3
561  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
562  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
563  * | Type | Length | Reserved |
564  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
565  * | MTU |
566  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
567  *
568  *
569  * Redirected header option
570  *
571  * 0 1 2 3
572  * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
573  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574  * | Type | Length | Reserved |
575  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
576  * | Reserved |
577  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
578  * | |
579  * ~ IP header + data ~
580  * | |
581  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
582  *
583  */
584 #endif /* UIP_ND6_H_ */
585 
586 /** @} */
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Definition: uip-nd6.c:116
ND option MTU.
Definition: uip-nd6.h:342
ND option RDNSS.
Definition: uip-nd6.h:350
struct uip_nd6_opt_mtu uip_nd6_opt_mtu
ND option MTU.
void uip_nd6_init(void)
Initialise the uIP ND core.
Definition: uip-nd6.c:1105
struct uip_nd6_opt_prefix_info uip_nd6_opt_prefix_info
ND option prefix information.
struct uip_nd6_redirect uip_nd6_redirect
A redirect message constant part.
struct uip_nd6_opt_dns uip_nd6_opt_dns
ND option RDNSS.
A neighbor solicitation constant part.
Definition: uip-nd6.h:268
struct uip_nd6_rs uip_nd6_rs
A router solicitation constant part.
ND option header.
Definition: uip-nd6.h:324
void uip_nd6_ns_output(uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt)
Send a neighbor solicitation, send a Neighbor Advertisement.
struct uip_nd6_opt_hdr uip_nd6_opt_hdr
ND option header.
A router solicitation constant part.
Definition: uip-nd6.h:289
struct uip_nd6_na uip_nd6_na
A neighbor advertisement constant part.
Second timer library header file.
ND option prefix information.
Definition: uip-nd6.h:330
Header file for the uIP TCP/IP stack.
struct uip_nd6_ns uip_nd6_ns
A neighbor solicitation constant part.
A neighbor advertisement constant part.
Definition: uip-nd6.h:278
A redirect message constant part.
Definition: uip-nd6.h:311
struct uip_nd6_ra uip_nd6_ra
A router advertisement constant part.
void uip_nd6_rs_output(void)
Send a Router Solicitation.
Definition: uip-nd6.c:807
A router advertisement constant part.
Definition: uip-nd6.h:298