Loading...
Searching...
No Matches
_nib-6ln.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
21
22#include <kernel_defines.h>
23#include <stdint.h>
24
26#include "net/sixlowpan/nd.h"
27#include "timex.h"
28#include "evtimer.h"
29
30#include "_nib-arsm.h"
31#include "_nib-internal.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
41#define _ADDR_REG_STATUS_TENTATIVE (3)
42
47#define _ADDR_REG_STATUS_IGNORE (4)
48
57#define _ADDR_REG_STATUS_UNAVAIL (255)
58
59#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || defined(DOXYGEN)
72
91int _build_ll_ipv6_from_addr(gnrc_netif_t *netif, const uint8_t *l2addr,
92 uint8_t l2addr_len, ipv6_addr_t *ipv6addr);
93
103static inline uint32_t _get_next_rs_interval(const gnrc_netif_t *netif)
104{
105 if (gnrc_netif_is_6ln(netif)) {
108 }
109 else {
110 unsigned exp = netif->ipv6.rs_sent - SIXLOWPAN_ND_MAX_RS_NUMOF;
111 uint32_t tmp = SIXLOWPAN_ND_RS_MSEC_INTERVAL +
112 ((1 << exp) * (NDP_RS_MS_INTERVAL));
113
116 }
117 return tmp;
118 }
119 }
120 else {
121 return NDP_RS_MS_INTERVAL;
122 }
123}
124
138uint8_t _handle_aro(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
139 const icmpv6_hdr_t *icmpv6,
140 const sixlowpan_nd_opt_ar_t *aro, const ndp_opt_t *sl2ao,
141 _nib_onl_entry_t *nce);
142
149
150#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C) || defined(DOXYGEN)
151_nib_abr_entry_t *_handle_abro(const sixlowpan_nd_opt_abr_t *abro);
152uint32_t _handle_6co(const icmpv6_hdr_t *icmpv6,
153 const sixlowpan_nd_opt_6ctx_t *sixco,
154 _nib_abr_entry_t *abr);
155#else /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
156uint32_t _handle_6co(const icmpv6_hdr_t *icmpv6,
157 const sixlowpan_nd_opt_6ctx_t *sixco);
158#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
159#else /* CONFIG_GNRC_IPV6_NIB_6LN || defined(DOXYGEN) */
160#define _resolve_addr_from_ipv6(dst, netif, nce) (false)
161#define _build_ll_ipv6_from_addr(netif, l2addr, l2addr_len, ipv6addr) (-ENOTSUP)
162/* _handle_aro() doesn't make sense without 6LR so don't even use it
163 * => throw error in case it is compiled in => don't define it here as NOP macro
164 */
165#define _get_next_rs_interval(netif) (NDP_RS_MS_INTERVAL)
166#define _handle_rereg_address(netif) (void)netif
167#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C) || defined(DOXYGEN)
168#define _handle_abro(abro) (NULL)
169#define _handle_6co(icmpv6, sixco, abr) (UINT32_MAX)
170#else /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
171#define _handle_6co(icmpv6, sixco) (UINT32_MAX)
172#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
173#endif /* CONFIG_GNRC_IPV6_NIB_6LN || defined(DOXYGEN) */
174
175#ifdef __cplusplus
176}
177#endif
178
uint8_t _handle_aro(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6, const icmpv6_hdr_t *icmpv6, const sixlowpan_nd_opt_ar_t *aro, const ndp_opt_t *sl2ao, _nib_onl_entry_t *nce)
Handles ARO.
bool _resolve_addr_from_ipv6(const ipv6_addr_t *dst, gnrc_netif_t *netif, gnrc_ipv6_nib_nc_t *nce)
Resolves address statically from destination address using reverse translation of the IID.
int _build_ll_ipv6_from_addr(gnrc_netif_t *netif, const uint8_t *l2addr, uint8_t l2addr_len, ipv6_addr_t *ipv6addr)
Build a link-local ipv6 address statically from the L2 address by translating the hardware address to...
void _handle_rereg_address(const ipv6_addr_t *addr)
Handler for GNRC_IPV6_NIB_REREG_ADDRESS event handler.
static uint32_t _get_next_rs_interval(const gnrc_netif_t *netif)
Calculates exponential backoff for RS retransmissions.
Definition _nib-6ln.h:103
evtimer API definitions
#define NDP_RS_MS_INTERVAL
RTR_SOLICITATION_INTERVAL (in ms)
Definition ndp.h:164
#define SIXLOWPAN_ND_MAX_RS_SEC_INTERVAL
MAX_RTR_SOLICITATIONS_INTERVAL (in seconds)
Definition nd.h:132
#define SIXLOWPAN_ND_MAX_RS_NUMOF
MAX_RTR_SOLICITATIONS.
Definition nd.h:128
#define SIXLOWPAN_ND_RS_MSEC_INTERVAL
RTR_SOLICITATION_INTERVAL (in msec)
Definition nd.h:127
#define MS_PER_SEC
The number of milliseconds per second.
Definition time_units.h:74
Configuration macro definitions for neighbor information base.
Common macros and compiler attributes/pragmas configuration.
Message type and helper function definitions for 6LoWPAN-ND.
Internal NIB-representation of the authoritative border router for multihop prefix and 6LoWPAN contex...
Neighbor cache entry view on NIB.
Definition nc.h:142
uint8_t rs_sent
number of unsolicited router solicitations scheduled
Definition ipv6.h:235
Representation of a network interface.
Definition netif.h:132
gnrc_netif_ipv6_t ipv6
IPv6 component.
Definition netif.h:144
General ICMPv6 message format.
Definition icmpv6.h:138
Data type to represent an IPv6 packet header.
Definition hdr.h:66
General NDP option format.
Definition ndp.h:298
6LoWPAN context option format
Definition nd.h:174
Authoritative border router option format.
Definition nd.h:189
Address registration option format.
Definition nd.h:158
Utility library for comparing and computing timestamps.
Data type to represent an IPv6 address.
Definition addr.h:67