From a99f0ca352ed99a3cb297880d73f7e59b3bb58ee Mon Sep 17 00:00:00 2001 From: bg- Date: Mon, 14 Aug 2006 14:01:02 +0000 Subject: [PATCH] * More uip_ipaddr_t fixes. --- platform/netsim/contiki-main.c | 4 ++-- platform/netsim/main.c | 17 +++++++++-------- platform/netsim/node.c | 10 +++++----- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/platform/netsim/contiki-main.c b/platform/netsim/contiki-main.c index 35cfe5263..99f6a73b7 100644 --- a/platform/netsim/contiki-main.c +++ b/platform/netsim/contiki-main.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: contiki-main.c,v 1.1 2006/06/17 22:41:35 adamdunkels Exp $ + * $Id: contiki-main.c,v 1.2 2006/08/14 14:01:02 bg- Exp $ */ #include "contiki.h" @@ -158,7 +158,7 @@ contiki_main(int flag) process_start(&tapdev_drv_process, NULL); uip_fw_register(ðernodeif); uip_fw_default(&tapif); - printf("uip_hostaddr %02x%02x\n", uip_hostaddr[0], uip_hostaddr[1]); + printf("uip_hostaddr %02x%02x\n", uip_hostaddr.u16[0], uip_hostaddr.u16[1]); } else { uip_fw_default(ðernodeif); } diff --git a/platform/netsim/main.c b/platform/netsim/main.c index 368586d76..c7b9897a2 100644 --- a/platform/netsim/main.c +++ b/platform/netsim/main.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: main.c,v 1.1 2006/06/17 22:41:35 adamdunkels Exp $ + * $Id: main.c,v 1.2 2006/08/14 14:01:02 bg- Exp $ */ /** @@ -233,19 +233,20 @@ clock_seconds(void) void uip_log(char *m) { - u16_t addr[2]; - uip_gethostaddr(addr); + uip_ipaddr_t addr; + + uip_gethostaddr(&addr); printf("uIP log at %d.%d.%d.%d: %s\n", - uip_ipaddr1(addr), - uip_ipaddr2(addr), - uip_ipaddr3(addr), - uip_ipaddr4(addr), + uip_ipaddr1(&addr), + uip_ipaddr2(&addr), + uip_ipaddr3(&addr), + uip_ipaddr4(&addr), m); fflush(NULL); } void -configurator_send_config(u16_t *addr, unsigned long seconds) +configurator_send_config(uip_ipaddr_t *addr, unsigned long seconds) { printf("Configurator: address %d.%d.%d.%d, seconds %lu\n", uip_ipaddr1(addr), diff --git a/platform/netsim/node.c b/platform/netsim/node.c index 7870ec062..e365bbe10 100644 --- a/platform/netsim/node.c +++ b/platform/netsim/node.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: node.c,v 1.1 2006/06/17 22:41:35 adamdunkels Exp $ + * $Id: node.c,v 1.2 2006/08/14 14:01:02 bg- Exp $ */ #include "node.h" #include "contiki.h" @@ -50,7 +50,7 @@ static void init_node_log(void); void node_init(int id, int posx, int posy, int b) { - u16_t addr[2]; + uip_ipaddr_t addr; node.id = id; node.x = posx; @@ -58,11 +58,11 @@ node_init(int id, int posx, int posy, int b) node.type = NODE_TYPE_NORMAL; if(b) { - uip_ipaddr(addr, 192,168,250,2); + uip_ipaddr(&addr, 192,168,250,2); } else { - uip_ipaddr(addr, 10,10,posx,posy); + uip_ipaddr(&addr, 10,10,posx,posy); } - uip_sethostaddr(addr); + uip_sethostaddr(&addr); drift = random() % 9572627217;