Homogenize NET layer config with MAC

This commit is contained in:
Simon Duquennoy 2017-09-08 21:10:37 +02:00
parent 1a8f04effc
commit 0aa44c3c22
50 changed files with 55 additions and 90 deletions

View File

@ -105,22 +105,28 @@ endif
# Configure IPv6, RPL
HAS_STACK = 0
MAKE_NET_NULLNET = 0
MAKE_NET_IPV6 = 1
MAKE_NET_OTHER = 2
# Make IPv6 the default stack
ifeq ($(HAS_STACK),0)
ifneq ($(CONTIKI_WITH_IPV6),0)
CONTIKI_WITH_IPV6 = 1
endif
MAKE_NET ?= MAKE_NET_IPV6
ifeq ($(MAKE_NET),MAKE_NET_NULLNET)
CFLAGS += -DNETSTACK_CONF_WITH_NULLNET=1
endif
ifeq ($(CONTIKI_WITH_IPV6),1)
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
CONTIKI_WITH_RPL ?= 1
CONTIKI_WITH_RPL_LITE ?= 1
MODULES += os/net/ipv6 os/net/ip
endif
ifeq ($(MAKE_NET),MAKE_NET_OTHER)
CFLAGS += -DNETSTACK_CONF_WITH_OTHER=1
endif
ifeq ($(CONTIKI_WITH_RPL),1)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
ifeq ($(CONTIKI_WITH_RPL_LITE),1)

View File

@ -51,9 +51,9 @@ endif
### Banking Guesswork:
### Generic examples do not specify banking.
### We automatically turn it on if its unspecified and if we are building with
### CONTIKI_WITH_IPV6
### MAKE_NET_IPV6
ifndef HAVE_BANKING
ifeq ($(CONTIKI_WITH_IPV6),1)
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
HAVE_BANKING=1
else
HAVE_BANKING=0

View File

@ -11,7 +11,7 @@ ifeq ($(NRF52_JLINK_PATH),)
endif
endif
ifneq ($(CONTIKI_WITH_IPV6),1)
ifneq ($(MAKE_NET),MAKE_NET_IPV6)
$(error Only IPv6 stack is supported!)
endif

View File

@ -80,16 +80,27 @@ CFLAGS += $(CFLAGSNO)
MODULES += os/net os/net/mac os/net/mac/framer os/net/ip64-addr
## Copied from Makefile.include, since Cooja overrides CFLAGS et al
HAS_STACK = 0
MAKE_NET_NULLNET = 0
MAKE_NET_IPV6 = 1
# Make IPv6 the default stack
ifeq ($(HAS_STACK),0)
CONTIKI_WITH_IPV6 = 1
MAKE_NET ?= MAKE_NET_IPV6
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
CONTIKI_WITH_RPL ?= 1
CONTIKI_WITH_RPL_LITE ?= 1
MODULES += os/net/ipv6 os/net/ip
endif
ifeq ($(CONTIKI_WITH_IPV6),1)
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
ifneq ($(CONTIKI_WITH_RPL),0)
ifeq ($(CONTIKI_WITH_RPL),1)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
endif
ifeq ($(CONTIKI_WITH_RPL_LITE),1)
CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1
MODULES += os/net/rpl-lite
else
MODULES += os/net/rpl
endif
else
CFLAGS += -DUIP_CONF_IPV6_RPL=0
endif

View File

@ -19,7 +19,7 @@ TARGET_LIBFILES = /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a
else
CONTIKI_TARGET_SOURCEFILES += tapdev-drv.c linuxradio-drv.c
#math
ifneq ($(CONTIKI_WITH_IPV6),1)
ifneq ($(MAKE_NET),MAKE_NET_IPV6)
CONTIKI_TARGET_SOURCEFILES += tapdev.c
else
CONTIKI_TARGET_SOURCEFILES += tapdev6.c

View File

@ -289,7 +289,7 @@ main(int argc, char **argv)
NETSTACK_NETWORK.init();
PRINTF("%s, radio channel %u\n",
NETSTACK_MAC.name CC2420_CONF_CHANNEL);
NETSTACK_MAC.name, CC2420_CONF_CHANNEL);
#endif /* NETSTACK_CONF_WITH_IPV6 */
#if !NETSTACK_CONF_WITH_IPV6

