updated for new uIPv6 APIs

This commit is contained in:
joxe 2010-04-17 21:22:39 +00:00
parent 9f00170c59
commit fd3b773eb4
2 changed files with 14 additions and 10 deletions

View file

@ -82,13 +82,14 @@ static void
print_local_addresses(void) print_local_addresses(void)
{ {
int i; int i;
uip_netif_state state; uint8_t state;
PRINTF("Client IPv6 addresses: "); PRINTF("Client IPv6 addresses: ");
for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i++) { for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i++) {
state = uip_netif_physical_if.addresses[i].state; state = uip_ds6_if.addr_list[i].state;
if(state == TENTATIVE || state == PREFERRED) { if(uip_ds6_if.addr_list[i].isused &&
PRINT6ADDR(&uip_netif_physical_if.addresses[i].ipaddr); (state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
PRINT6ADDR(&uip_ds6_if.addr_list[i].ipaddr);
PRINTF("\n"); PRINTF("\n");
} }
} }
@ -100,7 +101,8 @@ set_global_address(void)
uip_ipaddr_t ipaddr; uip_ipaddr_t ipaddr;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_netif_addr_add(&ipaddr, 64, 0, AUTOCONF); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void

View file

@ -81,13 +81,14 @@ static void
print_local_addresses(void) print_local_addresses(void)
{ {
int i; int i;
uip_netif_state state; uint8_t state;
PRINTF("Server IPv6 addresses: "); PRINTF("Server IPv6 addresses: ");
for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i++) { for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i++) {
state = uip_netif_physical_if.addresses[i].state; state = uip_ds6_if.addr_list[i].state;
if(state == TENTATIVE || state == PREFERRED) { if(uip_ds6_if.addr_list[i].isused &&
PRINT6ADDR(&uip_netif_physical_if.addresses[i].ipaddr); (state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
PRINT6ADDR(&uip_ds6_if.addr_list[i].ipaddr);
PRINTF("\n"); PRINTF("\n");
} }
} }
@ -102,7 +103,8 @@ PROCESS_THREAD(udp_server_process, ev, data)
#if UIP_CONF_ROUTER #if UIP_CONF_ROUTER
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_netif_addr_add(&ipaddr, 64, 0, AUTOCONF); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
#endif /* UIP_CONF_ROUTER */ #endif /* UIP_CONF_ROUTER */
print_local_addresses(); print_local_addresses();