Rename apps/examples/uip to apps/examples/webserver

This commit is contained in:
Gregory Nutt 2014-07-03 17:31:17 -06:00
parent 14297d4e30
commit 36575ad0f4
21 changed files with 84 additions and 84 deletions

View File

@ -65,7 +65,7 @@ source "$APPSDIR/examples/tiff/Kconfig"
source "$APPSDIR/examples/touchscreen/Kconfig"
source "$APPSDIR/examples/udp/Kconfig"
source "$APPSDIR/examples/discover/Kconfig"
source "$APPSDIR/examples/uip/Kconfig"
source "$APPSDIR/examples/webserver/Kconfig"
source "$APPSDIR/examples/usbserial/Kconfig"
source "$APPSDIR/examples/usbterm/Kconfig"
source "$APPSDIR/examples/watchdog/Kconfig"

View File

@ -282,8 +282,8 @@ ifeq ($(CONFIG_EXAMPLES_UDP),y)
CONFIGURED_APPS += examples/udp
endif
ifeq ($(CONFIG_EXAMPLES_UIP),y)
CONFIGURED_APPS += examples/uip
ifeq ($(CONFIG_EXAMPLES_WEBSERVER),y)
CONFIGURED_APPS += examples/webserver
endif
ifeq ($(CONFIG_EXAMPLES_USBSERIAL),y)

View File

@ -44,7 +44,7 @@ SUBDIRS += nrf24l01_term nsh null nx nxconsole nxffs nxflat nxhello nximage
SUBDIRS += nxlines nxtext ostest pashello pipe poll posix_spawn pwm qencoder
SUBDIRS += random relays rgmp romfs sendmail serialblaster serloop serialrx
SUBDIRS += slcd smart smart_test tcpecho telnetd thttpd tiff touchscreen udp
SUBDIRS += uip usbserial usbterm watchdog wget wgetjson xmlrpc
SUBDIRS += usbserial usbterm watchdog webserver wget wgetjson xmlrpc
# Sub-directories that might need context setup. Directories may need
# context setup for a variety of reasons, but the most common is because

View File

