Router-part of 6LoWPAN-ND. More...

Detailed Description

Files

file  net/gnrc/sixlowpan/nd/router.h
 Router-definitions for 6LoWPAN-ND.
 

Data Structures

struct  gnrc_sixlowpan_nd_router_prf
 Representation for prefixes coming from a router. More...
 
struct  gnrc_sixlowpan_nd_router_abr_t
 Abstract representation of a border router on all (border) routers. More...
 

Macros

#define GNRC_SIXLOWPAN_ND_ROUTER_ABR_NUMOF   (1)
 Number of registerable border routers. More...
 
#define GNRC_SIXLOWPAN_ND_ROUTER_ABR_PRF_NUMOF   (GNRC_SIXLOWPAN_ND_ROUTER_ABR_NUMOF * GNRC_NETIF_NUMOF)
 The number of non-link-local prefixes associated with border routers at maximum.
 

Typedefs

typedef struct gnrc_sixlowpan_nd_router_prf gnrc_sixlowpan_nd_router_prf_t
 Representation for prefixes coming from a router.
 

Functions

static void gnrc_sixlowpan_nd_router_gc_nc (gnrc_ipv6_nc_t *nc_entry)
 Removes tentetative neighbor cache entries or sets registered ones to garbage-collectible. More...
 
static void gnrc_sixlowpan_nd_router_set_router (gnrc_ipv6_netif_t *netif, bool enable)
 Set netif to router mode. More...
 
void gnrc_sixlowpan_nd_router_set_rtr_adv (gnrc_ipv6_netif_t *netif, bool enable)
 Set/Unset GNRC_IPV6_NETIF_FLAGS_RTR_ADV flag for netif. More...
 
gnrc_sixlowpan_nd_router_abr_tgnrc_sixlowpan_nd_router_abr_get (void)
 Get's the border router for this router. More...
 
bool gnrc_sixlowpan_nd_router_abr_older (sixlowpan_nd_opt_abr_t *abr_opt)
 Checks if the version data abr_opt is older than the version of the currently registered border router. More...
 
void gnrc_sixlowpan_nd_router_abr_remove (gnrc_sixlowpan_nd_router_abr_t *abr)
 Removes the border router and all the prefixes and contexts it disseminated through the network for this node. More...
 
gnrc_sixlowpan_nd_router_abr_tgnrc_sixlowpan_nd_router_abr_create (ipv6_addr_t *addr, unsigned int ltime)
 Makes this node a new border router. More...
 
int gnrc_sixlowpan_nd_router_abr_add_prf (gnrc_sixlowpan_nd_router_abr_t *abr, gnrc_ipv6_netif_t *iface, gnrc_ipv6_netif_addr_t *prefix)
 Adds a prefix for this border router to manage. More...
 
void gnrc_sixlowpan_nd_router_abr_rem_prf (gnrc_sixlowpan_nd_router_abr_t *abr, gnrc_ipv6_netif_t *iface, gnrc_ipv6_netif_addr_t *prefix)
 Removes a prefix from this border router. More...
 
int gnrc_sixlowpan_nd_router_abr_add_ctx (gnrc_sixlowpan_nd_router_abr_t *abr, uint8_t cid)
 Adds a context for this border router to manage. More...
 
void gnrc_sixlowpan_nd_router_abr_rem_ctx (gnrc_sixlowpan_nd_router_abr_t *abr, uint8_t cid)
 Removes a context from this border router. More...
 

Macro Definition Documentation

◆ GNRC_SIXLOWPAN_ND_ROUTER_ABR_NUMOF

#define GNRC_SIXLOWPAN_ND_ROUTER_ABR_NUMOF   (1)
Note
More than one border routers require some way of synchronization of the context information (see RFC 6775, section 8.1)

Definition at line 41 of file net/gnrc/sixlowpan/nd/router.h.

Function Documentation

◆ gnrc_sixlowpan_nd_router_abr_add_ctx()

int gnrc_sixlowpan_nd_router_abr_add_ctx ( gnrc_sixlowpan_nd_router_abr_t abr,
uint8_t  cid 
)
Parameters
[in]abrThe local border router
[in]cidThe context to be add.
Returns
0, on success
-EINVAL, if ctx is greater than 15.
-ENOENT, if abr is not registered.

