From 9bcf982d87cc254cbc91f637931bc0c7a78cde67 Mon Sep 17 00:00:00 2001 From: dak664 Date: Thu, 18 Mar 2010 20:11:54 +0000 Subject: [PATCH] Update minimal net to new ds6 interface --- platform/minimal-net/contiki-conf.h | 5 ++++- platform/minimal-net/contiki-main.c | 22 ++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/platform/minimal-net/contiki-conf.h b/platform/minimal-net/contiki-conf.h index a6b045045..617fc9e87 100644 --- a/platform/minimal-net/contiki-conf.h +++ b/platform/minimal-net/contiki-conf.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: contiki-conf.h,v 1.9 2008/10/15 09:14:25 adamdunkels Exp $ + * @(#)$Id: contiki-conf.h,v 1.10 2010/03/18 20:11:54 dak664 Exp $ */ #ifndef __CONTIKI_CONF_H__ @@ -60,6 +60,9 @@ typedef unsigned short uip_stats_t; #define UIP_CONF_LOGGING 0 #define UIP_CONF_UDP_CHECKSUMS 0 +/* Not used but avoids compile errors while sicslowpan.c is being developed */ +#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 + #define UIP_CONF_UDP 1 #define UIP_CONF_TCP 1 diff --git a/platform/minimal-net/contiki-main.c b/platform/minimal-net/contiki-main.c index e678f312d..67846f5ca 100644 --- a/platform/minimal-net/contiki-main.c +++ b/platform/minimal-net/contiki-main.c @@ -29,7 +29,7 @@ * * This file is part of the Contiki OS * - * $Id: contiki-main.c,v 1.23 2010/02/02 17:51:55 dak664 Exp $ + * $Id: contiki-main.c,v 1.24 2010/03/18 20:11:54 dak664 Exp $ * */ @@ -132,12 +132,22 @@ main(void) printf("Def. Router: %d.%d.%d.%d\n", uip_ipaddr_to_quad(&addr)); #else /* !UIP_CONF_IPV6 */ + uint8_t i; uip_ipaddr_t ipaddr; - - uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); - uip_netif_addr_autoconf_set(&ipaddr, &uip_lladdr); - uip_netif_addr_add(&ipaddr, 16, 0, TENTATIVE); - printf("IP6 Address: ");sprint_ip6(ipaddr);printf("\n"); + uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); +#if UIP_CONF_ROUTER + uip_ds6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0, 0, 0, 0); +#else /* UIP_CONF_ROUTER */ + uip_ds6_prefix_add(&ipaddr, UIP_DEFAULT_PREFIX_LEN, 0); +#endif /* UIP_CONF_ROUTER */ + uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); + uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF); + // printf("IP6 Address: ");sprint_ip6(ipaddr);printf("\n"); + for (i=0;i