Loading...
Searching...
No Matches

RPL implementation for GNRC. More...

Detailed Description

RPL implementation for GNRC.

Configuration

USEMODULE

Auto-Initialization

If the application defines only one interface (gnrc_netif_highlander() returns true), then RPL will be initialized on this interface.

If the application defines several interfaces (gnrc_netif_highlander() returns false), then RPL will be initialized on the interface CONFIG_GNRC_RPL_DEFAULT_NETIF. Your application is responsible for setting CONFIG_GNRC_RPL_DEFAULT_NETIF to a valid interface PID, e.g. via CFLAGS or menuconfig.

Initializing RPL on multiple interfaces automatically is currently not supported. Call gnrc_rpl_init() manually from your application for the desired interfaces in this case.

CFLAGS

TODO

The GNRC RPL implementation only implements storing mode with OF0 (RFC6552). The RPL routing header is parsed by the nodes when the gnrc_rpl_srh module is used, but anything else for non-storing mode is missing. For interoperability with other RPL implementations, open task include:

Topics

 RPL source routing header extension
 Implementation of RPL source routing extension headers.
 
 Reactive Discovery of P2P Routes in LLNs
 Implementation of P2P-RPL.
 

Files

file  rpl.h
 RPL header.
 
file  dodag.h
 DODAG-related functions for RPL.
 
file  of_manager.h
 RPL Objective functions manager header.
 
file  rpble.h
 Glue code linking RPL with the NimBLE rpble connection manager.
 
file  structs.h
 RPL data structs.
 
file  globals.h
 Internal globals for RPL.
 
file  netstats.h
 RPL control message statistics functions.
 
file  validation.h
 RPL control message validation functions.
 
file  of0.h
 Objective Function Zero.
 

Macros

#define GNRC_RPL_STACK_SIZE   (THREAD_STACKSIZE_DEFAULT)
 Default stack size to use for the RPL thread.
 
#define GNRC_RPL_PRIO   (GNRC_IPV6_PRIO + 1)
 Default priority for the RPL thread.
 
#define CONFIG_GNRC_RPL_MSG_QUEUE_SIZE_EXP   (3U)
 Default message queue size to use for the RPL thread (as exponent of 2^n).
 
#define GNRC_RPL_MSG_QUEUE_SIZE   (1 << CONFIG_GNRC_RPL_MSG_QUEUE_SIZE_EXP)
 Message queue size to use for the RPL thread.
 
#define GNRC_RPL_ALL_NODES_ADDR   {{ 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1a }}
 Static initializer for the all-RPL-nodes multicast IPv6 address (ff02::1a)
 
#define GNRC_RPL_MSG_TYPE_LIFETIME_UPDATE   (0x0900)
 Message type for lifetime updates.
 
#define GNRC_RPL_MSG_TYPE_TRICKLE_MSG   (0x0901)
 Message type for trickle.
 
#define GNRC_RPL_MSG_TYPE_DAO_HANDLE   (0x0903)
 Message type for handling DAO sending.
 
#define GNRC_RPL_INFINITE_RANK   (0xFFFF)
 Infinite rank.
 
#define CONFIG_GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE   (256)
 Default minimum hop rank increase.
 
#define CONFIG_GNRC_RPL_DEFAULT_MAX_RANK_INCREASE   (0)
 Maximum rank increase.
 
#define GNRC_RPL_IMPLEMENTED_OFS_NUMOF   (1)
 Number of implemented Objective Functions.
 
#define GNRC_RPL_DEFAULT_OCP   (0)
 Default Objective Code Point (OF0)
 
#define CONFIG_GNRC_RPL_DEFAULT_INSTANCE   (0)
 Default Instance ID.
 
#define GNRC_RPL_DEFAULT_PREFIX_LEN   (64)
 Default prefix length for the DODAG id.
 
#define GNRC_RPL_DEFAULT_PREFIX_LIFETIME   (0xFFFFFFFF)
 Default prefix valid and preferred time for the DODAG id.
 
#define GNRC_RPL_GROUNDED   (1)
 A DODAG can be grounded or floating.
 
#define CONFIG_GNRC_RPL_CLEANUP_TIME   (5 * MS_PER_SEC)
 Cleanup interval in milliseconds.
 
#define GNRC_RPL_ROOT_RANK   (CONFIG_GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE)
 Rank of the root node.
 
#define GNRC_RPL_ICMPV6_CODE_DIS   (0x00)
 DIS ICMPv6 code.
 
#define GNRC_RPL_ICMPV6_CODE_DIO   (0x01)
 DIO ICMPv6 code.
 
#define GNRC_RPL_ICMPV6_CODE_DAO   (0x02)
 DAO ICMPv6 code.
 
#define GNRC_RPL_ICMPV6_CODE_DAO_ACK   (0x03)
 DAO ACK ICMPv6 code.
 
#define GNRC_RPL_LIFETIME_UPDATE_STEP   (2)
 Update interval of the lifetime update function.
 