@ -182,7 +182,7 @@ examples/dhcpd
(as well as various other UDP-related
configuration settings)
CONFIG_NET_BROADCAST=y - UDP broadcast support is needed.
CONFIG_NETUTILS_NETLIB=y - The UIP library is needed
CONFIG_NETUTILS_NETLIB=y - The networking library is needed
CONFIG_EXAMPLES_DHCPD_NOMAC - (May be defined to use software assigned MAC)
CONFIG_EXAMPLES_DHCPD_IPADDR - Target IP address
@ -490,7 +490,7 @@ examples/igmp
* CONFIG_EXAMPLES_IGMP_GRPADDR
Multicast group address
* CONFIG_EXAMPLES_NETLIB
The UIP library is needed
The networking library is needed
examples/adc
^^^^^^^^^^^^
@ -670,7 +670,7 @@ examples/nettest
functionality in a TCP/IP connection.
CONFIG_EXAMPLES_NETTEST=y - Enables the nettest example
CONFIG_EXAMPLES_NETLIB=y - The UIP livrary in needed.
CONFIG_EXAMPLES_NETLIB=y - The networking library in needed.
See also examples/tcpecho
@ -1218,7 +1218,7 @@ examples/poll
If networking is enabled, applications using this example will need to
provide the following definition in the defconfig file to enable the
UIP library:
networking library:
CONFIG_NETUTILS_NETLIB=y
@ -1670,52 +1670,6 @@ examples/udp
CONFIG_NETUTILS_NETLIB=y
examples/uip
^^^^^^^^^^^^
This is a port of uIP tiny webserver example application. Settings
specific to this example include:
CONFIG_EXAMPLES_UIP_NOMAC - (May be defined to use software assigned MAC)
CONFIG_EXAMPLES_UIP_IPADDR - Target IP address
CONFIG_EXAMPLES_UIP_DRIPADDR - Default router IP addess
CONFIG_EXAMPLES_UIP_NETMASK - Network mask
CONFIG_EXAMPLES_UIP_DHCPC - Select to get IP address via DHCP
If you use DHCPC, then some special configuration network options are
required. These include:
CONFIG_NET=y - Of course
CONFIG_NSOCKET_DESCRIPTORS - And, of course, you must allocate some
socket descriptors.
CONFIG_NET_UDP=y - UDP support is required for DHCP
(as well as various other UDP-related
configuration settings).
CONFIG_NET_BROADCAST=y - UDP broadcast support is needed.
CONFIG_NET_BUFSIZE=650 - Per RFC2131 (p. 9), the DHCP client must be
(or larger) prepared to receive DHCP messages of up to
576 bytes (excluding Ethernet, IP, or UDP
headers and FCS).
Other configuration items apply also to the selected webserver net utility.
Additional relevant settings for the uIP webserver net utility are:
CONFIG_NETUTILS_HTTPDSTACKSIZE
CONFIG_NETUTILS_HTTPDFILESTATS
CONFIG_NETUTILS_HTTPDNETSTATS
Applications using this example will need to enable the following
netutils libraries in their defconfig file:
CONFIG_NETUTILS_NETLIB=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_DNSCLIENT=y
CONFIG_NETUTILS_WEBSERVER=y
NOTE: This example does depend on the perl script at
nuttx/tools/mkfsdata.pl. You must have perl installed on your
development system at /usr/bin/perl.
examples/usbserial
^^^^^^^^^^^^^^^^^^
@ -1894,6 +1848,52 @@ examples/watchdog
milliseconds before the watchdog timer expires. Default: 2000
milliseconds.
examples/webserver
^^^^^^^^^^^^^^^^^^
This is a port of uIP tiny webserver example application. Settings
specific to this example include:
CONFIG_EXAMPLES_WEBSERVER_NOMAC - (May be defined to use software assigned MAC)
CONFIG_EXAMPLES_WEBSERVER_IPADDR - Target IP address
CONFIG_EXAMPLES_WEBSERVER_DRIPADDR - Default router IP addess
CONFIG_EXAMPLES_WEBSERVER_NETMASK - Network mask
CONFIG_EXAMPLES_WEBSERVER_DHCPC - Select to get IP address via DHCP
If you use DHCPC, then some special configuration network options are
required. These include:
CONFIG_NET=y - Of course
CONFIG_NSOCKET_DESCRIPTORS - And, of course, you must allocate some
socket descriptors.
CONFIG_NET_UDP=y - UDP support is required for DHCP
(as well as various other UDP-related
configuration settings).
CONFIG_NET_BROADCAST=y - UDP broadcast support is needed.
CONFIG_NET_BUFSIZE=650 - Per RFC2131 (p. 9), the DHCP client must be
(or larger) prepared to receive DHCP messages of up to
576 bytes (excluding Ethernet, IP, or UDP
headers and FCS).
Other configuration items apply also to the selected webserver net utility.
Additional relevant settings for the uIP webserver net utility are:
CONFIG_NETUTILS_HTTPDSTACKSIZE
CONFIG_NETUTILS_HTTPDFILESTATS
CONFIG_NETUTILS_HTTPDNETSTATS
Applications using this example will need to enable the following
netutils libraries in their defconfig file:
CONFIG_NETUTILS_NETLIB=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_DNSCLIENT=y
CONFIG_NETUTILS_WEBSERVER=y
NOTE: This example does depend on the perl script at
nuttx/tools/mkfsdata.pl. You must have perl installed on your
development system at /usr/bin/perl.
examples/wget
^^^^^^^^^^^^^

View File

@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __EXAMPLES_UIP_INTERNAL_H
#define __EXAMPLES_UIP_INTERNAL_H
#ifndef __EXAMPLES_UDP_INTERNAL_H
#define __EXAMPLES_UDP_INTERNAL_H
/****************************************************************************
* Included Files
@ -87,4 +87,4 @@
extern void send_client(void);
extern void recv_server(void);
#endif /* __EXAMPLES_UIP_INTERNAL_H */
#endif /* __EXAMPLES_UDP_INTERNAL_H */

View File

@ -3,33 +3,33 @@
# see misc/tools/kconfig-language.txt.
#
config EXAMPLES_UIP
config EXAMPLES_WEBSERVER
bool "uIP web server example"
default n
---help---
Enable the uIP web server example
if EXAMPLES_UIP
if EXAMPLES_WEBSERVER
config EXAMPLES_UIP_IPADDR
config EXAMPLES_WEBSERVER_IPADDR
hex "Device IP"
default 0x0a000002
---help---
This is the IP address of your board.
config EXAMPLES_UIP_DRIPADDR
config EXAMPLES_WEBSERVER_DRIPADDR
hex "Default Router IP"
default 0x0a000001
---help---
This is the IP address of your router/gateway.
config EXAMPLES_UIP_NETMASK
config EXAMPLES_WEBSERVER_NETMASK
hex "Network Mask"
default 0xffffff00
---help---
This is the network mask to use on this device.
config EXAMPLES_UIP_NOMAC
config EXAMPLES_WEBSERVER_NOMAC
bool "No hardware MAC"
default y
---help---

View File

