Neighbor Information Base (NIB) for IPv6. More...
Neighbor Information Base (NIB) for IPv6.
Add detailed description
Implement multihop DAD
Implement classic SLAAC
Implement MLD
Modules | |
Authoritative border router list | |
Authoritative border router list component of neighbor information base. | |
Forwarding table | |
GNRC IPv6 NIB compile configurations | |
Configuration macros for neighbor information base. | |
Neighbor Cache | |
Neighbor cache component of neighbor information base. | |
Prefix list | |
Prefix list component of neighbor information base. | |
Files | |
file | nib.h |
NIB definitions. | |
file | _nib-6ln.h |
Definitions related to 6Lo node (6LN) functionality of the NIB. | |
file | _nib-6lr.h |
Definitions related to 6Lo router (6LR) functionality of the NIB. | |
file | _nib-slaac.h |
Definions related to SLAAC functionality of the NIB. | |
Enumerations | |
enum | { GNRC_IPV6_NIB_ROUTE_INFO_TYPE_UNDEF = 0, GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RRQ, GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RN, GNRC_IPV6_NIB_ROUTE_INFO_TYPE_NSC } |
Types for gnrc_netif_ipv6_t::route_info_cb. More... | |
Functions | |
void | gnrc_ipv6_nib_init (void) |
Initialize NIB. | |
void | gnrc_ipv6_nib_init_iface (gnrc_netif_t *netif) |
Adds an interface to be managed by the NIB. More... | |
int | gnrc_ipv6_nib_get_next_hop_l2addr (const ipv6_addr_t *dst, gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, gnrc_ipv6_nib_nc_t *nce) |
Gets link-layer address of next hop to a destination address. More... | |
void | gnrc_ipv6_nib_handle_pkt (gnrc_netif_t *netif, const ipv6_hdr_t *ipv6, const icmpv6_hdr_t *icmpv6, size_t icmpv6_len) |
Handles a received ICMPv6 packet. More... | |
void | gnrc_ipv6_nib_handle_timer_event (void *ctx, uint16_t type) |
Handles a timer event. More... | |
void | gnrc_ipv6_nib_change_rtr_adv_iface (gnrc_netif_t *netif, bool enable) |
Changes the state if an interface advertises itself as a router or not. More... | |
void | _snd_ns (const ipv6_addr_t *tgt, gnrc_netif_t *netif, const ipv6_addr_t *src, const ipv6_addr_t *dst) |
Sends neighbor solicitation (including ARO if required) More... | |
static void | _init_iface_router (gnrc_netif_t *netif) |
Initializes interface for router behavior. More... | |
Timer event message types | |
#define | GNRC_IPV6_NIB_SND_UC_NS (0x4fc0U) |
(Re-)transmit unicast Neighbor Solicitation event. More... | |
#define | GNRC_IPV6_NIB_SND_MC_NS (0x4fc1U) |
(Re-)transmit multicast Neighbor Solicitation event. More... | |
#define | GNRC_IPV6_NIB_SND_NA (0x4fc2U) |
Send delayed Neighbor Advertisement event. More... | |
#define | GNRC_IPV6_NIB_SEARCH_RTR (0x4fc3U) |
Search router event. More... | |
#define | GNRC_IPV6_NIB_REPLY_RS (0x4fc5U) |
Reply Router Solicitation event. More... | |
#define | GNRC_IPV6_NIB_SND_MC_RA (0x4fc6U) |
(Re-)transmit multicast Router Advertisement event. More... | |
#define | GNRC_IPV6_NIB_REACH_TIMEOUT (0x4fc7U) |
Reachability timeout event. More... | |
#define | GNRC_IPV6_NIB_DELAY_TIMEOUT (0x4fc8U) |
Delay timeout event. More... | |
#define | GNRC_IPV6_NIB_ADDR_REG_TIMEOUT (0x4fc9U) |
Address registration timeout event. More... | |
#define | GNRC_IPV6_NIB_ABR_TIMEOUT (0x4fcbU) |
Authoritative border router timeout event. More... | |
#define | GNRC_IPV6_NIB_PFX_TIMEOUT (0x4fccU) |
Prefix timeout event. More... | |
#define | GNRC_IPV6_NIB_RTR_TIMEOUT (0x4fcdU) |
Router timeout event. More... | |
#define | GNRC_IPV6_NIB_RECALC_REACH_TIME (0x4fceU) |
Recalculate reachability timeout time. More... | |
#define | GNRC_IPV6_NIB_REREG_ADDRESS (0x4fcfU) |
Reregister address. More... | |
#define | GNRC_IPV6_NIB_ROUTE_TIMEOUT (0x4fd0U) |
Route timeout event. More... | |
#define | GNRC_IPV6_NIB_DAD (0x4fd1U) |
Perform DAD event. More... | |
#define | GNRC_IPV6_NIB_VALID_ADDR (0x4fd2U) |
Validate a tentative address event. More... | |
#define | GNRC_IPV6_NIB_RDNSS_TIMEOUT (0x4fd3U) |
Recursive DNS server timeout. More... | |
#define GNRC_IPV6_NIB_ABR_TIMEOUT (0x4fcbU) |
Authoritative border router timeout event.
This message type is for the event of an Authoritative border router timeout. The expected message context is the NIB-internal state of the authoritative border router.
#define GNRC_IPV6_NIB_ADDR_REG_TIMEOUT (0x4fc9U) |
Address registration timeout event.
This message type is for the event of a 6LoWPAN address registration state timeout. The expected message context is a pointer to a valid on-link entry representing the neighbor which faces a timeout of its address registration.
#define GNRC_IPV6_NIB_DAD (0x4fd1U) |
Perform DAD event.
This message type is for performing DAD for a given address. The expected message context is a TENTATIVE IPv6 address.
#define GNRC_IPV6_NIB_DELAY_TIMEOUT (0x4fc8U) |
Delay timeout event.
This message type is for the event of the DELAY state timeout. The expected message context is a pointer to a valid on-link entry representing the neighbor cache entry that faces a state change.
#define GNRC_IPV6_NIB_PFX_TIMEOUT (0x4fccU) |
#define GNRC_IPV6_NIB_RDNSS_TIMEOUT (0x4fd3U) |
Recursive DNS server timeout.
This message type is for the event of a recursive DNS server timeout. The expected message context is the UDP end point representing the DNS server.
#define GNRC_IPV6_NIB_REACH_TIMEOUT (0x4fc7U) |
Reachability timeout event.
This message type is for the event of a REACHABLE state timeout. The expected message context is a pointer to a valid on-link entry representing the neighbor cache entry that faces a state change.
#define GNRC_IPV6_NIB_RECALC_REACH_TIME (0x4fceU) |
Recalculate reachability timeout time.
This message type is for the event of recalculating the reachability timeout time. The expected message context is a valid interface.
#define GNRC_IPV6_NIB_REPLY_RS (0x4fc5U) |
Reply Router Solicitation event.
This message type is for the event of the delayed reply to a Router Solicitaion with a Router Advertisement. The expected message context is a pointer to a valid on-link entry representing the neighbor that sent the Router Solicitation.
#define GNRC_IPV6_NIB_REREG_ADDRESS (0x4fcfU) |
Reregister address.
This message type is for the event of reregistering an IPv6 address to the upstream router. The expected message context is an IPv6 address assigned to one of the nodes interfaces.
#define GNRC_IPV6_NIB_ROUTE_TIMEOUT (0x4fd0U) |
Route timeout event.
This message type is for the event of a route timeout. The expected message context is a valid off-link entry representing the route.
#define GNRC_IPV6_NIB_RTR_TIMEOUT (0x4fcdU) |
#define GNRC_IPV6_NIB_SEARCH_RTR (0x4fc3U) |
#define GNRC_IPV6_NIB_SND_MC_NS (0x4fc1U) |
(Re-)transmit multicast Neighbor Solicitation event.
This message type is for the event of (re-)transmitting of multicast Neighbor Solicitation. The expected message context is a pointer to a valid on-link entry representing the neighbor to which solicited nodes group the Neighbor Solicitation is supposed to be sent.
#define GNRC_IPV6_NIB_SND_MC_RA (0x4fc6U) |
(Re-)transmit multicast Router Advertisement event.
This message type is for the event of (Re)transmit Advertisements event. The expected message context is a pointer to a valid interface over which the Router Advertisement will be sent and by which parameters it will be configured.
#define GNRC_IPV6_NIB_SND_NA (0x4fc2U) |
Send delayed Neighbor Advertisement event.
This message type is for the event of sending delayed Neighbor Advertisements. The expected message context is a pointer to a valid packet snip in sending order, representing the Neighbor Advertisement.
#define GNRC_IPV6_NIB_SND_UC_NS (0x4fc0U) |
(Re-)transmit unicast Neighbor Solicitation event.
This message type is for the event of (re-)transmitting of unicast Neighbor Solicitation. The expected message context is a pointer to a valid on-link entry representing the neighbor to which the Neighbor Solicitation is supposed to be sent.
#define GNRC_IPV6_NIB_VALID_ADDR (0x4fd2U) |
Validate a tentative address event.
Moves a TENTATIVE address to VALID state. The expected message context is a TENTATIVE IPv6 address.
anonymous enum |
Types for gnrc_netif_ipv6_t::route_info_cb.
Enumerator | |
---|---|
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_UNDEF | undefined |
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RRQ | reactive routing query A reactive routing query is issued when a route is unknown to the NIB. A reactive routing protocol can use this call to search for a route in a reactive manner. The |
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RN | route notification A route notification is issued when an already established route is taken. A routing protocol can use this call to update its information on the route. The |
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_NSC | neighbor state change A neighbor state change is issued when ever the NUD state of a neighbor changes. A routing protocol can use this call to update its information on routes via this neighbor. The Be advised to only use |
|
inlinestatic |
Initializes interface for router behavior.
[in] | netif | An interface. |
Definition at line 42 of file _nib-router.h.
void _snd_ns | ( | const ipv6_addr_t * | tgt, |
gnrc_netif_t * | netif, | ||
const ipv6_addr_t * | src, | ||
const ipv6_addr_t * | dst | ||
) |
Sends neighbor solicitation (including ARO if required)
(tgt != NULL) && !ipv6_addr_is_multicast(tgt)
(netif != NULL) && (dst != NULL)
[in] | tgt | The target address of the neighbor solicitation. Must not be NULL or a multicast address. |
[in] | netif | Interface to send over. Must not be NULL. |
[in] | src | Source address for the neighbor solicitation. Will be chosen from the interface according to dst , if NULL. |
[in] | dst | Destination address for neighbor solicitation. Must not be NULL. |
void gnrc_ipv6_nib_change_rtr_adv_iface | ( | gnrc_netif_t * | netif, |
bool | enable | ||
) |
Changes the state if an interface advertises itself as a router or not.
[in] | netif | The interface for which the state should be changed. |
[in] | enable | true , to enable advertising the interface as a router. false , to disable advertising the interface as a router. |
int gnrc_ipv6_nib_get_next_hop_l2addr | ( | const ipv6_addr_t * | dst, |
gnrc_netif_t * | netif, | ||
gnrc_pktsnip_t * | pkt, | ||
gnrc_ipv6_nib_nc_t * | nce | ||
) |
Gets link-layer address of next hop to a destination address.
(dst != NULL) && (nce != NULL)
[in] | dst | Destination address of a packet. |
[in] | netif | Restrict search to this interface. May be NULL for any interface. |
[in] | pkt | The IPv6 packet in sending order for which the next hop is searched. Needed for queuing for with reactive routing or address resolution. May be NULL . Will be released properly on error. |
[out] | nce | The neighbor cache entry of the next hop to dst . |
dst
was link-local, but iface
was KERNEL_PID_UNDEF (no neighbor cache entry will be created in this case and no neighbor solicitation sent). void gnrc_ipv6_nib_handle_pkt | ( | gnrc_netif_t * | netif, |
const ipv6_hdr_t * | ipv6, | ||
const icmpv6_hdr_t * | icmpv6, | ||
size_t | icmpv6_len | ||
) |
Handles a received ICMPv6 packet.
netif != NULL
ipv6 != NULL
icmpv6 != NULL
icmpv6_len > sizeof(icmpv6_hdr_t)
ipv6
is just used for the addresses and hop limit. The next header field will not be checked for correctness (but should be PROTNUM_ICMPV6)[in] | netif | The interface the packet came over. |
[in] | ipv6 | The IPv6 header of the received packet. |
[in] | icmpv6 | The ICMPv6 header and payload of the received packet. |
[in] | icmpv6_len | The number of bytes at icmpv6 . |
void gnrc_ipv6_nib_handle_timer_event | ( | void * | ctx, |
uint16_t | type | ||
) |
Handles a timer event.
[in] | ctx | Context of the timer event. |
[in] | type | Type of the timer event (see timer event types") |
void gnrc_ipv6_nib_init_iface | ( | gnrc_netif_t * | netif | ) |
Adds an interface to be managed by the NIB.
netif != NULL
[in,out] | netif | The interface to be managed by the NIB |