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
101link-local IPv6, assuming it used autoconfiguration. This is not
102standard-compliant but this is a convenient way to keep the
103neighbor cache out of the way in cases ND is not used.
104Note that this is not standard-compliant (RFC 4861), as neighbors will
105be 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 */
268typedef struct uip_nd6_ns {
269 uint32_t reserved;
270 uip_ipaddr_t tgtipaddr;
272
273/**
274 * \brief A neighbor advertisement constant part.
275 *
276 * Possible option is: TLLAO
277 */
278typedef struct uip_nd6_na {
279 uint8_t flagsreserved;
280 uint8_t reserved[3];
281 uip_ipaddr_t tgtipaddr;
283
284/**
285 * \brief A router solicitation constant part
286 *
287 * Possible option is: SLLAO
288 */
289typedef struct uip_nd6_rs {
290 uint32_t reserved;
292
293/**
294 * \brief A router advertisement constant part
295 *
296 * Possible options are: SLLAO, MTU, Prefix Information
297 */
298typedef 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;
305
306/**
307 * \brief A redirect message constant part
308 *
309 * Possible options are: TLLAO, redirected header
310 */
311typedef 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 */
324typedef struct uip_nd6_opt_hdr {
325 uint8_t type;
326 uint8_t len;
328
329/** \brief ND option prefix information */
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 */
342typedef 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 */
350typedef 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 */
359typedef 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 */
390void
391uip_nd6_ns_output(const uip_ipaddr_t *src, const uip_ipaddr_t *dest,
392 uip_ipaddr_t *tgt);
393
394#if UIP_CONF_ROUTER
395#if UIP_ND6_SEND_RA
396/**
397 * \brief send a Router Advertisement
398 *
399 * Only for router, for periodic as well as sollicited RA
400 */
401void uip_nd6_ra_output(const uip_ipaddr_t *dest);
402#endif /* UIP_ND6_SEND_RA */
403#endif /*UIP_CONF_ROUTER*/
404
405/**
406 * \brief Send a Router Solicitation
407 *
408 * src is chosen through the uip_netif_select_src function. If src is
409 * unspecified (i.e. we do not have a preferred address yet), then we do not
410 * put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.
411 *
412 * RS message format,
413 * possible option is SLLAO, MUST NOT be included if source = unspecified
414 * SHOULD be included otherwise
415 */
416void uip_nd6_rs_output(void);
417
418/**
419 * \brief Initialise the uIP ND core
420 */
421void uip_nd6_init(void);
422/** @} */
423
424
425void
426uip_appserver_addr_get(uip_ipaddr_t *ipaddr);
427/*--------------------------------------*/
428/******* ANNEX - message formats ********/
429/*--------------------------------------*/
430
431/*
432 * RS format. possible option is SLLAO
433 * 0 1 2 3
434 * 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
435 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
436 * | Type | Code | Checksum |
437 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
438 * | Reserved |
439 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
440 * | Options ...
441 * +-+-+-+-+-+-+-+-+-+-+-+-
442 *
443 *
444 * RA format. possible options: prefix information, MTU, SLLAO
445 * 0 1 2 3
446 * 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
447 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
448 * | Type | Code | Checksum |
449 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
450 * | Cur Hop Limit |M|O| Reserved | Router Lifetime |
451 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
452 * | Reachable Time |
453 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
454 * | Retrans Timer |
455 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
456 * | Options ...
457 * +-+-+-+-+-+-+-+-+-+-+-+-
458 *
459 *
460 * NS format: options should be SLLAO
461 * 0 1 2 3
462 * 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
463 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
464 * | Type | Code | Checksum |
465 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
466 * | Reserved |
467 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
468 * | |
469 * + +
470 * | |
471 * + Target Address +
472 * | |
473 * + +
474 * | |
475 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
476 * | Options ...
477 * +-+-+-+-+-+-+-+-+-+-+-+-
478 *
479 *
480 * NA message format. possible options is TLLAO
481 *
482 * 0 1 2 3
483 * 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
484 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
485 * | Type | Code | Checksum |
486 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
487 * |R|S|O| Reserved |
488 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
489 * | |
490 * + +
491 * | |
492 * + Target Address +
493 * | |
494 * + +
495 * | |
496 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
497 * | Options ...
498 * +-+-+-+-+-+-+-+-+-+-+-+-
499 *
500 *
501 * Redirect message format. Possible options are TLLAO and Redirected header
502 *
503 * 0 1 2 3
504 * 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
505 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
506 * | Type | Code | Checksum |
507 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
508 * | Reserved |
509 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
510 * | |
511 * + +
512 * | |
513 * + Target Address +
514 * | |
515 * + +
516 * | |
517 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
518 * | |
519 * + +
520 * | |
521 * + Destination Address +
522 * | |
523 * + +
524 * | |
525 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
526 * | Options ...
527 * +-+-+-+-+-+-+-+-+-+-+-+-
528 *
529 *
530 * SLLAO/TLLAO option:
531 * 0 1 2 3
532 * 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
533 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
534 * | Type | Length | Link-Layer Address ...
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
536 *
537 *
538 * Prefix information option
539 * 0 1 2 3
540 * 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
541 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
542 * | Type | Length | Prefix Length |L|A| Reserved1 |
543 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
544 * | Valid Lifetime |
545 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
546 * | Preferred Lifetime |
547 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
548 * | Reserved2 |
549 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
550 * | |
551 * + +
552 * | |
553 * + Prefix +
554 * | |
555 * + +
556 * | |
557 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
558 *
559 *
560 * MTU option
561 * 0 1 2 3
562 * 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
563 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
564 * | Type | Length | Reserved |
565 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 * | MTU |
567 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
568 *
569 *
570 * Redirected header option
571 *
572 * 0 1 2 3
573 * 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
574 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
575 * | Type | Length | Reserved |
576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
577 * | Reserved |
578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
579 * | |
580 * ~ IP header + data ~
581 * | |
582 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
583 *
584 */
585#endif /* UIP_ND6_H_ */
586
587/** @} */
void uip_nd6_ns_output(const uip_ipaddr_t *src, const uip_ipaddr_t *dest, uip_ipaddr_t *tgt)
Send a neighbor solicitation, send a Neighbor Advertisement.
struct uip_nd6_opt_prefix_info uip_nd6_opt_prefix_info
ND option prefix information.
struct uip_nd6_na uip_nd6_na
A neighbor advertisement constant part.
struct uip_nd6_opt_dns uip_nd6_opt_dns
ND option RDNSS.
void uip_nd6_rs_output(void)
Send a Router Solicitation.
Definition: uip-nd6.c:819
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:1117
struct uip_nd6_ns uip_nd6_ns
A neighbor solicitation constant part.
struct uip_nd6_opt_hdr uip_nd6_opt_hdr
ND option header.
struct uip_nd6_rs uip_nd6_rs
A router solicitation constant part.
struct uip_nd6_ra uip_nd6_ra
A router advertisement constant part.
struct uip_nd6_opt_mtu uip_nd6_opt_mtu
ND option MTU.
Second timer library header file.
A neighbor advertisement constant part.
Definition: uip-nd6.h:278
A neighbor solicitation constant part.
Definition: uip-nd6.h:268
ND option RDNSS.
Definition: uip-nd6.h:350
ND option header.
Definition: uip-nd6.h:324
ND option MTU.
Definition: uip-nd6.h:342
ND option prefix information.
Definition: uip-nd6.h:330
A router advertisement constant part.
Definition: uip-nd6.h:298
A redirect message constant part.
Definition: uip-nd6.h:311
A router solicitation constant part.
Definition: uip-nd6.h:289
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Definition: uip-nd6.c:116
Header file for the uIP TCP/IP stack.