The friendly Operating System for the Internet of Things

Definitions for IPv6 specific information of network interfaces. More...

Detailed Description

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "kernel_defines.h"
#include "kernel_types.h"
#include "mutex.h"
#include "net/ipv6.h"
#include "net/ipv6/addr.h"
#include "net/netstats.h"
#include "xtimer.h"
+ Include dependency graph for ipv6/netif.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gnrc_ipv6_netif_addr_t
 Type to represent an IPv6 address registered to an interface. More...
 
struct  gnrc_ipv6_netif_t
 Definition of IPv6 interface type. More...
 

Macros

#define GNRC_IPV6_NETIF_ADDR_NUMOF   (6 + GNRC_IPV6_NETIF_RPL_ADDR + GNRC_IPV6_NETIF_RTR_ADDR)
 Number of IPv6 addresses per interface.
 
#define GNRC_IPV6_NETIF_DEFAULT_MTU   (IPV6_MIN_MTU)
 Default MTU. More...
 
#define GNRC_IPV6_NETIF_DEFAULT_HL   (64)
 Default hop limit. More...
 
Default values for router configuration
#define GNRC_IPV6_NETIF_DEFAULT_MAX_ADV_INT   (600U)
 Maximum time in seconds between sending unsolicited multicast router advertisements.
 
#define GNRC_IPV6_NETIF_DEFAULT_MIN_ADV_INT   (200U)
 Minimum time in seconds between sending unsolicited multicast router advertisements.
 
#define GNRC_IPV6_NETIF_DEFAULT_ROUTER_LTIME   (1800U)
 The router lifetime to propagate in router advertisements.
 
Flags for a registered IPv6 address.

Needed primarily to identify addresses as either anycast or unicast.

See also
RFC 4291, section 2.6
#define GNRC_IPV6_NETIF_ADDR_FLAGS_UNICAST   (0x00)
 unicast address
 
#define GNRC_IPV6_NETIF_ADDR_FLAGS_NON_UNICAST   (0x01)
 non-unicast address
 
#define GNRC_IPV6_NETIF_ADDR_FLAGS_NDP_AUTO   (0x40)
 A prefix information option that propagates the prefix of this address should set the autonomous flag. More...
 
#define GNRC_IPV6_NETIF_ADDR_FLAGS_NDP_ON_LINK   (0x80)
 A prefix information option that propagates the prefix of this address should set the on-link flag. More...
 
Flags for the interfaces
Note
The most-significant byte of these flags is identical to the flags in IPv6 router advertisements. See RFC4861, section 4.2, RFC6275, section 7.1, RFC4191, section 2.2, and RFC4389, section 4.1.3.3.
#define GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN   (0x0001)
 Interface is 6LoWPAN interface.
 
#define GNRC_IPV6_NETIF_FLAGS_ROUTER   (0x0002)
 Flag to indicate that routing is enabled on the interface.
 
#define GNRC_IPV6_NETIF_FLAGS_RTR_ADV   (0x0004)
 Flag to indicate that the interface sends periodic router advertisements and in response to router solicitations.
 
#define GNRC_IPV6_NETIF_FLAGS_ADV_MTU   (0x0008)
 Flag to indicate that gnrc_ipv6_netif_t::mtu shall be propagated with the MTU options in router advertisements.
 
#define GNRC_IPV6_NETIF_FLAGS_ADV_CUR_HL   (0x0010)
 Flag to indicate that gnrc_ipv6_netif_t::cur_hl shall be propagated in router advertisements.
 
#define GNRC_IPV6_NETIF_FLAGS_ADV_REACH_TIME   (0x0020)
 Flag to indicate that gnrc_ipv6_netif_t::reach_time shall be propagated in router advertisements.
 
#define GNRC_IPV6_NETIF_FLAGS_ADV_RETRANS_TIMER   (0x0040)
 Flag to indicate that gnrc_ipv6_netif_t::retrans_timer shall be propagated in router advertisements.
 
#define GNRC_IPV6_NETIF_FLAGS_IS_WIRED   (0x0080)
 Flag to indicate if the interface is operating over a wired link.
 
#define GNRC_IPV6_NETIF_FLAGS_RTR_ADV_POS   (8U)
 Offset of the router advertisement flags compared to the position in router advertisements.
 
#define GNRC_IPV6_NETIF_FLAGS_RTR_ADV_MASK   (0xc000)
 Mask for flags intended for router advertisements. More...
 
#define GNRC_IPV6_NETIF_FLAGS_OTHER_CONF   (0x4000)
 Flag to indicate that the interface has other address configuration.
 
#define GNRC_IPV6_NETIF_FLAGS_MANAGED   (0x8000)
 Flag to indicate that the interface has managed address configuration (e.g. More...
 

Functions

void gnrc_ipv6_netif_init (void)
 Initializes the module.
 
void gnrc_ipv6_netif_add (kernel_pid_t pid)
 Add interface to IPv6. More...
 
void gnrc_ipv6_netif_remove (kernel_pid_t pid)
 Remove interface from IPv6. More...
 
gnrc_ipv6_netif_tgnrc_ipv6_netif_get (kernel_pid_t pid)
 Get interface. More...
 
void gnrc_ipv6_netif_set_router (gnrc_ipv6_netif_t *netif, bool enable)
 Set interface to router mode. More...
 
void gnrc_ipv6_netif_set_rtr_adv (gnrc_ipv6_netif_t *netif, bool enable)
 Set interface to router advertisement mode. More...
 
ipv6_addr_tgnrc_ipv6_netif_add_addr (kernel_pid_t pid, const ipv6_addr_t *addr, uint8_t prefix_len, uint8_t flags)
 Adds an address to an interface. More...
 
void gnrc_ipv6_netif_remove_addr (kernel_pid_t pid, ipv6_addr_t *addr)
 Remove an address from the interface. More...
 
void gnrc_ipv6_netif_reset_addr (kernel_pid_t pid)
 Removes all addresses from the interface. More...
 
kernel_pid_t gnrc_ipv6_netif_find_by_addr (ipv6_addr_t **out, const ipv6_addr_t *addr)
 Searches for an address on all interfaces. More...
 
ipv6_addr_tgnrc_ipv6_netif_find_addr (kernel_pid_t pid, const ipv6_addr_t *addr)
 Searches for an address on an interface. More...
 
kernel_pid_t gnrc_ipv6_netif_find_by_prefix (ipv6_addr_t **out, const ipv6_addr_t *prefix)
 Searches for the first address matching a prefix best on all interfaces. More...
 
ipv6_addr_tgnrc_ipv6_netif_match_prefix (kernel_pid_t pid, const ipv6_addr_t *prefix)
 Searches for the first address matching a prefix best on an interface. More...
 
ipv6_addr_tgnrc_ipv6_netif_find_best_src_addr (kernel_pid_t pid, const ipv6_addr_t *dest, bool ll_only)
 Searches for the best address on an interface usable as a source address for a given destination address. More...
 
static gnrc_ipv6_netif_addr_tgnrc_ipv6_netif_addr_get (const ipv6_addr_t *addr)
 Get interface specific meta-information on an address. More...
 
static bool gnrc_ipv6_netif_addr_is_non_unicast (const ipv6_addr_t *addr)
 Checks if an address is non-unicast. More...
 
void gnrc_ipv6_netif_init_by_dev (void)
 Initializes an interface with device-dependent values. More...
 
netstats_tgnrc_ipv6_netif_get_stats (kernel_pid_t pid)
 Get sent and received statistics about IPv6 traffic on this interface. More...