updated for new uIPv6 APIs
This commit is contained in:
parent
9f00170c59
commit
fd3b773eb4
2 changed files with 14 additions and 10 deletions
|
@ -82,13 +82,14 @@ static void
|
|||
print_local_addresses(void)
|
||||
{
|
||||
int i;
|
||||
uip_netif_state state;
|
||||
uint8_t state;
|
||||
|
||||
PRINTF("Client IPv6 addresses: ");
|
||||
for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i++) {
|
||||
state = uip_netif_physical_if.addresses[i].state;
|
||||
if(state == TENTATIVE || state == PREFERRED) {
|
||||
PRINT6ADDR(&uip_netif_physical_if.addresses[i].ipaddr);
|
||||
state = uip_ds6_if.addr_list[i].state;
|
||||
if(uip_ds6_if.addr_list[i].isused &&
|
||||
(state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
|
||||
PRINT6ADDR(&uip_ds6_if.addr_list[i].ipaddr);
|
||||
PRINTF("\n");
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +101,8 @@ set_global_address(void)
|
|||
uip_ipaddr_t ipaddr;
|
||||
|
||||
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
|
||||
|
|
|
@ -81,13 +81,14 @@ static void
|
|||
print_local_addresses(void)
|
||||
{
|
||||
int i;
|
||||
uip_netif_state state;
|
||||
uint8_t state;
|
||||
|
||||
PRINTF("Server IPv6 addresses: ");
|
||||
for(i = 0; i < UIP_CONF_NETIF_MAX_ADDRESSES; i++) {
|
||||
state = uip_netif_physical_if.addresses[i].state;
|
||||
if(state == TENTATIVE || state == PREFERRED) {
|
||||
PRINT6ADDR(&uip_netif_physical_if.addresses[i].ipaddr);
|
||||
state = uip_ds6_if.addr_list[i].state;
|
||||
if(uip_ds6_if.addr_list[i].isused &&
|
||||
(state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
|
||||
PRINT6ADDR(&uip_ds6_if.addr_list[i].ipaddr);
|
||||
PRINTF("\n");
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +103,8 @@ PROCESS_THREAD(udp_server_process, ev, data)
|
|||
|
||||
#if UIP_CONF_ROUTER
|
||||
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 */
|
||||
|
||||
print_local_addresses();
|
||||
|
|
Loading…
Reference in a new issue