2011-01-05 18:01:03 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006, Swedish Institute of Computer Science.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the Institute nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* This file is part of the Contiki operating system.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-11-08 01:15:42 +01:00
|
|
|
/**
|
2015-02-15 19:02:07 +01:00
|
|
|
* \addtogroup uip6
|
|
|
|
* @{
|
2014-11-08 01:15:42 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2015-02-15 19:02:07 +01:00
|
|
|
* \file
|
|
|
|
* Header file for IPv6 Neighbor discovery (RFC 4861)
|
|
|
|
* \author Julien Abeille <jabeille@cisco.com>
|
|
|
|
* \author Mathilde Durvy <mdurvy@cisco.com>
|
2014-11-08 01:15:42 +01:00
|
|
|
*/
|
|
|
|
|
2013-11-24 16:57:08 +01:00
|
|
|
#ifndef UIP_ND6_H_
|
|
|
|
#define UIP_ND6_H_
|
2011-01-05 18:01:03 +01:00
|
|
|
|
2013-11-22 09:17:54 +01:00
|
|
|
#include "net/ip/uip.h"
|
2011-01-05 18:01:03 +01:00
|
|
|
#include "sys/stimer.h"
|
|
|
|
/**
|
2011-07-11 12:04:52 +02:00
|
|
|
* \name General
|
|
|
|
* @{
|
2011-01-05 18:01:03 +01:00
|
|
|
*/
|
|
|
|
/** \brief HOP LIMIT to be used when sending ND messages (255) */
|
|
|
|
#define UIP_ND6_HOP_LIMIT 255
|
|
|
|
/** \brief INFINITE lifetime */
|
|
|
|
#define UIP_ND6_INFINITE_LIFETIME 0xFFFFFFFF
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** \name RFC 4861 Host constant */
|
|
|
|
/** @{ */
|
2015-10-30 08:55:11 +01:00
|
|
|
/** \brief Maximum router solicitation delay */
|
2011-07-11 12:04:52 +02:00
|
|
|
#define UIP_ND6_MAX_RTR_SOLICITATION_DELAY 1
|
2015-10-30 08:55:11 +01:00
|
|
|
/** \brief Router solicitation interval */
|
2011-07-11 12:04:52 +02:00
|
|
|
#define UIP_ND6_RTR_SOLICITATION_INTERVAL 4
|
2015-10-30 08:55:11 +01:00
|
|
|
/** \brief Maximum router solicitations */
|
|
|
|
#define UIP_ND6_MAX_RTR_SOLICITATIONS 3
|
2011-01-05 18:01:03 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** \name RFC 4861 Router constants */
|
|
|
|
/** @{ */
|
|
|
|
#ifndef UIP_CONF_ND6_SEND_RA
|
|
|
|
#define UIP_ND6_SEND_RA 1 /* enable/disable RA sending */
|
|
|
|
#else
|
|
|
|
#define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
|
|
|
|
#endif
|
2013-07-02 13:52:11 +02:00
|
|
|
#ifndef UIP_CONF_ND6_SEND_NA
|
|
|
|
#define UIP_ND6_SEND_NA 1 /* enable/disable NA sending */
|
|
|
|
#else
|
|
|
|
#define UIP_ND6_SEND_NA UIP_CONF_ND6_SEND_NA
|
|
|
|
#endif
|
2013-05-15 16:05:20 +02:00
|
|
|
#ifndef UIP_CONF_ND6_MAX_RA_INTERVAL
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_MAX_RA_INTERVAL 600
|
2013-05-15 16:05:20 +02:00
|
|
|
#else
|
|
|
|
#define UIP_ND6_MAX_RA_INTERVAL UIP_CONF_ND6_MAX_RA_INTERVAL
|
|
|
|
#endif
|
|
|
|
#ifndef UIP_CONF_ND6_MIN_RA_INTERVAL
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3)
|
2013-05-15 16:05:20 +02:00
|
|
|
#else
|
|
|
|
#define UIP_ND6_MIN_RA_INTERVAL UIP_CONF_ND6_MIN_RA_INTERVAL
|
|
|
|
#endif
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_M_FLAG 0
|
2014-04-16 15:22:31 +02:00
|
|
|
#define UIP_ND6_O_FLAG (UIP_ND6_RA_RDNSS || UIP_ND6_RA_DNSSL)
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL
|
|
|
|
|
|
|
|
#define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/
|
|
|
|
#define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/
|
2013-05-15 16:05:20 +02:00
|
|
|
#ifndef UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/
|
2013-05-15 16:05:20 +02:00
|
|
|
#else
|
|
|
|
#define UIP_ND6_MIN_DELAY_BETWEEN_RAS UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS
|
|
|
|
#endif
|
2011-01-05 18:01:03 +01:00
|
|
|
//#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/
|
|
|
|
#define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/
|
|
|
|
/** @} */
|
|
|
|
|
2013-07-02 13:52:11 +02:00
|
|
|
#ifndef UIP_CONF_ND6_DEF_MAXDADNS
|
|
|
|
/** \brief Do not try DAD when using EUI-64 as allowed by draft-ietf-6lowpan-nd-15 section 8.2 */
|
|
|
|
#if UIP_CONF_LL_802154
|
|
|
|
#define UIP_ND6_DEF_MAXDADNS 0
|
|
|
|
#else /* UIP_CONF_LL_802154 */
|
|
|
|
#define UIP_ND6_DEF_MAXDADNS UIP_ND6_SEND_NA
|
|
|
|
#endif /* UIP_CONF_LL_802154 */
|
|
|
|
#else /* UIP_CONF_ND6_DEF_MAXDADNS */
|
|
|
|
#define UIP_ND6_DEF_MAXDADNS UIP_CONF_ND6_DEF_MAXDADNS
|
|
|
|
#endif /* UIP_CONF_ND6_DEF_MAXDADNS */
|
2011-01-05 18:01:03 +01:00
|
|
|
|
|
|
|
/** \name RFC 4861 Node constant */
|
|
|
|
#define UIP_ND6_MAX_MULTICAST_SOLICIT 3
|
2012-11-26 19:40:14 +01:00
|
|
|
|
|
|
|
#ifdef UIP_CONF_ND6_MAX_UNICAST_SOLICIT
|
|
|
|
#define UIP_ND6_MAX_UNICAST_SOLICIT UIP_CONF_ND6_MAX_UNICAST_SOLICIT
|
|
|
|
#else /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_MAX_UNICAST_SOLICIT 3
|
2012-11-26 19:40:14 +01:00
|
|
|
#endif /* UIP_CONF_ND6_MAX_UNICAST_SOLICIT */
|
|
|
|
|
2011-01-05 18:01:03 +01:00
|
|
|
#ifdef UIP_CONF_ND6_REACHABLE_TIME
|
|
|
|
#define UIP_ND6_REACHABLE_TIME UIP_CONF_ND6_REACHABLE_TIME
|
|
|
|
#else
|
|
|
|
#define UIP_ND6_REACHABLE_TIME 30000
|
|
|
|
#endif
|
2012-11-26 19:40:14 +01:00
|
|
|
|
2011-01-05 18:01:03 +01:00
|
|
|
#ifdef UIP_CONF_ND6_RETRANS_TIMER
|
2015-10-30 11:41:59 +01:00
|
|
|
#define UIP_ND6_RETRANS_TIMER UIP_CONF_ND6_RETRANS_TIMER
|
2011-01-05 18:01:03 +01:00
|
|
|
#else
|
2015-10-30 11:41:59 +01:00
|
|
|
#define UIP_ND6_RETRANS_TIMER 1000
|
2011-01-05 18:01:03 +01:00
|
|
|
#endif
|
2012-11-26 19:40:14 +01:00
|
|
|
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_DELAY_FIRST_PROBE_TIME 5
|
|
|
|
#define UIP_ND6_MIN_RANDOM_FACTOR(x) (x / 2)
|
|
|
|
#define UIP_ND6_MAX_RANDOM_FACTOR(x) ((x) + (x) / 2)
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
|
2014-04-16 15:22:31 +02:00
|
|
|
/** \name RFC 6106 RA DNS Options Constants */
|
|
|
|
/** @{ */
|
|
|
|
#ifndef UIP_CONF_ND6_RA_RDNSS
|
|
|
|
#define UIP_ND6_RA_RDNSS 0
|
|
|
|
#else
|
|
|
|
#define UIP_ND6_RA_RDNSS UIP_CONF_ND6_RA_RDNSS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef UIP_CONF_ND6_RA_DNSSL
|
|
|
|
#define UIP_ND6_RA_DNSSL 0
|
|
|
|
#else
|
|
|
|
#error Not implemented
|
|
|
|
#define UIP_ND6_RA_DNSSL UIP_CONF_ND6_RA_DNSSL
|
|
|
|
#endif
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
|
2011-01-05 18:01:03 +01:00
|
|
|
/** \name ND6 option types */
|
|
|
|
/** @{ */
|
|
|
|
#define UIP_ND6_OPT_SLLAO 1
|
|
|
|
#define UIP_ND6_OPT_TLLAO 2
|
|
|
|
#define UIP_ND6_OPT_PREFIX_INFO 3
|
|
|
|
#define UIP_ND6_OPT_REDIRECTED_HDR 4
|
|
|
|
#define UIP_ND6_OPT_MTU 5
|
2014-04-16 15:22:31 +02:00
|
|
|
#define UIP_ND6_OPT_RDNSS 25
|
|
|
|
#define UIP_ND6_OPT_DNSSL 31
|
2011-01-05 18:01:03 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** \name ND6 option types */
|
|
|
|
/** @{ */
|
|
|
|
#define UIP_ND6_OPT_TYPE_OFFSET 0
|
|
|
|
#define UIP_ND6_OPT_LEN_OFFSET 1
|
|
|
|
#define UIP_ND6_OPT_DATA_OFFSET 2
|
|
|
|
|
|
|
|
/** \name ND6 message length (excluding options) */
|
|
|
|
/** @{ */
|
2011-07-11 12:04:52 +02:00
|
|
|
#define UIP_ND6_NA_LEN 20
|
|
|
|
#define UIP_ND6_NS_LEN 20
|
2011-01-05 18:01:03 +01:00
|
|
|
#define UIP_ND6_RA_LEN 12
|
|
|
|
#define UIP_ND6_RS_LEN 4
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
|
|
|
|
/** \name ND6 option length in bytes */
|
|
|
|
/** @{ */
|
|
|
|
#define UIP_ND6_OPT_HDR_LEN 2
|
|
|
|
#define UIP_ND6_OPT_PREFIX_INFO_LEN 32
|
|
|
|
#define UIP_ND6_OPT_MTU_LEN 8
|
2014-04-16 15:22:31 +02:00
|
|
|
#define UIP_ND6_OPT_RDNSS_LEN 1
|
|
|
|
#define UIP_ND6_OPT_DNSSL_LEN 1
|
2011-01-05 18:01:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Length of TLLAO and SLLAO options, it is L2 dependant */
|
|
|
|
#if UIP_CONF_LL_802154
|
|
|
|
/* If the interface is 802.15.4. For now we use only long addresses */
|
|
|
|
#define UIP_ND6_OPT_SHORT_LLAO_LEN 8
|
|
|
|
#define UIP_ND6_OPT_LONG_LLAO_LEN 16
|
|
|
|
/** \brief length of a ND6 LLAO option for 802.15.4 */
|
2011-07-11 12:04:52 +02:00
|
|
|
#define UIP_ND6_OPT_LLAO_LEN UIP_ND6_OPT_LONG_LLAO_LEN
|
2011-01-05 18:01:03 +01:00
|
|
|
#else /*UIP_CONF_LL_802154*/
|
|
|
|
#if UIP_CONF_LL_80211
|
|
|
|
/* If the interface is 802.11 */
|
|
|
|
/** \brief length of a ND6 LLAO option for 802.11 */
|
|
|
|
#define UIP_ND6_OPT_LLAO_LEN 8
|
|
|
|
#else /*UIP_CONF_LL_80211*/
|
|
|
|
/** \brief length of a ND6 LLAO option for default L2 type (e.g. Ethernet) */
|
|
|
|
#define UIP_ND6_OPT_LLAO_LEN 8
|
|
|
|
#endif /*UIP_CONF_LL_80211*/
|
|
|
|
#endif /*UIP_CONF_LL_802154*/
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
|
|
|
|
/** \name Neighbor Advertisement flags masks */
|
|
|
|
/** @{ */
|
|
|
|
#define UIP_ND6_NA_FLAG_ROUTER 0x80
|
|
|
|
#define UIP_ND6_NA_FLAG_SOLICITED 0x40
|
|
|
|
#define UIP_ND6_NA_FLAG_OVERRIDE 0x20
|
2011-07-11 12:04:52 +02:00
|
|
|
#define UIP_ND6_RA_FLAG_ONLINK 0x80
|
|
|
|
#define UIP_ND6_RA_FLAG_AUTONOMOUS 0x40
|
2011-01-05 18:01:03 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \name ND message structures
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2011-07-11 12:04:52 +02:00
|
|
|
/**
|
2011-01-05 18:01:03 +01:00
|
|
|
* \brief A neighbor solicitation constant part
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Possible option is: SLLAO
|
|
|
|
*/
|
|
|
|
typedef struct uip_nd6_ns {
|
|
|
|
uint32_t reserved;
|
|
|
|
uip_ipaddr_t tgtipaddr;
|
|
|
|
} uip_nd6_ns;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief A neighbor advertisement constant part.
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Possible option is: TLLAO
|
2011-07-11 12:04:52 +02:00
|
|
|
*/
|
2011-01-05 18:01:03 +01:00
|
|
|
typedef struct uip_nd6_na {
|
|
|
|
uint8_t flagsreserved;
|
|
|
|
uint8_t reserved[3];
|
|
|
|
uip_ipaddr_t tgtipaddr;
|
|
|
|
} uip_nd6_na;
|
|
|
|
|
2011-07-11 12:04:52 +02:00
|
|
|
/**
|
2011-01-05 18:01:03 +01:00
|
|
|
* \brief A router solicitation constant part
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
|
|
|
* Possible option is: SLLAO
|
2011-01-05 18:01:03 +01:00
|
|
|
*/
|
|
|
|
typedef struct uip_nd6_rs {
|
|
|
|
uint32_t reserved;
|
|
|
|
} uip_nd6_rs;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief A router advertisement constant part
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Possible options are: SLLAO, MTU, Prefix Information
|
|
|
|
*/
|
|
|
|
typedef struct uip_nd6_ra {
|
|
|
|
uint8_t cur_ttl;
|
|
|
|
uint8_t flags_reserved;
|
|
|
|
uint16_t router_lifetime;
|
|
|
|
uint32_t reachable_time;
|
|
|
|
uint32_t retrans_timer;
|
|
|
|
} uip_nd6_ra;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief A redirect message constant part
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Possible options are: TLLAO, redirected header
|
|
|
|
*/
|
|
|
|
typedef struct uip_nd6_redirect {
|
|
|
|
uint32_t reserved;
|
2011-07-11 12:04:52 +02:00
|
|
|
uip_ipaddr_t tgtipaddress;
|
|
|
|
uip_ipaddr_t destipaddress;
|
2011-01-05 18:01:03 +01:00
|
|
|
} uip_nd6_redirect;
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \name ND Option structures
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \brief ND option header */
|
|
|
|
typedef struct uip_nd6_opt_hdr {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t len;
|
|
|
|
} uip_nd6_opt_hdr;
|
|
|
|
|
|
|
|
/** \brief ND option prefix information */
|
|
|
|
typedef struct uip_nd6_opt_prefix_info {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t len;
|
|
|
|
uint8_t preflen;
|
|
|
|
uint8_t flagsreserved1;
|
|
|
|
uint32_t validlt;
|
|
|
|
uint32_t preferredlt;
|
|
|
|
uint32_t reserved2;
|
|
|
|
uip_ipaddr_t prefix;
|
|
|
|
} uip_nd6_opt_prefix_info ;
|
|
|
|
|
|
|
|
/** \brief ND option MTU */
|
|
|
|
typedef struct uip_nd6_opt_mtu {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t len;
|
|
|
|
uint16_t reserved;
|
|
|
|
uint32_t mtu;
|
|
|
|
} uip_nd6_opt_mtu;
|
|
|
|
|
2014-04-16 15:22:31 +02:00
|
|
|
/** \brief ND option RDNSS */
|
|
|
|
typedef struct uip_nd6_opt_dns {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t len;
|
|
|
|
uint16_t reserved;
|
|
|
|
uint32_t lifetime;
|
|
|
|
uip_ipaddr_t ip;
|
|
|
|
} uip_nd6_opt_dns;
|
|
|
|
|
2011-01-05 18:01:03 +01:00
|
|
|
/** \struct Redirected header option */
|
|
|
|
typedef struct uip_nd6_opt_redirected_hdr {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t len;
|
|
|
|
uint8_t reserved[6];
|
|
|
|
} uip_nd6_opt_redirected_hdr;
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \name ND Messages Processing and Generation
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2011-07-11 12:04:52 +02:00
|
|
|
* \brief Send a neighbor solicitation, send a Neighbor Advertisement
|
2011-01-05 18:01:03 +01:00
|
|
|
* \param src pointer to the src of the NS if known
|
|
|
|
* \param dest pointer to ip address to send the NS, for DAD or ADDR Resol,
|
|
|
|
* MUST be NULL, for NUD, must be correct unicast dest
|
|
|
|
* \param tgt pointer to ip address to fill the target address field, must
|
|
|
|
* not be NULL
|
|
|
|
*
|
|
|
|
* - RFC 4861, 7.2.2 :
|
|
|
|
* "If the source address of the packet prompting the solicitation is the
|
|
|
|
* same as one of the addresses assigned to the outgoing interface, that
|
|
|
|
* address SHOULD be placed in the IP Source Address of the outgoing
|
|
|
|
* solicitation. Otherwise, any one of the addresses assigned to the
|
|
|
|
* interface should be used."
|
|
|
|
* This is why we have a src ip address as argument. If NULL, we will do
|
2011-07-11 12:04:52 +02:00
|
|
|
* src address selection, otherwise we use the argument.
|
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* - we check if it is a NS for Address resolution or NUD, if yes we include
|
|
|
|
* a SLLAO option, otherwise no.
|
|
|
|
*/
|
|
|
|
void
|
2011-07-11 12:04:52 +02:00
|
|
|
uip_nd6_ns_output(uip_ipaddr_t *src, uip_ipaddr_t *dest, uip_ipaddr_t *tgt);
|
2011-01-05 18:01:03 +01:00
|
|
|
|
|
|
|
#if UIP_CONF_ROUTER
|
|
|
|
#if UIP_ND6_SEND_RA
|
|
|
|
/**
|
|
|
|
* \brief send a Router Advertisement
|
|
|
|
*
|
|
|
|
* Only for router, for periodic as well as sollicited RA
|
|
|
|
*/
|
|
|
|
void uip_nd6_ra_output(uip_ipaddr_t *dest);
|
|
|
|
#endif /* UIP_ND6_SEND_RA */
|
|
|
|
#endif /*UIP_CONF_ROUTER*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Send a Router Solicitation
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* src is chosen through the uip_netif_select_src function. If src is
|
|
|
|
* unspecified (i.e. we do not have a preferred address yet), then we do not
|
|
|
|
* put a SLLAO option (MUST NOT in RFC 4861). Otherwise we do.
|
|
|
|
*
|
2011-07-11 12:04:52 +02:00
|
|
|
* RS message format,
|
2011-01-05 18:01:03 +01:00
|
|
|
* possible option is SLLAO, MUST NOT be included if source = unspecified
|
|
|
|
* SHOULD be included otherwise
|
|
|
|
*/
|
|
|
|
void uip_nd6_rs_output(void);
|
|
|
|
|
|
|
|
/**
|
2014-03-08 22:35:17 +01:00
|
|
|
* \brief Initialise the uIP ND core
|
2011-01-05 18:01:03 +01:00
|
|
|
*/
|
2014-03-08 22:35:17 +01:00
|
|
|
void uip_nd6_init(void);
|
2011-01-05 18:01:03 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2011-07-11 12:04:52 +02:00
|
|
|
uip_appserver_addr_get(uip_ipaddr_t *ipaddr);
|
2011-01-05 18:01:03 +01:00
|
|
|
/*--------------------------------------*/
|
|
|
|
/******* ANNEX - message formats ********/
|
|
|
|
/*--------------------------------------*/
|
|
|
|
|
2011-07-11 12:04:52 +02:00
|
|
|
/*
|
|
|
|
* RS format. possible option is SLLAO
|
2011-01-05 18:01:03 +01:00
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Code | Checksum |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Options ...
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* RA format. possible options: prefix information, MTU, SLLAO
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Code | Checksum |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Cur Hop Limit |M|O| Reserved | Router Lifetime |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Reachable Time |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Retrans Timer |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Options ...
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* NS format: options should be SLLAO
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Code | Checksum |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* + Target Address +
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Options ...
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* NA message format. possible options is TLLAO
|
|
|
|
*
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Code | Checksum |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* |R|S|O| Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* + Target Address +
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Options ...
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
*
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Redirect message format. Possible options are TLLAO and Redirected header
|
|
|
|
*
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Code | Checksum |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* + Target Address +
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* + Destination Address +
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Options ...
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-
|
|
|
|
*
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* SLLAO/TLLAO option:
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Length | Link-Layer Address ...
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Prefix information option
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Length | Prefix Length |L|A| Reserved1 |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Valid Lifetime |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Preferred Lifetime |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Reserved2 |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* + Prefix +
|
|
|
|
* | |
|
|
|
|
* + +
|
|
|
|
* | |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* MTU option
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Length | Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | MTU |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2011-07-11 12:04:52 +02:00
|
|
|
*
|
|
|
|
*
|
2011-01-05 18:01:03 +01:00
|
|
|
* Redirected header option
|
|
|
|
*
|
|
|
|
* 0 1 2 3
|
|
|
|
* 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
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Type | Length | Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | Reserved |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
* | |
|
|
|
|
* ~ IP header + data ~
|
|
|
|
* | |
|
|
|
|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
*
|
2011-07-11 12:04:52 +02:00
|
|
|
*/
|
2013-11-24 16:57:08 +01:00
|
|
|
#endif /* UIP_ND6_H_ */
|
2011-01-05 18:01:03 +01:00
|
|
|
|
|
|
|
/** @} */
|