diff --git a/examples/gnrc_networking/Makefile b/examples/gnrc_networking/Makefile index 555b89eee55e..f90e41a6f84b 100644 --- a/examples/gnrc_networking/Makefile +++ b/examples/gnrc_networking/Makefile @@ -7,17 +7,22 @@ BOARD ?= native # This has to be the absolute path to the RIOT base directory: RIOTBASE ?= $(CURDIR)/../.. +# By default this application will run as a host, i.e., not forward any +# packets. Setting this variable to 1 will change this behavior and let the +# node act as a router. +ROUTER ?= 0 # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present USEMODULE += netdev_default USEMODULE += auto_init_gnrc_netif # Activate ICMPv6 error messages USEMODULE += gnrc_icmpv6_error -# Specify the mandatory networking module for a IPv6 routing node +# Specify the mandatory networking module for a IPv6 in router or host node +ifeq (1,$(ROUTER)) USEMODULE += gnrc_ipv6_router_default -# Add a routing protocol -USEMODULE += gnrc_rpl -USEMODULE += auto_init_gnrc_rpl +else +USEMODULE += gnrc_ipv6_default +endif # Additional networking modules that can be dropped if not needed USEMODULE += gnrc_icmpv6_echo USEMODULE += shell_cmd_gnrc_udp @@ -27,7 +32,16 @@ USEMODULE += shell_cmds_default USEMODULE += ps USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 + +# Optionally include the RPL routing protocol (particular useful if not all +# nodes are within radio transmission range to the border router) +USE_RPL ?= 0 + +ifeq (1,$(USE_RPL)) +USEMODULE += gnrc_rpl +USEMODULE += auto_init_gnrc_rpl USEMODULE += netstats_rpl +endif # Optionally include DNS support. This includes resolution of names at an # upstream DNS server and the handling of RDNSS options in Router Advertisements