View File

@ -2,7 +2,6 @@ all: http-example
CONTIKI=../..
MODULES += os/net/app-layer/http-socket
CONTIKI_WITH_IPV6 = 1
CONTIKI_WITH_RPL_LITE = 0
CFLAGS += -DUIP_CONF_TCP=1
include $(CONTIKI)/Makefile.include

View File

@ -1,7 +1,5 @@
all: ip64-router
CONTIKI=../..
CONTIKI_WITH_IPV6 = 1
CONTIKI_WITH_RPL_LITE = 0
CFLAGS += -DUIP_CONF_TCP=1
include $(CONTIKI)/Makefile.include

View File

@ -11,7 +11,6 @@ MODULES += os/services/lwm2m
MODULES += os/services/ipso-objects
CONTIKI=../..
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
# border router rules

View File

@ -27,7 +27,6 @@ MODULES += os/net/app-layer/coap
#CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
#CUSTOM_RULE_S_TO_OBJECTDIR_O = 1
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
# optional rules to get assembly

View File

@ -23,5 +23,4 @@ ifneq ($(TARGET),)
all: websense-$(TARGET)
endif
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -7,6 +7,5 @@ CONTIKI = ../../..
MODULES += os/net/ipv6/multicast
CONTIKI_WITH_IPV6 = 1
CONTIKI_WITH_RPL_LITE = 1
include $(CONTIKI)/Makefile.include

View File

@ -19,8 +19,6 @@ endif
# Custom MAC layer (border_router_mac_driver)
MAKE_MAC = MAKE_MAC_OTHER
# Configure Network stack
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
connect-router: border-router.native

View File

@ -30,7 +30,6 @@ ifeq ($(PREFIX),)
PREFIX = fd00::1/64
endif
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c

View File

@ -6,6 +6,4 @@ CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
# Set MAKE_MAC = MAKE_MAC_TSCH to run TSCH instead
MAKE_MAC = MAKE_MAC_CSMA
CONTIKI_WITH_IPV6 = 1
CONTIKI_WITH_RPL_LITE = 1
include $(CONTIKI)/Makefile.include

View File

@ -4,7 +4,6 @@ all: $(CONTIKI_PROJECT)
CONTIKI=../../..
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
CONTIKI_WITH_IPV6 = 1
MAKE_WITH_ORCHESTRA ?= 0 # force Orchestra from command line
MAKE_WITH_SECURITY ?= 0 # force Security from command line
MAKE_WITH_PERIODIC_ROUTES_PRINT ?= 0 # print #routes periodically, used for regression tests

View File

@ -8,5 +8,4 @@ ifdef PERIOD
CFLAGS+=-DPERIOD=$(PERIOD)
endif
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -17,6 +17,9 @@ ifeq ($(TARGET),nooliberry)
PROJECT_SOURCEFILES += slip-radio-rf230.c
endif
# custom net layer, but with IPv6 enabled
MAKE_NET = MAKE_NET_OTHER
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
CONTIKI_WITH_RPL = 0
CONTIKI_WITH_IPV6 = 1
MODULES += os/net/ipv6 os/net/ip
include $(CONTIKI)/Makefile.include

View File

@ -52,9 +52,9 @@
#define CMD_CONF_HANDLERS slip_radio_cmd_handler
#endif
/* configuration for the slipradio/network driver */
#undef NETSTACK_CONF_NETWORK
#define NETSTACK_CONF_NETWORK slipnet_driver
/* Configuration for the slipradio/network driver. Selected through the Makefile,
with MAKE_NET = MAKE_NET_OTHER */
#define NETSTACK_CONF_OTHER_NETWORK slipnet_driver
#undef NETSTACK_CONF_FRAMER
#define NETSTACK_CONF_FRAMER no_framer

View File

@ -1,6 +1,5 @@
all: udp-server udp-client
CONTIKI = ../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DUIP_CONF_ND6_SEND_NS=1
include $(CONTIKI)/Makefile.include

View File

@ -2,7 +2,6 @@ DEFINES+=PROJECT_CONF_H=\"project-conf.h\"
all: mqtt-demo
CONTIKI_WITH_IPV6 = 1
MODULES += os/net/app-layer/mqtt

View File