#define DAGRANK(rank, mhri)
 Rank part of the DODAG.
 
#define CONFIG_GNRC_RPL_PARENT_TIMEOUT_DIS_RETRIES   (3)
 Number of DIS retries before parent times out.
 
#define CONFIG_GNRC_RPL_DEFAULT_NETIF   (KERNEL_PID_UNDEF)
 Default network interface for GNRC RPL.
 

Functions

kernel_pid_t gnrc_rpl_init (kernel_pid_t if_pid)
 Initialization of the RPL thread.
 
gnrc_rpl_instance_tgnrc_rpl_root_init (uint8_t instance_id, const ipv6_addr_t *dodag_id, bool gen_inst_id, bool local_inst_id)
 Initialization of a node as root.
 
void gnrc_rpl_send_DIO (gnrc_rpl_instance_t *instance, ipv6_addr_t *destination)
 Send a DIO of the instance to the destination.
 
void gnrc_rpl_send_DIS (gnrc_rpl_instance_t *instance, ipv6_addr_t *destination, gnrc_rpl_internal_opt_t **options, size_t num_opts)
 Send a DIS of the instance to the destination.
 
void gnrc_rpl_send_DAO (gnrc_rpl_instance_t *instance, ipv6_addr_t *destination, uint8_t lifetime)
 Send a DAO of the dodag to the destination.
 
void gnrc_rpl_send_DAO_ACK (gnrc_rpl_instance_t *instance, ipv6_addr_t *destination, uint8_t seq)
 Send a DAO-ACK of the instance to the destination.
 
void gnrc_rpl_recv_DIS (gnrc_rpl_dis_t *dis, kernel_pid_t iface, ipv6_addr_t *src, ipv6_addr_t *dst, uint16_t len)
 Parse a DIS.
 
void gnrc_rpl_recv_DIO (gnrc_rpl_dio_t *dio, kernel_pid_t iface, ipv6_addr_t *src, ipv6_addr_t *dst, uint16_t len)
 Parse a DIO.
 
void gnrc_rpl_recv_DAO (gnrc_rpl_dao_t *dao, kernel_pid_t iface, ipv6_addr_t *src, ipv6_addr_t *dst, uint16_t len)
 Parse a DAO.
 
void gnrc_rpl_recv_DAO_ACK (gnrc_rpl_dao_ack_t *dao_ack, kernel_pid_t iface, ipv6_addr_t *src, ipv6_addr_t *dst, uint16_t len)
 Parse a DAO-ACK.
 
void gnrc_rpl_delay_dao (gnrc_rpl_dodag_t *dodag)
 Delay the DAO sending interval.
 
void gnrc_rpl_long_delay_dao (gnrc_rpl_dodag_t *dodag)
 Long delay the DAO sending interval.
 
gnrc_rpl_instance_tgnrc_rpl_root_instance_init (uint8_t instance_id, const ipv6_addr_t *dodag_id, uint8_t mop)
 Create a new RPL instance and RPL DODAG.
 
void gnrc_rpl_send (gnrc_pktsnip_t *pkt, kernel_pid_t iface, ipv6_addr_t *src, ipv6_addr_t *dst, ipv6_addr_t *dodag_id)
 Send a control message.
 
uint8_t gnrc_rpl_gen_instance_id (bool local)
 Generate a local or global instance id.
 
static void gnrc_rpl_config_pio (gnrc_rpl_dodag_t *dodag, bool status)
 (De-)Activate the transmission of Prefix Information Options within DIOs for a particular DODAG.
 
void gnrc_rpl_configure_root (gnrc_netif_t *netif, const ipv6_addr_t *dodag_id)
 Convenience function to start a RPL root using the default configuration.
 

Variables

kernel_pid_t gnrc_rpl_pid
 PID of the RPL thread.
 
const ipv6_addr_t ipv6_addr_all_rpl_nodes
 See GNRC_RPL_ALL_NODES_ADDR.
 

Sequence counter handling

See also
Sequence Counter Operation
static uint8_t GNRC_RPL_COUNTER_INCREMENT (uint8_t counter)
 
static bool GNRC_RPL_COUNTER_IS_INIT (uint8_t counter)
 
static bool GNRC_RPL_COUNTER_GREATER_THAN_LOCAL (uint8_t A, uint8_t B)
 
static bool GNRC_RPL_COUNTER_GREATER_THAN (uint8_t A, uint8_t B)
 
#define GNRC_RPL_COUNTER_MAX   (255)
 
#define GNRC_RPL_COUNTER_LOWER_REGION   (127)
 
#define GNRC_RPL_COUNTER_SEQ_WINDOW   (16)
 
#define GNRC_RPL_COUNTER_INIT   (GNRC_RPL_COUNTER_MAX - GNRC_RPL_COUNTER_SEQ_WINDOW + 1)
 

RPL Mode of Operations

#define GNRC_RPL_MOP_NO_DOWNWARD_ROUTES   (0x00)
 
