From 8ef5c8b8c68619f89ee14e7fae1f4ddb354c8863 Mon Sep 17 00:00:00 2001 From: Yasuyuki Tanaka Date: Sat, 31 Mar 2018 18:35:25 +0200 Subject: [PATCH] uip-ds6-nbr: make ds6_neighbors a local variable All the nbr_table API calls with ds6_neighbors are replaced with uip_ds6_nbr APIs accordingly. --- .../cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c | 5 +++-- .../zoul/orion/ip64-router/ip64-router.c | 5 +++-- examples/rpl-border-router/webserver/webserver.c | 5 +++-- os/net/ipv6/uip-ds6-nbr.c | 2 +- os/net/ipv6/uip-ds6-nbr.h | 2 -- os/net/routing/rpl-classic/rpl-dag.c | 6 +++--- os/net/routing/rpl-classic/rpl-nbr-policy.c | 10 +++++----- os/net/routing/rpl-classic/rpl.h | 2 +- os/net/routing/rpl-lite/rpl-nbr-policy.c | 8 ++++---- os/net/routing/rpl-lite/rpl-neighbor.c | 4 ++-- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c index 287452bb3..101b6441b 100644 --- a/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c @@ -38,6 +38,7 @@ /*---------------------------------------------------------------------------*/ #include "contiki.h" #include "httpd-simple.h" +#include "net/ipv6/uip-ds6-nbr.h" #include "net/ipv6/uip-ds6-route.h" #include "batmon-sensor.h" #include "lib/sensors.h" @@ -436,8 +437,8 @@ PT_THREAD(generate_index(struct httpd_state *s)) PT_WAIT_THREAD(&s->generate_pt, enqueue_chunk(s, 0, SECTION_OPEN "Neighbors" CONTENT_OPEN)); - for(s->nbr = nbr_table_head(ds6_neighbors); s->nbr != NULL; - s->nbr = nbr_table_next(ds6_neighbors, s->nbr)) { + for(s->nbr = uip_ds6_nbr_head(); s->nbr != NULL; + s->nbr = uip_ds6_nbr_next(s->nbr)) { PT_WAIT_THREAD(&s->generate_pt, enqueue_chunk(s, 0, "\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 5f2a98e24..4b3279e44 100644 --- a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c +++ b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c @@ -45,6 +45,7 @@ #include "contiki-net.h" #include "net/ipv6/uip.h" #include "net/ipv6/uip-ds6.h" +#include "net/ipv6/uip-ds6-nbr.h" #include "net/routing/routing.h" #include "dev/leds.h" #include "ip64/ip64.h" @@ -142,9 +143,9 @@ PT_THREAD(generate_routes(struct httpd_state *s)) #endif ADD("Neighbors
");
 
-  for(nbr = nbr_table_head(ds6_neighbors);
+  for(nbr = uip_ds6_nbr_head();
       nbr != NULL;
-      nbr = nbr_table_next(ds6_neighbors, nbr)) {
+      nbr = uip_ds6_nbr_next(nbr)) {
 
 #if WEBSERVER_CONF_NEIGHBOR_STATUS
 #if BUF_USES_STACK
diff --git a/examples/rpl-border-router/webserver/webserver.c b/examples/rpl-border-router/webserver/webserver.c
index 3658381bf..c4b472837 100644
--- a/examples/rpl-border-router/webserver/webserver.c
+++ b/examples/rpl-border-router/webserver/webserver.c
@@ -32,6 +32,7 @@
 
 #include "contiki.h"
 #include "net/routing/routing.h"
+#include "net/ipv6/uip-ds6-nbr.h"
 #include "net/ipv6/uip-ds6-route.h"
 #include "net/ipv6/uip-sr.h"
 
@@ -90,9 +91,9 @@ PT_THREAD(generate_routes(struct httpd_state *s))
 
   ADD("  Neighbors\n