19#ifndef PRIV_NIB_INTERNAL_H
20#define PRIV_NIB_INTERNAL_H
34#ifdef MODULE_GNRC_IPV6
71#define _PFX_ON_LINK (0x0001)
72#define _PFX_SLAAC (0x0002)
78#define _NIB_IF_MASK (GNRC_IPV6_NIB_NC_INFO_IFACE_MASK)
83#define _NIB_IF_POS (GNRC_IPV6_NIB_NC_INFO_IFACE_POS)
88#define _NIB_IF_MAX (_NIB_IF_MASK >> _NIB_IF_POS)
96#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT) || defined(DOXYGEN)
108#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LR) || defined(DOXYGEN)
116#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || defined(DOXYGEN)
146#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || defined(DOXYGEN)
149#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LR) || defined(DOXYGEN)
168#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || defined(DOXYGEN)
183#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT) || defined(DOXYGEN)
209#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER)
273uint32_t _evtimer_lookup(
const void *ctx, uint16_t type);
293static inline void _evtimer_add(
void *ctx, int16_t type,
296#ifdef MODULE_GNRC_IPV6
302 event->event.next = NULL;
303 event->event.offset = offset;
304 event->msg.type = type;
305 event->msg.content.ptr = ctx;
317void _nib_acquire(
void);
322void _nib_release(
void);
333 return (node->
info & _NIB_IF_MASK) >> _NIB_IF_POS;
344 assert(iface <= _NIB_IF_MAX);
345 node->
info &= ~(_NIB_IF_MASK);
346 node->
info |= ((iface << _NIB_IF_POS) & _NIB_IF_MASK);
372 if (node->
mode == _EMPTY) {
415 if (nce && (nce->
mode & _NC)) {
485 node->
mode |= (_DAD);
497 node->
mode &= ~(_DAD);
498 _nib_onl_clear(node);
637 unsigned pfx_len, uint8_t mode)
641 if (nib_offl != NULL) {
642 nib_offl->
mode |= mode;
654 nib_offl->
mode &= ~mode;
655 _nib_offl_clear(nib_offl);
658#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_DC) || DOXYGEN
679 assert((next_hop != NULL) && (dst != NULL));
694 _nib_offl_remove(nib_offl, _DC);
722 uint32_t valid_ltime,
723 uint32_t pref_ltime);
744#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER) || DOXYGEN
770 return _nib_offl_add(next_hop, iface, pfx, pfx_len, _FT);
784 _evtimer_del(&nib_offl->route_timeout);
785 _nib_offl_remove(nib_offl, _FT);
789#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C) || defined(DOXYGEN)
847#define _nib_abr_iter(abr) NULL
878#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_QUEUE_PKT) || DOXYGEN
908#define _nbr_flush_pktqueue(node) ((void)node)
909#define _nbr_pop_pkt(node) ((void)node, NULL)
910#define _nbr_push_pkt(node, pkt) ((void)node, (void)pkt)
POSIX.1-2008 compliant version of the assert macro.
#define assert(cond)
abort the program if assertion is false
bitfields operations on bitfields of arbitrary length
Context buffer definitions.
EUI-64 data type definition.
IPC-based evtimer definitions.
Forwarding table definitions.
Definitions for GNRC's IPv6 implementation.
#define KERNEL_PID_LAST
The last valid PID (inclusive).
int16_t kernel_pid_t
Unique process identifier.
#define CONFIG_GNRC_IPV6_NIB_L2ADDR_MAX_LEN
Maximum link-layer address length (aligned)
#define CONFIG_GNRC_IPV6_NIB_OFFL_NUMOF
Number of off-link entries in NIB.
kernel_pid_t gnrc_ipv6_pid
The PID to the IPv6 thread.
#define GNRC_SIXLOWPAN_CTX_SIZE
maximum number of entries in context buffer
#define IPV6_ADDR_BIT_LEN
Length of an IPv6 address in bit.
static void evtimer_add_msg(evtimer_msg_t *evtimer, evtimer_msg_event_t *event, kernel_pid_t target_pid)
Adds event to an event timer that handles events via IPC.
void evtimer_del(evtimer_t *evtimer, evtimer_event_t *event)
Removes an event from an event timer.
Definitions for IPv6 addresses.
Configuration macro definitions for neighbor information base.
Common macros and compiler attributes/pragmas configuration.
Mutex for thread synchronization.
Neighbor cache definitions.
IPv6 neighbor discovery message type definitions.
Packet queue definitions.
Common interface to the software PRNG.
Scheduler API definition.
Internal NIB-representation of the authoritative border router for multihop prefix and 6LoWPAN contex...
ipv6_addr_t addr
The address of the border router.
BITFIELD(pfxs, CONFIG_GNRC_IPV6_NIB_OFFL_NUMOF)
Bitfield marking the prefixes in the NIB's off-link entries disseminated by _nib_abr_entry_t::addr.
uint32_t valid_until_ms
timestamp (in ms) until which information is valid (needs resolution in minutes an 16 bits of them)
evtimer_msg_event_t timeout
timeout of the information
BITFIELD(ctxs, GNRC_SIXLOWPAN_CTX_SIZE)
Bitfield marking the contexts disseminated by _nib_abr_entry_t::addr.
uint32_t version
last received version of the info of the _nib_abr_entry_t::addr
evtimer_msg_event_t rtr_timeout
Event for GNRC_IPV6_NIB_RTR_TIMEOUT.
_nib_onl_entry_t * next_hop
next hop to destination
ipv6_addr_t pfx
prefix to the destination
uint32_t valid_until
timestamp (in ms) until which the prefix valid (UINT32_MAX means forever)
uint8_t mode
mode of the off-link entry
uint8_t pfx_len
prefix-length in bits of _nib_onl_entry_t::pfx
uint32_t pref_until
timestamp (in ms) until which the prefix preferred (UINT32_MAX means forever)
evtimer_msg_event_t pfx_timeout
Event for GNRC_IPV6_NIB_PFX_TIMEOUT.
uint16_t flags
[flags](net_gnrc_ipv6_nib_offl_flags
_nib_onl_entry_t * next_hop
next hop to destination
uint8_t mode
NIB entry mode.
uint8_t ns_sent
Neighbor solicitations sent for probing.
evtimer_msg_event_t addr_reg_timeout
Event for GNRC_IPV6_NIB_ADDR_REG_TIMEOUT.
gnrc_pktqueue_t * pktqueue
queue for packets currently in address resolution
uint8_t l2addr_len
length in bytes of _nib_onl_entry_t::l2addr
eui64_t eui64
The neighbors EUI-64 (used for DAD)
struct _nib_onl_entry * next
next removable entry
uint8_t l2addr[CONFIG_GNRC_IPV6_NIB_L2ADDR_MAX_LEN]
Link-layer address of _nib_onl_entry_t::next_hop.
evtimer_msg_event_t reply_rs
Event for GNRC_IPV6_NIB_REPLY_RS.
ipv6_addr_t ipv6
Neighbors IPv6 address.
uint16_t info
Information flags.
evtimer_msg_event_t snd_na
Event for GNRC_IPV6_NIB_SND_NA.
uint8_t pktqueue_len
Number of queued packets (in pktqueue)
evtimer_msg_event_t nud_timeout
Event for GNRC_IPV6_NIB_SND_UC_NS, GNRC_IPV6_NIB_SND_MC_NS, GNRC_IPV6_NIB_REACH_TIMEOUT and GNRC_IPV6...
Forwarding table entry view on NIB.
Neighbor cache entry view on NIB.
data type for packet queue nodes
Type to represent parts (either headers or payload) of a packet, called snips.
Utility library for comparing and computing timestamps.
Data type to represent an EUI-64.
Data type to represent an IPv6 address.