#define GNRC_RPL_MOP_NON_STORING_MODE   (0x01)
 
#define GNRC_RPL_MOP_STORING_MODE_NO_MC   (0x02)
 
#define GNRC_RPL_MOP_STORING_MODE_MC   (0x03)
 
#define GNRC_RPL_DEFAULT_MOP   GNRC_RPL_MOP_STORING_MODE_NO_MC
 default MOP set on compile time
 

Trickle parameters

See also
Trickle Parameters
#define CONFIG_GNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS   (20)
 
#define CONFIG_GNRC_RPL_DEFAULT_DIO_INTERVAL_MIN   (3)
 
#define CONFIG_GNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT   (10)
 

Default parent and route entry lifetime

default lifetime will be multiplied by the lifetime unit to obtain the resulting lifetime

See also
DODAG Configuration
#define CONFIG_GNRC_RPL_DEFAULT_LIFETIME   (5)
 
#define CONFIG_GNRC_RPL_LIFETIME_UNIT   (60)
 

Parameters used for DAO handling

See also
RPL Constants and Variables
#define CONFIG_GNRC_RPL_DAO_SEND_RETRIES   (4)
 
#define CONFIG_GNRC_RPL_DAO_ACK_DELAY   (3000UL)
 
#define CONFIG_GNRC_RPL_DAO_DELAY_LONG   (60000UL)
 Long delay for DAOs in milli seconds.
 
#define CONFIG_GNRC_RPL_DAO_DELAY_DEFAULT   (1000UL)
 Default delay for DAOs in milli seconds.
 
#define CONFIG_GNRC_RPL_DAO_DELAY_JITTER   (1000UL)
 Jitter for DAOs in milli seconds.
 

Node Status

#define GNRC_RPL_NORMAL_NODE   (0)
 
#define GNRC_RPL_ROOT_NODE   (1)
 
#define GNRC_RPL_LEAF_NODE   (2)
 

RPL Control Message Options

See also
RPL Control Message Options
#define GNRC_RPL_OPT_PAD1   (0)
 Type ID of the Pad1 option.
 
#define GNRC_RPL_OPT_PADN   (1)
 Type ID of the PadN option.
 
#define GNRC_RPL_OPT_DAG_METRIC_CONTAINER   (2)
 Type ID of the DAG Metric Container option.
 
#define GNRC_RPL_OPT_ROUTE_INFO   (3)
 Type ID of the Route Information option.
 
#define GNRC_RPL_OPT_DODAG_CONF   (4)
 Type ID of the DODAG Configuration option.
 
#define GNRC_RPL_OPT_TARGET   (5)
 Type ID of the RPL Target option.
 
#define GNRC_RPL_OPT_TRANSIT   (6)
 Type ID of the Transit Information option.
 
#define GNRC_RPL_OPT_TRANSIT_E_FLAG_SHIFT   (7)
 Shift of the External 'E' flag in the Transit Information flags.
 
#define GNRC_RPL_OPT_SOLICITED_INFO   (7)
 Type ID of the Solocited option.
 
#define GNRC_RPL_OPT_PREFIX_INFO   (8)
 Type ID of the Prefix Information option.
 
#define GNRC_RPL_PREFIX_AUTO_ADDRESS_BIT   (1 << 6)
 Shift of the autnomous address-configuration 'A' flag in the Prefix Information option.
 
#define GNRC_RPL_OPT_TARGET_DESC   (9)
 Type ID of the RPL Target Descriptor option.
 

RPL DIO Base Object fields

See also
DODAG Information Object (DIO)
#define GNRC_RPL_GROUNDED_SHIFT   (7)
 Shift of the Grounded 'G' flag in the DIO.
 
#define GNRC_RPL_MOP_SHIFT   (3)
 Shift of the Mode of Operation (MOP) field in the DIO.
 
#define GNRC_RPL_SHIFTED_MOP_MASK   (0x7)
 Mask for the 3 MOP bits.
 
#define GNRC_RPL_PRF_MASK   (0x7)
 Mask for the 3 PRF bits.
 

Global / Local instance id masks

See also
RFC 6550, section 5.1, RPL Instance ID
#define GNRC_RPL_INSTANCE_ID_MSB   (1 << 7)
 
#define GNRC_RPL_GLOBAL_INSTANCE_MASK   (0x7F)
 
#define GNRC_RPL_LOCAL_INSTANCE_MASK   (0x3F)
 
#define GNRC_RPL_INSTANCE_D_FLAG_MASK   (1 << 6)
 
#define GNRC_RPL_DIS_SOLICITED_INFO_LENGTH   (19)
 DIS Solicited Information option (numbers)
 
#define GNRC_RPL_DIS_SOLICITED_INFO_FLAG_V   (1 << 7)
 
#define GNRC_RPL_DIS_SOLICITED_INFO_FLAG_I   (1 << 6)
 
#define GNRC_RPL_DIS_SOLICITED_INFO_FLAG_D   (1 << 5)
 

