All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
6LoWPAN Neighbor Discovery

Message types and helper functions for Neighbor Discovery Optimization for 6LoWPAN (6LoWPAN-ND) More...

Detailed Description

Message types and helper functions for Neighbor Discovery Optimization for 6LoWPAN (6LoWPAN-ND)

See also
RFC 6775, section 4

Files

file  nd.h
 Message type and helper function definitions for 6LoWPAN-ND.
 

Data Structures

struct  sixlowpan_nd_da_t
 Duplicate address request and confirmation message format. More...
 
struct  sixlowpan_nd_opt_ar_t
 Address registration option format. More...
 
struct  sixlowpan_nd_opt_6ctx_t
 6LoWPAN context option format More...
 
struct  sixlowpan_nd_opt_abr_t
 Authoritative border router option format. More...
 

Functions

static bool sixlowpan_nd_opt_6ctx_is_comp (const sixlowpan_nd_opt_6ctx_t *ctx_opt)
 Checks if a 6LoWPAN context in an 6LoWPAN context option is valid for compression.
 
static uint8_t sixlowpan_nd_opt_6ctx_get_cid (const sixlowpan_nd_opt_6ctx_t *ctx_opt)
 Gets a CID (context identifier) from a 6LoWPAN context option.
 
static void sixlowpan_nd_opt_6ctx_set_cid (sixlowpan_nd_opt_6ctx_t *ctx_opt, uint8_t cid)
 Sets a CID (context identifier) for a 6LoWPAN context option.
 
static uint32_t sixlowpan_nd_opt_abr_get_version (const sixlowpan_nd_opt_abr_t *abr_opt)
 Gets the version in correct order from an Authoritative Border Router option.
 
static void sixlowpan_nd_opt_abr_set_version (sixlowpan_nd_opt_abr_t *abr_opt, uint32_t version)
 Sets the version of an Authoritative Border Router option.
 
static uint16_t gnrc_sixlowpan_nd_opt_get_ltime (const sixlowpan_nd_opt_abr_t *abr_opt)
 Get the lifetime of an Authoritative Border Router from an ABR option.
 

Lengths for fixed length options

Note
Options don't use bytes as their length unit, but 8 bytes.
#define SIXLOWPAN_ND_OPT_6CTX_LEN_MIN   (2U)
 
#define SIXLOWPAN_ND_OPT_6CTX_LEN_MAX   (3U)
 
#define SIXLOWPAN_ND_OPT_AR_LEN   (2U)
 
#define SIXLOWPAN_ND_OPT_ABR_LEN   (3U)
 

Authoritative border router option constants

See also
RFC 6775, section 4.3
#define SIXLOWPAN_ND_OPT_ABR_LTIME_DEFAULT   (10000U)
 Valid lifetime (in minutes) assumed if sixlowpan_nd_opt_abr_t::ltime is 0.
 

Status values for address registration option and DARs

See also
RFC 6775, section 4.1
#define SIXLOWPAN_ND_STATUS_SUCCESS   (0)
 success
 
#define SIXLOWPAN_ND_STATUS_DUP   (1)
 duplicate address
 
#define SIXLOWPAN_ND_STATUS_NC_FULL   (2)
 neighbor cache full
 

Flags for 6LoWPAN context option

#define SIXLOWPAN_ND_OPT_6CTX_FLAGS_MASK   (0x1f)
 
#define SIXLOWPAN_ND_OPT_6CTX_FLAGS_C   (0x10)
 valid for compression
 
#define SIXLOWPAN_ND_OPT_6CTX_FLAGS_CID_MASK   (0x0f)
 mask for CID
 

6LoWPAN border router constants

See also
RFC 6775, section 9
#define SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY   (300U)
 MIN_CONTEXT_CHANGE_DELAY (in sec)
 

6LoWPAN router constants

See also
RFC 6775, section 9
#define SIXLOWPAN_ND_MAX_RA_NUMOF   (3U)
 MAX_RTR_ADVERTISEMENTS.
 
#define SIXLOWPAN_ND_MIN_MS_DELAY_BETWEEN_RAS   (10000U)
 MIN_DELAY_BETWEEN_RAS (in ms)
 
#define SIXLOWPAN_ND_MAX_RA_MS_DELAY   (2000U)
 MAX_RA_DELAY_TIME (in ms)
 
#define SIXLOWPAN_ND_TENTATIVE_NCE_SEC_LTIME   (20U)
 TENTATIVE_NCE_LIFETIME (in sec)
 

Router constants

