76 #include "lib/random.h" 80 #define LOG_MODULE "IPv6 NDP" 81 #define LOG_LEVEL LOG_LEVEL_IPV6 96 #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) 97 #define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len]) 99 #define UIP_ND6_RS_BUF ((uip_nd6_rs *)&uip_buf[uip_l2_l3_icmp_hdr_len]) 100 #define UIP_ND6_RA_BUF ((uip_nd6_ra *)&uip_buf[uip_l2_l3_icmp_hdr_len]) 101 #define UIP_ND6_NS_BUF ((uip_nd6_ns *)&uip_buf[uip_l2_l3_icmp_hdr_len]) 102 #define UIP_ND6_NA_BUF ((uip_nd6_na *)&uip_buf[uip_l2_l3_icmp_hdr_len]) 105 #define UIP_ND6_OPT_HDR_BUF ((uip_nd6_opt_hdr *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset]) 106 #define UIP_ND6_OPT_PREFIX_BUF ((uip_nd6_opt_prefix_info *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset]) 107 #define UIP_ND6_OPT_MTU_BUF ((uip_nd6_opt_mtu *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset]) 108 #define UIP_ND6_OPT_RDNSS_BUF ((uip_nd6_opt_dns *)&uip_buf[uip_l2_l3_icmp_hdr_len + nd6_opt_offset]) 111 #if UIP_ND6_SEND_NS || UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER 112 static uint8_t nd6_opt_offset;
118 #if UIP_ND6_SEND_NS || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER 122 #if !UIP_CONF_ROUTER // TBD see if we move it to ra_input 126 #if (!UIP_CONF_ROUTER || UIP_ND6_SEND_RA) 130 #if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA || !UIP_CONF_ROUTER 146 create_llao(uint8_t *llao, uint8_t type) {
147 llao[UIP_ND6_OPT_TYPE_OFFSET] = type;
182 LOG_INFO(
"Received NS from ");
186 LOG_INFO_(
" with target address ");
187 LOG_INFO_6ADDR((uip_ipaddr_t *) (&UIP_ND6_NS_BUF->tgtipaddr));
191 #if UIP_CONF_IPV6_CHECKS 195 LOG_ERR(
"NS received is bad\n");
202 nd6_opt_offset = UIP_ND6_NS_LEN;
203 while(uip_l3_icmp_hdr_len + nd6_opt_offset <
uip_len) {
204 #if UIP_CONF_IPV6_CHECKS 206 LOG_ERR(
"NS received is bad\n");
211 case UIP_ND6_OPT_SLLAO:
213 #if UIP_CONF_IPV6_CHECKS 216 LOG_ERR(
"NS received is bad\n");
220 uip_lladdr_t lladdr_aligned;
222 nbr = uip_ds6_nbr_lookup(&
UIP_IP_BUF->srcipaddr);
225 0, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
227 const uip_lladdr_t *lladdr = uip_ds6_nbr_get_ll(nbr);
233 if(uip_ds6_nbr_update_ll(&nbr,
234 (
const uip_lladdr_t *)&lladdr_aligned)
239 nbr->state = NBR_STALE;
242 nbr->state = NBR_STALE;
246 #if UIP_CONF_IPV6_CHECKS 251 LOG_WARN(
"ND option not supported in NS");
257 addr = uip_ds6_addr_lookup(&UIP_ND6_NS_BUF->tgtipaddr);
261 #if UIP_ND6_DEF_MAXDADNS > 0 262 #if UIP_CONF_IPV6_CHECKS 264 LOG_ERR(
"NS received is bad\n");
271 flags = UIP_ND6_NA_FLAG_OVERRIDE;
282 #if UIP_CONF_IPV6_CHECKS 283 if(uip_ds6_is_my_addr(&
UIP_IP_BUF->srcipaddr)) {
290 LOG_ERR(
"NS received is bad\n");
299 flags = UIP_ND6_NA_FLAG_SOLICITED | UIP_ND6_NA_FLAG_OVERRIDE;
304 if(uip_ds6_addr_lookup(&
UIP_IP_BUF->destipaddr) == addr) {
307 flags = UIP_ND6_NA_FLAG_SOLICITED | UIP_ND6_NA_FLAG_OVERRIDE;
310 #if UIP_CONF_IPV6_CHECKS 311 LOG_ERR(
"NS received is bad\n");
323 flags = flags | UIP_ND6_NA_FLAG_ROUTER;
337 UIP_ND6_NA_BUF->flagsreserved = flags;
338 memcpy(&UIP_ND6_NA_BUF->tgtipaddr, &addr->ipaddr,
sizeof(uip_ipaddr_t));
340 create_llao(&
uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_NA_LEN],
350 LOG_INFO(
"Sending NA to ");
354 LOG_INFO_(
" with target address ");
355 LOG_INFO_6ADDR(&UIP_ND6_NA_BUF->tgtipaddr);
385 UIP_ND6_NS_BUF->reserved = 0;
392 if(!(uip_ds6_is_my_addr(tgt))) {
399 LOG_ERR(
"Dropping NS due to no suitable source address\n");
406 create_llao(&
uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_NS_LEN],
413 UIP_IP_BUF->len[1] = UIP_ICMPH_LEN + UIP_ND6_NS_LEN;
414 uip_len = UIP_IPH_LEN + UIP_ICMPH_LEN + UIP_ND6_NS_LEN;
421 LOG_INFO(
"Sending NS to ");
425 LOG_INFO_(
" with target address ");
456 uint8_t is_solicited;
458 uip_lladdr_t lladdr_aligned;
460 LOG_INFO(
"Received NA from ");
464 LOG_INFO_(
" with target address ");
465 LOG_INFO_6ADDR((uip_ipaddr_t *) (&UIP_ND6_NA_BUF->tgtipaddr));
474 is_router = ((UIP_ND6_NA_BUF->flagsreserved & UIP_ND6_NA_FLAG_ROUTER));
476 ((UIP_ND6_NA_BUF->flagsreserved & UIP_ND6_NA_FLAG_SOLICITED));
478 ((UIP_ND6_NA_BUF->flagsreserved & UIP_ND6_NA_FLAG_OVERRIDE));
480 #if UIP_CONF_IPV6_CHECKS 485 LOG_ERR(
"NA received is bad\n");
491 nd6_opt_offset = UIP_ND6_NA_LEN;
493 while(uip_l3_icmp_hdr_len + nd6_opt_offset <
uip_len) {
494 #if UIP_CONF_IPV6_CHECKS 496 LOG_ERR(
"NA received is bad\n");
501 case UIP_ND6_OPT_TLLAO:
505 LOG_WARN(
"ND option not supported in NA\n");
510 addr = uip_ds6_addr_lookup(&UIP_ND6_NA_BUF->tgtipaddr);
513 #if UIP_ND6_DEF_MAXDADNS > 0 518 LOG_ERR(
"NA received is bad\n");
521 const uip_lladdr_t *lladdr;
522 nbr = uip_ds6_nbr_lookup(&UIP_ND6_NA_BUF->tgtipaddr);
526 lladdr = uip_ds6_nbr_get_ll(nbr);
539 if(uip_ds6_nbr_update_ll(&nbr,
540 (
const uip_lladdr_t *)&lladdr_aligned) < 0) {
550 nbr->state = NBR_STALE;
552 nbr->isrouter = is_router;
554 if(!is_override && is_llchange) {
555 if(nbr->state == NBR_REACHABLE) {
556 nbr->state = NBR_STALE;
564 if(is_override || !is_llchange ||
nd6_opt_llao == NULL) {
567 uip_ds6_nbr_update_ll(&nbr,
568 (
const uip_lladdr_t *)&lladdr_aligned)
580 if(nbr->isrouter && !is_router) {
581 defrt = uip_ds6_defrt_lookup(&
UIP_IP_BUF->srcipaddr);
583 uip_ds6_defrt_rm(defrt);
586 nbr->isrouter = is_router;
589 #if UIP_CONF_IPV6_QUEUE_PKT 597 if(uip_packetqueue_buflen(&nbr->packethandle) != 0) {
598 uip_len = uip_packetqueue_buflen(&nbr->packethandle);
600 uip_packetqueue_free(&nbr->packethandle);
619 LOG_INFO(
"Received RS from ");
627 #if UIP_CONF_IPV6_CHECKS 634 LOG_ERR(
"RS received is bad\n");
641 nd6_opt_offset = UIP_ND6_RS_LEN;
644 while(uip_l3_icmp_hdr_len + nd6_opt_offset <
uip_len) {
645 #if UIP_CONF_IPV6_CHECKS 647 LOG_ERR(
"RS received is bad\n");
652 case UIP_ND6_OPT_SLLAO:
656 LOG_WARN(
"ND option not supported in RS\n");
663 #if UIP_CONF_IPV6_CHECKS 665 LOG_ERR(
"RS received is bad\n");
669 uip_lladdr_t lladdr_aligned;
671 if((nbr = uip_ds6_nbr_lookup(&
UIP_IP_BUF->srcipaddr)) == NULL) {
674 0, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
677 const uip_lladdr_t *lladdr = uip_ds6_nbr_get_ll(nbr);
687 0, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
688 nbr->reachable = nbr_data.reachable;
689 nbr->sendns = nbr_data.sendns;
690 nbr->nscount = nbr_data.nscount;
694 #if UIP_CONF_IPV6_CHECKS 700 uip_ds6_send_ra_sollicited();
709 uip_nd6_ra_output(uip_ipaddr_t * dest)
729 UIP_ND6_RA_BUF->cur_ttl =
uip_ds6_if.cur_hop_limit;
731 UIP_ND6_RA_BUF->flags_reserved =
732 (UIP_ND6_M_FLAG << 7) | (UIP_ND6_O_FLAG << 6);
734 UIP_ND6_RA_BUF->router_lifetime =
uip_htons(UIP_ND6_ROUTER_LIFETIME);
737 UIP_ND6_RA_BUF->reachable_time = 0;
738 UIP_ND6_RA_BUF->retrans_timer = 0;
740 uip_len = UIP_IPH_LEN + UIP_ICMPH_LEN + UIP_ND6_RA_LEN;
741 nd6_opt_offset = UIP_ND6_RA_LEN;
747 if((prefix->isused) && (prefix->advertise)) {
748 UIP_ND6_OPT_PREFIX_BUF->type = UIP_ND6_OPT_PREFIX_INFO;
749 UIP_ND6_OPT_PREFIX_BUF->len = UIP_ND6_OPT_PREFIX_INFO_LEN / 8;
750 UIP_ND6_OPT_PREFIX_BUF->preflen = prefix->length;
751 UIP_ND6_OPT_PREFIX_BUF->flagsreserved1 = prefix->l_a_reserved;
752 UIP_ND6_OPT_PREFIX_BUF->validlt = uip_htonl(prefix->vlifetime);
753 UIP_ND6_OPT_PREFIX_BUF->preferredlt = uip_htonl(prefix->plifetime);
754 UIP_ND6_OPT_PREFIX_BUF->reserved2 = 0;
756 nd6_opt_offset += UIP_ND6_OPT_PREFIX_INFO_LEN;
757 uip_len += UIP_ND6_OPT_PREFIX_INFO_LEN;
768 UIP_ND6_OPT_MTU_BUF->type = UIP_ND6_OPT_MTU;
769 UIP_ND6_OPT_MTU_BUF->len = UIP_ND6_OPT_MTU_LEN >> 3;
770 UIP_ND6_OPT_MTU_BUF->reserved = 0;
772 UIP_ND6_OPT_MTU_BUF->mtu = uip_htonl(1500);
774 uip_len += UIP_ND6_OPT_MTU_LEN;
775 nd6_opt_offset += UIP_ND6_OPT_MTU_LEN;
780 uip_ipaddr_t *ip = &UIP_ND6_OPT_RDNSS_BUF->ip;
781 uip_ipaddr_t *dns = NULL;
782 UIP_ND6_OPT_RDNSS_BUF->type = UIP_ND6_OPT_RDNSS;
783 UIP_ND6_OPT_RDNSS_BUF->reserved = 0;
792 UIP_ND6_OPT_RDNSS_BUF->len = UIP_ND6_OPT_RDNSS_LEN + (i << 1);
793 LOG_INFO(
"%d nameservers reported\n", i);
794 uip_len += UIP_ND6_OPT_RDNSS_BUF->len << 3;
795 nd6_opt_offset += UIP_ND6_OPT_RDNSS_BUF->len << 3;
807 LOG_INFO(
"Sending RA to ");
834 UIP_IP_BUF->len[1] = UIP_ICMPH_LEN + UIP_ND6_RS_LEN;
835 uip_len = uip_l3_icmp_hdr_len + UIP_ND6_RS_LEN;
841 create_llao(&
uip_buf[uip_l2_l3_icmp_hdr_len + UIP_ND6_RS_LEN],
849 LOG_INFO(
"Sending RS to ");
869 uip_lladdr_t lladdr_aligned;
871 LOG_INFO(
"Received RA from ");
878 #if UIP_CONF_IPV6_CHECKS 882 LOG_ERR(
"RA received is bad");
887 if(UIP_ND6_RA_BUF->cur_ttl != 0) {
888 uip_ds6_if.cur_hop_limit = UIP_ND6_RA_BUF->cur_ttl;
889 LOG_INFO(
"uip_ds6_if.cur_hop_limit %u\n",
uip_ds6_if.cur_hop_limit);
892 if(UIP_ND6_RA_BUF->reachable_time != 0) {
894 uip_ntohl(UIP_ND6_RA_BUF->reachable_time)) {
895 uip_ds6_if.base_reachable_time = uip_ntohl(UIP_ND6_RA_BUF->reachable_time);
899 if(UIP_ND6_RA_BUF->retrans_timer != 0) {
900 uip_ds6_if.retrans_timer = uip_ntohl(UIP_ND6_RA_BUF->retrans_timer);
904 nd6_opt_offset = UIP_ND6_RA_LEN;
905 while(uip_l3_icmp_hdr_len + nd6_opt_offset <
uip_len) {
907 LOG_ERR(
"RA received is bad");
911 case UIP_ND6_OPT_SLLAO:
912 LOG_DBG(
"Processing SLLAO option in RA\n");
914 nbr = uip_ds6_nbr_lookup(&
UIP_IP_BUF->srcipaddr);
921 1, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
923 const uip_lladdr_t *lladdr = uip_ds6_nbr_get_ll(nbr);
928 nbr->state = NBR_STALE;
933 if(uip_ds6_nbr_update_ll(&nbr,
934 (
const uip_lladdr_t *)&lladdr_aligned) < 0) {
938 nbr->state = NBR_STALE;
943 case UIP_ND6_OPT_MTU:
944 LOG_DBG(
"Processing MTU option in RA\n");
948 case UIP_ND6_OPT_PREFIX_INFO:
949 LOG_DBG(
"Processing PREFIX option in RA\n");
951 if((uip_ntohl(nd6_opt_prefix_info->validlt) >=
952 uip_ntohl(nd6_opt_prefix_info->preferredlt))
955 if(nd6_opt_prefix_info->flagsreserved1 & UIP_ND6_RA_FLAG_ONLINK) {
957 uip_ds6_prefix_lookup(&nd6_opt_prefix_info->prefix,
958 nd6_opt_prefix_info->preflen);
960 if(nd6_opt_prefix_info->validlt != 0) {
962 prefix = uip_ds6_prefix_add(&nd6_opt_prefix_info->prefix,
963 nd6_opt_prefix_info->preflen,
964 uip_ntohl(nd6_opt_prefix_info->
967 prefix = uip_ds6_prefix_add(&nd6_opt_prefix_info->prefix,
968 nd6_opt_prefix_info->preflen, 0);
972 switch (nd6_opt_prefix_info->validlt) {
974 uip_ds6_prefix_rm(prefix);
977 prefix->isinfinite = 1;
980 LOG_DBG(
"Updating timer of prefix ");
981 LOG_DBG_6ADDR(&prefix->ipaddr);
982 LOG_DBG_(
" new value %"PRIu32
"\n", uip_ntohl(nd6_opt_prefix_info->validlt));
984 uip_ntohl(nd6_opt_prefix_info->validlt));
985 prefix->isinfinite = 0;
992 if((nd6_opt_prefix_info->flagsreserved1 & UIP_ND6_RA_FLAG_AUTONOMOUS)
993 && (nd6_opt_prefix_info->validlt != 0)
994 && (nd6_opt_prefix_info->preflen == UIP_DEFAULT_PREFIX_LEN)) {
998 addr = uip_ds6_addr_lookup(&
ipaddr);
999 if((addr != NULL) && (addr->type == ADDR_AUTOCONF)) {
1002 if((uip_ntohl(nd6_opt_prefix_info->validlt) > 2 * 60 * 60) ||
1003 (uip_ntohl(nd6_opt_prefix_info->validlt) >
1005 LOG_DBG(
"Updating timer of address ");
1006 LOG_DBG_6ADDR(&addr->ipaddr);
1007 LOG_DBG_(
" new value %lu\n",
1008 (
unsigned long)uip_ntohl(nd6_opt_prefix_info->validlt));
1010 uip_ntohl(nd6_opt_prefix_info->validlt));
1013 LOG_DBG(
"Updating timer of address ");
1014 LOG_DBG_6ADDR(&addr->ipaddr);
1015 LOG_DBG_(
" new value %lu\n", (
unsigned long)(2 * 60 * 60));
1017 addr->isinfinite = 0;
1019 addr->isinfinite = 1;
1022 if(uip_ntohl(nd6_opt_prefix_info->validlt) ==
1034 #if UIP_ND6_RA_RDNSS 1035 case UIP_ND6_OPT_RDNSS:
1036 LOG_DBG(
"Processing RDNSS option\n");
1037 uint8_t naddr = (UIP_ND6_OPT_RDNSS_BUF->len - 1) / 2;
1038 uip_ipaddr_t *ip = (uip_ipaddr_t *)(&UIP_ND6_OPT_RDNSS_BUF->ip);
1039 LOG_DBG(
"got %d nameservers\n", naddr);
1040 while(naddr-- > 0) {
1041 LOG_DBG(
"nameserver: ");
1043 LOG_DBG_(
" lifetime: %"PRIx32
"\n", uip_ntohl(UIP_ND6_OPT_RDNSS_BUF->lifetime));
1050 LOG_ERR(
"ND option not supported in RA\n");
1056 defrt = uip_ds6_defrt_lookup(&
UIP_IP_BUF->srcipaddr);
1057 if(UIP_ND6_RA_BUF->router_lifetime != 0) {
1064 long)(uip_ntohs(UIP_ND6_RA_BUF->router_lifetime)));
1067 (
unsigned long)(uip_ntohs(UIP_ND6_RA_BUF->router_lifetime)));
1071 uip_ds6_defrt_rm(defrt);
1075 #if UIP_CONF_IPV6_QUEUE_PKT 1084 if(nbr != NULL && uip_packetqueue_buflen(&nbr->packethandle) != 0) {
1085 uip_len = uip_packetqueue_buflen(&nbr->packethandle);
1087 uip_packetqueue_free(&nbr->packethandle);
1101 UIP_ICMP6_HANDLER(ns_input_handler,
ICMP6_NS, UIP_ICMP6_HANDLER_CODE_ANY,
1105 UIP_ICMP6_HANDLER(na_input_handler,
ICMP6_NA, UIP_ICMP6_HANDLER_CODE_ANY,
1109 #if UIP_CONF_ROUTER && UIP_ND6_SEND_RA 1110 UIP_ICMP6_HANDLER(rs_input_handler,
ICMP6_RS, UIP_ICMP6_HANDLER_CODE_ANY,
1114 #if !UIP_CONF_ROUTER 1115 UIP_ICMP6_HANDLER(ra_input_handler,
ICMP6_RA, UIP_ICMP6_HANDLER_CODE_ANY,
1133 #if UIP_CONF_ROUTER && UIP_ND6_SEND_RA 1138 #if !UIP_CONF_ROUTER static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
#define UIP_IP_BUF
Pointer to IP header.
An entry in the default router list.
uip_lladdr_t uip_lladdr
Host L2 address.
Header file for ICMPv6 message and error handing (RFC 4443)
#define UIP_ND6_OPT_LLAO_LEN
length of a ND6 LLAO option for default L2 type (e.g.
static uip_ds6_nbr_t * nbr
Pointer to llao option in uip_buf.
unsigned long stimer_remaining(struct stimer *t)
The time until the timer expires.
uint16_t uip_len
The length of the packet in the uip_buf buffer.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
void ra_input(void)
Process a Router Advertisement.
#define UIP_ICMP_BUF
Pointer to ICMP header.
uint32_t uip_nameserver_next_expiration(void)
Get next expiration time.
#define UIP_NAMESERVER_INFINITE_LIFETIME
Infinite Lifetime indicator.
void uip_nd6_init()
Initialise the uIP ND core.
void uip_ds6_set_addr_iid(uip_ipaddr_t *ipaddr, uip_lladdr_t *lladdr)
set the last 64 bits of an IP address based on the MAC address
static int extract_lladdr_from_llao_aligned(uip_lladdr_t *dest)
Pointer to a prefix list entry.
unsigned long clock_seconds(void)
Get the current value of the platform seconds.
uip_ds6_prefix_t uip_ds6_prefix_list[UIP_DS6_PREFIX_NB]
Prefix list.
uint16_t uip_htons(uint16_t val)
Convert a 16-bit quantity from host byte order to network byte order.
Header file for IPv6-related data structures.
int uip_ds6_dad_failed(uip_ds6_addr_t *addr)
Callback when DAD failed.
#define ICMP6_RA
Router Advertisement.
#define UIP_LLADDR_LEN
802.15.4 address
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.
void stimer_set(struct stimer *t, unsigned long interval)
Set a timer.
void uip_nameserver_update(const uip_ipaddr_t *nameserver, uint32_t lifetime)
Initialize the module variables.
static uint8_t * nd6_opt_llao
Offset from the end of the icmpv6 header to the option in uip_buf.
#define uip_create_linklocal_allnodes_mcast(a)
set IP address a to the link local all-nodes multicast address
#define UIP_ND6_INFINITE_LIFETIME
INFINITE lifetime.
uIP Name Server interface
#define uip_is_addr_unspecified(a)
Is IPv6 address a the unspecified address a is of type uip_ipaddr_t.
#define uip_buf
Macro to access uip_aligned_buf as an array of bytes.
Unicast address structure.
#define uip_ipaddr_copy(dest, src)
Copy an IP address from one place to another.
#define uip_is_addr_solicited_node(a)
is addr (a) a solicited node multicast address, see RFC 4291 a is of type uip_ipaddr_t* ...
#define ICMP6_NS
Neighbor Solicitation.
#define UIP_STAT(s)
The uIP TCP/IP statistics.
#define uip_create_linklocal_allrouters_mcast(a)
set IP address a to the link local all-routers multicast address
#define ADDR_TENTATIVE
Possible states for the an address (RFC 4862)
ND option prefix information.
uip_ds6_addr_t * uip_ds6_addr_add(uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type)
Add a unicast address to the interface.
#define NBR_INCOMPLETE
Possible states for the nbr cache entries.
#define uip_is_addr_mcast(a)
is address a multicast address, see RFC 4291 a is of type uip_ipaddr_t*
static uip_nd6_opt_prefix_info * nd6_opt_prefix_info
Pointer to a router list entry.
#define ICMP6_RS
Router Solicitation.
#define uip_create_unspecified(a)
set IP address a to unspecified
#define ICMP6_NA
Neighbor advertisement.
uint8_t uip_ext_len
The length of the extension headers.
uip_ds6_nbr_t * uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, uint8_t isrouter, uint8_t state, nbr_table_reason_t reason, void *data)
Neighbor Cache basic routines.
Header file for IPv6 Neighbor discovery (RFC 4861)
uip_ds6_netif_t uip_ds6_if
The single interface.
uint16_t uip_icmp6chksum(void)
Calculate the ICMP checksum of the packet in uip_buf.
#define UIP_ND6_OPT_HDR_BUF
Pointer to ND option.
#define UIP_ND6_HOP_LIMIT
HOP LIMIT to be used when sending ND messages (255)
void uip_icmp6_register_input_handler(uip_icmp6_input_handler_t *handler)
Register a handler which can handle a specific ICMPv6 message type.
#define uip_is_addr_linklocal(a)
is addr (a) a link local unicast address, see RFC 4291 i.e.
static uip_ds6_defrt_t * defrt
Pointer to an interface address.
Header file for the logging system
uint16_t uip_nameserver_count(void)
Get the number of recorded name servers.
void uip_nd6_rs_output(void)
Neighbor Solicitation Processing.
uip_ipaddr_t * uip_nameserver_get(uint8_t num)
Get a Nameserver ip address given in RA.
#define uip_create_solicited_node(a, b)
put in b the solicited node address corresponding to address a both a and b are of type uip_ipaddr_t*...
void uip_ds6_select_src(uip_ipaddr_t *src, uip_ipaddr_t *dst)
Source address selection, see RFC 3484.
uint32_t uip_ds6_compute_reachable_time(void)
Compute the reachable time based on base reachable time, see RFC 4861.
An entry in the nbr cache.