Macro Definition Documentation

◆ CONFIG_GNRC_RPL_CLEANUP_TIME

#define CONFIG_GNRC_RPL_CLEANUP_TIME   (5 * MS_PER_SEC)

Cleanup interval in milliseconds.

Definition at line 423 of file rpl.h.

◆ CONFIG_GNRC_RPL_DAO_ACK_DELAY

#define CONFIG_GNRC_RPL_DAO_ACK_DELAY   (3000UL)

Definition at line 397 of file rpl.h.

◆ CONFIG_GNRC_RPL_DAO_DELAY_DEFAULT

#define CONFIG_GNRC_RPL_DAO_DELAY_DEFAULT   (1000UL)

Default delay for DAOs in milli seconds.

Definition at line 409 of file rpl.h.

◆ CONFIG_GNRC_RPL_DAO_DELAY_JITTER

#define CONFIG_GNRC_RPL_DAO_DELAY_JITTER   (1000UL)

Jitter for DAOs in milli seconds.

Definition at line 415 of file rpl.h.

◆ CONFIG_GNRC_RPL_DAO_DELAY_LONG

#define CONFIG_GNRC_RPL_DAO_DELAY_LONG   (60000UL)

Long delay for DAOs in milli seconds.

Definition at line 403 of file rpl.h.

◆ CONFIG_GNRC_RPL_DAO_SEND_RETRIES

#define CONFIG_GNRC_RPL_DAO_SEND_RETRIES   (4)

Definition at line 394 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS

#define CONFIG_GNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS   (20)

Definition at line 336 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_DIO_INTERVAL_MIN

#define CONFIG_GNRC_RPL_DEFAULT_DIO_INTERVAL_MIN   (3)

Definition at line 340 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT

#define CONFIG_GNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT   (10)

Definition at line 344 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_INSTANCE

#define CONFIG_GNRC_RPL_DEFAULT_INSTANCE   (0)

Default Instance ID.

Definition at line 261 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_LIFETIME

#define CONFIG_GNRC_RPL_DEFAULT_LIFETIME   (5)

Definition at line 357 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_MAX_RANK_INCREASE

#define CONFIG_GNRC_RPL_DEFAULT_MAX_RANK_INCREASE   (0)

Maximum rank increase.

Definition at line 244 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE

#define CONFIG_GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE   (256)

Default minimum hop rank increase.

See also
RFC 6550, section 17

Definition at line 237 of file rpl.h.

◆ CONFIG_GNRC_RPL_DEFAULT_NETIF

#define CONFIG_GNRC_RPL_DEFAULT_NETIF   (KERNEL_PID_UNDEF)

Default network interface for GNRC RPL.

Definition at line 634 of file rpl.h.

◆ CONFIG_GNRC_RPL_LIFETIME_UNIT

#define CONFIG_GNRC_RPL_LIFETIME_UNIT   (60)

Definition at line 360 of file rpl.h.

◆ CONFIG_GNRC_RPL_MSG_QUEUE_SIZE_EXP

#define CONFIG_GNRC_RPL_MSG_QUEUE_SIZE_EXP   (3U)

Default message queue size to use for the RPL thread (as exponent of 2^n).

As the queue size ALWAYS needs to be power of two, this option represents the exponent of 2^n, which will be used as the size of the queue.

Definition at line 187 of file rpl.h.

◆ CONFIG_GNRC_RPL_PARENT_TIMEOUT_DIS_RETRIES

#define CONFIG_GNRC_RPL_PARENT_TIMEOUT_DIS_RETRIES   (3)

Number of DIS retries before parent times out.

Definition at line 627 of file rpl.h.

◆ DAGRANK

#define DAGRANK ( rank,
mhri )
Value:
(rank/mhri)

Rank part of the DODAG.

See also
RFC 6550, section 3.5.1, Rank Comparison (DAGRank())

Definition at line 568 of file rpl.h.

◆ GNRC_RPL_ALL_NODES_ADDR

#define GNRC_RPL_ALL_NODES_ADDR   {{ 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1a }}

Static initializer for the all-RPL-nodes multicast IPv6 address (ff02::1a)

See also
RFC 6550, section 6

Definition at line 205 of file rpl.h.

◆ GNRC_RPL_COUNTER_INIT

#define GNRC_RPL_COUNTER_INIT   (GNRC_RPL_COUNTER_MAX - GNRC_RPL_COUNTER_SEQ_WINDOW + 1)

Definition at line 300 of file rpl.h.

◆ GNRC_RPL_COUNTER_LOWER_REGION

#define GNRC_RPL_COUNTER_LOWER_REGION   (127)

Definition at line 298 of file rpl.h.

◆ GNRC_RPL_COUNTER_MAX

#define GNRC_RPL_COUNTER_MAX   (255)

Definition at line 297 of file rpl.h.

◆ GNRC_RPL_COUNTER_SEQ_WINDOW

#define GNRC_RPL_COUNTER_SEQ_WINDOW   (16)

