Merge pull request #1297 from simonduq/pr/default-prefix
Change the default IPv6 prefix from aaaa::/64 to fd00::/64
This commit is contained in:
commit
cd981b23d5
78 changed files with 165 additions and 131 deletions
|
@ -78,7 +78,7 @@
|
|||
static const char http_content_type_json[] = "application/json";
|
||||
|
||||
/* Maximum 40 chars in host name?: 5 x 8 */
|
||||
static char callback_host[40] = "[aaaa::1]";
|
||||
static char callback_host[40] = "[fd00::1]";
|
||||
static uint16_t callback_port = CALLBACK_PORT;
|
||||
static uint16_t callback_interval = SEND_INTERVAL;
|
||||
static char callback_path[80] = "/debug/";
|
||||
|
|
|
@ -111,7 +111,7 @@ set_own_addresses(void)
|
|||
rpl_dag_t *dag;
|
||||
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_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ join_mcast_group(void)
|
|||
uip_ds6_maddr_t *rv;
|
||||
|
||||
/* First, set our v6 global */
|
||||
uip_ip6addr(&addr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
|
||||
uip_ip6addr(&addr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
|
||||
uip_ds6_set_addr_iid(&addr, &uip_lladdr);
|
||||
uip_ds6_addr_add(&addr, 0, ADDR_AUTOCONF);
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@ CONTIKI_WITH_IPV6 = 1
|
|||
include $(CONTIKI)/Makefile.include
|
||||
|
||||
connect-router: border-router.native
|
||||
sudo ./border-router.native aaaa::1/64
|
||||
sudo ./border-router.native fd00::1/64
|
||||
|
|
|
@ -125,7 +125,7 @@ slip_config_handle_arguments(int argc, char **argv)
|
|||
case 'h':
|
||||
default:
|
||||
fprintf(stderr,"usage: %s [options] ipaddress\n", prog);
|
||||
fprintf(stderr,"example: border-router.native -L -v2 -s ttyUSB1 aaaa::1/64\n");
|
||||
fprintf(stderr,"example: border-router.native -L -v2 -s ttyUSB1 fd00::1/64\n");
|
||||
fprintf(stderr,"Options are:\n");
|
||||
#ifdef linux
|
||||
fprintf(stderr," -B baudrate 9600,19200,38400,57600,115200,921600 (default 115200)\n");
|
||||
|
|
|
@ -33,7 +33,7 @@ CFLAGS += -DWEBSERVER=2
|
|||
endif
|
||||
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX = aaaa::1/64
|
||||
PREFIX = fd00::1/64
|
||||
endif
|
||||
|
||||
CONTIKI_WITH_IPV6 = 1
|
||||
|
|
|
@ -195,12 +195,12 @@ set_global_address(void)
|
|||
{
|
||||
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_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
|
||||
|
||||
/* set server address */
|
||||
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);
|
||||
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -145,14 +145,14 @@ PROCESS_THREAD(udp_server_process, ev, data)
|
|||
PRINTF("UDP server started\n");
|
||||
|
||||
#if UIP_CONF_ROUTER
|
||||
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);
|
||||
/* uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); */
|
||||
uip_ds6_addr_add(&ipaddr, 0, ADDR_MANUAL);
|
||||
root_if = uip_ds6_addr_lookup(&ipaddr);
|
||||
if(root_if != NULL) {
|
||||
rpl_dag_t *dag;
|
||||
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);
|
||||
PRINTF("created a new RPL dag\n");
|
||||
} else {
|
||||
|
|
|
@ -116,7 +116,7 @@ set_global_address(void)
|
|||
{
|
||||
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_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
|
||||
|
||||
|
@ -125,21 +125,21 @@ set_global_address(void)
|
|||
* Obviously the choice made here must also be selected in udp-server.c.
|
||||
*
|
||||
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the 6LowPAN protocol preferences,
|
||||
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and then overwrites it.
|
||||
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit compressed address of aaaa::1111:22ff:fe33:xxxx)
|
||||
* e.g. set Context 0 to fd00::. At present Wireshark copies Context/128 and then overwrites it.
|
||||
* (Setting Context 0 to fd00::1111:2222:3333:4444 will report a 16 bit compressed address of fd00::1111:22ff:fe33:xxxx)
|
||||
*
|
||||
* Note the IPCMV6 checksum verification depends on the correct uncompressed addresses.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* 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
|
||||
/* 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
|
||||
/* 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
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
|
@ -114,20 +114,20 @@ PROCESS_THREAD(udp_server_process, ev, data)
|
|||
* Obviously the choice made here must also be selected in udp-client.c.
|
||||
*
|
||||
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the 6LowPAN protocol preferences,
|
||||
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and then overwrites it.
|
||||
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit compressed address of aaaa::1111:22ff:fe33:xxxx)
|
||||
* e.g. set Context 0 to fd00::. At present Wireshark copies Context/128 and then overwrites it.
|
||||
* (Setting Context 0 to fd00::1111:2222:3333:4444 will report a 16 bit compressed address of fd00::1111:22ff:fe33:xxxx)
|
||||
* Note Wireshark's IPCMV6 checksum verification depends on the correct uncompressed addresses.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* 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
|
||||
/* 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
|
||||
/* 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);
|
||||
#endif
|
||||
|
||||
|
@ -136,7 +136,7 @@ PROCESS_THREAD(udp_server_process, ev, data)
|
|||
if(root_if != NULL) {
|
||||
rpl_dag_t *dag;
|
||||
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);
|
||||
PRINTF("created a new RPL dag\n");
|
||||
} else {
|
||||
|
|
|
@ -80,7 +80,7 @@ set_global_address(void)
|
|||
int i;
|
||||
uint8_t state;
|
||||
|
||||
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_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
|
||||
|
||||
|
@ -109,7 +109,7 @@ create_rpl_dag(uip_ipaddr_t *ipaddr)
|
|||
|
||||
rpl_set_root(RPL_DEFAULT_INSTANCE, ipaddr);
|
||||
dag = rpl_get_any_dag();
|
||||
uip_ip6addr(&prefix, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
|
||||
uip_ip6addr(&prefix, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0);
|
||||
rpl_set_prefix(dag, &prefix, 64);
|
||||
PRINTF("created a new RPL dag\n");
|
||||
} else {
|
||||
|
|
|
@ -78,7 +78,7 @@ set_global_address(void)
|
|||
int i;
|
||||
uint8_t state;
|
||||
|
||||
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_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ $(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
|
|||
(cd $(CONTIKI)/tools && $(MAKE) tunslip6)
|
||||
|
||||
connect-router: $(CONTIKI)/tools/tunslip6
|
||||
sudo $(CONTIKI)/tools/tunslip6 aaaa::1/64
|
||||
sudo $(CONTIKI)/tools/tunslip6 fd00::1/64
|
||||
|
||||
connect-router-cooja: $(CONTIKI)/tools/tunslip6
|
||||
sudo $(CONTIKI)/tools/tunslip6 -a 127.0.0.1 aaaa::1/64
|
||||
sudo $(CONTIKI)/tools/tunslip6 -a 127.0.0.1 fd00::1/64
|
||||
|
|
|
@ -17,8 +17,8 @@ To test the example in COOJA under Linux
|
|||
make connect-router-cooja
|
||||
|
||||
3. You should now be able to browse to the nodes using your web browser:
|
||||
Router: http://[aaaa::0212:7401:0001:0101]/
|
||||
Node 2: http://[aaaa::0212:7402:0002:0202]/
|
||||
Router: http://[fd00::0212:7401:0001:0101]/
|
||||
Node 2: http://[fd00::0212:7402:0002:0202]/
|
||||
|
||||
|
||||
To run the example on real nodes under Linux
|
||||
|
|
|
@ -44,13 +44,13 @@
|
|||
#include <stdio.h>
|
||||
|
||||
/* The address of the server to register the services for this node */
|
||||
#define SERVER "[aaaa::1]"
|
||||
#define SERVER "[fd00::1]"
|
||||
|
||||
/* This command registers two services (/0 and /1) to turn the leds on or off */
|
||||
#define REGISTER_COMMAND "/r?p=0&d=Turn%20off%20leds&p=1&d=Turn%20on%20leds"
|
||||
|
||||
/* The address of the other node to control */
|
||||
#define OTHER_NODE "[aaaa::1]"
|
||||
#define OTHER_NODE "[fd00::1]"
|
||||
|
||||
/* The commands to send to the other node */
|
||||
#define SET_LEDS_ON "/1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue