Merge pull request #1967 from MohamedSeliem/patch-9

Fix the leftover mentions of aaaa as a prefix to be UIP_DS6_DEFAULT_PREFIX (now fd00)
This commit is contained in:
Antonio Lignan 2016-12-04 12:46:07 +01:00 committed by GitHub
commit 2be999c707
9 changed files with 35 additions and 33 deletions

View file

@ -166,7 +166,7 @@ tapdev_init_darwin_routes(void)
addreq6.ifra_addr.sin6_family = AF_INET6; addreq6.ifra_addr.sin6_family = AF_INET6;
addreq6.ifra_addr.sin6_len = sizeof(addreq6.ifra_addr); addreq6.ifra_addr.sin6_len = sizeof(addreq6.ifra_addr);
addreq6.ifra_addr.sin6_addr.__u6_addr.__u6_addr16[0] = UIP_HTONS(0xAAAA); addreq6.ifra_addr.sin6_addr.__u6_addr.__u6_addr16[0] = UIP_HTONS(0xFD00);
addreq6.ifra_addr.sin6_addr.__u6_addr.__u6_addr16[7] = UIP_HTONS(0x0001); addreq6.ifra_addr.sin6_addr.__u6_addr.__u6_addr16[7] = UIP_HTONS(0x0001);
addreq6.ifra_prefixmask.sin6_family = AF_INET6; addreq6.ifra_prefixmask.sin6_family = AF_INET6;
@ -227,7 +227,7 @@ tapdev_init_darwin_routes(void)
msg.dst.sin6_family = AF_INET6; msg.dst.sin6_family = AF_INET6;
msg.dst.sin6_len = sizeof(msg.dst); msg.dst.sin6_len = sizeof(msg.dst);
msg.dst.sin6_addr.__u6_addr.__u6_addr16[0] = UIP_HTONS(0xAAAA); msg.dst.sin6_addr.__u6_addr.__u6_addr16[0] = UIP_HTONS(0xFD00);
msg.gw.sdl_family = AF_LINK; msg.gw.sdl_family = AF_LINK;
msg.gw.sdl_len = sizeof(msg.gw); msg.gw.sdl_len = sizeof(msg.gw);
@ -269,7 +269,7 @@ tapdev_cleanup_darwin_routes(void)
msg.dst.sin6_family = AF_INET6; msg.dst.sin6_family = AF_INET6;
msg.dst.sin6_len = sizeof(msg.dst); msg.dst.sin6_len = sizeof(msg.dst);
msg.dst.sin6_addr.__u6_addr.__u6_addr16[0] = UIP_HTONS(0xAAAA); msg.dst.sin6_addr.__u6_addr.__u6_addr16[0] = UIP_HTONS(0xFD00);
msg.gw.sdl_family = AF_LINK; msg.gw.sdl_family = AF_LINK;
msg.gw.sdl_len = sizeof(msg.gw); msg.gw.sdl_len = sizeof(msg.gw);

View file

@ -172,7 +172,7 @@ 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, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF); uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
@ -183,23 +183,23 @@ set_global_address(void)
* *
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the * For correct Wireshark decoding using a sniffer, add the /64 prefix to the
* 6LowPAN protocol preferences, * 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and * e.g. set Context 0 to fd00::. At present Wireshark copies Context/128 and
* then overwrites it. * then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit * (Setting Context 0 to fd00::1111:2222:3333:4444 will report a 16 bit
* compressed address of aaaa::1111:22ff:fe33:xxxx) * compressed address of fd00::1111:22ff:fe33:xxxx)
* *
* Note the IPCMV6 checksum verification depends on the correct uncompressed addresses. * Note the IPCMV6 checksum verification depends on the correct uncompressed addresses.
*/ */
#if 0 #if 0
/* Mode 1 - 64 bits inline */ /* Mode 1 - 64 bits inline */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1); uip_ip6addr(&server_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 1);
#elif 1 #elif 1
/* Mode 2 - 16 bits inline */ /* Mode 2 - 16 bits inline */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1); uip_ip6addr(&server_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else #else
/* Mode 3 - derived from server link-local (MAC) address */ /* Mode 3 - derived from server link-local (MAC) address */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0x0250, 0xc2ff, 0xfea8, 0xcd1a); /* redbee-econotag */ uip_ip6addr(&server_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0x0250, 0xc2ff, 0xfea8, 0xcd1a); /* redbee-econotag */
#endif #endif
/* Voravit Added */ /* Voravit Added */
/* PRINTF("VORAVIT CLIENT: SERVER IPv6 addresses: \n"); */ /* PRINTF("VORAVIT CLIENT: SERVER IPv6 addresses: \n"); */

View file