Definition at line 299 of file rpl.h.

◆ GNRC_RPL_DEFAULT_MOP

#define GNRC_RPL_DEFAULT_MOP   GNRC_RPL_MOP_STORING_MODE_NO_MC

default MOP set on compile time

Definition at line 286 of file rpl.h.

◆ GNRC_RPL_DEFAULT_OCP

#define GNRC_RPL_DEFAULT_OCP   (0)

Default Objective Code Point (OF0)

Definition at line 255 of file rpl.h.

◆ GNRC_RPL_DEFAULT_PREFIX_LEN

#define GNRC_RPL_DEFAULT_PREFIX_LEN   (64)

Default prefix length for the DODAG id.

Definition at line 367 of file rpl.h.

◆ GNRC_RPL_DEFAULT_PREFIX_LIFETIME

#define GNRC_RPL_DEFAULT_PREFIX_LIFETIME   (0xFFFFFFFF)

Default prefix valid and preferred time for the DODAG id.

Note
Currently not used, but needed for RIOs
See also
Route Information

Definition at line 376 of file rpl.h.

◆ GNRC_RPL_DIS_SOLICITED_INFO_FLAG_D

#define GNRC_RPL_DIS_SOLICITED_INFO_FLAG_D   (1 << 5)

Definition at line 593 of file rpl.h.

◆ GNRC_RPL_DIS_SOLICITED_INFO_FLAG_I

#define GNRC_RPL_DIS_SOLICITED_INFO_FLAG_I   (1 << 6)

Definition at line 592 of file rpl.h.

◆ GNRC_RPL_DIS_SOLICITED_INFO_FLAG_V

#define GNRC_RPL_DIS_SOLICITED_INFO_FLAG_V   (1 << 7)

Definition at line 591 of file rpl.h.

◆ GNRC_RPL_DIS_SOLICITED_INFO_LENGTH

#define GNRC_RPL_DIS_SOLICITED_INFO_LENGTH   (19)

DIS Solicited Information option (numbers)

See also
RFC6550, section 6.7.9, Solicited Information

Definition at line 590 of file rpl.h.

◆ GNRC_RPL_GLOBAL_INSTANCE_MASK

#define GNRC_RPL_GLOBAL_INSTANCE_MASK   (0x7F)

Definition at line 578 of file rpl.h.

◆ GNRC_RPL_GROUNDED

#define GNRC_RPL_GROUNDED   (1)

A DODAG can be grounded or floating.

See also
Grounded and Floating DODAGs

Definition at line 384 of file rpl.h.

◆ GNRC_RPL_GROUNDED_SHIFT

#define GNRC_RPL_GROUNDED_SHIFT   (7)

Shift of the Grounded 'G' flag in the DIO.

Definition at line 504 of file rpl.h.

◆ GNRC_RPL_ICMPV6_CODE_DAO

#define GNRC_RPL_ICMPV6_CODE_DAO   (0x02)

DAO ICMPv6 code.

See also
RFC 6550, section 6

Definition at line 547 of file rpl.h.

◆ GNRC_RPL_ICMPV6_CODE_DAO_ACK

#define GNRC_RPL_ICMPV6_CODE_DAO_ACK   (0x03)

DAO ACK ICMPv6 code.

See also
RFC 6550, section 6

Definition at line 555 of file rpl.h.

◆ GNRC_RPL_ICMPV6_CODE_DIO

#define GNRC_RPL_ICMPV6_CODE_DIO   (0x01)

DIO ICMPv6 code.

See also
RFC 6550, section 6

Definition at line 539 of file rpl.h.

◆ GNRC_RPL_ICMPV6_CODE_DIS

#define GNRC_RPL_ICMPV6_CODE_DIS   (0x00)

DIS ICMPv6 code.

See also
RFC 6550, section 6

Definition at line 531 of file rpl.h.

◆ GNRC_RPL_IMPLEMENTED_OFS_NUMOF

#define GNRC_RPL_IMPLEMENTED_OFS_NUMOF   (1)

Number of implemented Objective Functions.

Definition at line 250 of file rpl.h.

◆ GNRC_RPL_INFINITE_RANK

#define GNRC_RPL_INFINITE_RANK   (0xFFFF)

Infinite rank.

See also
RFC 6550, section 17

Definition at line 228 of file rpl.h.

◆ GNRC_RPL_INSTANCE_D_FLAG_MASK

#define GNRC_RPL_INSTANCE_D_FLAG_MASK   (1 << 6)

Definition at line 580 of file rpl.h.

◆ GNRC_RPL_INSTANCE_ID_MSB

#define GNRC_RPL_INSTANCE_ID_MSB   (1 << 7)

Definition at line 577 of file rpl.h.

◆ GNRC_RPL_LEAF_NODE

#define GNRC_RPL_LEAF_NODE   (2)

Definition at line 432 of file rpl.h.

◆ GNRC_RPL_LIFETIME_UPDATE_STEP