@ -1,5 +1,5 @@
############################################################################
# apps/examples/uip/Makefile
# apps/examples/webserver/Makefile
#
# Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@ -40,7 +40,7 @@ include $(APPDIR)/Make.defs
# uIP very tiny web server example
ASRCS =
CSRCS = uip_main.c cgi.c httpd_fsdata.c
CSRCS = webserver_main.c cgi.c httpd_fsdata.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/examples/uip/cgi.c
* apps/examples/webserver/cgi.c
* Web server script interface
* Author: Adam Dunkels <adam@sics.se>
*

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/examples/uip/cgi.c
* apps/examples/webserver/cgi.h
* Web server script interface header file
* Author: Adam Dunkels <adam@sics.se>
*
@ -31,8 +31,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef __HTTPD_CGI_H__
#define __HTTPD_CGI_H__
#ifndef __EXAMPLES_WEBSERVER_CGI_H
#define __EXAMPLES_WEBSERVER_CGI_H
/****************************************************************************
* Public Function Prototypes
@ -40,4 +40,4 @@
void cgi_register(void);
#endif /* __HTTPD_CGI_H__ */
#endif /* __EXAMPLES_WEBSERVER_CGI_H */

View File

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 196 B

View File

@ -1,5 +1,5 @@
/****************************************************************************
* examples/uip/uip_main.c
* examples/webserver/webserver_main.c
*
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -59,7 +59,7 @@
#include <apps/netutils/netlib.h>
#ifdef CONFIG_EXAMPLES_UIP_DHCPC
#ifdef CONFIG_EXAMPLES_WEBSERVER_DHCPC
#include <arpa/inet.h>
#endif
@ -69,7 +69,7 @@
/* DHCPC may be used in conjunction with any other feature (or not) */
#ifdef CONFIG_EXAMPLES_UIP_DHCPC
#ifdef CONFIG_EXAMPLES_WEBSERVER_DHCPC
# include <apps/netutils/dnsclient.h>
# include <apps/netutils/dhcpc.h>
#endif
@ -107,22 +107,22 @@
****************************************************************************/
/****************************************************************************
* uip_main
* webserver_main
****************************************************************************/
int uip_main(int argc, char *argv[])
int webserver_main(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLES_UIP_DHCPC) || defined(CONFIG_EXAMPLES_UIP_NOMAC)
#if defined(CONFIG_EXAMPLES_WEBSERVER_DHCPC) || defined(CONFIG_EXAMPLES_WEBSERVER_NOMAC)
uint8_t mac[IFHWADDRLEN];
#endif
#ifdef CONFIG_EXAMPLES_UIP_DHCPC
#ifdef CONFIG_EXAMPLES_WEBSERVER_DHCPC
void *handle;
#endif
/* Many embedded network interfaces must have a software assigned MAC */
#ifdef CONFIG_EXAMPLES_UIP_NOMAC
#ifdef CONFIG_EXAMPLES_WEBSERVER_NOMAC
mac[0] = 0x00;
mac[1] = 0xe0;
mac[2] = 0xde;
@ -134,24 +134,24 @@ int uip_main(int argc, char *argv[])
/* Set up our host address */
#ifdef CONFIG_EXAMPLES_UIP_DHCPC
#ifdef CONFIG_EXAMPLES_WEBSERVER_DHCPC
addr.s_addr = 0;
#else
addr.s_addr = HTONL(CONFIG_EXAMPLES_UIP_IPADDR);
addr.s_addr = HTONL(CONFIG_EXAMPLES_WEBSERVER_IPADDR);
#endif
netlib_sethostaddr("eth0", &addr);
/* Set up the default router address */
addr.s_addr = HTONL(CONFIG_EXAMPLES_UIP_DRIPADDR);
addr.s_addr = HTONL(CONFIG_EXAMPLES_WEBSERVER_DRIPADDR);
netlib_setdraddr("eth0", &addr);
/* Setup the subnet mask */
addr.s_addr = HTONL(CONFIG_EXAMPLES_UIP_NETMASK);
addr.s_addr = HTONL(CONFIG_EXAMPLES_WEBSERVER_NETMASK);
netlib_setnetmask("eth0", &addr);
#ifdef CONFIG_EXAMPLES_UIP_DHCPC
#ifdef CONFIG_EXAMPLES_WEBSERVER_DHCPC
/* Set up the resolver */
dns_bind();
@ -205,7 +205,7 @@ int uip_main(int argc, char *argv[])
while (1)
{
sleep(3);
printf("uip_main: Still running\n");
printf("webserver_main: Still running\n");
#if CONFIG_NFILE_DESCRIPTORS > 0
fflush(stdout);
#endif