Contiki 2.5
uip-nd6.h
Go to the documentation of this file.
1 /**
2  * \addtogroup uip6
3  * @{
4  */
5 
6 /**
7  * \file
8  * Neighbor discovery (RFC 4861)
9  * \author Julien Abeille <jabeille@cisco.com>
10  * \author Mathilde Durvy <mdurvy@cisco.com>
11  */
12 
13 /*
14  * Copyright (c) 2006, Swedish Institute of Computer Science.
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions
19  * are met:
20  * 1. Redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution.
25  * 3. Neither the name of the Institute nor the names of its contributors
26  * may be used to endorse or promote products derived from this software
27  * without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
30  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
33  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39  * SUCH DAMAGE.
40  *
41  * This file is part of the Contiki operating system.
42  *
43  */
44 
45 #ifndef __UIP_ND6_H__
46 #define __UIP_ND6_H__
47 
48 #include "net/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 #define UIP_ND6_DEF_MAXDADNS 1
61 
62 /** \name Configuration options */
63 /** @{ */
64 #ifndef UIP_CONF_ND6_MAX_NEIGHBORS
65 /** \brief max number of entries in the neighbor cache */
66 #define UIP_CONF_ND6_MAX_NEIGHBORS 4
67 #endif /*UIP_CONF_ND6_MAX_NEIGHBORS*/
68 #ifndef UIP_CONF_ND6_MAX_DEFROUTERS
69 /** \brief max number of entries in the default router cache */
70 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
71 #endif /*UIP_CONF_ND6_MAX_DEFROUTERS*/
72 #ifndef UIP_CONF_ND6_MAX_PREFIXES
73 /** \brief max number of entries in the prefix list */
74 #define UIP_CONF_ND6_MAX_PREFIXES 2
75 #endif /*UIP_CONF_ND6_MAX_PREFIXES*/
76 /** @} */
77 
78 
79 /** \name RFC 4861 Host constant */
80 /** @{ */
81 #define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1
82 #define UIP_ND6_RTR_SOLICITATION_INTERVAL 4
83 #define UIP_ND6_MAX_RTR_SOLICITATIONS 3
84 /** @} */
85 
86 /** \name RFC 4861 Router constants */
87 /** @{ */
88 #ifndef UIP_CONF_ND6_SEND_RA
89 #define UIP_ND6_SEND_RA 1 /* enable/disable RA sending */
90 #else
91 #define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
92 #endif
93 #define UIP_ND6_MAX_RA_INTERVAL 600
94 #define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3)
95 #define UIP_ND6_M_FLAG 0
96 #define UIP_ND6_O_FLAG 0
97 #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL
98 
99 #define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/
100 #define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/
101 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/
102 //#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/
103 #define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/
104 /** @} */
105 
106 
107 /** \name RFC 4861 Node constant */
108 #define UIP_ND6_MAX_MULTICAST_SOLICIT 3
109 #define UIP_ND6_MAX_UNICAST_SOLICIT 3
110 #ifdef UIP_CONF_ND6_REACHABLE_TIME
111 #define UIP_ND6_REACHABLE_TIME UIP_CONF_ND6_REACHABLE_TIME
112 #else
113 #define UIP_ND6_REACHABLE_TIME 30000
114 #endif
115 #ifdef UIP_CONF_ND6_RETRANS_TIMER
116 #define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER
117 #else
118 #define UIP_ND6_RETRANS_TIMER 1000
119 #endif
120 #define UIP_ND6_DELAY_FIRST_PROBE_TIME 5
121 #define UIP_ND6_MIN_RANDOM_FACTOR(x) (x / 2)
122 #define UIP_ND6_MAX_RANDOM_FACTOR(x) ((x) + (x) / 2)
123 /** @} */
124 
125 
126 /** \name ND6 option types */
127 /** @{ */
128 #define UIP_ND6_OPT_SLLAO 1
129 #define UIP_ND6_OPT_TLLAO 2
130 #define UIP_ND6_OPT_PREFIX_INFO 3
131 #define UIP_ND6_OPT_REDIRECTED_HDR 4
132 #define UIP_ND6_OPT_MTU 5
133 /** @} */
134 
135 /** \name ND6 option types */
136 /** @{ */
137 #define UIP_ND6_OPT_TYPE_OFFSET 0
138 #define UIP_ND6_OPT_LEN_OFFSET 1
139 #define UIP_ND6_OPT_DATA_OFFSET 2
140 
141 /** \name ND6 message length (excluding options) */
142 /** @{ */
143 #define UIP_ND6_NA_LEN 20
144 #define UIP_ND6_NS_LEN 20
145 #define UIP_ND6_RA_LEN 12
146 #define UIP_ND6_RS_LEN 4
147 /** @} */
148 
149 
150 /** \name ND6 option length in bytes */
151 /** @{ */
152 #define UIP_ND6_OPT_HDR_LEN 2
153 #define UIP_ND6_OPT_PREFIX_INFO_LEN 32
154 #define UIP_ND6_OPT_MTU_LEN 8
155 
156 
157 /* Length of TLLAO and SLLAO options, it is L2 dependant */
158 #if UIP_CONF_LL_802154
159 /* If the interface is 802.15.4. For now we use only long addresses */
160 #define UIP_ND6_OPT_SHORT_LLAO_LEN 8
161 #define UIP_ND6_OPT_LONG_LLAO_LEN 16
162 /** \brief length of a ND6 LLAO option for 802.15.4 */
163 #define UIP_ND6_OPT_LLAO_LEN UIP_ND6_OPT_LONG_LLAO_LEN
164 #else /*UIP_CONF_LL_802154*/
165 #if UIP_CONF_LL_80211
166 /* If the interface is 802.11 */
167 /** \brief length of a ND6 LLAO option for 802.11 */
168 #define UIP_ND6_OPT_LLAO_LEN 8
169 #else /*UIP_CONF_LL_80211*/
170 /** \brief length of a ND6 LLAO option for default L2 type (e.g. Ethernet) */
171 #define UIP_ND6_OPT_LLAO_LEN 8
172 #endif /*UIP_CONF_LL_80211*/
173 #endif /*UIP_CONF_LL_802154*/
174 /** @} */
175 
176 
177 /** \name Neighbor Advertisement flags masks */
178 /** @{ */
179 #define UIP_ND6_NA_FLAG_ROUTER 0x80
180 #define UIP_ND6_NA_FLAG_SOLICITED 0x40
181 #define UIP_ND6_NA_FLAG_OVERRIDE 0x20
182 #define UIP_ND6_RA_FLAG_ONLINK 0x80
183 #define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40
184 /** @} */
185 
186 
187 /**
188  * \brief Possible states for the neighbor cache entries
189  *
190  * NO_STATE is for implementation purposes: a router entry contains a pointer
191  * to a neighbor entry, which holds its ip address. If we do not know the LL
192  * address of the router, we do not have to create a neighbor entry as per
193  * RFC 4861. However, we still need to have the IP of the router stored in a
194  * neighbor entry, hence we create an entry in the NO_STATE state
195  */
196 typedef enum {
197  INCOMPLETE = 0,
198  REACHABLE = 1,
199  STALE = 2,
200  DELAY = 3,
201  PROBE = 4,
202  NO_STATE = 5
204 
205 /**
206  * \name ND structures
207  * @{
208  */
209 /** \brief An entry in the neighbor cache */
211  uip_ipaddr_t ipaddr;
212  uip_lladdr_t lladdr;
213  u8_t isrouter;
214  uip_neighbor_state state;
215  struct stimer reachable;
216  struct stimer last_send; /**< last time a ND message was sent */
217  u8_t count_send; /**< how many ND message were already sent */
218  u8_t used; /**< brief is this neighbor currently used */
219 #if UIP_CONF_IPV6_QUEUE_PKT
220  u8_t queue_buf[UIP_BUFSIZE - UIP_LLH_LEN];
221  /**< buffer to hold one packet during address resolution */
222  u8_t queue_buf_len;
223  /**< length of the pkt in buffer, used as "boolean" as well*/
224 #endif /*UIP_CONF_QUEUE_PKT*/
225 };
226 
227 
228 /** \brief An entry in the default router list */
230  struct uip_nd6_neighbor *nb;
231  struct stimer lifetime;
232  /**< the lifetime contained in RA corresponds to the interval field
233  * of the timer
234  */
235  u8_t used; /**< Is this default router entry currently used */
236 };
237 
238 /** \brief A prefix list entry */
240  uip_ipaddr_t ipaddr;
241  u8_t length;
242  /**< we do not use preferred lifetime, which is always smaller than
243  * valid lifetime (for addr, preferred->deprecated)
244  */
245  struct stimer vlifetime;
246  u8_t is_infinite; /**< Is the prefix lifetime INFINITE */
247  u8_t used; /**< Is this prefix entry currently used */
248 };
249 /** @} */
250 
251 extern struct etimer uip_nd6_timer_periodic;
252 
253 /**
254  * \note
255  * We do not use a destination cache, do next-hop determination each time
256  * a packet needs to be sent. (info such as rtt, path mtu could be stored
257  * in uip_conn)
258  *
259  */
260 
261 /**
262  * \name ND message structures
263  * @{
264  */
265 
266 /**
267  * \brief A neighbor solicitation constant part
268  *
269  * Possible option is: SLLAO
270  */
271 typedef struct uip_nd6_ns {
272  uint32_t reserved;
273  uip_ipaddr_t tgtipaddr;
274 } uip_nd6_ns;
275 
276 /**
277  * \brief A neighbor advertisement constant part.
278  *
279  * Possible option is: TLLAO
280  */
281 typedef struct uip_nd6_na {
282  uint8_t flagsreserved;
283  uint8_t reserved[3];
284  uip_ipaddr_t tgtipaddr;
285 } uip_nd6_na;
286 
287 /**
288  * \brief A router solicitation constant part
289  *
290  * Possible option is: SLLAO
291  */
292 typedef struct uip_nd6_rs {
293  uint32_t reserved;
294 } uip_nd6_rs;
295 
296 /**
297  * \brief A router advertisement constant part
298  *
299  * Possible options are: SLLAO, MTU, Prefix Information
300  */
301 typedef struct uip_nd6_ra {
302  uint8_t cur_ttl;
303  uint8_t flags_reserved;
304  uint16_t router_lifetime;
305  uint32_t reachable_time;
306  uint32_t retrans_timer;
307 } uip_nd6_ra;
308 
309 /**
310  * \brief A redirect message constant part
311  *
312  * Possible options are: TLLAO, redirected header
313  */
314 typedef struct uip_nd6_redirect {
315  uint32_t reserved;
316  uip_ipaddr_t tgtipaddress;
317  uip_ipaddr_t destipaddress;
319 /** @} */
320 
321 /**
322  * \name ND Option structures
323  * @{
324  */
325 
326 /** \brief ND option header */
327 typedef struct uip_nd6_opt_hdr {
328  uint8_t type;
329  uint8_t len;
331 
332 /** \brief ND option prefix information */
333 typedef struct uip_nd6_opt_prefix_info {
334  uint8_t type;
335  uint8_t len;
336  uint8_t preflen;
337  uint8_t flagsreserved1;
338  uint32_t validlt;
339  uint32_t preferredlt;
340  uint32_t reserved2;
341  uip_ipaddr_t prefix;
343 
344 /** \brief ND option MTU */
345 typedef struct uip_nd6_opt_mtu {
346  uint8_t type;
347  uint8_t len;
348  uint16_t reserved;
349  uint32_t mtu;
351 
352 /** \struct Redirected header option */
353 typedef struct uip_nd6_opt_redirected_hdr {
354  uint8_t type;
355  uint8_t len;
356  uint8_t reserved[6];
357 } uip_nd6_opt_redirected_hdr;
358 /** @} */
359 
360 /**
361  * \name ND Neighbor Cache, Router List and Prefix List handling functions
362  * @{
363  */
364 /**
365  * \brief Initialize Neighbor Discovery structures
366  */
367 void uip_nd6_init(void);
368 
369 /**
370  * \brief Periodic processing of Neighbor Discovery Structures
371  */
372 void uip_nd6_periodic(void);
373 
374 /**
375  * \brief Look for a neighbor cache entry corresponding to a specific IP
376  * address
377  * \param ipaddr the specific IP address
378  * \return the corresponding neighbor cache entry
379  */
381 
382 /**
383  * \brief Add a neighbor cache entry
384  * \param ipaddr the IP address of the entry
385  * \param lladdr the layer 2 address of the entry
386  * \param isrouter true is the entry is a router
387  * \param state the state of the entry
388  * \return the new neighbor or updated cache entry
389  */
391  uip_lladdr_t *lladdr,
392  u8_t isrouter,
393  uip_neighbor_state state);
394 /**
395  * \brief Returns a default router
396  */
398 
399 /**
400  * \brief Find a default router corresponding to a given neighbor cache entry
401  * \param neighbor the neighbor cache entry
402  * \return the corresponding router if any
403  */
404 struct uip_nd6_defrouter *
406 
407 /**
408  * \brief Remove a default router
409  * \param router to be removed
410  */
411 void uip_nd6_defrouter_rm(struct uip_nd6_defrouter *router);
412 
413 /**
414  * \brief Add a default router
415  * \param neighbor the corresponding neighbor cache entry
416  * \param interval the lifetime of the router
417  * \return the new or updated defrouter entry
418  */
419 struct uip_nd6_defrouter *
420 uip_nd6_defrouter_add(struct uip_nd6_neighbor *neighbor, unsigned long interval);
421 
422 /**
423  * \brief Check if an IP address in on-link by looking at prefix list
424  * \param ipaddr an IP address
425  * \return true if on-link
426  */
428 
429 /**
430  * \brief Find a given prefix
431  * \param ipaddr an IP address
432  * \return the corresponding prefix if any
433  */
434 struct uip_nd6_prefix *
436 
437 /**
438  * \brief Add a prefix
439  * \param ipaddr the IP address of the prefix
440  * \param length the length of the prefix
441  * \param interval the lifetime of the prefix
442  * \return the new or updated prefix entry
443  */
444 struct uip_nd6_prefix *
445 uip_nd6_prefix_add(uip_ipaddr_t *ipaddr, u8_t length, unsigned long interval);
446 
447 /**
448  * \brief Remove a prefix from th eprefix list
449  * \param prefix pointer to the prefix to be removed
450  */
451 void
452  uip_nd6_prefix_rm(struct uip_nd6_prefix *prefix);
453 /** @} */
454 
455 
456 /**
457  * \name ND Messages Processing and Generation
458  * @{
459  */
460  /**
461  * \brief Process a neighbor solicitation
462  *
463  * The NS can be received in 3 cases (procedures):
464  * - sender is performing DAD (ip src = unspecified, no SLLAO option)
465  * - sender is performing NUD (ip dst = unicast)
466  * - sender is performing address resolution (ip dest = solicited node mcast
467  * address)
468  *
469  * We do:
470  * - if the tgt belongs to me, reply, otherwise ignore
471  * - if i was performing DAD for the same address, two cases:
472  * -- I already sent a NS, hence I win
473  * -- I did not send a NS yet, hence I lose
474  *
475  * If we need to send a NA in response (i.e. the NS was done for NUD, or
476  * address resolution, or DAD and there is a conflict), we do it in this
477  * function: set src, dst, tgt address in the three cases, then for all cases
478  * set the rest, including SLLAO
479  *
480  */
481 void
482 uip_nd6_ns_input(void);
483 
484 /**
485  * \brief Send a neighbor solicitation, send a Neighbor Advertisement
486  * \param src pointer to the src of the NS if known
487  * \param dest pointer to ip address to send the NS, for DAD or ADDR Resol,
488  * MUST be NULL, for NUD, must be correct unicast dest
489  * \param tgt pointer to ip address to fill the target address field, must
490  * not be NULL
491  *
492  * - RFC 4861, 7.2.2 :
493  * "If the source address of the packet prompting the solicitation is the
494  * same as one of the addresses assigned to the outgoing interface, that
495  * address SHOULD be placed in the IP Source Address of the outgoing
496  * solicitation. Otherwise, any one of the addresses assigned to the
497  * interface should be used."
498  * This is why we have a src ip address as argument. If NULL, we will do
499  * src address selection, otherwise we use the argument.
500  *
501  * - we check if it is a NS for Address resolution or NUD, if yes we include
502  * a SLLAO option, otherwise no.
503  */
504 void
506 
507 /**
508  * \brief Process a Neighbor Advertisement
509  *
510  * we might have to send a pkt that had been buffered while address
511  * resolution was performed (if we support buffering, see UIP_CONF_QUEUE_PKT)
512  *
513  * As per RFC 4861, on link layer that have addresses, TLLAO options MUST be
514  * included when responding to multicast solicitations, SHOULD be included in
515  * response to unicast (here we assume it is for now)
516  *
517  * NA can be received after sending NS for DAD, Address resolution or NUD. Can
518  * be unsolicited as well.
519  * It can trigger update of the state of the neighbor in the neighbor cache,
520  * router in the router list.
521  * If the NS was for DAD, it means DAD failed
522  *
523  */
524 void
525 uip_nd6_na_input(void);
526 
527 #if UIP_CONF_ROUTER
528 #if UIP_ND6_SEND_RA
529 /**
530  * \brief Process a Router Solicitation
531  *
532  */
533 void uip_nd6_rs_input(void);
534 
535 /**
536  * \brief send a Router Advertisement
537  *
538  * Only for router, for periodic as well as sollicited RA
539  */
540 void uip_nd6_ra_output(uip_ipaddr_t *dest);
541 #endif /* UIP_ND6_SEND_RA */
542 #endif /*UIP_CONF_ROUTER*/
543 
544 /**
545  * \brief Send a Router Solicitation
546  *
547  * src is chosen through the uip_netif_select_src function. If src is
548  * unspecified (i.e. we do not have a preferred address yet), then we do not
549  * put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.
550  *
551  * RS message format,
552  * possible option is SLLAO, MUST NOT be included if source = unspecified
553  * SHOULD be included otherwise
554  */
555 void uip_nd6_rs_output(void);
556 
557 /**
558  *
559  * \brief process a Router Advertisement
560  *
561  * - Possible actions when receiving a RA: add router to router list,
562  * recalculate reachable time, update link hop limit, update retrans timer.
563  * - If MTU option: update MTU.
564  * - If SLLAO option: update entry in neighbor cache
565  * - If prefix option: start autoconf, add prefix to prefix list
566  */
567 void
568 uip_nd6_ra_input(void);
569 /** @} */
570 
571 
572 void
573 uip_appserver_addr_get(uip_ipaddr_t *ipaddr);
574 /*--------------------------------------*/
575 /******* ANNEX - message formats ********/
576 /*--------------------------------------*/
577 
578 /*
579  * RS format. possible option is SLLAO
580  * 0 1 2 3
581  * 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
582  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583  * | Type | Code | Checksum |
584  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
585  * | Reserved |
586  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
587  * | Options ...
588  * +-+-+-+-+-+-+-+-+-+-+-+-
589  *
590  *
591  * RA format. possible options: prefix information, MTU, SLLAO
592  * 0 1 2 3
593  * 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
594  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
595  * | Type | Code | Checksum |
596  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
597  * | Cur Hop Limit |M|O| Reserved | Router Lifetime |
598  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
599  * | Reachable Time |
600  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
601  * | Retrans Timer |
602  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603  * | Options ...
604  * +-+-+-+-+-+-+-+-+-+-+-+-
605  *
606  *
607  * NS format: options should be SLLAO
608  * 0 1 2 3
609  * 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
610  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611  * | Type | Code | Checksum |
612  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
613  * | Reserved |
614  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615  * | |
616  * + +
617  * | |
618  * + Target Address +
619  * | |
620  * + +
621  * | |
622  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
623  * | Options ...
624  * +-+-+-+-+-+-+-+-+-+-+-+-
625  *
626  *
627  * NA message format. possible options is TLLAO
628  *
629  * 0 1 2 3
630  * 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
631  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
632  * | Type | Code | Checksum |
633  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
634  * |R|S|O| Reserved |
635  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
636  * | |
637  * + +
638  * | |
639  * + Target Address +
640  * | |
641  * + +
642  * | |
643  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
644  * | Options ...
645  * +-+-+-+-+-+-+-+-+-+-+-+-
646  *
647  *
648  * Redirect message format. Possible options are TLLAO and Redirected header
649  *
650  * 0 1 2 3
651  * 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
652  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
653  * | Type | Code | Checksum |
654  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
655  * | Reserved |
656  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
657  * | |
658  * + +
659  * | |
660  * + Target Address +
661  * | |
662  * + +
663  * | |
664  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
665  * | |
666  * + +
667  * | |
668  * + Destination Address +
669  * | |
670  * + +
671  * | |
672  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
673  * | Options ...
674  * +-+-+-+-+-+-+-+-+-+-+-+-
675  *
676  *
677  * SLLAO/TLLAO option:
678  * 0 1 2 3
679  * 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
680  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
681  * | Type | Length | Link-Layer Address ...
682  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
683  *
684  *
685  * Prefix information option
686  * 0 1 2 3
687  * 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
688  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
689  * | Type | Length | Prefix Length |L|A| Reserved1 |
690  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
691  * | Valid Lifetime |
692  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
693  * | Preferred Lifetime |
694  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
695  * | Reserved2 |
696  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
697  * | |
698  * + +
699  * | |
700  * + Prefix +
701  * | |
702  * + +
703  * | |
704  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
705  *
706  *
707  * MTU option
708  * 0 1 2 3
709  * 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
710  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
711  * | Type | Length | Reserved |
712  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
713  * | MTU |
714  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
715  *
716  *
717  * Redirected header option
718  *
719  * 0 1 2 3
720  * 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
721  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
722  * | Type | Length | Reserved |
723  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
724  * | Reserved |
725  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
726  * | |
727  * ~ IP header + data ~
728  * | |
729  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
730  *
731  */
732 #endif /* __UIP_ND6_H__ */
733 
734 /** @} */