Port apps, examples, platforms and tools so they use the new neighbor and route API.
This commit is contained in:
parent
ff093a2b50
commit
5dc05e7913
21 changed files with 262 additions and 257 deletions
|
@ -56,8 +56,6 @@
|
|||
|
||||
uint16_t dag_id[] = {0x1111, 0x1100, 0, 0, 0, 0, 0, 0x0011};
|
||||
|
||||
extern uip_ds6_nbr_t uip_ds6_nbr_cache[];
|
||||
|
||||
static uip_ipaddr_t prefix;
|
||||
static uint8_t prefix_set;
|
||||
|
||||
|
@ -149,6 +147,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
{
|
||||
static int i;
|
||||
static uip_ds6_route_t *r;
|
||||
static uip_ds6_nbr_t *nbr;
|
||||
#if BUF_USES_STACK
|
||||
char buf[256];
|
||||
#endif
|
||||
|
@ -166,15 +165,17 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
blen = 0;
|
||||
#endif
|
||||
ADD("Neighbors<pre>");
|
||||
for(i = 0; i < UIP_DS6_NBR_NB; i++) {
|
||||
if(uip_ds6_nbr_cache[i].isused) {
|
||||
|
||||
for(nbr = nbr_table_head(ds6_neighbors);
|
||||
nbr != NULL;
|
||||
nbr = nbr_table_next(ds6_neighbors, nbr)) {
|
||||
|
||||
#if WEBSERVER_CONF_NEIGHBOR_STATUS
|
||||
#if BUF_USES_STACK
|
||||
{char* j=bufptr+25;
|
||||
ipaddr_add(&uip_ds6_nbr_cache[i].ipaddr);
|
||||
ipaddr_add(&nbr->ipaddr);
|
||||
while (bufptr < j) ADD(" ");
|
||||
switch (uip_ds6_nbr_cache[i].state) {
|
||||
switch (nbr->state) {
|
||||
case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
|
||||
case NBR_REACHABLE: ADD(" REACHABLE");break;
|
||||
case NBR_STALE: ADD(" STALE");break;
|
||||
|
@ -184,9 +185,9 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
}
|
||||
#else
|
||||
{uint8_t j=blen+25;
|
||||
ipaddr_add(&uip_ds6_nbr_cache[i].ipaddr);
|
||||
ipaddr_add(&nbr->ipaddr);
|
||||
while (blen < j) ADD(" ");
|
||||
switch (uip_ds6_nbr_cache[i].state) {
|
||||
switch (nbr->state) {
|
||||
case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
|
||||
case NBR_REACHABLE: ADD(" REACHABLE");break;
|
||||
case NBR_STALE: ADD(" STALE");break;
|
||||
|
@ -196,7 +197,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
}
|
||||
#endif
|
||||
#else
|
||||
ipaddr_add(&uip_ds6_nbr_cache[i].ipaddr);
|
||||
ipaddr_add(&nbr->ipaddr);
|
||||
#endif
|
||||
|
||||
ADD("\n");
|
||||
|
@ -211,7 +212,6 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
blen = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
ADD("</pre>Routes<pre>");
|
||||
SEND_STRING(&s->sout, buf);
|
||||
|
@ -221,7 +221,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
blen = 0;
|
||||
#endif
|
||||
|
||||
for(r = uip_ds6_route_list_head(); r != NULL; r = list_item_next(r)) {
|
||||
for(r = uip_ds6_route_head(); r != NULL; r = uip_ds6_route_next(r)) {
|
||||
|
||||
#if BUF_USES_STACK
|
||||
#if WEBSERVER_CONF_ROUTE_LINKS
|
||||
|
@ -247,7 +247,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||
#endif
|
||||
#endif
|
||||
ADD("/%u (via ", r->length);
|
||||
ipaddr_add(&r->nexthop);
|
||||
ipaddr_add(uip_ds6_route_nexthop(r));
|
||||
if(1 || (r->state.lifetime < 600)) {
|
||||
ADD(") %lus\n", r->state.lifetime);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue