Merge pull request #2073 from cetic/pr-fix-send-na
Fix semantic of UIP_ND6_SEND_NA and add UIP_ND6_SEND_NS
This commit is contained in:
commit
5eb2ac15ff
|
@ -211,7 +211,7 @@
|
||||||
#define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
|
#define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
|
||||||
#endif /* UIP_CONF_ND6_SEND_RA */
|
#endif /* UIP_CONF_ND6_SEND_RA */
|
||||||
|
|
||||||
/* UIP_CONF_ND6_SEND_NA enables standard IPv6 Neighbor Discovery Protocol.
|
/* UIP_CONF_ND6_SEND_NS enables standard IPv6 Neighbor Discovery Protocol.
|
||||||
We enable it by default when IPv6 is used without RPL.
|
We enable it by default when IPv6 is used without RPL.
|
||||||
With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
|
With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping)
|
||||||
is fed whenever receiving DIO and DAO messages. This is always sufficient
|
is fed whenever receiving DIO and DAO messages. This is always sufficient
|
||||||
|
@ -221,9 +221,15 @@
|
||||||
neighbor to us is weak, if DIO transmissions are suppressed (Trickle
|
neighbor to us is weak, if DIO transmissions are suppressed (Trickle
|
||||||
timer) or if the neighbor chooses not to transmit DIOs because it is
|
timer) or if the neighbor chooses not to transmit DIOs because it is
|
||||||
a leaf node or for any reason. */
|
a leaf node or for any reason. */
|
||||||
|
#ifndef UIP_CONF_ND6_SEND_NS
|
||||||
|
#define UIP_CONF_ND6_SEND_NS (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
|
||||||
|
#endif /* UIP_CONF_ND6_SEND_NS */
|
||||||
|
/* UIP_CONF_ND6_SEND_NA allows to still comply with NDP even if the host does
|
||||||
|
not perform NUD or DAD processes. By default it is activated so the host
|
||||||
|
can still communicate with a full NDP peer. */
|
||||||
#ifndef UIP_CONF_ND6_SEND_NA
|
#ifndef UIP_CONF_ND6_SEND_NA
|
||||||
#define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL)
|
#define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6)
|
||||||
#endif /* UIP_CONF_ND6_SEND_NA */
|
#endif /* UIP_CONF_ND6_SEND_NS */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* 6lowpan configuration options.
|
/* 6lowpan configuration options.
|
||||||
|
|
|
@ -662,7 +662,7 @@ tcpip_ipv6_output(void)
|
||||||
|
|
||||||
nbr = uip_ds6_nbr_lookup(nexthop);
|
nbr = uip_ds6_nbr_lookup(nexthop);
|
||||||
if(nbr == NULL) {
|
if(nbr == NULL) {
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
if((nbr = uip_ds6_nbr_add(nexthop, NULL, 0, NBR_INCOMPLETE, NBR_TABLE_REASON_IPV6_ND, NULL)) == NULL) {
|
if((nbr = uip_ds6_nbr_add(nexthop, NULL, 0, NBR_INCOMPLETE, NBR_TABLE_REASON_IPV6_ND, NULL)) == NULL) {
|
||||||
uip_clear_buf();
|
uip_clear_buf();
|
||||||
PRINTF("tcpip_ipv6_output: failed to add neighbor to cache\n");
|
PRINTF("tcpip_ipv6_output: failed to add neighbor to cache\n");
|
||||||
|
@ -691,13 +691,13 @@ tcpip_ipv6_output(void)
|
||||||
nbr->nscount = 1;
|
nbr->nscount = 1;
|
||||||
/* Send the first NS try from here (multicast destination IP address). */
|
/* Send the first NS try from here (multicast destination IP address). */
|
||||||
}
|
}
|
||||||
#else /* UIP_ND6_SEND_NA */
|
#else /* UIP_ND6_SEND_NS */
|
||||||
PRINTF("tcpip_ipv6_output: neighbor not in cache\n");
|
PRINTF("tcpip_ipv6_output: neighbor not in cache\n");
|
||||||
uip_len = 0;
|
uip_len = 0;
|
||||||
return;
|
return;
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
} else {
|
} else {
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
if(nbr->state == NBR_INCOMPLETE) {
|
if(nbr->state == NBR_INCOMPLETE) {
|
||||||
PRINTF("tcpip_ipv6_output: nbr cache entry incomplete\n");
|
PRINTF("tcpip_ipv6_output: nbr cache entry incomplete\n");
|
||||||
#if UIP_CONF_IPV6_QUEUE_PKT
|
#if UIP_CONF_IPV6_QUEUE_PKT
|
||||||
|
@ -719,7 +719,7 @@ tcpip_ipv6_output(void)
|
||||||
nbr->nscount = 0;
|
nbr->nscount = 0;
|
||||||
PRINTF("tcpip_ipv6_output: nbr cache entry stale moving to delay\n");
|
PRINTF("tcpip_ipv6_output: nbr cache entry stale moving to delay\n");
|
||||||
}
|
}
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
tcpip_output(uip_ds6_nbr_get_ll(nbr));
|
tcpip_output(uip_ds6_nbr_get_ll(nbr));
|
||||||
|
|
||||||
|
|
|
@ -88,14 +88,14 @@ uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr,
|
||||||
, reason, data);
|
, reason, data);
|
||||||
if(nbr) {
|
if(nbr) {
|
||||||
uip_ipaddr_copy(&nbr->ipaddr, ipaddr);
|
uip_ipaddr_copy(&nbr->ipaddr, ipaddr);
|
||||||
#if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER
|
#if UIP_ND6_SEND_RA || !UIP_CONF_ROUTER
|
||||||
nbr->isrouter = isrouter;
|
nbr->isrouter = isrouter;
|
||||||
#endif /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER */
|
#endif /* UIP_ND6_SEND_RA || !UIP_CONF_ROUTER */
|
||||||
nbr->state = state;
|
nbr->state = state;
|
||||||
#if UIP_CONF_IPV6_QUEUE_PKT
|
#if UIP_CONF_IPV6_QUEUE_PKT
|
||||||
uip_packetqueue_new(&nbr->packethandle);
|
uip_packetqueue_new(&nbr->packethandle);
|
||||||
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
if(nbr->state == NBR_REACHABLE) {
|
if(nbr->state == NBR_REACHABLE) {
|
||||||
stimer_set(&nbr->reachable, UIP_ND6_REACHABLE_TIME / 1000);
|
stimer_set(&nbr->reachable, UIP_ND6_REACHABLE_TIME / 1000);
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,7 +104,7 @@ uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr,
|
||||||
}
|
}
|
||||||
stimer_set(&nbr->sendns, 0);
|
stimer_set(&nbr->sendns, 0);
|
||||||
nbr->nscount = 0;
|
nbr->nscount = 0;
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
PRINTF("Adding neighbor with ip addr ");
|
PRINTF("Adding neighbor with ip addr ");
|
||||||
PRINT6ADDR(ipaddr);
|
PRINT6ADDR(ipaddr);
|
||||||
PRINTF(" link addr ");
|
PRINTF(" link addr ");
|
||||||
|
@ -245,7 +245,7 @@ uip_ds6_link_neighbor_callback(int status, int numtx)
|
||||||
#endif /* UIP_DS6_LL_NUD */
|
#endif /* UIP_DS6_LL_NUD */
|
||||||
|
|
||||||
}
|
}
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/** Periodic processing on neighbors */
|
/** Periodic processing on neighbors */
|
||||||
void
|
void
|
||||||
|
@ -326,7 +326,6 @@ uip_ds6_neighbor_periodic(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#if UIP_ND6_SEND_NA
|
|
||||||
void
|
void
|
||||||
uip_ds6_nbr_refresh_reachable_state(const uip_ipaddr_t *ipaddr)
|
uip_ds6_nbr_refresh_reachable_state(const uip_ipaddr_t *ipaddr)
|
||||||
{
|
{
|
||||||
|
@ -338,7 +337,6 @@ uip_ds6_nbr_refresh_reachable_state(const uip_ipaddr_t *ipaddr)
|
||||||
stimer_set(&nbr->reachable, UIP_ND6_REACHABLE_TIME / 1000);
|
stimer_set(&nbr->reachable, UIP_ND6_REACHABLE_TIME / 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
uip_ds6_nbr_t *
|
uip_ds6_nbr_t *
|
||||||
uip_ds6_get_least_lifetime_neighbor(void)
|
uip_ds6_get_least_lifetime_neighbor(void)
|
||||||
|
@ -358,6 +356,6 @@ uip_ds6_get_least_lifetime_neighbor(void)
|
||||||
}
|
}
|
||||||
return nbr_expiring;
|
return nbr_expiring;
|
||||||
}
|
}
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -69,11 +69,11 @@ typedef struct uip_ds6_nbr {
|
||||||
uip_ipaddr_t ipaddr;
|
uip_ipaddr_t ipaddr;
|
||||||
uint8_t isrouter;
|
uint8_t isrouter;
|
||||||
uint8_t state;
|
uint8_t state;
|
||||||
#if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA
|
#if UIP_ND6_SEND_NS || UIP_ND6_SEND_RA
|
||||||
struct stimer reachable;
|
struct stimer reachable;
|
||||||
struct stimer sendns;
|
struct stimer sendns;
|
||||||
uint8_t nscount;
|
uint8_t nscount;
|
||||||
#endif /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA */
|
#endif /* UIP_ND6_SEND_NS || UIP_ND6_SEND_RA */
|
||||||
#if UIP_CONF_IPV6_QUEUE_PKT
|
#if UIP_CONF_IPV6_QUEUE_PKT
|
||||||
struct uip_packetqueue_handle packethandle;
|
struct uip_packetqueue_handle packethandle;
|
||||||
#define UIP_DS6_NBR_PACKET_LIFETIME CLOCK_SECOND * 4
|
#define UIP_DS6_NBR_PACKET_LIFETIME CLOCK_SECOND * 4
|
||||||
|
@ -98,7 +98,7 @@ void uip_ds6_link_neighbor_callback(int status, int numtx);
|
||||||
void uip_ds6_neighbor_periodic(void);
|
void uip_ds6_neighbor_periodic(void);
|
||||||
int uip_ds6_nbr_num(void);
|
int uip_ds6_nbr_num(void);
|
||||||
|
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
/**
|
/**
|
||||||
* \brief Refresh the reachable state of a neighbor. This function
|
* \brief Refresh the reachable state of a neighbor. This function
|
||||||
* may be called when a node receives an IPv6 message that confirms the
|
* may be called when a node receives an IPv6 message that confirms the
|
||||||
|
@ -107,7 +107,7 @@ int uip_ds6_nbr_num(void);
|
||||||
* should be refreshed.
|
* should be refreshed.
|
||||||
*/
|
*/
|
||||||
void uip_ds6_nbr_refresh_reachable_state(const uip_ipaddr_t *ipaddr);
|
void uip_ds6_nbr_refresh_reachable_state(const uip_ipaddr_t *ipaddr);
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief
|
* \brief
|
||||||
|
|
|
@ -187,9 +187,9 @@ uip_ds6_periodic(void)
|
||||||
}
|
}
|
||||||
#endif /* !UIP_CONF_ROUTER */
|
#endif /* !UIP_CONF_ROUTER */
|
||||||
|
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
uip_ds6_neighbor_periodic();
|
uip_ds6_neighbor_periodic();
|
||||||
#endif /* UIP_ND6_SEND_RA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
#if UIP_CONF_ROUTER && UIP_ND6_SEND_RA
|
#if UIP_CONF_ROUTER && UIP_ND6_SEND_RA
|
||||||
/* Periodic RA sending */
|
/* Periodic RA sending */
|
||||||
|
|
|
@ -116,13 +116,16 @@ void uip_log(char *msg);
|
||||||
#define UIP_ND6_OPT_RDNSS_BUF ((uip_nd6_opt_dns *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
|
#define UIP_ND6_OPT_RDNSS_BUF ((uip_nd6_opt_dns *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset])
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
#if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER
|
#if UIP_ND6_SEND_NS || UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER
|
||||||
static uint8_t nd6_opt_offset; /** Offset from the end of the icmpv6 header to the option in uip_buf*/
|
static uint8_t nd6_opt_offset; /** Offset from the end of the icmpv6 header to the option in uip_buf*/
|
||||||
static uint8_t *nd6_opt_llao; /** Pointer to llao option in uip_buf */
|
static uint8_t *nd6_opt_llao; /** Pointer to llao option in uip_buf */
|
||||||
static uip_ds6_nbr_t *nbr; /** Pointer to a nbr cache entry*/
|
static uip_ds6_nbr_t *nbr; /** Pointer to a nbr cache entry*/
|
||||||
static uip_ds6_defrt_t *defrt; /** Pointer to a router list entry */
|
|
||||||
static uip_ds6_addr_t *addr; /** Pointer to an interface address */
|
static uip_ds6_addr_t *addr; /** Pointer to an interface address */
|
||||||
#endif /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER */
|
#endif /* UIP_ND6_SEND_NS || UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER */
|
||||||
|
|
||||||
|
#if UIP_ND6_SEND_NS || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER
|
||||||
|
static uip_ds6_defrt_t *defrt; /** Pointer to a router list entry */
|
||||||
|
#endif /* UIP_ND6_SEND_NS || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER */
|
||||||
|
|
||||||
#if !UIP_CONF_ROUTER // TBD see if we move it to ra_input
|
#if !UIP_CONF_ROUTER // TBD see if we move it to ra_input
|
||||||
static uip_nd6_opt_prefix_info *nd6_opt_prefix_info; /** Pointer to prefix information option in uip_buf */
|
static uip_nd6_opt_prefix_info *nd6_opt_prefix_info; /** Pointer to prefix information option in uip_buf */
|
||||||
|
@ -366,6 +369,7 @@ discard:
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
|
#if UIP_ND6_SEND_NS
|
||||||
void
|
void
|
||||||
uip_nd6_ns_output(uip_ipaddr_t * src, uip_ipaddr_t * dest, uip_ipaddr_t * tgt)
|
uip_nd6_ns_output(uip_ipaddr_t * src, uip_ipaddr_t * dest, uip_ipaddr_t * tgt)
|
||||||
{
|
{
|
||||||
|
@ -428,7 +432,9 @@ uip_nd6_ns_output(uip_ipaddr_t * src, uip_ipaddr_t * dest, uip_ipaddr_t * tgt)
|
||||||
PRINTF("\n");
|
PRINTF("\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if UIP_ND6_SEND_NA
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
|
#if UIP_ND6_SEND_NS
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* Neighbor Advertisement Processing
|
* Neighbor Advertisement Processing
|
||||||
|
@ -603,7 +609,7 @@ discard:
|
||||||
uip_clear_buf();
|
uip_clear_buf();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
#if UIP_CONF_ROUTER
|
#if UIP_CONF_ROUTER
|
||||||
#if UIP_ND6_SEND_RA
|
#if UIP_ND6_SEND_RA
|
||||||
|
@ -1097,6 +1103,8 @@ discard:
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NA
|
||||||
UIP_ICMP6_HANDLER(ns_input_handler, ICMP6_NS, UIP_ICMP6_HANDLER_CODE_ANY,
|
UIP_ICMP6_HANDLER(ns_input_handler, ICMP6_NS, UIP_ICMP6_HANDLER_CODE_ANY,
|
||||||
ns_input);
|
ns_input);
|
||||||
|
#endif
|
||||||
|
#if UIP_ND6_SEND_NS
|
||||||
UIP_ICMP6_HANDLER(na_input_handler, ICMP6_NA, UIP_ICMP6_HANDLER_CODE_ANY,
|
UIP_ICMP6_HANDLER(na_input_handler, ICMP6_NA, UIP_ICMP6_HANDLER_CODE_ANY,
|
||||||
na_input);
|
na_input);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1114,19 +1122,16 @@ UIP_ICMP6_HANDLER(ra_input_handler, ICMP6_RA, UIP_ICMP6_HANDLER_CODE_ANY,
|
||||||
void
|
void
|
||||||
uip_nd6_init()
|
uip_nd6_init()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NA
|
||||||
/* Only handle NSs if we are prepared to send out NAs */
|
/* Only handle NSs if we are prepared to send out NAs */
|
||||||
uip_icmp6_register_input_handler(&ns_input_handler);
|
uip_icmp6_register_input_handler(&ns_input_handler);
|
||||||
|
|
||||||
/*
|
|
||||||
* Only handle NAs if we are prepared to send out NAs.
|
|
||||||
* This is perhaps logically incorrect, but this condition was present in
|
|
||||||
* uip_process and we keep it until proven wrong
|
|
||||||
*/
|
|
||||||
uip_icmp6_register_input_handler(&na_input_handler);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if UIP_ND6_SEND_NS
|
||||||
|
/*
|
||||||
|
* Only handle NAs if we are prepared to send out NSs. */
|
||||||
|
uip_icmp6_register_input_handler(&na_input_handler);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if UIP_CONF_ROUTER && UIP_ND6_SEND_RA
|
#if UIP_CONF_ROUTER && UIP_ND6_SEND_RA
|
||||||
/* Only accept RS if we are a router and happy to send out RAs */
|
/* Only accept RS if we are a router and happy to send out RAs */
|
||||||
|
|
|
@ -86,6 +86,11 @@
|
||||||
#else
|
#else
|
||||||
#define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
|
#define UIP_ND6_SEND_RA UIP_CONF_ND6_SEND_RA
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef UIP_CONF_ND6_SEND_NS
|
||||||
|
#define UIP_ND6_SEND_NS 1 /* enable/disable NS sending */
|
||||||
|
#else
|
||||||
|
#define UIP_ND6_SEND_NS UIP_CONF_ND6_SEND_NS
|
||||||
|
#endif
|
||||||
#ifndef UIP_CONF_ND6_SEND_NA
|
#ifndef UIP_CONF_ND6_SEND_NA
|
||||||
#define UIP_ND6_SEND_NA 1 /* enable/disable NA sending */
|
#define UIP_ND6_SEND_NA 1 /* enable/disable NA sending */
|
||||||
#else
|
#else
|
||||||
|
@ -125,7 +130,7 @@
|
||||||
#if UIP_CONF_LL_802154
|
#if UIP_CONF_LL_802154
|
||||||
#define UIP_ND6_DEF_MAXDADNS 0
|
#define UIP_ND6_DEF_MAXDADNS 0
|
||||||
#else /* UIP_CONF_LL_802154 */
|
#else /* UIP_CONF_LL_802154 */
|
||||||
#define UIP_ND6_DEF_MAXDADNS UIP_ND6_SEND_NA
|
#define UIP_ND6_DEF_MAXDADNS UIP_ND6_SEND_NS
|
||||||
#endif /* UIP_CONF_LL_802154 */
|
#endif /* UIP_CONF_LL_802154 */
|
||||||
#else /* UIP_CONF_ND6_DEF_MAXDADNS */
|
#else /* UIP_CONF_ND6_DEF_MAXDADNS */
|
||||||
#define UIP_ND6_DEF_MAXDADNS UIP_CONF_ND6_DEF_MAXDADNS
|
#define UIP_ND6_DEF_MAXDADNS UIP_CONF_ND6_DEF_MAXDADNS
|
||||||
|
|
|
@ -85,9 +85,9 @@
|
||||||
#include "rpl/rpl-private.h"
|
#include "rpl/rpl-private.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
#include "net/ipv6/uip-ds6-nbr.h"
|
#include "net/ipv6/uip-ds6-nbr.h"
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -1156,11 +1156,11 @@ uip_process(uint8_t flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Refresh neighbor state after receiving a unicast message */
|
/* Refresh neighbor state after receiving a unicast message */
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
if(!uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) {
|
if(!uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) {
|
||||||
uip_ds6_nbr_refresh_reachable_state(&UIP_IP_BUF->srcipaddr);
|
uip_ds6_nbr_refresh_reachable_state(&UIP_IP_BUF->srcipaddr);
|
||||||
}
|
}
|
||||||
#endif /* UIP_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
#if UIP_CONF_ROUTER
|
#if UIP_CONF_ROUTER
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -215,13 +215,13 @@ rpl_parent_is_reachable(rpl_parent_t *p) {
|
||||||
if(p == NULL || p->dag == NULL || p->dag->instance == NULL || p->dag->instance->of == NULL) {
|
if(p == NULL || p->dag == NULL || p->dag->instance == NULL || p->dag->instance->of == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
#ifndef UIP_CONF_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
uip_ds6_nbr_t *nbr = rpl_get_nbr(p);
|
uip_ds6_nbr_t *nbr = rpl_get_nbr(p);
|
||||||
/* Exclude links to a neighbor that is not reachable at a NUD level */
|
/* Exclude links to a neighbor that is not reachable at a NUD level */
|
||||||
if(nbr == NULL || nbr->state != NBR_REACHABLE) {
|
if(nbr == NULL || nbr->state != NBR_REACHABLE) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
/* If we don't have fresh link information, assume the parent is reachable. */
|
/* If we don't have fresh link information, assume the parent is reachable. */
|
||||||
return !rpl_parent_is_fresh(p) || p->dag->instance->of->parent_has_usable_link(p);
|
return !rpl_parent_is_fresh(p) || p->dag->instance->of->parent_has_usable_link(p);
|
||||||
}
|
}
|
||||||
|
@ -877,7 +877,7 @@ best_parent(rpl_dag_t *dag, int fresh_only)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef UIP_CONF_ND6_SEND_NA
|
#if UIP_ND6_SEND_NS
|
||||||
{
|
{
|
||||||
uip_ds6_nbr_t *nbr = rpl_get_nbr(p);
|
uip_ds6_nbr_t *nbr = rpl_get_nbr(p);
|
||||||
/* Exclude links to a neighbor that is not reachable at a NUD level */
|
/* Exclude links to a neighbor that is not reachable at a NUD level */
|
||||||
|
@ -885,7 +885,7 @@ best_parent(rpl_dag_t *dag, int fresh_only)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UIP_CONF_ND6_SEND_NA */
|
#endif /* UIP_ND6_SEND_NS */
|
||||||
|
|
||||||
/* Now we have an acceptable parent, check if it is the new best */
|
/* Now we have an acceptable parent, check if it is the new best */
|
||||||
best = of->best_parent(best, p);
|
best = of->best_parent(best, p);
|
||||||
|
|
|
@ -281,11 +281,11 @@ rpl_ipv6_neighbor_callback(uip_ds6_nbr_t *nbr)
|
||||||
|
|
||||||
PRINTF("RPL: Neighbor state changed for ");
|
PRINTF("RPL: Neighbor state changed for ");
|
||||||
PRINT6ADDR(&nbr->ipaddr);
|
PRINT6ADDR(&nbr->ipaddr);
|
||||||
#if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA
|
#if UIP_ND6_SEND_NS || UIP_ND6_SEND_RA
|
||||||
PRINTF(", nscount=%u, state=%u\n", nbr->nscount, nbr->state);
|
PRINTF(", nscount=%u, state=%u\n", nbr->nscount, nbr->state);
|
||||||
#else /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA */
|
#else /* UIP_ND6_SEND_NS || UIP_ND6_SEND_RA */
|
||||||
PRINTF(", state=%u\n", nbr->state);
|
PRINTF(", state=%u\n", nbr->state);
|
||||||
#endif /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA */
|
#endif /* UIP_ND6_SEND_NS || UIP_ND6_SEND_RA */
|
||||||
for(instance = &instance_table[0], end = instance + RPL_MAX_INSTANCES; instance < end; ++instance) {
|
for(instance = &instance_table[0], end = instance + RPL_MAX_INSTANCES; instance < end; ++instance) {
|
||||||
if(instance->used == 1 ) {
|
if(instance->used == 1 ) {
|
||||||
p = rpl_find_parent_any_dag(instance, &nbr->ipaddr);
|
p = rpl_find_parent_any_dag(instance, &nbr->ipaddr);
|
||||||
|
|
|
@ -45,6 +45,6 @@
|
||||||
#define BUTTON_SENSOR_CONF_ON 1
|
#define BUTTON_SENSOR_CONF_ON 1
|
||||||
#define UIP_CONF_ICMP6 1
|
#define UIP_CONF_ICMP6 1
|
||||||
#define RIMESTATS_CONF_ENABLED 1
|
#define RIMESTATS_CONF_ENABLED 1
|
||||||
#define UIP_CONF_ND6_SEND_NA 1
|
#define UIP_CONF_ND6_SEND_NS 1
|
||||||
|
|
||||||
#endif /* PROJECT_CONF_H_ */
|
#endif /* PROJECT_CONF_H_ */
|
||||||
|
|
|
@ -4,5 +4,5 @@ all: $(CONTIKI_PROJECT)
|
||||||
|
|
||||||
CONTIKI = ../../..
|
CONTIKI = ../../..
|
||||||
CONTIKI_WITH_IPV6 = 1
|
CONTIKI_WITH_IPV6 = 1
|
||||||
CFLAGS += -DUIP_CONF_ND6_SEND_NA=1
|
CFLAGS += -DUIP_CONF_ND6_SEND_NS=1
|
||||||
include $(CONTIKI)/Makefile.include
|
include $(CONTIKI)/Makefile.include
|
||||||
|
|
|
@ -155,8 +155,8 @@
|
||||||
#define RPL_NS_CONF_LINK_NUM 8
|
#define RPL_NS_CONF_LINK_NUM 8
|
||||||
#undef NBR_TABLE_CONF_MAX_NEIGHBORS
|
#undef NBR_TABLE_CONF_MAX_NEIGHBORS
|
||||||
#define NBR_TABLE_CONF_MAX_NEIGHBORS 8
|
#define NBR_TABLE_CONF_MAX_NEIGHBORS 8
|
||||||
#undef UIP_CONF_ND6_SEND_NA
|
#undef UIP_CONF_ND6_SEND_NS
|
||||||
#define UIP_CONF_ND6_SEND_NA 0
|
#define UIP_CONF_ND6_SEND_NS 0
|
||||||
#undef SICSLOWPAN_CONF_FRAG
|
#undef SICSLOWPAN_CONF_FRAG
|
||||||
#define SICSLOWPAN_CONF_FRAG 0
|
#define SICSLOWPAN_CONF_FRAG 0
|
||||||
|
|
||||||
|
|
|
@ -116,9 +116,9 @@
|
||||||
#define RPL_CONF_MAX_INSTANCES 1 /* default 1 */
|
#define RPL_CONF_MAX_INSTANCES 1 /* default 1 */
|
||||||
#define RPL_CONF_MAX_DAG_PER_INSTANCE 1 /* default 2 */
|
#define RPL_CONF_MAX_DAG_PER_INSTANCE 1 /* default 2 */
|
||||||
|
|
||||||
/* No RA, No NA */
|
/* No RA, No NS */
|
||||||
#undef UIP_CONF_ND6_SEND_NA
|
#undef UIP_CONF_ND6_SEND_NS
|
||||||
#define UIP_CONF_ND6_SEND_NA 0
|
#define UIP_CONF_ND6_SEND_NS 0
|
||||||
|
|
||||||
#undef UIP_CONF_ND6_SEND_RA
|
#undef UIP_CONF_ND6_SEND_RA
|
||||||
#define UIP_CONF_ND6_SEND_RA 0
|
#define UIP_CONF_ND6_SEND_RA 0
|
||||||
|
|
|
@ -2,5 +2,5 @@ all: udp-server udp-client
|
||||||
|
|
||||||
CONTIKI = ../..
|
CONTIKI = ../..
|
||||||
CONTIKI_WITH_IPV6 = 1
|
CONTIKI_WITH_IPV6 = 1
|
||||||
CFLAGS += -DUIP_CONF_ND6_SEND_NA=1
|
CFLAGS += -DUIP_CONF_ND6_SEND_NS=1
|
||||||
include $(CONTIKI)/Makefile.include
|
include $(CONTIKI)/Makefile.include
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
|
|
||||||
/* ND and Routing */
|
/* ND and Routing */
|
||||||
#define UIP_CONF_ROUTER 0 /**< BLE master role, which allows for routing, isn't supported. */
|
#define UIP_CONF_ROUTER 0 /**< BLE master role, which allows for routing, isn't supported. */
|
||||||
#define UIP_CONF_ND6_SEND_NA 1
|
#define UIP_CONF_ND6_SEND_NS 1
|
||||||
#define UIP_CONF_IP_FORWARD 0 /**< No packet forwarding. */
|
#define UIP_CONF_IP_FORWARD 0 /**< No packet forwarding. */
|
||||||
|
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
|
|
|
@ -157,7 +157,7 @@
|
||||||
#endif /* UIP_CONF_MAX_ROUTES */
|
#endif /* UIP_CONF_MAX_ROUTES */
|
||||||
|
|
||||||
#define UIP_CONF_ND6_SEND_RA 0
|
#define UIP_CONF_ND6_SEND_RA 0
|
||||||
#define UIP_CONF_ND6_SEND_NA 0
|
#define UIP_CONF_ND6_SEND_NS 0
|
||||||
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
#define UIP_CONF_ND6_REACHABLE_TIME 600000
|
||||||
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
#define UIP_CONF_ND6_RETRANS_TIMER 10000
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#undef UIP_CONF_ND6_SEND_NA
|
#undef UIP_CONF_ND6_SEND_NS
|
||||||
#define UIP_CONF_ND6_SEND_NA 1
|
#define UIP_CONF_ND6_SEND_NS 1
|
||||||
|
|
||||||
#ifdef BUFSIZE
|
#ifdef BUFSIZE
|
||||||
#undef UIP_CONF_BUFFER_SIZE
|
#undef UIP_CONF_BUFFER_SIZE
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#undef UIP_CONF_ND6_SEND_NA
|
#undef UIP_CONF_ND6_SEND_NS
|
||||||
#define UIP_CONF_ND6_SEND_NA 1
|
#define UIP_CONF_ND6_SEND_NS 1
|
||||||
|
|
||||||
#ifdef BUFSIZE
|
#ifdef BUFSIZE
|
||||||
#undef UIP_CONF_BUFFER_SIZE
|
#undef UIP_CONF_BUFFER_SIZE
|
||||||
|
|
Loading…
Reference in a new issue