@ -3,6 +3,5 @@ CONTIKI_PROJECT = udp-echo-server
all: $(CONTIKI_PROJECT)
CONTIKI = ../../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DUIP_CONF_ND6_SEND_NS=1
include $(CONTIKI)/Makefile.include

View File

@ -3,7 +3,5 @@ CONTIKI_PROJECT = cc26xx-demo
all: $(CONTIKI_PROJECT)
CONTIKI_WITH_IPV6 = 1
CONTIKI = ../../..
include $(CONTIKI)/Makefile.include

View File

@ -13,8 +13,6 @@ PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
PROJECT_SOURCEFILES += cetic-6lbr-client.c coap-server.c net-uart.c mqtt-client.c
PROJECT_SOURCEFILES += httpd-simple.c
CONTIKI_WITH_IPV6 = 1
# REST Engine shall use Erbium CoAP implementation
MODULES += os/net/app-layer/mqtt
MODULES += os/net/app-layer/coap

View File

@ -3,8 +3,6 @@ CONTIKI_PROJECT = very-sleepy-demo
all: $(CONTIKI_PROJECT)
CONTIKI_WITH_IPV6 = 1
MODULES += os/net/app-layer/coap
CONTIKI = ../../../..

View File

@ -5,8 +5,6 @@ TARGET ?= jn516x
CONTIKI=../../../../..
CONTIKI_WITH_IPV6 = 1
MAKE_MAC = MAKE_MAC_TSCH
PROJECTDIRS += .. ../tools
PROJECT_SOURCEFILES += rpl-tools.c

View File

@ -6,8 +6,6 @@ JN516x_WITH_DONGLE = 1
CONTIKI=../../../../..
CONTIKI_WITH_IPV6 = 1
MAKE_MAC = MAKE_MAC_TSCH
MODULES += os/lib/json
PROJECTDIRS += .. ../tools

View File

@ -6,8 +6,6 @@ JN516x_WITH_DR1175 = 1
CONTIKI=../../../../..
CONTIKI_WITH_IPV6 = 1
MAKE_MAC = MAKE_MAC_TSCH
MODULES += os/lib/json
PROJECTDIRS += .. ../tools

View File

@ -6,8 +6,6 @@ JN516x_WITH_DR1199 = 1
CONTIKI=../../../../..
CONTIKI_WITH_IPV6 = 1
MAKE_MAC = MAKE_MAC_TSCH
MODULES += os/lib/json
PROJECTDIRS += .. ../tools

View File

@ -5,8 +5,6 @@ TARGET ?= jn516x
CONTIKI=../../../../..
CONTIKI_WITH_IPV6 = 1
MAKE_MAC = MAKE_MAC_TSCH
PROJECTDIRS += .. ../tools
PROJECT_SOURCEFILES += rpl-tools.c

View File

@ -5,8 +5,6 @@ JN516x_WITH_DONGLE = 1
CONTIKI=../../../../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECTDIRS += .. ../../tools
PROJECT_SOURCEFILES += rpl-tools.c

View File

@ -4,8 +4,6 @@ TARGET ?= jn516x
JN516x_WITH_DONGLE = 1
CONTIKI=../../../../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += slip-bridge.c slip.c

View File

@ -4,7 +4,6 @@ TARGET ?= jn516x
JN516x_WITH_DONGLE = 1
CONTIKI=../../../../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECTDIRS += .. ../../tools

View File

@ -5,8 +5,6 @@ JN516x_WITH_DONGLE = 1
CONTIKI=../../../../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += slip-bridge.c slip.c

View File

@ -5,7 +5,6 @@ JN516x_WITH_DR1174 = 1
TARGET_WITH_UART1 = 1
CONTIKI=../../../../..
CONTIKI_WITH_IPV6 = 1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECTDIRS += .. ../tools

View File

@ -2,7 +2,6 @@ DEFINES+=PROJECT_CONF_H=\"project-conf.h\"
all: mqtt-demo
CONTIKI_WITH_IPV6 = 1
CONTIKI_WITH_RPL = 0
MODULES += os/net/app-layer/mqtt

View File

@ -7,10 +7,8 @@ BOARD = orion
CONTIKI = ../../../../..
WITH_IP64 = 1
CONTIKI_WITH_IPV6 = 1
DEFINES += UIP_CONF_TCP=1
PROJECT_SOURCEFILES += httpd-simple.c
include $(CONTIKI)/Makefile.include

