NETSTACK_CONF_WITH_IPV6

This commit is contained in:
Harald Pichler 2014-12-07 17:36:53 +01:00
parent a02be51f08
commit ed161d1905
3 changed files with 23 additions and 20 deletions

View file

@ -3,12 +3,6 @@ all: er-example-server er-example-client
CONTIKI=../../..
# Contiki IPv6 configuration
WITH_UIP6=1
UIP_CONF_IPV6=1
CFLAGS += -DUIP_CONF_IPV6=1
CFLAGS += -DUIP_CONF_IPV6_RPL=1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
# automatically build RESTful resources
@ -37,6 +31,7 @@ APPS += rest-engine
#CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
#CUSTOM_RULE_S_TO_OBJECTDIR_O = 1
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
# minimal-net target is currently broken in Contiki
@ -46,7 +41,7 @@ ${info INFO: er-example compiling with large buffers}
CFLAGS += -DUIP_CONF_BUFFER_SIZE=1300
CFLAGS += -DREST_MAX_CHUNK_SIZE=1024
CFLAGS += -DCOAP_MAX_HEADER_SIZE=176
CFLAGS += -DUIP_CONF_IPV6_RPL=0
CONTIKI_WITH_RPL=0
endif
# optional rules to get assembly

View file

@ -144,11 +144,11 @@ typedef unsigned short uip_stats_t;
/* Allow MCU sleeping between channel checks */
#define RDC_CONF_MCU_SLEEP 1
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
#define LINKADDR_CONF_SIZE 8
#define UIP_CONF_ICMP6 1
#define UIP_CONF_UDP 1
//#define UIP_CONF_TCP 1
#define UIP_CONF_TCP 1
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#else
@ -239,14 +239,20 @@ typedef unsigned short uip_stats_t;
#define NETSTACK_CONF_RDC contikimac_driver
/* Default is two CCA separated by 500 usec */
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
/* Wireshark won't decode with the header, but padded packets will fail ipv6 checksum */
#define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0
/* So without the header this needed for RPL mesh to form */
#define CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE 43-18 //multicast RPL DIS length
#define CONTIKIMAC_FRAMER_CONF_SHORTEST_PACKET_SIZE 43-18 //multicast RPL DIS length
/* Not tested much yet */
#define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
#define WITH_PHASE_OPTIMIZATION 0
#define CONTIKIMAC_CONF_COMPOWER 1
#define RIMESTATS_CONF_ENABLED 1
#if NETSTACK_CONF_WITH_IPV6
//#define NETSTACK_CONF_FRAMER framer802154
#else /* NETSTACK_CONF_WITH_IPV6 */
#define NETSTACK_CONF_FRAMER contikimac_framer
#endif /* NETSTACK_CONF_WITH_IPV6 */
#define NETSTACK_CONF_FRAMER framer_802154
#define NETSTACK_CONF_RADIO rf230_driver
/* The radio needs to interrupt during an rtimer interrupt */

View file

@ -277,7 +277,7 @@ uint8_t i;
PRINTA("Random EUI64 address generated\n");
}
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
memcpy(&uip_lladdr.addr, &addr.u8, sizeof(linkaddr_t));
#elif WITH_NODE_ID
node_id=get_panaddr_from_eeprom();
@ -293,7 +293,7 @@ uint8_t i;
rf230_set_channel(params_get_channel());
rf230_set_txpower(params_get_txpower());
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
PRINTA("EUI-64 MAC: %x-%x-%x-%x-%x-%x-%x-%x\n",addr.u8[0],addr.u8[1],addr.u8[2],addr.u8[3],addr.u8[4],addr.u8[5],addr.u8[6],addr.u8[7]);
#else
PRINTA("MAC address ");
@ -323,7 +323,9 @@ uint8_t i;
#endif /* ANNOUNCE_BOOT */
#if NETSTACK_CONF_WITH_IPV6 || NETSTACK_CONF_WITH_IPV4
process_start(&tcpip_process, NULL);
#endif
#ifdef RAVEN_LCD_INTERFACE
process_start(&raven_lcd_process, NULL);
@ -408,7 +410,7 @@ uint8_t i;
#endif
}
#if ROUTES && UIP_CONF_IPV6
#if ROUTES && NETSTACK_CONF_WITH_IPV6
static void
ipaddr_add(const uip_ipaddr_t *addr)
{
@ -436,9 +438,9 @@ ipaddr_add(const uip_ipaddr_t *addr)
int
main(void)
{
#if UIP_CONF_IPV6
#if NETSTACK_CONF_WITH_IPV6
uip_ds6_nbr_t *nbr;
#endif /* UIP_CONF_IPV6 */
#endif /* NETSTACK_CONF_WITH_IPV6 */
initialize();
while(1) {
@ -525,7 +527,7 @@ extern volatile unsigned long radioontime;
clocktime+=1;
#endif
#if PINGS && UIP_CONF_IPV6
#if PINGS && NETSTACK_CONF_WITH_IPV6
extern void raven_ping6(void);
if ((clocktime%PINGS)==1) {
PRINTF("**Ping\n");
@ -533,7 +535,7 @@ if ((clocktime%PINGS)==1) {
}
#endif
#if ROUTES && UIP_CONF_IPV6
#if ROUTES && NETSTACK_CONF_WITH_IPV6
if ((clocktime%ROUTES)==2) {
extern uip_ds6_netif_t uip_ds6_if;