Contiki 3.x
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 uip6
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/ip/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 #define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1
64 /** \brief Router solicitation interval */
65 #define UIP_ND6_RTR_SOLICITATION_INTERVAL 4
66 /** \brief Maximum router solicitations */
67 #define UIP_ND6_MAX_RTR_SOLICITATIONS 3
68 /** @} */
69 
70 /** \name RFC 4861 Router constants */
71 /** @{ */
72 #ifndef UIP_CONF_ND6_SEND_RA
73 #define UIP_ND6_SEND_RA 1 /* enable/disable RA sending */
74 #else
75 #define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
76 #endif
77 #ifndef UIP_CONF_ND6_SEND_NA
78 #define UIP_ND6_SEND_NA 1 /* enable/disable NA sending */
79 #else
80 #define UIP_ND6_SEND_NA UIP_CONF_ND6_SEND_NA
81 #endif
82 #ifndef UIP_CONF_ND6_MAX_RA_INTERVAL
83 #define UIP_ND6_MAX_RA_INTERVAL 600
84 #else
85 #define UIP_ND6_MAX_RA_INTERVAL UIP_CONF_ND6_MAX_RA_INTERVAL
86 #endif
87 #ifndef UIP_CONF_ND6_MIN_RA_INTERVAL
88 #define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3)
89 #else
90 #define UIP_ND6_MIN_RA_INTERVAL UIP_CONF_ND6_MIN_RA_INTERVAL
91 #endif
92 #define UIP_ND6_M_FLAG 0
93 #define UIP_ND6_O_FLAG (UIP_ND6_RA_RDNSS || UIP_ND6_RA_DNSSL)
94 #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL
95 
96 #define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/
97 #define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/
98 #ifndef UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS
99 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/
100 #else
101 #define UIP_ND6_MIN_DELAY_BETWEEN_RAS UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS
102 #endif
103 //#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/
104 #define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/
105 /** @} */
106 
107 #ifndef UIP_CONF_ND6_DEF_MAXDADNS
108 /** \brief Do not try DAD when using EUI-64 as allowed by draft-ietf-6lowpan-nd-15 section 8.2 */
109 #if UIP_CONF_LL_802154
110 #define UIP_ND6_DEF_MAXDADNS 0
111 #else /* UIP_CONF_LL_802154 */
112 #define UIP_ND6_DEF_MAXDADNS UIP_ND6_SEND_NA
113 #endif /* UIP_CONF_LL_802154 */
114 #else /* UIP_CONF_ND6_DEF_MAXDADNS */
115 #define UIP_ND6_DEF_MAXDADNS UIP_CONF_ND6_DEF_MAXDADNS
116 #endif /* UIP_CONF_ND6_DEF_MAXDADNS */
117 
118 /** \name RFC 4861 Node constant */
119 #define UIP_ND6_MAX_MULTICAST_SOLICIT 3
120 
121 #ifdef UIP_CONF_ND6_MAX_UNICAST_SOLICIT
122 #define UIP_ND6_MAX_UNICAST_SOLICIT UIP_CONF_ND6_MAX_UNICAST_SOLICIT
123 #else /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
124 #define UIP_ND6_MAX_UNICAST_SOLICIT 3
125 #endif /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
126 
127 #ifdef UIP_CONF_ND6_REACHABLE_TIME
128 #define UIP_ND6_REACHABLE_TIME UIP_CONF_ND6_REACHABLE_TIME
129 #else
130 #define UIP_ND6_REACHABLE_TIME 30000
131 #endif
132 
133 #ifdef UIP_CONF_ND6_RETRANS_TIMER
134 #define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER
135 #else
136 #define UIP_ND6_RETRANS_TIMER 1000
137 #endif
138 
139 #define UIP_ND6_DELAY_FIRST_PROBE_TIME 5
140 #define UIP_ND6_MIN_RANDOM_FACTOR(x) (x / 2)
141 #define UIP_ND6_MAX_RANDOM_FACTOR(x) ((x) + (x) / 2)
142 /** @} */
143 
144 
145 /** \name RFC 6106 RA DNS Options Constants */
146 /** @{ */
147 #ifndef UIP_CONF_ND6_RA_RDNSS
148 #define UIP_ND6_RA_RDNSS 0
149 #else
150 #define UIP_ND6_RA_RDNSS UIP_CONF_ND6_RA_RDNSS
151 #endif
152 
153 #ifndef UIP_CONF_ND6_RA_DNSSL
154 #define UIP_ND6_RA_DNSSL 0
155 #else
156 #error Not implemented
157 #define UIP_ND6_RA_DNSSL UIP_CONF_ND6_RA_DNSSL
158 #endif
159 /** @} */
160 
161 
162 /** \name ND6 option types */
163 /** @{ */
164 #define UIP_ND6_OPT_SLLAO 1
165 #define UIP_ND6_OPT_TLLAO 2
166 #define UIP_ND6_OPT_PREFIX_INFO 3
167 #define UIP_ND6_OPT_REDIRECTED_HDR 4
168 #define UIP_ND6_OPT_MTU 5
169 #define UIP_ND6_OPT_RDNSS 25
170 #define UIP_ND6_OPT_DNSSL 31
171 /** @} */
172 
173 /** \name ND6 option types */
174 /** @{ */
175 #define UIP_ND6_OPT_TYPE_OFFSET 0
176 #define UIP_ND6_OPT_LEN_OFFSET 1
177 #define UIP_ND6_OPT_DATA_OFFSET 2
178 
179 /** \name ND6 message length (excluding options) */
180 /** @{ */
181 #define UIP_ND6_NA_LEN 20
182 #define UIP_ND6_NS_LEN 20
183 #define UIP_ND6_RA_LEN 12
184 #define UIP_ND6_RS_LEN 4
185 /** @} */
186 
187 
188 /** \name ND6 option length in bytes */
189 /** @{ */
190 #define UIP_ND6_OPT_HDR_LEN 2
191 #define UIP_ND6_OPT_PREFIX_INFO_LEN 32
192 #define UIP_ND6_OPT_MTU_LEN 8
193 #define UIP_ND6_OPT_RDNSS_LEN 1
194 #define UIP_ND6_OPT_DNSSL_LEN 1
195 
196 
197 /* Length of TLLAO and SLLAO options, it is L2 dependant */
198 #if UIP_CONF_LL_802154
199 /* If the interface is 802.15.4. For now we use only long addresses */
200 #define UIP_ND6_OPT_SHORT_LLAO_LEN 8
201 #define UIP_ND6_OPT_LONG_LLAO_LEN 16
202 /** \brief length of a ND6 LLAO option for 802.15.4 */
203 #define UIP_ND6_OPT_LLAO_LEN UIP_ND6_OPT_LONG_LLAO_LEN
204 #else /*UIP_CONF_LL_802154*/
205 #if UIP_CONF_LL_80211
206 /* If the interface is 802.11 */
207 /** \brief length of a ND6 LLAO option for 802.11 */
208 #define UIP_ND6_OPT_LLAO_LEN 8
209 #else /*UIP_CONF_LL_80211*/
210 /** \brief length of a ND6 LLAO option for default L2 type (e.g. Ethernet) */
211 #define UIP_ND6_OPT_LLAO_LEN 8
212 #endif /*UIP_CONF_LL_80211*/
213 #endif /*UIP_CONF_LL_802154*/
214 /** @} */
215 
216 
217 /** \name Neighbor Advertisement flags masks */
218 /** @{ */
219 #define UIP_ND6_NA_FLAG_ROUTER 0x80
220 #define UIP_ND6_NA_FLAG_SOLICITED 0x40
221 #define UIP_ND6_NA_FLAG_OVERRIDE 0x20
222 #define UIP_ND6_RA_FLAG_ONLINK 0x80
223 #define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40
224 /** @} */
225 
226 /**
227  * \name ND message structures
228  * @{
229  */
230 
231 /**
232  * \brief A neighbor solicitation constant part
233  *
234  * Possible option is: SLLAO
235  */
236 typedef struct uip_nd6_ns {
237  uint32_t reserved;
238  uip_ipaddr_t tgtipaddr;
239 } uip_nd6_ns;
240 
241 /**
242  * \brief A neighbor advertisement constant part.
243  *
244  * Possible option is: TLLAO
245  */
246 typedef struct uip_nd6_na {
247  uint8_t flagsreserved;
248  uint8_t reserved[3];
249  uip_ipaddr_t tgtipaddr;
250 } uip_nd6_na;
251 
252 /**
253  * \brief A router solicitation constant part
254  *
255  * Possible option is: SLLAO
256  */
257 typedef struct uip_nd6_rs {
258  uint32_t reserved;
259 } uip_nd6_rs;
260 
261 /**
262  * \brief A router advertisement constant part
263  *
264  * Possible options are: SLLAO, MTU, Prefix Information
265  */
266 typedef struct uip_nd6_ra {
267  uint8_t cur_ttl;
268  uint8_t flags_reserved;
269  uint16_t router_lifetime;
270  uint32_t reachable_time;
271  uint32_t retrans_timer;
272 } uip_nd6_ra;
273 
274 /**
275  * \brief A redirect message constant part
276  *
277  * Possible options are: TLLAO, redirected header
278  */
279 typedef struct uip_nd6_redirect {
280  uint32_t reserved;
281  uip_ipaddr_t tgtipaddress;
282  uip_ipaddr_t destipaddress;
284 /** @} */
285 
286 /**
287  * \name ND Option structures
288  * @{
289  */
290 
291 /** \brief ND option header */
292 typedef struct uip_nd6_opt_hdr {
293  uint8_t type;
294  uint8_t len;
296 
297 /** \brief ND option prefix information */
298 typedef struct uip_nd6_opt_prefix_info {
299  uint8_t type;
300  uint8_t len;
301  uint8_t preflen;
302  uint8_t flagsreserved1;
303  uint32_t validlt;
304  uint32_t preferredlt;
305  uint32_t reserved2;
306  uip_ipaddr_t prefix;
308 
309 /** \brief ND option MTU */
310 typedef struct uip_nd6_opt_mtu {
311  uint8_t type;
312  uint8_t len;
313  uint16_t reserved;
314  uint32_t mtu;
316 
317 /** \brief ND option RDNSS */
318 typedef struct uip_nd6_opt_dns {
319  uint8_t type;
320  uint8_t len;
321  uint16_t reserved;
322  uint32_t lifetime;
323  uip_ipaddr_t ip;
325 
326 /** \struct Redirected header option */
327 typedef struct uip_nd6_opt_redirected_hdr {
328  uint8_t type;
329  uint8_t len;
330  uint8_t reserved[6];
331 } uip_nd6_opt_redirected_hdr;
332 /** @} */
333 
334 /**
335  * \name ND Messages Processing and Generation
336  * @{
337  */
338  /**
339  * \brief Process a neighbor solicitation
340  *
341  * The NS can be received in 3 cases (procedures):
342  * - sender is performing DAD (ip src = unspecified, no SLLAO option)
343  * - sender is performing NUD (ip dst = unicast)
344  * - sender is performing address resolution (ip dest = solicited node mcast
345  * address)
346  *
347  * We do:
348  * - if the tgt belongs to me, reply, otherwise ignore
349  * - if i was performing DAD for the same address, two cases:
350  * -- I already sent a NS, hence I win
351  * -- I did not send a NS yet, hence I lose
352  *
353  * If we need to send a NA in response (i.e. the NS was done for NUD, or
354  * address resolution, or DAD and there is a conflict), we do it in this
355  * function: set src, dst, tgt address in the three cases, then for all cases
356  * set the rest, including SLLAO
357  *
358  */
359 void
360 uip_nd6_ns_input(void);
361 
362 /**
363  * \brief Send a neighbor solicitation, send a Neighbor Advertisement
364  * \param src pointer to the src of the NS if known
365  * \param dest pointer to ip address to send the NS, for DAD or ADDR Resol,
366  * MUST be NULL, for NUD, must be correct unicast dest
367  * \param tgt pointer to ip address to fill the target address field, must
368  * not be NULL
369  *
370  * - RFC 4861, 7.2.2 :
371  * "If the source address of the packet prompting the solicitation is the
372  * same as one of the addresses assigned to the outgoing interface, that
373  * address SHOULD be placed in the IP Source Address of the outgoing
374  * solicitation. Otherwise, any one of the addresses assigned to the
375  * interface should be used."
376  * This is why we have a src ip address as argument. If NULL, we will do
377  * src address selection, otherwise we use the argument.
378  *
379  * - we check if it is a NS for Address resolution or NUD, if yes we include
380  * a SLLAO option, otherwise no.
381  */
382 void
383 uip_nd6_ns_output(uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt);
384 
385 #if UIP_CONF_ROUTER
386 #if UIP_ND6_SEND_RA
387 /**
388  * \brief send a Router Advertisement
389  *
390  * Only for router, for periodic as well as sollicited RA
391  */
392 void uip_nd6_ra_output(uip_ipaddr_t *dest);
393 #endif /* UIP_ND6_SEND_RA */
394 #endif /*UIP_CONF_ROUTER*/
395 
396 /**
397  * \brief Send a Router Solicitation
398  *
399  * src is chosen through the uip_netif_select_src function. If src is
400  * unspecified (i.e. we do not have a preferred address yet), then we do not
401  * put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.
402  *
403  * RS message format,
404  * possible option is SLLAO, MUST NOT be included if source = unspecified
405  * SHOULD be included otherwise
406  */
407 void uip_nd6_rs_output(void);
408 
409 /**
410  * \brief Initialise the uIP ND core
411  */
412 void uip_nd6_init(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 /** @} */
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Definition: uip-nd6.c:129
struct uip_nd6_opt_dns uip_nd6_opt_dns
ND option RDNSS.
ND option RDNSS.
Definition: uip-nd6.h:318
void uip_nd6_rs_output(void)
Send a Router Solicitation.
Definition: uip-nd6.c:801
A router solicitation constant part.
Definition: uip-nd6.h:257
struct uip_nd6_ns uip_nd6_ns
A neighbor solicitation constant part.
ND option prefix information.
Definition: uip-nd6.h:298
void uip_nd6_ns_input(void)
Process a neighbor solicitation.
struct uip_nd6_na uip_nd6_na
A neighbor advertisement constant part.
A neighbor solicitation constant part.
Definition: uip-nd6.h:236
Second timer library header file.
ND option MTU.
Definition: uip-nd6.h:310
struct uip_nd6_ra uip_nd6_ra
A router advertisement constant part.
A redirect message constant part.
Definition: uip-nd6.h:279
A neighbor advertisement constant part.
Definition: uip-nd6.h:246
Header file for the uIP TCP/IP stack.
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.
Definition: uip-nd6.c:352
struct uip_nd6_opt_prefix_info uip_nd6_opt_prefix_info
ND option prefix information.
struct uip_nd6_rs uip_nd6_rs
A router solicitation constant part.
ND option header.
Definition: uip-nd6.h:292
struct uip_nd6_opt_mtu uip_nd6_opt_mtu
ND option MTU.
struct uip_nd6_opt_hdr uip_nd6_opt_hdr
ND option header.
struct uip_nd6_redirect uip_nd6_redirect
A redirect message constant part.
void uip_nd6_init(void)
Initialise the uIP ND core.
Definition: uip-nd6.c:1100
A router advertisement constant part.
Definition: uip-nd6.h:266