View File

@ -4,5 +4,4 @@ all: $(CONTIKI_PROJECT)
CONTIKI = ../..
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -54,12 +54,6 @@
/* #define NETSTACK_CONF_FRAMER framer_802154 */
#endif /* NETSTACK_CONF_FRAMER */
/* NETSTACK_CONF_NETWORK specifies the network layer and can be either
sicslowpan_driver, for IPv6 networking. */
#ifndef NETSTACK_CONF_NETWORK
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#endif /* NETSTACK_CONF_NETWORK */
/*---------------------------------------------------------------------------*/
/* Packet buffer size options.
*

View File

@ -43,13 +43,17 @@
#include "contiki.h"
#ifndef NETSTACK_NETWORK
#ifdef NETSTACK_CONF_NETWORK
#define NETSTACK_NETWORK NETSTACK_CONF_NETWORK
#else /* NETSTACK_CONF_NETWORK */
/* Network layer configuration. The NET layer is configured through the Makefile,
via the flag MAC_NET */
#if NETSTACK_CONF_WITH_IPV6
#define NETSTACK_NETWORK sicslowpan_driver
#endif /* NETSTACK_CONF_NETWORK */
#endif /* NETSTACK_NETWORK */
#elif NETSTACK_CONF_WITH_NULLNET
#error Nullnet layer not implemented yet
#elif NETSTACK_CONF_WITH_OTHER
#define NETSTACK_NETWORK NETSTACK_CONF_OTHER_NETWORK
#else
#error Unknown NET configuration
#endif
/* MAC layer configuration. The MAC layer is configured through the Makefile,
via the flag MAKE_MAC */
@ -61,6 +65,8 @@
#define NETSTACK_MAC tschmac_driver
#elif MAC_CONF_WITH_OTHER
#define NETSTACK_MAC NETSTACK_CONF_OTHER_MAC
#else
#error Unknown MAC configuration
#endif
#ifndef NETSTACK_RADIO

View File

@ -48,11 +48,10 @@
*
*/
#if NETSTACK_CONF_WITH_IPV6
#include "sys/log.h"
#include "net/ip/ip64-addr.h"
#if NETSTACK_CONF_WITH_IPV6
int curr_log_level_rpl = LOG_CONF_LEVEL_RPL;
int curr_log_level_tcpip = LOG_CONF_LEVEL_TCPIP;

View File

@ -4,5 +4,4 @@ CFLAGS += -D PROJECT_CONF_H=\"project-conf.h\"
MODULES += os/services/unit-test
CONTIKI = ../../..
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -1,5 +1,4 @@
all: wait-dag
CONTIKI=../../..
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -2,5 +2,4 @@ CONTIKI=../../../..
CFLAGS+= -DPROJECT_CONF_H=\"project-conf.h\"
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -2,5 +2,4 @@ CONTIKI=../../../..
CFLAGS+= -DPROJECT_CONF_H=\"project-conf.h\"
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -7,5 +7,4 @@ MODULES += os/net/mac/tsch/sixtop os/services/unit-test
PROJECT_SOURCEFILES += common.c
CONTIKI = ../../..
MAKE_MAC = MAKE_MAC_TSCH
include $(CONTIKI)/Makefile.include

View File

@ -15,5 +15,4 @@ CFLAGS += -D WITH_ALL_ENABLED=1
endif
CONTIKI = ../../..
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -3,5 +3,4 @@ CONTIKI=../../..
CFLAGS+=-DPROJECT_CONF_H=\"project-conf.h\"
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include

View File

@ -3,6 +3,5 @@ CONTIKI=../../..
CFLAGS+=-DPROJECT_CONF_H=\"project-conf.h\"
CONTIKI_WITH_IPV6 = 1
CONTIKI_WITH_RPL_LITE = 0
include $(CONTIKI)/Makefile.include

View File

@ -21,7 +21,6 @@ upload: uip6-bridge-tap.ihex
cp $< $(IHEXFILE)
$(MAKE) sky-u.$(subst /,-,$(word $(MOTE), $(MOTES)))
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
../../tapslip6: ../../tapslip6.c