Loading...
Searching...
No Matches
_nib-6ln.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include <kernel_defines.h>
20#include <stdint.h>
21
23#include "net/sixlowpan/nd.h"
24#include "timex.h"
25#include "evtimer.h"
26
27#include "_nib-arsm.h"
28#include "_nib-internal.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
38#define _ADDR_REG_STATUS_TENTATIVE (3)
39
44#define _ADDR_REG_STATUS_IGNORE (4)
45
54#define _ADDR_REG_STATUS_UNAVAIL (255)
55
56#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || defined(DOXYGEN)
69
88int _build_ll_ipv6_from_addr(gnrc_netif_t *netif, const uint8_t *l2addr,
89 uint8_t l2addr_len, ipv6_addr_t *ipv6addr);
90
100static inline uint32_t _get_next_rs_interval(const gnrc_netif_t *netif)
101{
102 if (gnrc_netif_is_6ln(netif)) {
105 }
106 else {
107 unsigned exp = netif->ipv6.rs_sent - SIXLOWPAN_ND_MAX_RS_NUMOF;
108 uint32_t tmp = SIXLOWPAN_ND_RS_MSEC_INTERVAL +
109 ((1 << exp) * (NDP_RS_MS_INTERVAL));
110
113 }
114 return tmp;
115 }
116 }
117 else {
118 return NDP_RS_MS_INTERVAL;
119 }
120}
121
135uint8_t _handle_aro(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
136 const icmpv6_hdr_t *icmpv6,
137 const sixlowpan_nd_opt_ar_t *aro, const ndp_opt_t *sl2ao,
138 _nib_onl_entry_t *nce);
139
146
147#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C) || defined(DOXYGEN)
148_nib_abr_entry_t *_handle_abro(const sixlowpan_nd_opt_abr_t *abro);
149uint32_t _handle_6co(const icmpv6_hdr_t *icmpv6,
150 const sixlowpan_nd_opt_6ctx_t *sixco,
151 _nib_abr_entry_t *abr);
152#else /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
153uint32_t _handle_6co(const icmpv6_hdr_t *icmpv6,
154 const sixlowpan_nd_opt_6ctx_t *sixco);
155#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
156#else /* CONFIG_GNRC_IPV6_NIB_6LN || defined(DOXYGEN) */
157#define _resolve_addr_from_ipv6(dst, netif, nce) (false)
158#define _build_ll_ipv6_from_addr(netif, l2addr, l2addr_len, ipv6addr) (-ENOTSUP)
159/* _handle_aro() doesn't make sense without 6LR so don't even use it
160 * => throw error in case it is compiled in => don't define it here as NOP macro
161 */
162#define _get_next_rs_interval(netif) (NDP_RS_MS_INTERVAL)
163#define _handle_rereg_address(netif) (void)netif
164#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C) || defined(DOXYGEN)
165#define _handle_abro(abro) (NULL)
166#define _handle_6co(icmpv6, sixco, abr) (UINT32_MAX)
167#else /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
168#define _handle_6co(icmpv6, sixco) (UINT32_MAX)
169#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C || defined(DOXYGEN) */
170#endif /* CONFIG_GNRC_IPV6_NIB_6LN || defined(DOXYGEN) */
171
172#ifdef __cplusplus
173}
174#endif
175
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:100
evtimer API definitions
#define NDP_RS_MS_INTERVAL
RTR_SOLICITATION_INTERVAL (in ms)
Definition ndp.h:161
#define SIXLOWPAN_ND_MAX_RS_SEC_INTERVAL
MAX_RTR_SOLICITATIONS_INTERVAL (in seconds)
Definition nd.h:129
#define SIXLOWPAN_ND_MAX_RS_NUMOF
MAX_RTR_SOLICITATIONS.
Definition nd.h:125
#define SIXLOWPAN_ND_RS_MSEC_INTERVAL
RTR_SOLICITATION_INTERVAL (in msec)
Definition nd.h:124
#define MS_PER_SEC
The number of milliseconds per second.
Definition time_units.h:71
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:140
uint8_t rs_sent
number of unsolicited router solicitations scheduled
Definition ipv6.h:232
Representation of a network interface.
Definition netif.h:137
gnrc_netif_ipv6_t ipv6
IPv6 component.
Definition netif.h:149
General ICMPv6 message format.
Definition icmpv6.h:135
Data type to represent an IPv6 packet header.
Definition hdr.h:63
General NDP option format.
Definition ndp.h:295
6LoWPAN context option format
Definition nd.h:171
Authoritative border router option format.
Definition nd.h:186
Address registration option format.
Definition nd.h:155
Utility library for comparing and computing timestamps.
Data type to represent an IPv6 address.
Definition addr.h:64