#define GNRC_RPL_LIFETIME_UPDATE_STEP   (2)

Update interval of the lifetime update function.

Definition at line 560 of file rpl.h.

◆ GNRC_RPL_LOCAL_INSTANCE_MASK

#define GNRC_RPL_LOCAL_INSTANCE_MASK   (0x3F)

Definition at line 579 of file rpl.h.

◆ GNRC_RPL_MOP_NO_DOWNWARD_ROUTES

#define GNRC_RPL_MOP_NO_DOWNWARD_ROUTES   (0x00)

Definition at line 268 of file rpl.h.

◆ GNRC_RPL_MOP_NON_STORING_MODE

#define GNRC_RPL_MOP_NON_STORING_MODE   (0x01)

Definition at line 269 of file rpl.h.

◆ GNRC_RPL_MOP_SHIFT

#define GNRC_RPL_MOP_SHIFT   (3)

Shift of the Mode of Operation (MOP) field in the DIO.

Definition at line 508 of file rpl.h.

◆ GNRC_RPL_MOP_STORING_MODE_MC

#define GNRC_RPL_MOP_STORING_MODE_MC   (0x03)

Definition at line 271 of file rpl.h.

◆ GNRC_RPL_MOP_STORING_MODE_NO_MC

#define GNRC_RPL_MOP_STORING_MODE_NO_MC   (0x02)

Definition at line 270 of file rpl.h.

◆ GNRC_RPL_MSG_QUEUE_SIZE

#define GNRC_RPL_MSG_QUEUE_SIZE   (1 << CONFIG_GNRC_RPL_MSG_QUEUE_SIZE_EXP)

Message queue size to use for the RPL thread.

Definition at line 194 of file rpl.h.

◆ GNRC_RPL_MSG_TYPE_DAO_HANDLE

#define GNRC_RPL_MSG_TYPE_DAO_HANDLE   (0x0903)

Message type for handling DAO sending.

Definition at line 220 of file rpl.h.

◆ GNRC_RPL_MSG_TYPE_LIFETIME_UPDATE

#define GNRC_RPL_MSG_TYPE_LIFETIME_UPDATE   (0x0900)

Message type for lifetime updates.

Definition at line 210 of file rpl.h.

◆ GNRC_RPL_MSG_TYPE_TRICKLE_MSG

#define GNRC_RPL_MSG_TYPE_TRICKLE_MSG   (0x0901)

Message type for trickle.

Definition at line 215 of file rpl.h.

◆ GNRC_RPL_NORMAL_NODE

#define GNRC_RPL_NORMAL_NODE   (0)

Definition at line 430 of file rpl.h.

◆ GNRC_RPL_OPT_DAG_METRIC_CONTAINER

#define GNRC_RPL_OPT_DAG_METRIC_CONTAINER   (2)

Type ID of the DAG Metric Container option.

Definition at line 453 of file rpl.h.

◆ GNRC_RPL_OPT_DODAG_CONF

#define GNRC_RPL_OPT_DODAG_CONF   (4)

Type ID of the DODAG Configuration option.

Definition at line 461 of file rpl.h.

◆ GNRC_RPL_OPT_PAD1

#define GNRC_RPL_OPT_PAD1   (0)

Type ID of the Pad1 option.

Definition at line 445 of file rpl.h.

◆ GNRC_RPL_OPT_PADN

#define GNRC_RPL_OPT_PADN   (1)

Type ID of the PadN option.

Definition at line 449 of file rpl.h.

◆ GNRC_RPL_OPT_PREFIX_INFO

#define GNRC_RPL_OPT_PREFIX_INFO   (8)

Type ID of the Prefix Information option.

Definition at line 482 of file rpl.h.

◆ GNRC_RPL_OPT_ROUTE_INFO

#define GNRC_RPL_OPT_ROUTE_INFO   (3)

Type ID of the Route Information option.

Definition at line 457 of file rpl.h.

◆ GNRC_RPL_OPT_SOLICITED_INFO

#define GNRC_RPL_OPT_SOLICITED_INFO   (7)

Type ID of the Solocited option.

Definition at line 478 of file rpl.h.

◆ GNRC_RPL_OPT_TARGET

#define GNRC_RPL_OPT_TARGET   (5)

Type ID of the RPL Target option.

Definition at line 465 of file rpl.h.

◆ GNRC_RPL_OPT_TARGET_DESC

#define GNRC_RPL_OPT_TARGET_DESC   (9)

Type ID of the RPL Target Descriptor option.

Definition at line 491 of file rpl.h.

◆ GNRC_RPL_OPT_TRANSIT

#define GNRC_RPL_OPT_TRANSIT   (6)

Type ID of the Transit Information option.

Definition at line 469 of file rpl.h.

◆ GNRC_RPL_OPT_TRANSIT_E_FLAG_SHIFT

#define GNRC_RPL_OPT_TRANSIT_E_FLAG_SHIFT   (7)

Shift of the External 'E' flag in the Transit Information flags.

