Contiki-Inga 3.x
uip-nd6.h
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 uip6
35  * @{
36  */
37 
38 /**
39  * \file Neighbor discovery (RFC 4861)
40  *
41  * \author Julien Abeille <jabeille@cisco.com>
42  * \author Mathilde Durvy <mdurvy@cisco.com>
43  */
44 
45 /**
46  * \defgroup uip_nd6 Neighbor discovery (RFC 4861)
47  *
48  * \author Julien Abeille <jabeille@cisco.com>
49  * \author Mathilde Durvy <mdurvy@cisco.com>
50  * @{ */
51 
52 #ifndef UIP_ND6_H_
53 #define UIP_ND6_H_
54 
55 #include "net/ip/uip.h"
56 #include "sys/stimer.h"
57 /**
58  * \name General
59  * @{
60  */
61 /** \brief HOP LIMIT to be used when sending ND messages (255) */
62 #define UIP_ND6_HOP_LIMIT 255
63 /** \brief INFINITE lifetime */
64 #define UIP_ND6_INFINITE_LIFETIME 0xFFFFFFFF
65 /** @} */
66 
67 /** \name RFC 4861 Host constant */
68 /** @{ */
69 #define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1
70 #define UIP_ND6_RTR_SOLICITATION_INTERVAL 4
71 #define UIP_ND6_MAX_RTR_SOLICITATIONS 3
72 /** @} */
73 
74 /** \name RFC 4861 Router constants */
75 /** @{ */
76 #ifndef UIP_CONF_ND6_SEND_RA
77 #define UIP_ND6_SEND_RA 1 /* enable/disable RA sending */
78 #else
79 #define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
80 #endif
81 #ifndef UIP_CONF_ND6_SEND_NA
82 #define UIP_ND6_SEND_NA 1 /* enable/disable NA sending */
83 #else
84 #define UIP_ND6_SEND_NA UIP_CONF_ND6_SEND_NA
85 #endif
86 #define UIP_ND6_MAX_RA_INTERVAL 600
87 #define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3)
88 #define UIP_ND6_M_FLAG 0
89 #define UIP_ND6_O_FLAG 0
90 #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL
91 
92 #define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/
93 #define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/
94 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/
95 //#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/
96 #define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/
97 /** @} */
98 
99 #ifndef UIP_CONF_ND6_DEF_MAXDADNS
100 /** \brief Do not try DAD when using EUI-64 as allowed by draft-ietf-6lowpan-nd-15 section 8.2 */
101 #if UIP_CONF_LL_802154
102 #define UIP_ND6_DEF_MAXDADNS 0
103 #else /* UIP_CONF_LL_802154 */
104 #define UIP_ND6_DEF_MAXDADNS UIP_ND6_SEND_NA
105 #endif /* UIP_CONF_LL_802154 */
106 #else /* UIP_CONF_ND6_DEF_MAXDADNS */
107 #define UIP_ND6_DEF_MAXDADNS UIP_CONF_ND6_DEF_MAXDADNS
108 #endif /* UIP_CONF_ND6_DEF_MAXDADNS */
109 
110 /** \name RFC 4861 Node constant
111  * @{ */
112 #define UIP_ND6_MAX_MULTICAST_SOLICIT 3
113 
114 #ifdef UIP_CONF_ND6_MAX_UNICAST_SOLICIT
115 #define UIP_ND6_MAX_UNICAST_SOLICIT UIP_CONF_ND6_MAX_UNICAST_SOLICIT
116 #else /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
117 #define UIP_ND6_MAX_UNICAST_SOLICIT 3
118 #endif /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
119 
120 #ifdef UIP_CONF_ND6_REACHABLE_TIME
121 #define UIP_ND6_REACHABLE_TIME UIP_CONF_ND6_REACHABLE_TIME
122 #else
123 #define UIP_ND6_REACHABLE_TIME 30000
124 #endif
125 
126 #ifdef UIP_CONF_ND6_RETRANS_TIMER
127 #define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER
128 #else
129 #define UIP_ND6_RETRANS_TIMER 1000
130 #endif
131 
132 #define UIP_ND6_DELAY_FIRST_PROBE_TIME 5
133 #define UIP_ND6_MIN_RANDOM_FACTOR(x) (x / 2)
134 #define UIP_ND6_MAX_RANDOM_FACTOR(x) ((x) + (x) / 2)
135 /** @} */
136 
137 
138 /** \name ND6 option types */
139 /** @{ */
140 /** Source Link-Layer Address Option */
141 #define UIP_ND6_OPT_SLLAO 1
142 /** Target Link-Layer Address Option */
143 #define UIP_ND6_OPT_TLLAO 2
144 #define UIP_ND6_OPT_PREFIX_INFO 3
145 #define UIP_ND6_OPT_REDIRECTED_HDR 4
146 #define UIP_ND6_OPT_MTU 5
147 /** @} */
148 
149 /** \name ND6 option types */
150 /** @{ */
151 #define UIP_ND6_OPT_TYPE_OFFSET 0
152 #define UIP_ND6_OPT_LEN_OFFSET 1
153 #define UIP_ND6_OPT_DATA_OFFSET 2
154 /** @} */
155 
156 /** \name ND6 message length (excluding options) */
157 /** @{ */
158 #define UIP_ND6_NA_LEN 20
159 #define UIP_ND6_NS_LEN 20
160 #define UIP_ND6_RA_LEN 12
161 #define UIP_ND6_RS_LEN 4
162 /** @} */
163 
164 
165 /** \name ND6 option length in bytes */
166 /** @{ */
167 #define UIP_ND6_OPT_HDR_LEN 2
168 #define UIP_ND6_OPT_PREFIX_INFO_LEN 32
169 #define UIP_ND6_OPT_MTU_LEN 8
170 
171 
172 /* Length of TLLAO and SLLAO options, it is L2 dependant */
173 #if UIP_CONF_LL_802154
174 /* If the interface is 802.15.4. For now we use only long addresses */
175 #define UIP_ND6_OPT_SHORT_LLAO_LEN 8
176 #define UIP_ND6_OPT_LONG_LLAO_LEN 16
177 /** \brief length of a ND6 LLAO option for 802.15.4 */
178 #define UIP_ND6_OPT_LLAO_LEN UIP_ND6_OPT_LONG_LLAO_LEN
179 #else /*UIP_CONF_LL_802154*/
180 #if UIP_CONF_LL_80211
181 /* If the interface is 802.11 */
182 /** \brief length of a ND6 LLAO option for 802.11 */
183 #define UIP_ND6_OPT_LLAO_LEN 8
184 #else /*UIP_CONF_LL_80211*/
185 /** \brief length of a ND6 LLAO option for default L2 type (e.g. Ethernet) */
186 #define UIP_ND6_OPT_LLAO_LEN 8
187 #endif /*UIP_CONF_LL_80211*/
188 #endif /*UIP_CONF_LL_802154*/
189 /** @} */
190 
191 
192 /** \name Neighbor Advertisement flags masks */
193 /** @{ */
194 #define UIP_ND6_NA_FLAG_ROUTER 0x80
195 #define UIP_ND6_NA_FLAG_SOLICITED 0x40
196 #define UIP_ND6_NA_FLAG_OVERRIDE 0x20
197 #define UIP_ND6_RA_FLAG_ONLINK 0x80
198 #define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40
199 /** @} */
200 
201 /**
202  * \name ND message structures
203  * @{
204  */
205 
206 /**
207  * \brief A neighbor solicitation constant part
208  *
209  * Possible option is: SLLAO
210  */
211 typedef struct uip_nd6_ns {
212  uint32_t reserved;
213  uip_ipaddr_t tgtipaddr;
214 } uip_nd6_ns;
215 
216 /**
217  * \brief A neighbor advertisement constant part.
218  *
219  * Possible option is: TLLAO
220  */
221 typedef struct uip_nd6_na {
222  uint8_t flagsreserved;
223  uint8_t reserved[3];
224  uip_ipaddr_t tgtipaddr;
225 } uip_nd6_na;
226 
227 /**
228  * \brief A router solicitation constant part
229  *
230  * Possible option is: SLLAO
231  */
232 typedef struct uip_nd6_rs {
233  uint32_t reserved;
234 } uip_nd6_rs;
235 
236 /**
237  * \brief A router advertisement constant part
238  *
239  * Possible options are: SLLAO, MTU, Prefix Information
240  */
241 typedef struct uip_nd6_ra {
242  uint8_t cur_ttl;
243  uint8_t flags_reserved;
244  uint16_t router_lifetime;
245  uint32_t reachable_time;
246  uint32_t retrans_timer;
247 } uip_nd6_ra;
248 
249 /**
250  * \brief A redirect message constant part
251  *
252  * Possible options are: TLLAO, redirected header
253  */
254 typedef struct uip_nd6_redirect {
255  uint32_t reserved;
256  uip_ipaddr_t tgtipaddress;
257  uip_ipaddr_t destipaddress;
259 /** @} */
260 
261 /**
262  * \name ND Option structures
263  * @{
264  */
265 
266 /** \brief ND option header */
267 typedef struct uip_nd6_opt_hdr {
268  uint8_t type;
269  uint8_t len;
271 
272 /** \brief ND option prefix information */
273 typedef struct uip_nd6_opt_prefix_info {
274  uint8_t type;
275  uint8_t len;
276  uint8_t preflen;
277  uint8_t flagsreserved1;
278  uint32_t validlt;
279  uint32_t preferredlt;
280  uint32_t reserved2;
281  uip_ipaddr_t prefix;
283 
284 /** \brief ND option MTU */
285 typedef struct uip_nd6_opt_mtu {
286  uint8_t type;
287  uint8_t len;
288  uint16_t reserved;
289  uint32_t mtu;
291 
292 /** \struct Redirected header option */
293 typedef struct uip_nd6_opt_redirected_hdr {
294  uint8_t type;
295  uint8_t len;
296  uint8_t reserved[6];
297 } uip_nd6_opt_redirected_hdr;
298 /** @} */
299 
300 /**
301  * \name ND Messages Processing and Generation
302  * @{
303  */
304  /**
305  * \brief Process a neighbor solicitation
306  *
307  * The NS can be received in 3 cases (procedures):
308  * - sender is performing DAD (ip src = unspecified, no SLLAO option)
309  * - sender is performing NUD (ip dst = unicast)
310  * - sender is performing address resolution (ip dest = solicited node mcast
311  * address)
312  *
313  * We do:
314  * - if the tgt belongs to me, reply, otherwise ignore
315  * - if i was performing DAD for the same address, two cases:
316  * -- I already sent a NS, hence I win
317  * -- I did not send a NS yet, hence I lose
318  *
319  * If we need to send a NA in response (i.e. the NS was done for NUD, or
320  * address resolution, or DAD and there is a conflict), we do it in this
321  * function: set src, dst, tgt address in the three cases, then for all cases
322  * set the rest, including SLLAO
323  *
324  */
325 void
326 uip_nd6_ns_input(void);
327 
328 /**
329  * \brief Send a neighbor solicitation, send a Neighbor Advertisement
330  * \param src pointer to the src of the NS if known
331  * \param dest pointer to ip address to send the NS, for DAD or ADDR Resol,
332  * MUST be NULL, for NUD, must be correct unicast dest
333  * \param tgt pointer to ip address to fill the target address field, must
334  * not be NULL
335  *
336  * - RFC 4861, 7.2.2 :
337  * "If the source address of the packet prompting the solicitation is the
338  * same as one of the addresses assigned to the outgoing interface, that
339  * address SHOULD be placed in the IP Source Address of the outgoing
340  * solicitation. Otherwise, any one of the addresses assigned to the
341  * interface should be used."
342  * This is why we have a src ip address as argument. If NULL, we will do
343  * src address selection, otherwise we use the argument.
344  *
345  * - we check if it is a NS for Address resolution or NUD, if yes we include
346  * a SLLAO option, otherwise no.
347  */
348 void
349 uip_nd6_ns_output(uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt);
350 
351 /**
352  * \brief Process a Neighbor Advertisement
353  *
354  * we might have to send a pkt that had been buffered while address
355  * resolution was performed (if we support buffering, see UIP_CONF_QUEUE_PKT)
356  *
357  * As per RFC 4861, on link layer that have addresses, TLLAO options MUST be
358  * included when responding to multicast solicitations, SHOULD be included in
359  * response to unicast (here we assume it is for now)
360  *
361  * NA can be received after sending NS for DAD, Address resolution or NUD. Can
362  * be unsolicited as well.
363  * It can trigger update of the state of the neighbor in the neighbor cache,
364  * router in the router list.
365  * If the NS was for DAD, it means DAD failed
366  *
367  */
368 void
369 uip_nd6_na_input(void);
370 
371 #if UIP_CONF_ROUTER
372 #if UIP_ND6_SEND_RA
373 /**
374  * \brief Process a Router Solicitation
375  *
376  */
377 void uip_nd6_rs_input(void);
378 
379 /**
380  * \brief send a Router Advertisement
381  *
382  * Only for router, for periodic as well as sollicited RA
383  */
384 void uip_nd6_ra_output(uip_ipaddr_t *dest);
385 #endif /* UIP_ND6_SEND_RA */
386 #endif /*UIP_CONF_ROUTER*/
387 
388 /**
389  * \brief Send a Router Solicitation
390  *
391  * src is chosen through the uip_netif_select_src function. If src is
392  * unspecified (i.e. we do not have a preferred address yet), then we do not
393  * put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.
394  *
395  * RS message format,
396  * possible option is SLLAO, MUST NOT be included if source = unspecified
397  * SHOULD be included otherwise
398  */
399 void uip_nd6_rs_output(void);
400 
401 /**
402  *
403  * \brief process a Router Advertisement
404  *
405  * - Possible actions when receiving a RA: add router to router list,
406  * recalculate reachable time, update link hop limit, update retrans timer.
407  * - If MTU option: update MTU.
408  * - If SLLAO option: update entry in neighbor cache
409  * - If prefix option: start autoconf, add prefix to prefix list
410  */
411 void
412 uip_nd6_ra_input(void);
413 /** @} */
414 
415 
416 void
417 uip_appserver_addr_get(uip_ipaddr_t *ipaddr);
418 /*--------------------------------------*/
419 /******* ANNEX - message formats ********/
420 /*--------------------------------------*/
421 
422 /*
423  * RS format. possible option is SLLAO
424  * 0 1 2 3
425  * 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
426  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
427  * | Type | Code | Checksum |
428  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
429  * | Reserved |
430  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
431  * | Options ...
432  * +-+-+-+-+-+-+-+-+-+-+-+-
433  *
434  *
435  * RA format. possible options: prefix information, MTU, SLLAO
436  * 0 1 2 3
437  * 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
438  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
439  * | Type | Code | Checksum |
440  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
441  * | Cur Hop Limit |M|O| Reserved | Router Lifetime |
442  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
443  * | Reachable Time |
444  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
445  * | Retrans Timer |
446  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
447  * | Options ...
448  * +-+-+-+-+-+-+-+-+-+-+-+-
449  *
450  *
451  * NS format: options should be SLLAO
452  * 0 1 2 3
453  * 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
454  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
455  * | Type | Code | Checksum |
456  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
457  * | Reserved |
458  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
459  * | |
460  * + +
461  * | |
462  * + Target Address +
463  * | |
464  * + +
465  * | |
466  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
467  * | Options ...
468  * +-+-+-+-+-+-+-+-+-+-+-+-
469  *
470  *
471  * NA message format. possible options is TLLAO
472  *
473  * 0 1 2 3
474  * 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
475  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
476  * | Type | Code | Checksum |
477  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
478  * |R|S|O| Reserved |
479  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
480  * | |
481  * + +
482  * | |
483  * + Target Address +
484  * | |
485  * + +
486  * | |
487  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
488  * | Options ...
489  * +-+-+-+-+-+-+-+-+-+-+-+-
490  *
491  *
492  * Redirect message format. Possible options are TLLAO and Redirected header
493  *
494  * 0 1 2 3
495  * 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
496  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
497  * | Type | Code | Checksum |
498  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
499  * | Reserved |
500  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
501  * | |
502  * + +
503  * | |
504  * + Target Address +
505  * | |
506  * + +
507  * | |
508  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
509  * | |
510  * + +
511  * | |
512  * + Destination Address +
513  * | |
514  * + +
515  * | |
516  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
517  * | Options ...
518  * +-+-+-+-+-+-+-+-+-+-+-+-
519  *
520  *
521  * SLLAO/TLLAO option:
522  * 0 1 2 3
523  * 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
524  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
525  * | Type | Length | Link-Layer Address ...
526  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
527  *
528  *
529  * Prefix information 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 | Prefix Length |L|A| Reserved1 |
534  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
535  * | Valid Lifetime |
536  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537  * | Preferred Lifetime |
538  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
539  * | Reserved2 |
540  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
541  * | |
542  * + +
543  * | |
544  * + Prefix +
545  * | |
546  * + +
547  * | |
548  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
549  *
550  *
551  * MTU option
552  * 0 1 2 3
553  * 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
554  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
555  * | Type | Length | Reserved |
556  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
557  * | MTU |
558  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
559  *
560  *
561  * Redirected header option
562  *
563  * 0 1 2 3
564  * 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
565  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566  * | Type | Length | Reserved |
567  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568  * | Reserved |
569  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
570  * | |
571  * ~ IP header + data ~
572  * | |
573  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
574  *
575  */
576 #endif /* UIP_ND6_H_ */
577 
578 /** @} */