dodag.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2013 INRIA
3  * SPDX-FileCopyrightText: 2015 Cenk Gündoğan <cnkgndgn@gmail.com>
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "net/ipv6/addr.h"
27 #include "trickle.h"
28 #include "net/gnrc/rpl.h"
29 #include "net/gnrc/rpl/structs.h"
30 
34 #ifndef GNRC_RPL_INSTANCES_NUMOF
35 #define GNRC_RPL_INSTANCES_NUMOF (1)
36 #endif
37 
41 #ifndef GNRC_RPL_PARENTS_NUMOF
42 #define GNRC_RPL_PARENTS_NUMOF (3)
43 #endif
44 
49 
54 
64 bool gnrc_rpl_instance_add(uint8_t instance_id, gnrc_rpl_instance_t **inst);
65 
74 bool gnrc_rpl_instance_remove_by_id(uint8_t instance_id);
75 
82 
89 
99 
110 bool gnrc_rpl_dodag_init(gnrc_rpl_instance_t *instance, const ipv6_addr_t *dodag_id,
111  kernel_pid_t iface);
112 
119 
131  gnrc_rpl_parent_t **parent);
132 
142 
150 
158 
165 
172 
179 #ifdef __cplusplus
180 }
181 #endif
182 
void gnrc_rpl_dodag_remove(gnrc_rpl_dodag_t *dodag)
Remove a RPL DODAG with the pointer dodag from its instance.
bool gnrc_rpl_instance_add(uint8_t instance_id, gnrc_rpl_instance_t **inst)
Add a new RPL instance with the id instance_id.
#define GNRC_RPL_PARENTS_NUMOF
Number of RPL parents.
Definition: dodag.h:42
bool gnrc_rpl_parent_remove(gnrc_rpl_parent_t *parent)
Remove the parent from its DODAG.
gnrc_rpl_parent_t gnrc_rpl_parents[GNRC_RPL_PARENTS_NUMOF]
RPL parent table.
void gnrc_rpl_parent_update(gnrc_rpl_dodag_t *dodag, gnrc_rpl_parent_t *parent)
Update a parent of the dodag.
bool gnrc_rpl_parent_add_by_addr(gnrc_rpl_dodag_t *dodag, ipv6_addr_t *addr, gnrc_rpl_parent_t **parent)
Add a new parent with the IPv6 address addr to the dodag.
#define GNRC_RPL_INSTANCES_NUMOF
Number of RPL instances.
Definition: dodag.h:35
void gnrc_rpl_cleanup_start(gnrc_rpl_dodag_t *dodag)
Removes the dodag state of dodag after CONFIG_GNRC_RPL_CLEANUP_TIME milliseconds.
gnrc_rpl_instance_t * gnrc_rpl_instance_get(uint8_t instance_id)
Get the RPL instance with the id instance_id.
void gnrc_rpl_router_operation(gnrc_rpl_dodag_t *dodag)
Operate as router.
void gnrc_rpl_instance_remove(gnrc_rpl_instance_t *inst)
Remove a RPL instance with the pointer inst.
bool gnrc_rpl_dodag_init(gnrc_rpl_instance_t *instance, const ipv6_addr_t *dodag_id, kernel_pid_t iface)
Initialize a new RPL DODAG with the id dodag_id for the instance instance.
bool gnrc_rpl_instance_remove_by_id(uint8_t instance_id)
Remove a RPL instance with the id instance_id.
void gnrc_rpl_leaf_operation(gnrc_rpl_dodag_t *dodag)
Operate as leaf.
gnrc_rpl_instance_t gnrc_rpl_instances[GNRC_RPL_INSTANCES_NUMOF]
RPL instance table.
void gnrc_rpl_dodag_remove_all_parents(gnrc_rpl_dodag_t *dodag)
Remove all parents from the dodag.
void gnrc_rpl_local_repair(gnrc_rpl_dodag_t *dodag)
Start a local repair.
int16_t kernel_pid_t
Unique process identifier.
Definition: sched.h:135
Definitions for IPv6 addresses.
RPL header.
RPL data structs.
struct gnrc_rpl_instance gnrc_rpl_instance_t
Instance representation.
Definition: structs.h:231
struct gnrc_rpl_parent gnrc_rpl_parent_t
Parent representation.
Definition: structs.h:226
struct gnrc_rpl_dodag gnrc_rpl_dodag_t
DODAG representation.
Definition: structs.h:221
Trickle timer interface definition.
Data type to represent an IPv6 address.
Definition: addr.h:64