@ -31,6 +31,7 @@
#include "contiki-lib.h" #include "contiki-lib.h"
#include "contiki-net.h" #include "contiki-net.h"
#include "net/ip/uip.h" #include "net/ip/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "net/rpl/rpl.h" #include "net/rpl/rpl.h"
#include "net/netstack.h" #include "net/netstack.h"
@ -227,21 +228,21 @@ PROCESS_THREAD(coap_server_process, ev, data)
* 6LowPAN protocol preferences, * 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and * e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and
* then overwrites it. * then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit * (Setting Context 0 to fd00::1111:2222:3333:4444 will report a 16 bit
* compressed address of aaaa::1111:22ff:fe33:xxxx) * compressed address of fd00::1111:22ff:fe33:xxxx)
* Note Wireshark's IPCMV6 checksum verification depends on the correct * Note Wireshark's IPCMV6 checksum verification depends on the correct
* uncompressed addresses. * uncompressed addresses.
*/ */
#if 0 #if 0
/* Mode 1 - 64 bits inline */ /* Mode 1 - 64 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 1);
#elif 1 #elif 1
/* Mode 2 - 16 bits inline */ /* Mode 2 - 16 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else #else
/* Mode 3 - derived from link local (MAC) address */ /* Mode 3 - derived from link local (MAC) address */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
#endif #endif
@ -250,7 +251,7 @@ PROCESS_THREAD(coap_server_process, ev, data)
if(root_if != NULL) { if(root_if != NULL) {
rpl_dag_t *dag; rpl_dag_t *dag;
dag = rpl_set_root(RPL_DEFAULT_INSTANCE, (uip_ip6addr_t *)&ipaddr); dag = rpl_set_root(RPL_DEFAULT_INSTANCE, (uip_ip6addr_t *)&ipaddr);
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
rpl_set_prefix(dag, &ipaddr, 64); rpl_set_prefix(dag, &ipaddr, 64);
PRINTF("created a new RPL dag\n"); PRINTF("created a new RPL dag\n");
} else { } else {

View file

@ -370,7 +370,7 @@ PROCESS_THREAD(border_router_process, ev, data)
NETSTACK_MAC.off(1); NETSTACK_MAC.off(1);
/* Derived from link local (MAC) address */ /* Derived from link local (MAC) address */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
set_prefix_64(&ipaddr); set_prefix_64(&ipaddr);
print_local_addresses(); print_local_addresses();

View file

@ -143,7 +143,7 @@ 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, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF); uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
@ -153,10 +153,10 @@ set_global_address(void)
* *
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the * For correct Wireshark decoding using a sniffer, add the /64 prefix to the
* 6LowPAN protocol preferences, * 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and * e.g. set Context 0 to fd00::. At present Wireshark copies Context/128 and
* then overwrites it. * then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit * (Setting Context 0 to fd00::1111:2222:3333:4444 will report a 16 bit
* compressed address of aaaa::1111:22ff:fe33:xxxx) * compressed address of fd00::1111:22ff:fe33:xxxx)
* *
* Note the IPCMV6 checksum verification depends on the correct uncompressed * Note the IPCMV6 checksum verification depends on the correct uncompressed
* addresses. * addresses.
@ -164,13 +164,13 @@ set_global_address(void)
#if 0 #if 0
/* Mode 1 - 64 bits inline */ /* Mode 1 - 64 bits inline */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1); uip_ip6addr(&server_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 1);
#elif 1 #elif 1
/* Mode 2 - 16 bits inline */ /* Mode 2 - 16 bits inline */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1); uip_ip6addr(&server_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else #else
/* Mode 3 - derived from server link-local (MAC) address */ /* Mode 3 - derived from server link-local (MAC) address */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0x0250, 0xc2ff, 0xfea8, 0xcd1a); //redbee-econotag uip_ip6addr(&server_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0x0250, 0xc2ff, 0xfea8, 0xcd1a); //redbee-econotag
#endif #endif
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/

View file

@ -31,6 +31,7 @@
#include "contiki-lib.h" #include "contiki-lib.h"
#include "contiki-net.h" #include "contiki-net.h"
#include "net/ip/uip.h" #include "net/ip/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "net/rpl/rpl.h" #include "net/rpl/rpl.h"
#include "net/netstack.h" #include "net/netstack.h"
@ -124,21 +125,21 @@ PROCESS_THREAD(udp_server_process, ev, data)
* 6LowPAN protocol preferences, * 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and * e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and
* then overwrites it. * then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit * (Setting Context 0 to fd00::1111:2222:3333:4444 will report a 16 bit
* compressed address of aaaa::1111:22ff:fe33:xxxx) * compressed address of fd00::1111:22ff:fe33:xxxx)
* Note Wireshark's IPCMV6 checksum verification depends on the correct * Note Wireshark's IPCMV6 checksum verification depends on the correct
* uncompressed addresses. * uncompressed addresses.
*/ */
#if 0 #if 0
/* Mode 1 - 64 bits inline */ /* Mode 1 - 64 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 1);
#elif 1 #elif 1
/* Mode 2 - 16 bits inline */ /* Mode 2 - 16 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else #else
/* Mode 3 - derived from link local (MAC) address */ /* Mode 3 - derived from link local (MAC) address */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
#endif #endif
@ -147,7 +148,7 @@ PROCESS_THREAD(udp_server_process, ev, data)
if(root_if != NULL) { if(root_if != NULL) {
rpl_dag_t *dag; rpl_dag_t *dag;
dag = rpl_set_root(RPL_DEFAULT_INSTANCE,(uip_ip6addr_t *)&ipaddr); dag = rpl_set_root(RPL_DEFAULT_INSTANCE,(uip_ip6addr_t *)&ipaddr);
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
rpl_set_prefix(dag, &ipaddr, 64); rpl_set_prefix(dag, &ipaddr, 64);
PRINTF("created a new RPL dag\n"); PRINTF("created a new RPL dag\n");
} else { } else {

View file

@ -118,7 +118,7 @@ static void
set_global_address(void) 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, 0xfd00, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF); uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
} }

View file

@ -70,7 +70,7 @@ static void
set_global_address(void) 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, 0xfd00, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF); uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
} }

View file

@ -376,7 +376,7 @@ initialize(void)
#if 0 #if 0
{ {
uip_ip6addr_t ipaddr; uip_ip6addr_t ipaddr;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); uip_ip6addr(&ipaddr, 0xfd00, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF); uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
/* uip_ds6_prefix_add(&ipaddr,64,0); */ /* uip_ds6_prefix_add(&ipaddr,64,0); */
} }