Definition at line 474 of file rpl.h.

◆ GNRC_RPL_PREFIX_AUTO_ADDRESS_BIT

#define GNRC_RPL_PREFIX_AUTO_ADDRESS_BIT   (1 << 6)

Shift of the autnomous address-configuration 'A' flag in the Prefix Information option.

Definition at line 487 of file rpl.h.

◆ GNRC_RPL_PRF_MASK

#define GNRC_RPL_PRF_MASK   (0x7)

Mask for the 3 PRF bits.

Definition at line 516 of file rpl.h.

◆ GNRC_RPL_PRIO

#define GNRC_RPL_PRIO   (GNRC_IPV6_PRIO + 1)

Default priority for the RPL thread.

Definition at line 175 of file rpl.h.

◆ GNRC_RPL_ROOT_NODE

#define GNRC_RPL_ROOT_NODE   (1)

Definition at line 431 of file rpl.h.

◆ GNRC_RPL_ROOT_RANK

#define GNRC_RPL_ROOT_RANK   (CONFIG_GNRC_RPL_DEFAULT_MIN_HOP_RANK_INCREASE)

Rank of the root node.

Definition at line 523 of file rpl.h.

◆ GNRC_RPL_SHIFTED_MOP_MASK

#define GNRC_RPL_SHIFTED_MOP_MASK   (0x7)

Mask for the 3 MOP bits.

Definition at line 512 of file rpl.h.

◆ GNRC_RPL_STACK_SIZE

#define GNRC_RPL_STACK_SIZE   (THREAD_STACKSIZE_DEFAULT)

Default stack size to use for the RPL thread.

Definition at line 168 of file rpl.h.

Function Documentation

◆ gnrc_rpl_config_pio()

static void gnrc_rpl_config_pio ( gnrc_rpl_dodag_t * dodag,
bool status )
inlinestatic

(De-)Activate the transmission of Prefix Information Options within DIOs for a particular DODAG.

This function has no effect if CONFIG_GNRC_RPL_WITHOUT_PIO is set.

Parameters
[in]dodagPointer to the DODAG
[in]statustrue for activating PIOs and false for deactivating them

Definition at line 805 of file rpl.h.

◆ gnrc_rpl_configure_root()

void gnrc_rpl_configure_root ( gnrc_netif_t * netif,
const ipv6_addr_t * dodag_id )

Convenience function to start a RPL root using the default configuration.

Parameters
[in]netifNetwork interface to use as RPL root
[in]dodag_idId of the DODAG

◆ GNRC_RPL_COUNTER_GREATER_THAN()

static bool GNRC_RPL_COUNTER_GREATER_THAN ( uint8_t A,
uint8_t B )
inlinestatic

Definition at line 320 of file rpl.h.

◆ GNRC_RPL_COUNTER_GREATER_THAN_LOCAL()

static bool GNRC_RPL_COUNTER_GREATER_THAN_LOCAL ( uint8_t A,
uint8_t B )
inlinestatic

Definition at line 314 of file rpl.h.

◆ GNRC_RPL_COUNTER_INCREMENT()

static uint8_t GNRC_RPL_COUNTER_INCREMENT ( uint8_t counter)
inlinestatic

Definition at line 302 of file rpl.h.

◆ GNRC_RPL_COUNTER_IS_INIT()

static bool GNRC_RPL_COUNTER_IS_INIT ( uint8_t counter)
inlinestatic

Definition at line 309 of file rpl.h.

◆ gnrc_rpl_delay_dao()

void gnrc_rpl_delay_dao ( gnrc_rpl_dodag_t * dodag)

Delay the DAO sending interval.

Parameters
[in]dodagThe DODAG of the DAO

◆ gnrc_rpl_gen_instance_id()

uint8_t gnrc_rpl_gen_instance_id ( bool local)

Generate a local or global instance id.

Parameters
[in]localflag to indicate whether a local or global instance id is requested
Returns
Local instance id, if local is true
Global instance id, otherwise.

◆ gnrc_rpl_init()

kernel_pid_t gnrc_rpl_init ( kernel_pid_t if_pid)

Initialization of the RPL thread.

Parameters
[in]if_pidPID of the interface
Returns
The PID of the RPL thread, on success.
a negative errno on error.

◆ gnrc_rpl_long_delay_dao()

void gnrc_rpl_long_delay_dao ( gnrc_rpl_dodag_t * dodag)

Long delay the DAO sending interval.

Parameters
[in]dodagThe DODAG of the DAO

◆ gnrc_rpl_recv_DAO()

void gnrc_rpl_recv_DAO ( gnrc_rpl_dao_t * dao,
kernel_pid_t iface,
ipv6_addr_t * src,
ipv6_addr_t * dst,
uint16_t len )

Parse a DAO.

Parameters
[in]daoPointer to the DAO message.
[in]ifaceInterface PID of the incoming DIO.
[in]srcPointer to the source address of the IPv6 packet.
[in]dstPointer to the destination address of the IPv6 packet.
[in]lenLength of the IPv6 packet.