See also
RFC 6775, section 9
#define SIXLOWPAN_ND_MULTIHOP_HL   (64U)
 MULTIHOP_HOPLIMIT.
 

Host constants

See also
RFC 6775, section 9
#define SIXLOWPAN_ND_REG_TRANSMIT_NUMOF   (3U)
 Number of address registration retries.
 
#define SIXLOWPAN_ND_RS_MSEC_INTERVAL   (10000U)
 RTR_SOLICITATION_INTERVAL (in msec)
 
#define SIXLOWPAN_ND_MAX_RS_NUMOF   (3U)
 MAX_RTR_SOLICITATIONS.
 
#define SIXLOWPAN_ND_MAX_RS_SEC_INTERVAL   (60U)
 MAX_RTR_SOLICITATIONS_INTERVAL (in seconds)
 

Macro Definition Documentation

◆ SIXLOWPAN_ND_MAX_RA_MS_DELAY

#define SIXLOWPAN_ND_MAX_RA_MS_DELAY   (2000U)

MAX_RA_DELAY_TIME (in ms)

Definition at line 99 of file nd.h.

◆ SIXLOWPAN_ND_MAX_RA_NUMOF

#define SIXLOWPAN_ND_MAX_RA_NUMOF   (3U)

MAX_RTR_ADVERTISEMENTS.

Definition at line 97 of file nd.h.

◆ SIXLOWPAN_ND_MAX_RS_NUMOF

#define SIXLOWPAN_ND_MAX_RS_NUMOF   (3U)

MAX_RTR_SOLICITATIONS.

Definition at line 128 of file nd.h.

◆ SIXLOWPAN_ND_MAX_RS_SEC_INTERVAL

#define SIXLOWPAN_ND_MAX_RS_SEC_INTERVAL   (60U)

MAX_RTR_SOLICITATIONS_INTERVAL (in seconds)

Definition at line 132 of file nd.h.

◆ SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY

#define SIXLOWPAN_ND_MIN_CTX_CHANGE_SEC_DELAY   (300U)

MIN_CONTEXT_CHANGE_DELAY (in sec)

Definition at line 89 of file nd.h.

◆ SIXLOWPAN_ND_MIN_MS_DELAY_BETWEEN_RAS

#define SIXLOWPAN_ND_MIN_MS_DELAY_BETWEEN_RAS   (10000U)

MIN_DELAY_BETWEEN_RAS (in ms)

Definition at line 98 of file nd.h.

◆ SIXLOWPAN_ND_MULTIHOP_HL

#define SIXLOWPAN_ND_MULTIHOP_HL   (64U)

MULTIHOP_HOPLIMIT.

Definition at line 108 of file nd.h.

◆ SIXLOWPAN_ND_OPT_6CTX_FLAGS_C

#define SIXLOWPAN_ND_OPT_6CTX_FLAGS_C   (0x10)

valid for compression

Definition at line 78 of file nd.h.

◆ SIXLOWPAN_ND_OPT_6CTX_FLAGS_CID_MASK

#define SIXLOWPAN_ND_OPT_6CTX_FLAGS_CID_MASK   (0x0f)

mask for CID

Definition at line 79 of file nd.h.

◆ SIXLOWPAN_ND_OPT_6CTX_FLAGS_MASK

#define SIXLOWPAN_ND_OPT_6CTX_FLAGS_MASK   (0x1f)

Definition at line 77 of file nd.h.

◆ SIXLOWPAN_ND_OPT_6CTX_LEN_MAX

#define SIXLOWPAN_ND_OPT_6CTX_LEN_MAX   (3U)

Definition at line 41 of file nd.h.

◆ SIXLOWPAN_ND_OPT_6CTX_LEN_MIN

#define SIXLOWPAN_ND_OPT_6CTX_LEN_MIN   (2U)

Definition at line 40 of file nd.h.

◆ SIXLOWPAN_ND_OPT_ABR_LEN

#define SIXLOWPAN_ND_OPT_ABR_LEN   (3U)

Definition at line 43 of file nd.h.

◆ SIXLOWPAN_ND_OPT_ABR_LTIME_DEFAULT

#define SIXLOWPAN_ND_OPT_ABR_LTIME_DEFAULT   (10000U)

Valid lifetime (in minutes) assumed if sixlowpan_nd_opt_abr_t::ltime is 0.

Definition at line 57 of file nd.h.

◆ SIXLOWPAN_ND_OPT_AR_LEN

#define SIXLOWPAN_ND_OPT_AR_LEN   (2U)

