Tidy up webserver configuration (Native BR)

Previously, we were using the example's Makefile to configure whether we want a web server built into the BR. We had 3 options:

* No web server
* Internal web server
* External web server (from apps/)

The last option is no longer evailable. This commit removes support for this option and it also simplifies the situation: We now merely use a CPP macro to enable/disable the web server.
This commit is contained in:
George Oikonomou 2017-10-28 23:14:27 +01:00
parent 2efb34834f
commit a3c185132a
3 changed files with 9 additions and 23 deletions

View File

@ -4,17 +4,8 @@ MODULES += os/services/slip-cmd
CONTIKI=../.. CONTIKI=../..
PROJECT_SOURCEFILES += border-router-cmds.c tun-bridge.c border-router-mac.c \ PROJECT_SOURCEFILES += border-router-cmds.c tun-bridge.c httpd-simple.c
slip-config.c slip-dev.c PROJECT_SOURCEFILES += slip-config.c slip-dev.c border-router-mac.c
WITH_WEBSERVER=1
ifeq ($(WITH_WEBSERVER),1)
CFLAGS += -DWEBSERVER=1
PROJECT_SOURCEFILES += httpd-simple.c
else ifneq ($(WITH_WEBSERVER), 0)
MODULES += $(WITH_WEBSERVER)
CFLAGS += -DWEBSERVER=2
endif
MAKE_MAC = MAKE_MAC_OTHER MAKE_MAC = MAKE_MAC_OTHER
MAKE_NET = MAKE_NET_IPV6 MAKE_NET = MAKE_NET_IPV6

View File

@ -82,15 +82,7 @@ CMD_HANDLERS(border_router_cmd_handler);
PROCESS(border_router_process, "Border router process"); PROCESS(border_router_process, "Border router process");
#if WEBSERVER==0 #if BORDER_ROUTER_CONF_WEBSERVER
/* No webserver */
AUTOSTART_PROCESSES(&border_router_process,&border_router_cmd_process);
#elif WEBSERVER>1
/* Use an external webserver application */
#include "webserver-nogui.h"
AUTOSTART_PROCESSES(&border_router_process,&border_router_cmd_process,
&webserver_nogui_process);
#else
/* Use simple webserver with only one page */ /* Use simple webserver with only one page */
#include "httpd-simple.h" #include "httpd-simple.h"
PROCESS(webserver_nogui_process, "Web server"); PROCESS(webserver_nogui_process, "Web server");
@ -212,9 +204,10 @@ httpd_simple_get_script(const char *name)
{ {
return generate_routes; return generate_routes;
} }
#else /* BORDER_ROUTER_CONF_WEBSERVER */
#endif /* WEBSERVER */ /* No webserver */
AUTOSTART_PROCESSES(&border_router_process,&border_router_cmd_process);
#endif /* BORDER_ROUTER_CONF_WEBSERVER */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void
print_local_addresses(void) print_local_addresses(void)

View File

@ -30,6 +30,8 @@
#ifndef PROJECT_ROUTER_CONF_H_ #ifndef PROJECT_ROUTER_CONF_H_
#define PROJECT_ROUTER_CONF_H_ #define PROJECT_ROUTER_CONF_H_
#define BORDER_ROUTER_CONF_WEBSERVER 1
#define UIP_FALLBACK_INTERFACE rpl_interface #define UIP_FALLBACK_INTERFACE rpl_interface
/* use a non-default network driver */ /* use a non-default network driver */