update boarder router to new rpl tables

This commit is contained in:
Harald Pichler 2013-11-28 10:19:17 +01:00
parent dd917c3260
commit 171c1290c3
5 changed files with 20 additions and 31 deletions

View file

@ -3,9 +3,8 @@ all: $(CONTIKI_PROJECT)
CONTIKI=../../..
WITH_UIP6=1
UIP_CONF_IPV6=1
CFLAGS+= -DUIP_CONF_IPV6_RPL -DUIP_CONF_IPV6
CFLAGS+= -DUIP_CONF_IPV6_RPL
#linker optimizations
SMALL=1

View file

@ -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");
@ -212,7 +213,6 @@ PT_THREAD(generate_routes(struct httpd_state *s))
}
#endif
}
}
ADD("</pre>Routes<pre>");
SEND_STRING(&s->sout, buf);
#if BUF_USES_STACK
@ -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 {

View file

@ -37,8 +37,8 @@
* Joakim Eriksson <joakime@sics.se>
*/
#ifndef __HTTPD_SIMPLE_H__
#define __HTTPD_SIMPLE_H__
#ifndef HTTPD_SIMPLE_H_
#define HTTPD_SIMPLE_H_
#include "contiki-net.h"
@ -71,4 +71,4 @@ httpd_simple_script_t httpd_simple_get_script(const char *name);
#define SEND_STRING(s, str) PSOCK_SEND(s, (uint8_t *)str, strlen(str))
#endif /* __HTTPD_SIMPLE_H__ */
#endif /* HTTPD_SIMPLE_H_ */

View file

@ -28,22 +28,13 @@
*
*/
#ifndef __PROJECT_ROUTER_CONF_H__
#define __PROJECT_ROUTER_CONF_H__
#ifndef PROJECT_ROUTER_CONF_H_
#define PROJECT_ROUTER_CONF_H_
#ifndef UIP_FALLBACK_INTERFACE
#define UIP_FALLBACK_INTERFACE rpl_interface
#endif
/* Save some memory for the sky platform. */
#undef UIP_CONF_DS6_NBR_NBU
#define UIP_CONF_DS6_NBR_NBU 15
#undef UIP_CONF_DS6_ROUTE_NBU
#define UIP_CONF_DS6_ROUTE_NBU 50
#undef UIP_CONF_TCP
#define UIP_CONF_TCP 1
#ifndef QUEUEBUF_CONF_NUM
#define QUEUEBUF_CONF_NUM 4
#endif
@ -60,4 +51,4 @@
#define WEBSERVER_CONF_CFS_CONNS 2
#endif
#endif /* __PROJECT_ROUTER_CONF_H__ */
#endif /* PROJECT_ROUTER_CONF_H_ */

View file

@ -74,9 +74,8 @@ extern uint8_t eemem_domain_name[30];
/* This form of of EUI64 mac allows full 6LoWPAN header compression from mac address */
#if UIP_CONF_LL_802154
//#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN}
//#define PARAMS_EUI64ADDR {0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x01}
#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x27, 0x0d}
//#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x1E, 0xFB}
#define PARAMS_EUI64ADDR {0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x01}
#else
//#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xff, 0xfe, 0xNN, 0xNN, 0xNN}
#define PARAMS_EUI64ADDR {0x00, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x03}