◆ gnrc_rpl_recv_DAO_ACK()

void gnrc_rpl_recv_DAO_ACK ( gnrc_rpl_dao_ack_t * dao_ack,
kernel_pid_t iface,
ipv6_addr_t * src,
ipv6_addr_t * dst,
uint16_t len )

Parse a DAO-ACK.

Parameters
[in]dao_ackPointer to the DAO-ACK message.
[in]ifaceInterface PID of the incoming DIO.
[in]srcPointer to the source address of the IPv6 packet.
[in]dstPointer to the destination address of the IPv6 packet.
[in]lenLength of the IPv6 packet.

◆ gnrc_rpl_recv_DIO()

void gnrc_rpl_recv_DIO ( gnrc_rpl_dio_t * dio,
kernel_pid_t iface,
ipv6_addr_t * src,
ipv6_addr_t * dst,
uint16_t len )

Parse a DIO.

Parameters
[in]dioPointer to the DIO message.
[in]ifaceInterface PID of the incoming DIO.
[in]srcPointer to the source address of the IPv6 packet.
[in]dstPointer to the destination address of the IPv6 packet.
[in]lenLength of the IPv6 packet.

◆ gnrc_rpl_recv_DIS()

void gnrc_rpl_recv_DIS ( gnrc_rpl_dis_t * dis,
kernel_pid_t iface,
ipv6_addr_t * src,
ipv6_addr_t * dst,
uint16_t len )

Parse a DIS.

Parameters
[in]disPointer to the DIS message.
[in]ifaceInterface PID of the incoming DIS.
[in]srcPointer to the source address of the IPv6 packet.
[in]dstPointer to the destination address of the IPv6 packet.
[in]lenLength of the IPv6 packet.

◆ gnrc_rpl_root_init()

gnrc_rpl_instance_t * gnrc_rpl_root_init ( uint8_t instance_id,
const ipv6_addr_t * dodag_id,
bool gen_inst_id,
bool local_inst_id )

Initialization of a node as root.

Parameters
[in]instance_idId of the instance
[in]dodag_idId of the DODAG
[in]gen_inst_idFlag indicating whether to generate an instance id. If true, instance_id will be ignored
[in]local_inst_idFlag indicating whether a local or global instance id should be generatad
Returns
Pointer to the new RPL Instance, on success.
NULL, otherwise.

◆ gnrc_rpl_root_instance_init()

gnrc_rpl_instance_t * gnrc_rpl_root_instance_init ( uint8_t instance_id,
const ipv6_addr_t * dodag_id,
uint8_t mop )

Create a new RPL instance and RPL DODAG.

Parameters
[in]instance_idId of the instance
[in]dodag_idId of the DODAG
[in]mopMode of Operation
Returns
Pointer to the new RPL instance, on success.
NULL, otherwise.

◆ gnrc_rpl_send()

void gnrc_rpl_send ( gnrc_pktsnip_t * pkt,
kernel_pid_t iface,
ipv6_addr_t * src,
ipv6_addr_t * dst,
ipv6_addr_t * dodag_id )

Send a control message.

Parameters
[in]pktgnrc_pktnsip_t to send
[in]ifaceInterface PID to send this pkt to
[in]srcSource address of the packet
[in]dstDestination address of the packet
[in]dodag_idId of the DODAG

◆ gnrc_rpl_send_DAO()

void gnrc_rpl_send_DAO ( gnrc_rpl_instance_t * instance,
ipv6_addr_t * destination,
uint8_t lifetime )

Send a DAO of the dodag to the destination.

Parameters
[in]instancePointer to the instance.
[in]destinationIPv6 address of the destination.
[in]lifetimeLifetime of the route to announce.

◆ gnrc_rpl_send_DAO_ACK()

void gnrc_rpl_send_DAO_ACK ( gnrc_rpl_instance_t * instance,
ipv6_addr_t * destination,
uint8_t seq )

Send a DAO-ACK of the instance to the destination.

Parameters
[in]instancePointer to the RPL instance.
[in]destinationIPv6 address of the destination.
[in]seqSequence number to be acknowledged.

◆ gnrc_rpl_send_DIO()

void gnrc_rpl_send_DIO ( gnrc_rpl_instance_t * instance,
ipv6_addr_t * destination )

Send a DIO of the instance to the destination.

Parameters
[in]instancePointer to the RPL instance.
[in]destinationIPv6 address of the destination.

◆ gnrc_rpl_send_DIS()

void gnrc_rpl_send_DIS ( gnrc_rpl_instance_t * instance,
ipv6_addr_t * destination,
gnrc_rpl_internal_opt_t ** options,
size_t num_opts )

Send a DIS of the instance to the destination.

Parameters
[in]instancePointer to the RPL instance, optional.
[in]destinationIPv6 address of the destination.
[in]optionsPointer to the first option to be attached.
[in]num_optsThe number of options to attach.