Definition at line 42 of file nd.h.

◆ SIXLOWPAN_ND_REG_TRANSMIT_NUMOF

#define SIXLOWPAN_ND_REG_TRANSMIT_NUMOF   (3U)

Number of address registration retries.

Note
Must not be greater than 7 for Generic (GNRC) network stack since GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_TENTATIVE restricts it to that number.

Definition at line 123 of file nd.h.

◆ SIXLOWPAN_ND_RS_MSEC_INTERVAL

#define SIXLOWPAN_ND_RS_MSEC_INTERVAL   (10000U)

RTR_SOLICITATION_INTERVAL (in msec)

Definition at line 127 of file nd.h.

◆ SIXLOWPAN_ND_STATUS_DUP

#define SIXLOWPAN_ND_STATUS_DUP   (1)

duplicate address

Definition at line 67 of file nd.h.

◆ SIXLOWPAN_ND_STATUS_NC_FULL

#define SIXLOWPAN_ND_STATUS_NC_FULL   (2)

neighbor cache full

Definition at line 68 of file nd.h.

◆ SIXLOWPAN_ND_STATUS_SUCCESS

#define SIXLOWPAN_ND_STATUS_SUCCESS   (0)

success

Definition at line 66 of file nd.h.

◆ SIXLOWPAN_ND_TENTATIVE_NCE_SEC_LTIME

#define SIXLOWPAN_ND_TENTATIVE_NCE_SEC_LTIME   (20U)

TENTATIVE_NCE_LIFETIME (in sec)

Definition at line 100 of file nd.h.

Function Documentation

◆ gnrc_sixlowpan_nd_opt_get_ltime()

static uint16_t gnrc_sixlowpan_nd_opt_get_ltime ( const sixlowpan_nd_opt_abr_t * abr_opt)
inlinestatic

Get the lifetime of an Authoritative Border Router from an ABR option.

Parameters
[in]abr_optAn Authoritative Border Router option (ABRO).
Returns
The lifetime of abr_opt in minutes. If the lifetime is 0, SIXLOWPAN_ND_OPT_ABR_LTIME_DEFAULT is returned.

Definition at line 271 of file nd.h.

◆ sixlowpan_nd_opt_6ctx_get_cid()

static uint8_t sixlowpan_nd_opt_6ctx_get_cid ( const sixlowpan_nd_opt_6ctx_t * ctx_opt)
inlinestatic

Gets a CID (context identifier) from a 6LoWPAN context option.

Parameters
[in]ctx_optA 6LoWPAN context option.
Returns
The CID in the 6LoWPAN context option ctx_opt.

Definition at line 219 of file nd.h.

◆ sixlowpan_nd_opt_6ctx_is_comp()

static bool sixlowpan_nd_opt_6ctx_is_comp ( const sixlowpan_nd_opt_6ctx_t * ctx_opt)
inlinestatic

Checks if a 6LoWPAN context in an 6LoWPAN context option is valid for compression.

Parameters
[in]ctx_optA 6LoWPAN context option.
Returns
true, if C bit is set in ctx_opt.
false, if C bit is unset in ctx_opt.

Definition at line 207 of file nd.h.

◆ sixlowpan_nd_opt_6ctx_set_cid()

static void sixlowpan_nd_opt_6ctx_set_cid ( sixlowpan_nd_opt_6ctx_t * ctx_opt,
uint8_t cid )
inlinestatic

Sets a CID (context identifier) for a 6LoWPAN context option.

Parameters
[out]ctx_optA 6LoWPAN context option.
[in]cidThe CID for the 6LoWPAN context option.

Definition at line 230 of file nd.h.

◆ sixlowpan_nd_opt_abr_get_version()

static uint32_t sixlowpan_nd_opt_abr_get_version ( const sixlowpan_nd_opt_abr_t * abr_opt)
inlinestatic

Gets the version in correct order from an Authoritative Border Router option.

Parameters
[in]abr_optAn Authoritative Border Router option (ABRO).
Returns
The version of the ABRO

Definition at line 244 of file nd.h.

◆ sixlowpan_nd_opt_abr_set_version()

static void sixlowpan_nd_opt_abr_set_version ( sixlowpan_nd_opt_abr_t * abr_opt,
uint32_t version )
inlinestatic

Sets the version of an Authoritative Border Router option.

Parameters
[in]abr_optAn Authoritative Border Router option (ABRO).
[in]versionVersion for the ABRO.

Definition at line 256 of file nd.h.