◆ gnrc_sixlowpan_nd_router_abr_add_prf()

int gnrc_sixlowpan_nd_router_abr_add_prf ( gnrc_sixlowpan_nd_router_abr_t abr,
gnrc_ipv6_netif_t iface,
gnrc_ipv6_netif_addr_t prefix 
)
Precondition
iface != NULL && prefix != NULL
Parameters
[in]abrThe local border router.
[in]ifaceThe IPv6 interface the prefix was added to.
[in]prefixThe prefix.
Returns
0, on success
-ENOMEM, if no space for the new prefix is available.
-ENOENT, if abr is not registered.

◆ gnrc_sixlowpan_nd_router_abr_create()

gnrc_sixlowpan_nd_router_abr_t* gnrc_sixlowpan_nd_router_abr_create ( ipv6_addr_t addr,
unsigned int  ltime 
)
Precondition
addr != NULL
Parameters
[in]addrThe local address to use in the ABROs
[in]ltimeThe lifetime to advertise in the ABROs. 0 assumes a default value of GNRC_SIXLOWPAN_ND_BORDER_ROUTER_DEFAULT_LTIME
Returns
The new border router object.
NULL, on error.

◆ gnrc_sixlowpan_nd_router_abr_get()

gnrc_sixlowpan_nd_router_abr_t* gnrc_sixlowpan_nd_router_abr_get ( void  )
Returns
The border router, if one is specified.
NULL, otherwise.

◆ gnrc_sixlowpan_nd_router_abr_older()

bool gnrc_sixlowpan_nd_router_abr_older ( sixlowpan_nd_opt_abr_t abr_opt)
Parameters
[in]abr_optAn authoritative border router option containing potentially new information on the currently registered border router.
Returns
true, if the information in abr_opt is newer.
false, if the information in abr_opt is older.

◆ gnrc_sixlowpan_nd_router_abr_rem_ctx()

void gnrc_sixlowpan_nd_router_abr_rem_ctx ( gnrc_sixlowpan_nd_router_abr_t abr,
uint8_t  cid 
)
Parameters
[in]abrThe local border router.
[in]cidThe context to be remove.

◆ gnrc_sixlowpan_nd_router_abr_rem_prf()

void gnrc_sixlowpan_nd_router_abr_rem_prf ( gnrc_sixlowpan_nd_router_abr_t abr,
gnrc_ipv6_netif_t iface,
gnrc_ipv6_netif_addr_t prefix 
)
Parameters
[in]abrThe local border router.
[in]ifaceThe IPv6 interface the prefix was added to.
[in]prefixThe prefix.

◆ gnrc_sixlowpan_nd_router_abr_remove()

void gnrc_sixlowpan_nd_router_abr_remove ( gnrc_sixlowpan_nd_router_abr_t abr)
Parameters
[in]abrThe border router.

◆ gnrc_sixlowpan_nd_router_gc_nc()

static void gnrc_sixlowpan_nd_router_gc_nc ( gnrc_ipv6_nc_t nc_entry)
inlinestatic
Parameters
[in]nc_entryA neighbor cache entry.

Definition at line 85 of file net/gnrc/sixlowpan/nd/router.h.

◆ gnrc_sixlowpan_nd_router_set_router()

static void gnrc_sixlowpan_nd_router_set_router ( gnrc_ipv6_netif_t netif,
bool  enable 
)
inlinestatic

This sets/unsets the GNRC_IPV6_NETIF_FLAGS_ROUTER and initializes or ceases router behavior for 6LoWPAN neighbor discovery.

Parameters
[in]netifAn IPv6 interface. Must not be NULL.
[in]enableStatus for the GNRC_IPV6_NETIF_FLAGS_ROUTER flag.

Definition at line 107 of file net/gnrc/sixlowpan/nd/router.h.

◆ gnrc_sixlowpan_nd_router_set_rtr_adv()

void gnrc_sixlowpan_nd_router_set_rtr_adv ( gnrc_ipv6_netif_t netif,
bool  enable 
)

GNRC_IPV6_NETIF_FLAGS_RTR_ADV and initializes or ceases periodic router advertising behavior for neighbor discovery.

Parameters
[in]netifAn IPv6 interface. Must not be NULL.
[in]enableStatus for the GNRC_IPV6_NETIF_FLAGS_RTR_ADV flag.