diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-28 21:28:43 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-28 21:28:43 +0000 |
commit | 1b060ed713f398cafc8ddfd8d42b6c585812d6e1 (patch) | |
tree | a675633ad619c8a464c45dacb3305ff02ef169c9 /nuttx/examples/uip/main.c | |
parent | 55849f9eccefbfa62dcdf5891e571c335de15736 (diff) | |
download | nuttx-1b060ed713f398cafc8ddfd8d42b6c585812d6e1.tar.gz nuttx-1b060ed713f398cafc8ddfd8d42b6c585812d6e1.tar.bz2 nuttx-1b060ed713f398cafc8ddfd8d42b6c585812d6e1.zip |
Remove all options from examples/uip except for the webserver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1661 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/uip/main.c')
-rw-r--r-- | nuttx/examples/uip/main.c | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/nuttx/examples/uip/main.c b/nuttx/examples/uip/main.c index 2719f5bf7..79b4daa08 100644 --- a/nuttx/examples/uip/main.c +++ b/nuttx/examples/uip/main.c @@ -62,22 +62,14 @@ /* DHCPC may be used in conjunction with any other feature (or not) */ -#if defined(CONFIG_EXAMPLE_UIP_DHCPC) +#ifdef CONFIG_EXAMPLE_UIP_DHCPC # include <net/uip/resolv.h> # include <net/uip/dhcpc.h> #endif -/* Pick the netutils feature under test (which may be DHCPC) */ +/* Include uIP webserver definitions */ -#if defined(CONFIG_EXAMPLE_UIP_SMTP) -# include <net/uip/smtp.h> -#elif defined(CONFIG_EXAMPLE_UIP_TELNETD) -# include <net/uip/telnetd.h> -#elif defined(CONFIG_EXAMPLE_UIP_WEBSERVER) -# include <net/uip/httpd.h> -#elif !defined(CONFIG_EXAMPLE_UIP_DHCPC) -# error "No network application specified" -#endif +#include <net/uip/httpd.h> /**************************************************************************** * Definitions @@ -101,14 +93,6 @@ * Private Data ****************************************************************************/ -#if defined(CONFIG_EXAMPLE_UIP_SMTP) -static const char g_host_name[] = "localhost"; -static const char g_recipient[] = "spudmonkey@racsa.co.cr"; -static const char g_sender[] = "nuttx-testing@example.com"; -static const char g_subject[] = "Testing SMTP from NuttX"; -static const char g_msg_body[] = "Test message sent by NuttX\r\n"; -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -136,7 +120,7 @@ int user_start(int argc, char *argv[]) #if defined(CONFIG_EXAMPLE_UIP_DHCPC) || defined(CONFIG_EXAMPLE_UIP_NOMAC) uint8 mac[IFHWADDRLEN]; #endif -#if defined(CONFIG_EXAMPLE_UIP_DHCPC) || defined(CONFIG_EXAMPLE_UIP_SMTP) +#ifdef CONFIG_EXAMPLE_UIP_DHCPC void *handle; #endif @@ -154,10 +138,10 @@ int user_start(int argc, char *argv[]) /* Set up our host address */ -#if !defined(CONFIG_EXAMPLE_UIP_DHCPC) - addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_IPADDR); -#else +#ifdef CONFIG_EXAMPLE_UIP_DHCPC addr.s_addr = 0; +#else + addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_IPADDR); #endif uip_sethostaddr("eth0", &addr); @@ -171,13 +155,11 @@ int user_start(int argc, char *argv[]) addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_NETMASK); uip_setnetmask("eth0", &addr); -#if defined(CONFIG_EXAMPLE_UIP_DHCPC) +#ifdef CONFIG_EXAMPLE_UIP_DHCPC /* Set up the resolver */ resolv_init(); -#endif -#if defined(CONFIG_EXAMPLE_UIP_DHCPC) /* Get the MAC address of the NIC */ uip_getmacaddr("eth0", mac); @@ -210,25 +192,9 @@ int user_start(int argc, char *argv[]) } #endif -#if defined(CONFIG_EXAMPLE_UIP_WEBSERVER) printf("Starting webserver\n"); httpd_init(); httpd_listen(); -#elif defined(CONFIG_EXAMPLE_UIP_TELNETD) - printf("Starting telnetd\n"); - telnetd_init(); -#elif defined(CONFIG_EXAMPLE_UIP_SMTP) - printf("Sending mail\n"); - uip_ipaddr(addr.s_addr, 127, 0, 0, 1); - handle = smtp_open(); - if (handle) - { - smtp_configure(handle, g_host_name, &addr.s_addr); - smtp_send(handle, g_recipient, NULL, g_sender, g_subject, - g_msg_body, strlen(g_msg_body)); - smtp_close(handle); - } -#endif while(1) { |