diff --git a/examples/6tisch/etsi-plugtest-2017/node.c b/examples/6tisch/etsi-plugtest-2017/node.c
index 25035f7f4..a397dd4e1 100644
--- a/examples/6tisch/etsi-plugtest-2017/node.c
+++ b/examples/6tisch/etsi-plugtest-2017/node.c
@@ -77,7 +77,7 @@ PROCESS_THREAD(node_process, ev, data)
#endif
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
diff --git a/examples/6tisch/simple-node/node.c b/examples/6tisch/simple-node/node.c
index c11f8420c..8548f80ef 100644
--- a/examples/6tisch/simple-node/node.c
+++ b/examples/6tisch/simple-node/node.c
@@ -65,7 +65,7 @@ PROCESS_THREAD(node_process, ev, data)
#endif
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
diff --git a/examples/6tisch/sixtop/node-sixtop.c b/examples/6tisch/sixtop/node-sixtop.c
index b8b1e9e90..bd3cc97ea 100755
--- a/examples/6tisch/sixtop/node-sixtop.c
+++ b/examples/6tisch/sixtop/node-sixtop.c
@@ -73,7 +73,7 @@ PROCESS_THREAD(node_process, ev, data)
#endif
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
diff --git a/examples/ip64-router/ip64-router.c b/examples/ip64-router/ip64-router.c
index 3ce6ece6d..0d2078b91 100644
--- a/examples/ip64-router/ip64-router.c
+++ b/examples/ip64-router/ip64-router.c
@@ -14,7 +14,7 @@ PROCESS_THREAD(router_node_process, ev, data)
PROCESS_BEGIN();
/* Set us up as a RPL root node. */
- rpl_dag_root_init_dag_delay();
+ rpl_dag_root_start();
/* Initialize the IP64 module so we'll start translating packets */
ip64_init();
diff --git a/examples/ipso-objects/example-server.c b/examples/ipso-objects/example-server.c
index f8bd44171..aa715f4d7 100644
--- a/examples/ipso-objects/example-server.c
+++ b/examples/ipso-objects/example-server.c
@@ -236,8 +236,8 @@ setup_network(void)
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
#endif
- rpl_dag_root_init(&ipaddr, &ipaddr);
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_set_prefix(&ipaddr, &ipaddr);
+ rpl_dag_root_start();
#endif /* UIP_CONF_ROUTER */
PRINTF("IPv6 addresses: ");
diff --git a/examples/multicast/root.c b/examples/multicast/root.c
index 451c638ea..06b2534ba 100644
--- a/examples/multicast/root.c
+++ b/examples/multicast/root.c
@@ -111,7 +111,7 @@ PROCESS_THREAD(rpl_root_process, ev, data)
PRINTF("Multicast Engine: '%s'\n", UIP_MCAST6.name);
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
prepare_mcast();
diff --git a/examples/platform-specific/jn516x/rpl/coap-dongle-node/dongle-node.c b/examples/platform-specific/jn516x/rpl/coap-dongle-node/dongle-node.c
index 8920bdd3b..a39ea774f 100644
--- a/examples/platform-specific/jn516x/rpl/coap-dongle-node/dongle-node.c
+++ b/examples/platform-specific/jn516x/rpl/coap-dongle-node/dongle-node.c
@@ -129,7 +129,7 @@ PROCESS_THREAD(start_app, ev, data)
/* Start net stack */
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
printf("Starting RPL node\n");
diff --git a/examples/platform-specific/jn516x/rpl/coap-dr1175-node/dr1175-node.c b/examples/platform-specific/jn516x/rpl/coap-dr1175-node/dr1175-node.c
index f7c60b718..0c5da13a3 100644
--- a/examples/platform-specific/jn516x/rpl/coap-dr1175-node/dr1175-node.c
+++ b/examples/platform-specific/jn516x/rpl/coap-dr1175-node/dr1175-node.c
@@ -349,7 +349,7 @@ PROCESS_THREAD(start_app, ev, data)
/* Start net stack */
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
printf("Starting RPL node\n");
diff --git a/examples/platform-specific/jn516x/rpl/coap-dr1199-node/dr1199-node.c b/examples/platform-specific/jn516x/rpl/coap-dr1199-node/dr1199-node.c
index 44b482ce5..6839b7cf5 100644
--- a/examples/platform-specific/jn516x/rpl/coap-dr1199-node/dr1199-node.c
+++ b/examples/platform-specific/jn516x/rpl/coap-dr1199-node/dr1199-node.c
@@ -350,7 +350,7 @@ PROCESS_THREAD(start_app, ev, data)
/* Start net stack */
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
printf("Starting RPL node\n");
diff --git a/examples/platform-specific/jn516x/rpl/node/node.c b/examples/platform-specific/jn516x/rpl/node/node.c
index cb63f890f..6ba854093 100644
--- a/examples/platform-specific/jn516x/rpl/node/node.c
+++ b/examples/platform-specific/jn516x/rpl/node/node.c
@@ -96,7 +96,7 @@ PROCESS_THREAD(node_process, ev, data)
is_coordinator = node_role > role_6ln;
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
diff --git a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c
index 1abeb2f46..8e64ac001 100644
--- a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c
+++ b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c
@@ -169,7 +169,7 @@ PROCESS_THREAD(node_process, ev, data)
is_coordinator = node_role > role_6ln;
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
diff --git a/examples/platform-specific/jn516x/tsch/tx-power-verification/node/node.c b/examples/platform-specific/jn516x/tsch/tx-power-verification/node/node.c
index a2f3c0a1e..ec1052e86 100644
--- a/examples/platform-specific/jn516x/tsch/tx-power-verification/node/node.c
+++ b/examples/platform-specific/jn516x/tsch/tx-power-verification/node/node.c
@@ -104,7 +104,7 @@ PROCESS_THREAD(start_app, ev, data)
/* Start network stack */
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
printf("Starting RPL node\n");
diff --git a/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/rpl-border-router.c b/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/rpl-border-router.c
index fe72d1fc0..16915f32a 100644
--- a/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/rpl-border-router.c
+++ b/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/rpl-border-router.c
@@ -156,8 +156,8 @@ PROCESS_THREAD(border_router_process, ev, data)
uip_debug_ipaddr_print(&prefix);
PRINTF("\n");
- rpl_dag_root_init(&prefix, NULL);
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_set_prefix(&prefix, NULL);
+ rpl_dag_root_start();
coap_engine_init();
coap_activate_resource(&resource_get_rssi, "Get-RSSI");
diff --git a/examples/platform-specific/jn516x/tsch/uart1-test-node/uart1-test-node.c b/examples/platform-specific/jn516x/tsch/uart1-test-node/uart1-test-node.c
index 71ea980e4..bf17f1f96 100644
--- a/examples/platform-specific/jn516x/tsch/uart1-test-node/uart1-test-node.c
+++ b/examples/platform-specific/jn516x/tsch/uart1-test-node/uart1-test-node.c
@@ -145,7 +145,7 @@ PROCESS_THREAD(start_app, ev, data)
/* Start network stack */
if(is_coordinator) {
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
}
NETSTACK_MAC.on();
printf("Starting RPL node\n");
diff --git a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c
index 0f321074e..f2b9f4606 100644
--- a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c
+++ b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c
@@ -247,7 +247,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
#if WEBSERVER_CONF_LOADTIME
numticks = clock_time() - numticks + 1;
- ADD(" (%u.%02u sec)", numticks / CLOCK_SECOND,
+ ADD(" (%u.%02u sec)", numticks / CLOCK_SECOND,
(100 * (numticks % CLOCK_SECOND)) / CLOCK_SECOND));
#endif
@@ -307,7 +307,7 @@ PROCESS_THREAD(router_node_process, ev, data)
leds_off(LEDS_DHCP);
/* Set us up as a RPL root node. */
- rpl_dag_root_init_dag_delay();
+ rpl_dag_root_start();
/* ... and do nothing more. */
while(1) {
diff --git a/examples/rpl-udp/udp-server.c b/examples/rpl-udp/udp-server.c
index 9603b9e11..918da3c00 100644
--- a/examples/rpl-udp/udp-server.c
+++ b/examples/rpl-udp/udp-server.c
@@ -71,7 +71,7 @@ PROCESS_THREAD(udp_server_process, ev, data)
PROCESS_BEGIN();
/* Initialize DAG root */
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
/* Initialize UDP connection */
simple_udp_register(&udp_conn, UDP_SERVER_PORT, NULL,
diff --git a/os/net/rpl-classic/rpl-dag-root.c b/os/net/rpl-classic/rpl-dag-root.c
index 4082d936e..684b3c8ab 100644
--- a/os/net/rpl-classic/rpl-dag-root.c
+++ b/os/net/rpl-classic/rpl-dag-root.c
@@ -41,105 +41,6 @@
#define DEBUG DEBUG_NONE
#include "net/ipv6/uip-debug.h"
-#define RPL_DAG_GRACE_PERIOD (CLOCK_SECOND * 20 * 1)
-
-#if (UIP_MAX_ROUTES != 0)
-static struct uip_ds6_notification n;
-#endif /* (UIP_MAX_ROUTES != 0) */
-static uint8_t to_become_root;
-static struct ctimer c;
-/*---------------------------------------------------------------------------*/
-static const uip_ipaddr_t *
-dag_root(void)
-{
- rpl_dag_t *dag;
-
- dag = rpl_get_any_dag();
- if(dag != NULL) {
- return &dag->dag_id;
- }
-
- return NULL;
-}
-/*---------------------------------------------------------------------------*/
-static const uip_ipaddr_t *
-get_global_address(void)
-{
- int i;
- uint8_t state;
- uip_ipaddr_t *ipaddr = NULL;
-
- for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
- state = uip_ds6_if.addr_list[i].state;
- if(uip_ds6_if.addr_list[i].isused &&
- state == ADDR_PREFERRED &&
- !uip_is_addr_linklocal(&uip_ds6_if.addr_list[i].ipaddr)) {
- ipaddr = &uip_ds6_if.addr_list[i].ipaddr;
- }
- }
- return ipaddr;
-}
-/*---------------------------------------------------------------------------*/
-static void
-create_dag_callback(void *ptr)
-{
- const uip_ipaddr_t *root, *ipaddr;
-
- root = dag_root();
- ipaddr = get_global_address();
-
- if(root == NULL || uip_ipaddr_cmp(root, ipaddr)) {
- /* The RPL network we are joining is one that we created, so we
- become root. */
- if(to_become_root) {
- rpl_dag_root_init_dag_immediately();
- to_become_root = 0;
- }
- } else {
- rpl_dag_t *dag;
-
- dag = rpl_get_any_dag();
-#if DEBUG
- printf("Found a network we did not create\n");
- printf("version %d grounded %d preference %d used %d joined %d rank %d\n",
- dag->version, dag->grounded,
- dag->preference, dag->used,
- dag->joined, dag->rank);
-#endif /* DEBUG */
-
- /* We found a RPL network that we did not create so we just join
- it without becoming root. But if the network has an infinite
- rank, we assume the network has broken, and we become the new
- root of the network. */
-
- if(dag->rank == RPL_INFINITE_RANK) {
- if(to_become_root) {
- rpl_dag_root_init_dag_immediately();
- to_become_root = 0;
- }
- }
-
- /* Try again after the grace period */
- ctimer_set(&c, RPL_DAG_GRACE_PERIOD, create_dag_callback, NULL);
- }
-}
-#if (UIP_MAX_ROUTES != 0)
-/*---------------------------------------------------------------------------*/
-static void
-route_callback(int event, uip_ipaddr_t *route, uip_ipaddr_t *ipaddr,
- int numroutes)
-{
- if(event == UIP_DS6_NOTIFICATION_DEFRT_ADD) {
- if(route != NULL && ipaddr != NULL &&
- !uip_is_addr_unspecified(route) &&
- !uip_is_addr_unspecified(ipaddr)) {
- if(to_become_root) {
- ctimer_set(&c, 0, create_dag_callback, NULL);
- }
- }
- }
-}
-#endif /* (UIP_MAX_ROUTES != 0) */
/*---------------------------------------------------------------------------*/
static void
set_global_address(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
@@ -175,29 +76,25 @@ set_global_address(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
}
/*---------------------------------------------------------------------------*/
void
-rpl_dag_root_init(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
+rpl_dag_root_set_prefix(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
{
static uint8_t initialized = 0;
if(!initialized) {
- to_become_root = 0;
set_global_address(prefix, iid);
-#if (UIP_MAX_ROUTES != 0)
- uip_ds6_notification_add(&n, route_callback);
-#endif /* (UIP_MAX_ROUTES != 0) */
initialized = 1;
}
}
/*---------------------------------------------------------------------------*/
int
-rpl_dag_root_init_dag_immediately(void)
+rpl_dag_root_start(void)
{
struct uip_ds6_addr *root_if;
int i;
uint8_t state;
uip_ipaddr_t *ipaddr = NULL;
- rpl_dag_root_init(NULL, NULL);
+ rpl_dag_root_set_prefix(NULL, NULL);
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
@@ -222,38 +119,25 @@ rpl_dag_root_init_dag_immediately(void)
if(RPL_IS_STORING(dag->instance)) {
rpl_remove_routes(dag);
}
- if(dag->instance != NULL &&
- dag->instance->def_route != NULL) {
- uip_ds6_defrt_rm(dag->instance->def_route);
+ if(dag->instance != NULL && dag->instance->def_route != NULL) {
+ uip_ds6_defrt_rm(dag->instance->def_route);
dag->instance->def_route = NULL;
}
uip_ip6addr(&prefix, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
rpl_set_prefix(dag, &prefix, 64);
- PRINTF("rpl_dag_root_init_dag: created a new RPL dag\n");
+ PRINTF("rpl_dag_root_set_prefix_dag: created a new RPL dag\n");
return 0;
} else {
- PRINTF("rpl_dag_root_init_dag: failed to create a new RPL DAG\n");
+ PRINTF("rpl_dag_root_set_prefix_dag: failed to create a new RPL DAG\n");
return -1;
}
} else {
- PRINTF("rpl_dag_root_init_dag: failed to create a new RPL DAG, no preferred IP address found\n");
+ PRINTF("rpl_dag_root_set_prefix_dag: failed to create a new RPL DAG, no preferred IP address found\n");
return -2;
}
}
/*---------------------------------------------------------------------------*/
-void
-rpl_dag_root_init_dag_delay(void)
-{
- rpl_dag_root_init(NULL, NULL);
-
- ctimer_set(&c, RPL_DAG_GRACE_PERIOD, create_dag_callback, NULL);
- to_become_root = 1;
-
- /* Send a DIS packet to request RPL info from neighbors. */
- dis_output(NULL);
-}
-/*---------------------------------------------------------------------------*/
int
rpl_dag_root_is_root(void)
{
diff --git a/os/net/rpl-classic/rpl-dag-root.h b/os/net/rpl-classic/rpl-dag-root.h
index 05daec15b..9d2d09b02 100644
--- a/os/net/rpl-classic/rpl-dag-root.h
+++ b/os/net/rpl-classic/rpl-dag-root.h
@@ -32,9 +32,8 @@
#ifndef RPL_DAG_ROOT_H_
#define RPL_DAG_ROOT_H_
-void rpl_dag_root_init(uip_ipaddr_t *prefix, uip_ipaddr_t *iid);
-void rpl_dag_root_init_dag_delay(void);
-int rpl_dag_root_init_dag_immediately(void);
+void rpl_dag_root_set_prefix(uip_ipaddr_t *prefix, uip_ipaddr_t *iid);
+int rpl_dag_root_start(void);
int rpl_dag_root_is_root(void);
diff --git a/os/net/rpl-lite/rpl-dag-root.c b/os/net/rpl-lite/rpl-dag-root.c
index cfe227d4c..fbd74e735 100644
--- a/os/net/rpl-lite/rpl-dag-root.c
+++ b/os/net/rpl-lite/rpl-dag-root.c
@@ -48,48 +48,6 @@
#define LOG_MODULE "RPL"
#define LOG_LEVEL LOG_LEVEL_RPL
-#define RPL_DAG_GRACE_PERIOD (CLOCK_SECOND * 20 * 1)
-
-static uint8_t to_become_root;
-static struct ctimer c;
-
-/*---------------------------------------------------------------------------*/
-static void
-create_dag_callback(void *ptr)
-{
- const uip_ipaddr_t *root, *ipaddr;
-
- root = curr_instance.used ? &curr_instance.dag.dag_id : NULL;
- ipaddr = rpl_get_global_address();
-
- if(root == NULL || uip_ipaddr_cmp(root, ipaddr)) {
- /* The RPL network we are joining is one that we created, so we
- become root. */
- if(to_become_root) {
- rpl_dag_root_init_dag_immediately();
- to_become_root = 0;
- }
- } else {
- LOG_WARN("found a network we did not create: version %d grounded %d preference %d rank %d\n",
- curr_instance.dag.version, curr_instance.dag.grounded,
- curr_instance.dag.preference, curr_instance.dag.rank);
-
- /* We found a RPL network that we did not create so we just join
- it without becoming root. But if the network has an infinite
- rank, we assume the network has broken, and we become the new
- root of the network. */
-
- if(curr_instance.dag.rank == RPL_INFINITE_RANK) {
- if(to_become_root) {
- rpl_dag_root_init_dag_immediately();
- to_become_root = 0;
- }
- }
-
- /* Try again after the grace period */
- ctimer_set(&c, RPL_DAG_GRACE_PERIOD, create_dag_callback, NULL);
- }
-}
/*---------------------------------------------------------------------------*/
static void
set_global_address(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
@@ -125,26 +83,25 @@ set_global_address(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
}
/*---------------------------------------------------------------------------*/
void
-rpl_dag_root_init(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
+rpl_dag_root_set_prefix(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
{
static uint8_t initialized = 0;
if(!initialized) {
- to_become_root = 0;
set_global_address(prefix, iid);
initialized = 1;
}
}
/*---------------------------------------------------------------------------*/
int
-rpl_dag_root_init_dag_immediately(void)
+rpl_dag_root_start(void)
{
struct uip_ds6_addr *root_if;
int i;
uint8_t state;
uip_ipaddr_t *ipaddr = NULL;
- rpl_dag_root_init(NULL, NULL);
+ rpl_dag_root_set_prefix(NULL, NULL);
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
@@ -170,18 +127,6 @@ rpl_dag_root_init_dag_immediately(void)
}
}
/*---------------------------------------------------------------------------*/
-void
-rpl_dag_root_init_dag_delay(void)
-{
- rpl_dag_root_init(NULL, NULL);
-
- ctimer_set(&c, RPL_DAG_GRACE_PERIOD, create_dag_callback, NULL);
- to_become_root = 1;
-
- /* Send a DIS packet to request RPL info from neighbors. */
- rpl_icmp6_dis_output(NULL);
-}
-/*---------------------------------------------------------------------------*/
int
rpl_dag_root_is_root(void)
{
diff --git a/os/net/rpl-lite/rpl-dag-root.h b/os/net/rpl-lite/rpl-dag-root.h
index d6260ff21..509367030 100644
--- a/os/net/rpl-lite/rpl-dag-root.h
+++ b/os/net/rpl-lite/rpl-dag-root.h
@@ -49,20 +49,14 @@
* \param prefix The prefix. If NULL, UIP_DS6_DEFAULT_PREFIX is used instead
* \param iid The IID. If NULL, it will be built from uip_ds6_set_addr_iid.
*/
-void rpl_dag_root_init(uip_ipaddr_t *prefix, uip_ipaddr_t *iid);
+void rpl_dag_root_set_prefix(uip_ipaddr_t *prefix, uip_ipaddr_t *iid);
/**
- * Initializes the node as DAG root after a delay. Until the delay, the node
- * gets a chance to hear another DAG and join it instead.
-*/
-void rpl_dag_root_init_dag_delay(void);
-
-/**
- * Initializes the node as DAG root immediatly.
+ * Set the node as root and start a DAG
*
* \return 0 in case of success, -1 otherwise
*/
-int rpl_dag_root_init_dag_immediately(void);
+int rpl_dag_root_start(void);
/**
* Tells whether we are DAG root or not
diff --git a/os/services/rpl-border-router/rpl-border-router.c b/os/services/rpl-border-router/rpl-border-router.c
index 13421b232..60cbf2ce1 100644
--- a/os/services/rpl-border-router/rpl-border-router.c
+++ b/os/services/rpl-border-router/rpl-border-router.c
@@ -64,8 +64,8 @@ void
set_prefix_64(uip_ipaddr_t *prefix_64)
{
prefix_set = 1;
- rpl_dag_root_init(prefix_64, NULL);
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_set_prefix(prefix_64, NULL);
+ rpl_dag_root_start();
}
/*---------------------------------------------------------------------------*/
void
diff --git a/os/services/shell/shell-commands.c b/os/services/shell/shell-commands.c
index c9ca49e3d..e6789163b 100644
--- a/os/services/shell/shell-commands.c
+++ b/os/services/shell/shell-commands.c
@@ -324,8 +324,8 @@ PT_THREAD(cmd_rpl_set_root(struct pt *pt, shell_output_func output, char *args))
SHELL_OUTPUT(output, "Setting as DAG root with prefix ");
shell_output_6addr(output, &prefix);
SHELL_OUTPUT(output, "/64\n");
- rpl_dag_root_init(&prefix, NULL);
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_set_prefix(&prefix, NULL);
+ rpl_dag_root_start();
} else {
SHELL_OUTPUT(output, "Node is already a DAG root\n");
}
diff --git a/tests/07-simulation-base/code-ipv6/sender/unicast-sender.c b/tests/07-simulation-base/code-ipv6/sender/unicast-sender.c
index 44cf49196..2899530af 100644
--- a/tests/07-simulation-base/code-ipv6/sender/unicast-sender.c
+++ b/tests/07-simulation-base/code-ipv6/sender/unicast-sender.c
@@ -40,7 +40,7 @@ PROCESS_THREAD(udp_process, ev, data)
PROCESS_BEGIN();
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
simple_udp_register(&broadcast_connection, UDP_PORT,
NULL, UDP_PORT,
diff --git a/tests/14-rpl-lite/code/root-node.c b/tests/14-rpl-lite/code/root-node.c
index 153464842..9e584d4a0 100644
--- a/tests/14-rpl-lite/code/root-node.c
+++ b/tests/14-rpl-lite/code/root-node.c
@@ -74,7 +74,7 @@ PROCESS_THREAD(unicast_receiver_process, ev, data)
{
PROCESS_BEGIN();
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
simple_udp_register(&unicast_connection, UDP_PORT,
NULL, UDP_PORT, receiver);
diff --git a/tests/15-rpl-classic/code/root-node.c b/tests/15-rpl-classic/code/root-node.c
index 9983739b8..389add307 100644
--- a/tests/15-rpl-classic/code/root-node.c
+++ b/tests/15-rpl-classic/code/root-node.c
@@ -72,7 +72,7 @@ PROCESS_THREAD(unicast_receiver_process, ev, data)
{
PROCESS_BEGIN();
- rpl_dag_root_init_dag_immediately();
+ rpl_dag_root_start();
simple_udp_register(&unicast_connection, UDP_PORT,
NULL, UDP_PORT, receiver);