From 91d77b455375c2cb410ae981646f398de40175fc Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 Mar 2011 16:54:35 +0000 Subject: Move netutils header files from include/net/uip to include/apps/netutils git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3399 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/examples/dhcpd/target.c | 7 +- nuttx/examples/igmp/igmp.c | 6 +- nuttx/examples/nettest/nettest.c | 4 +- nuttx/examples/poll/net_listener.c | 4 +- nuttx/examples/poll/net_reader.c | 4 +- nuttx/examples/sendmail/host.c | 4 +- nuttx/examples/sendmail/target.c | 6 +- nuttx/examples/thttpd/main.c | 7 +- nuttx/examples/udp/target.c | 6 +- nuttx/examples/uip/main.c | 12 +-- nuttx/examples/wget/Makefile.host | 14 +-- nuttx/examples/wget/host.c | 3 +- nuttx/examples/wget/target.c | 9 +- nuttx/include/apps/netutils/dhcpc.h | 85 ++++++++++++++++++ nuttx/include/apps/netutils/dhcpd.h | 71 +++++++++++++++ nuttx/include/apps/netutils/httpd.h | 54 +++++++++++ nuttx/include/apps/netutils/ipmsfilter.h | 101 +++++++++++++++++++++ nuttx/include/apps/netutils/resolv.h | 65 ++++++++++++++ nuttx/include/apps/netutils/smtp.h | 66 ++++++++++++++ nuttx/include/apps/netutils/telnetd.h | 70 +++++++++++++++ nuttx/include/apps/netutils/tftp.h | 73 +++++++++++++++ nuttx/include/apps/netutils/thttpd.h | 101 +++++++++++++++++++++ nuttx/include/apps/netutils/uiplib.h | 129 ++++++++++++++++++++++++++ nuttx/include/apps/netutils/webclient.h | 149 +++++++++++++++++++++++++++++++ nuttx/include/net/uip/dhcpc.h | 85 ------------------ nuttx/include/net/uip/dhcpd.h | 71 --------------- nuttx/include/net/uip/httpd.h | 54 ----------- nuttx/include/net/uip/ipmsfilter.h | 101 --------------------- nuttx/include/net/uip/resolv.h | 65 -------------- nuttx/include/net/uip/smtp.h | 66 -------------- nuttx/include/net/uip/telnetd.h | 70 --------------- nuttx/include/net/uip/tftp.h | 73 --------------- nuttx/include/net/uip/thttpd.h | 101 --------------------- nuttx/include/net/uip/uip-lib.h | 129 -------------------------- nuttx/include/net/uip/webclient.h | 149 ------------------------------- nuttx/netutils/dhcpc/dhcpc.c | 6 +- nuttx/netutils/dhcpd/dhcpd.c | 12 +-- nuttx/netutils/resolv/resolv.c | 2 +- nuttx/netutils/smtp/smtp.c | 6 +- nuttx/netutils/telnetd/telnetd.c | 6 +- nuttx/netutils/tftpc/tftpc_get.c | 4 +- nuttx/netutils/tftpc/tftpc_packets.c | 4 +- nuttx/netutils/tftpc/tftpc_put.c | 4 +- nuttx/netutils/thttpd/libhttpd.c | 4 +- nuttx/netutils/thttpd/thttpd.c | 4 +- nuttx/netutils/thttpd/thttpd_cgi.c | 4 +- nuttx/netutils/uiplib/uip_gethostaddr.c | 4 +- nuttx/netutils/uiplib/uip_getmacaddr.c | 4 +- nuttx/netutils/uiplib/uip_ipmsfilter.c | 6 +- nuttx/netutils/uiplib/uip_parsehttpurl.c | 6 +- nuttx/netutils/uiplib/uip_server.c | 4 +- nuttx/netutils/uiplib/uip_setdraddr.c | 4 +- nuttx/netutils/uiplib/uip_sethostaddr.c | 4 +- nuttx/netutils/uiplib/uip_setmacaddr.c | 4 +- nuttx/netutils/uiplib/uip_setnetmask.c | 4 +- nuttx/netutils/uiplib/uiplib.c | 9 +- nuttx/netutils/webclient/webclient.c | 8 +- nuttx/netutils/webserver/httpd.c | 6 +- nuttx/netutils/webserver/httpd_cgi.c | 2 +- nuttx/netutils/webserver/httpd_cgi.h | 2 +- nuttx/netutils/webserver/httpd_fs.c | 4 +- 61 files changed, 1077 insertions(+), 1064 deletions(-) create mode 100644 nuttx/include/apps/netutils/dhcpc.h create mode 100644 nuttx/include/apps/netutils/dhcpd.h create mode 100644 nuttx/include/apps/netutils/httpd.h create mode 100755 nuttx/include/apps/netutils/ipmsfilter.h create mode 100644 nuttx/include/apps/netutils/resolv.h create mode 100644 nuttx/include/apps/netutils/smtp.h create mode 100644 nuttx/include/apps/netutils/telnetd.h create mode 100644 nuttx/include/apps/netutils/tftp.h create mode 100644 nuttx/include/apps/netutils/thttpd.h create mode 100644 nuttx/include/apps/netutils/uiplib.h create mode 100644 nuttx/include/apps/netutils/webclient.h delete mode 100644 nuttx/include/net/uip/dhcpc.h delete mode 100644 nuttx/include/net/uip/dhcpd.h delete mode 100644 nuttx/include/net/uip/httpd.h delete mode 100755 nuttx/include/net/uip/ipmsfilter.h delete mode 100644 nuttx/include/net/uip/resolv.h delete mode 100644 nuttx/include/net/uip/smtp.h delete mode 100644 nuttx/include/net/uip/telnetd.h delete mode 100644 nuttx/include/net/uip/tftp.h delete mode 100644 nuttx/include/net/uip/thttpd.h delete mode 100644 nuttx/include/net/uip/uip-lib.h delete mode 100644 nuttx/include/net/uip/webclient.h (limited to 'nuttx') diff --git a/nuttx/examples/dhcpd/target.c b/nuttx/examples/dhcpd/target.c index fd0579746..1878c2bc8 100644 --- a/nuttx/examples/dhcpd/target.c +++ b/nuttx/examples/dhcpd/target.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/dhcpd/target.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,9 @@ #include #include #include -#include -#include + +#include +#include /**************************************************************************** * Preprocessor Definitions diff --git a/nuttx/examples/igmp/igmp.c b/nuttx/examples/igmp/igmp.c index 8bca7fa4e..734a7e599 100755 --- a/nuttx/examples/igmp/igmp.c +++ b/nuttx/examples/igmp/igmp.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/igmp/igmp.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include #include "igmp.h" diff --git a/nuttx/examples/nettest/nettest.c b/nuttx/examples/nettest/nettest.c index a59bccf58..c7492fff6 100644 --- a/nuttx/examples/nettest/nettest.c +++ b/nuttx/examples/nettest/nettest.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nettest/nettest.c * - * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,7 +45,7 @@ #include #include -#include +#include #include "nettest.h" diff --git a/nuttx/examples/poll/net_listener.c b/nuttx/examples/poll/net_listener.c index 12621de9a..4d425c608 100644 --- a/nuttx/examples/poll/net_listener.c +++ b/nuttx/examples/poll/net_listener.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/poll/net_listener.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -54,7 +54,7 @@ #include #include -#include +#include #include "poll_internal.h" diff --git a/nuttx/examples/poll/net_reader.c b/nuttx/examples/poll/net_reader.c index 1ea8dbe54..b0cf94316 100644 --- a/nuttx/examples/poll/net_reader.c +++ b/nuttx/examples/poll/net_reader.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/poll/net_reader.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -54,7 +54,7 @@ #include #include -#include +#include #include "poll_internal.h" diff --git a/nuttx/examples/sendmail/host.c b/nuttx/examples/sendmail/host.c index ecae2b6a1..67a541b0c 100644 --- a/nuttx/examples/sendmail/host.c +++ b/nuttx/examples/sendmail/host.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/sendmail/host.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ #include #include -#include +#include /**************************************************************************** * Private Data diff --git a/nuttx/examples/sendmail/target.c b/nuttx/examples/sendmail/target.c index a68db0b26..d8643106b 100644 --- a/nuttx/examples/sendmail/target.c +++ b/nuttx/examples/sendmail/target.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/sendmail/target.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009. 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Defintitions diff --git a/nuttx/examples/thttpd/main.c b/nuttx/examples/thttpd/main.c index f9d0ee055..e2fdda4f4 100644 --- a/nuttx/examples/thttpd/main.c +++ b/nuttx/examples/thttpd/main.c @@ -49,11 +49,12 @@ #include #include -#include -#include -#include #include +#include +#include +#include + #include #include #include diff --git a/nuttx/examples/udp/target.c b/nuttx/examples/udp/target.c index 929c34883..5e31fdb36 100644 --- a/nuttx/examples/udp/target.c +++ b/nuttx/examples/udp/target.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/udp/nettest.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -42,7 +42,7 @@ #include #include -#include +#include #include "udp-internal.h" diff --git a/nuttx/examples/uip/main.c b/nuttx/examples/uip/main.c index 226e75c69..21a01998b 100644 --- a/nuttx/examples/uip/main.c +++ b/nuttx/examples/uip/main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/uip/main.c * - * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on uIP which also has a BSD style license: @@ -56,7 +56,9 @@ #include #include #include -#include + +#include + #ifdef CONFIG_EXAMPLE_UIP_DHCPC #include #endif @@ -68,13 +70,13 @@ /* DHCPC may be used in conjunction with any other feature (or not) */ #ifdef CONFIG_EXAMPLE_UIP_DHCPC -# include -# include +# include +# include #endif /* Include uIP webserver definitions */ -#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/examples/wget/Makefile.host b/nuttx/examples/wget/Makefile.host index e99f12503..73a1c7ce6 100644 --- a/nuttx/examples/wget/Makefile.host +++ b/nuttx/examples/wget/Makefile.host @@ -50,14 +50,14 @@ all: $(BIN) $(OBJS): %.o1: %.c $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@ -net/uip: - @mkdir -p net/uip +apps/netutils: + @mkdir -p apps/netutils -net/uip/webclient.h: net/uip $(TOPDIR)/include/net/uip/webclient.h - @cp -a $(TOPDIR)/include/net/uip/webclient.h net/uip/. +apps/netutils/webclient.h: apps/netutils $(TOPDIR)/include/apps/netutils/webclient.h + @cp -a $(TOPDIR)/include/apps/netutils/webclient.h apps/netutils/. -net/uip/uip-lib.h: net/uip $(TOPDIR)/include/net/uip/uip-lib.h - @cp -a $(TOPDIR)/include/net/uip/uip-lib.h net/uip/. +apps/netutils/uiplib.h: apps/netutils $(TOPDIR)/include/apps/netutils/uiplib.h + @cp -a $(TOPDIR)/include/apps/netutils/uiplib.h apps/netutils/. nuttx: @mkdir nuttx @@ -65,7 +65,7 @@ nuttx: nuttx/config.h: nuttx @touch nuttx/config.h -headers: net/uip/webclient.h net/uip/uip-lib.h nuttx/config.h +headers: apps/netutils/webclient.h apps/netutils/uiplib.h nuttx/config.h $(BIN): headers $(OBJS) $(HOSTCC) $(HOSTLDFLAGS) $(OBJS) -o $@ diff --git a/nuttx/examples/wget/host.c b/nuttx/examples/wget/host.c index fe8109051..a7b416db5 100644 --- a/nuttx/examples/wget/host.c +++ b/nuttx/examples/wget/host.c @@ -37,13 +37,14 @@ * Included Files ****************************************************************************/ -#include #include #include #include #include #include +#include + /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/nuttx/examples/wget/target.c b/nuttx/examples/wget/target.c index c135a1d57..b378e9944 100644 --- a/nuttx/examples/wget/target.c +++ b/nuttx/examples/wget/target.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/wget/target.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,9 +47,10 @@ #include #include -#include -#include -#include + +#include +#include +#include /**************************************************************************** * Preprocessor Definitions diff --git a/nuttx/include/apps/netutils/dhcpc.h b/nuttx/include/apps/netutils/dhcpc.h new file mode 100644 index 000000000..994a6713e --- /dev/null +++ b/nuttx/include/apps/netutils/dhcpc.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * apps/netutils/dhcpc.n + * + * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * This logic was leveraged from uIP which also has a BSD-style license: + * + * Copyright (c) 2005, Swedish Institute of Computer Science + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __APPS_NETUTILS_DHCPC_H +#define __APPS_NETUTILS_DHCPC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct dhcpc_state +{ + struct in_addr serverid; + struct in_addr ipaddr; + struct in_addr netmask; + struct in_addr dnsaddr; + struct in_addr default_router; + uint32_t lease_time; /* Lease expires in this number of seconds */ +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN void *dhcpc_open(const void *mac_addr, int mac_len); +EXTERN int dhcpc_request(void *handle, struct dhcpc_state *presult); +EXTERN void dhcpc_close(void *handle); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_NETUTILS_DHCPC_H */ diff --git a/nuttx/include/apps/netutils/dhcpd.h b/nuttx/include/apps/netutils/dhcpd.h new file mode 100644 index 000000000..b03415b20 --- /dev/null +++ b/nuttx/include/apps/netutils/dhcpd.h @@ -0,0 +1,71 @@ +/**************************************************************************** + * apps/netutils/dhcpd.h + * + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * This logic was leveraged from uIP which also has a BSD-style license: + * + * Copyright (c) 2005, Swedish Institute of Computer Science + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __APPS_NETUTILS_DHCPD_H +#define __APPS_NETUTILS_DHCPD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN int dhcpd_run(void); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_NETUTILS_DHCPD_H */ diff --git a/nuttx/include/apps/netutils/httpd.h b/nuttx/include/apps/netutils/httpd.h new file mode 100644 index 000000000..12f2a1511 --- /dev/null +++ b/nuttx/include/apps/netutils/httpd.h @@ -0,0 +1,54 @@ +/**************************************************************************** + * apps/netutils/httpd.h + * + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Based on uIP which also has a BSD style license: + * + * Author: Adam Dunkels + * Copyright (c) 2001-2005, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_HTTPD_H +#define __APPS_NETUTILS_HTTPD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +extern void httpd_init(void); +extern int httpd_listen(void); + +#endif /* __APPS_NETUTILS_HTTPD_H */ diff --git a/nuttx/include/apps/netutils/ipmsfilter.h b/nuttx/include/apps/netutils/ipmsfilter.h new file mode 100755 index 000000000..56088eca7 --- /dev/null +++ b/nuttx/include/apps/netutils/ipmsfilter.h @@ -0,0 +1,101 @@ +/**************************************************************************** + * apps/netutils/ipmsfilter.h + * User interface to add/remove IP multicast address + * + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_IPMSFILTER_H +#define __APPS_NETUTILS_IPMSFILTER_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#ifdef CONFIG_NET_IGMP + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv6 +# error "IGMP for IPv6 not supported" +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: ipmsfilter + * + * Description: + * Add or remove an IP address from a multicast filter set. + * (See netutils/uiplib/uip_ipmsfilter.c) + * + * Parameters: + * ifname The name of the interface to use, size must less than IMSFNAMSIZ + * multiaddr Multicast group address to add/remove + * fmode MCAST_INCLUDE: Add multicast address + * MCAST_EXCLUDE: Remove multicast address + * + * Return: + * 0 on sucess; Negated errno on failure + * + ****************************************************************************/ + +EXTERN int ipmsfilter(FAR const char *ifname, + FAR const struct in_addr *multiaddr, + uint32_t fmode); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* CONFIG_NET_IGMP */ +#endif /* __APPS_NETUTILS_IPMSFILTER_H */ diff --git a/nuttx/include/apps/netutils/resolv.h b/nuttx/include/apps/netutils/resolv.h new file mode 100644 index 000000000..a427c5394 --- /dev/null +++ b/nuttx/include/apps/netutils/resolv.h @@ -0,0 +1,65 @@ +/* includes/apps/netutils/resolv.h + * DNS resolver code header file. + * Authtor Adam Dunkels + * + * Copyright (c) 2002-2003, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __APPS_NETUTILS_RESOLVE_H +#define __APPS_NETUTILS_RESOLVE_H + +#include + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/* Functions. */ + +EXTERN int resolv_init(void); + +#ifdef CONFIG_NET_IPv6 +EXTERN void resolv_conf(const struct in6_addr *dnsserver); +EXTERN void resolv_getserver(const struct in_addr *dnsserver); +EXTERN int resolv_query(const char *name, struct sockaddr_in6 *addr); +#else +EXTERN void resolv_conf(const struct in_addr *dnsserver); +EXTERN void resolv_getserver(struct in_addr *dnsserver); +EXTERN int resolv_query(const char *name, struct sockaddr_in *addr); +#endif + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __APPS_NETUTILS_RESOLVE_H */ diff --git a/nuttx/include/apps/netutils/smtp.h b/nuttx/include/apps/netutils/smtp.h new file mode 100644 index 000000000..d1ea0c5d9 --- /dev/null +++ b/nuttx/include/apps/netutils/smtp.h @@ -0,0 +1,66 @@ +/**************************************************************************** + * include/apps/netutils/smtp.h + * SMTP header file + * + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Heavily leveraged from uIP 1.0 which also has a BSD-like license: + * + * Author: Adam Dunkels + * Copyright (c) 2002, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_SMTP_H +#define __APPS_NETUTILS_SMTP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Type Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +extern void *smtp_open(void); +extern void smtp_configure(void *handle, const char *localhostname, + const uip_ipaddr_t *paddr); +extern int smtp_send(void *handle, const char *to, const char *cc, + const char *from, const char *subject, + const char *msg, int msglen); +extern void smtp_close(void *handle); + +#endif /* __APPS_NETUTILS_SMTP_H */ diff --git a/nuttx/include/apps/netutils/telnetd.h b/nuttx/include/apps/netutils/telnetd.h new file mode 100644 index 000000000..9d3d6feaf --- /dev/null +++ b/nuttx/include/apps/netutils/telnetd.h @@ -0,0 +1,70 @@ +/**************************************************************************** + * include/apps/netutils/telnetd.h + * + * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * This is a leverage of similar logic from uIP: + * + * Author: Adam Dunkels + * Copyright (c) 2003, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_TELNETD_H +#define __APPS_NETUTILS_TELNETD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/* Start the telnet server -- does not return unless an error occurs */ + +EXTERN void telnetd_init(void); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_NETUTILS_TELNETD_H */ diff --git a/nuttx/include/apps/netutils/tftp.h b/nuttx/include/apps/netutils/tftp.h new file mode 100644 index 000000000..c00e37c72 --- /dev/null +++ b/nuttx/include/apps/netutils/tftp.h @@ -0,0 +1,73 @@ +/**************************************************************************** + * include/apps/netutils/tftp.h + * + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_TFTP_H +#define __APPS_NETUTILS_TFTP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary); +EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_NETUTILS_TFTP_H */ \ No newline at end of file diff --git a/nuttx/include/apps/netutils/thttpd.h b/nuttx/include/apps/netutils/thttpd.h new file mode 100644 index 000000000..959177219 --- /dev/null +++ b/nuttx/include/apps/netutils/thttpd.h @@ -0,0 +1,101 @@ +/**************************************************************************** + * apps/netutils/thttpd.h + * + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_THTTPD_H +#define __APPS_NETUTILS_THTTPD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/* These values must be provided by the user before the THTTPD task daemon + * is started: + * + * g_thttpdsymtab: A symbol table describing all of the symbols exported + * from the base system. These symbols are used to bind address references + * in CGI programs to NuttX. + * g_nsymbols: The number of symbols in g_thttpdsymtab[]. + * + * (See examples/nxflat and examples/thttpd for examples of how such a symbol + * table may be created.) + */ + +EXTERN FAR const struct symtab_s *g_thttpdsymtab; +EXTERN int g_thttpdnsymbols; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Function: thttpd_main + * + * Description: + * This function is the entrypoint into the THTTPD server. It does not + * return. It may be called, the normal mechanism for starting the server + * is: + * + * 1) Set is g_thttpdsymtab and g_thttpdnsymbols. The user is required + * to provide a symbol table to use for binding CGI programs (if CGI + * is enabled. See examples/nxflat and examples/thttpd for examples of + * how such a symbol table may be created.) + * 2) Call task_create() to start thttpd_main() + * + ****************************************************************************/ + +EXTERN int thttpd_main(int argc, char **argv); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __APPS_NETUTILS_THTTPD_H */ diff --git a/nuttx/include/apps/netutils/uiplib.h b/nuttx/include/apps/netutils/uiplib.h new file mode 100644 index 000000000..a149de63b --- /dev/null +++ b/nuttx/include/apps/netutils/uiplib.h @@ -0,0 +1,129 @@ +/**************************************************************************** + * apps/netutils/uiplib.h + * Various non-standard APIs to support netutils. All non-standard and + * intended only for internal use. + * + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Some of these APIs derive from uIP but all of them use the uip_ prefix + * to identify them as members of this library. uIP also has a BSD style + * license: + * + * Author: Adam Dunkels + * Copyright (c) 2002, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_UIPLIB_H +#define __APPS_NETUTILS_UIPLIB_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* SOCK_DGRAM is the preferred socket type to use when we just want a + * socket for performing drive ioctls. However, we can't use SOCK_DRAM + * if UDP is disabled. + */ + +#ifdef CONFIG_NET_UDP +# define UIPLIB_SOCK_IOCTL SOCK_DGRAM +#else +# define UIPLIB_SOCK_IOCTL SOCK_STREAM +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/* Convert a textual representation of an IP address to a numerical representation. + * + * This function takes a textual representation of an IP address in + * the form a.b.c.d and converts it into a 4-byte array that can be + * used by other uIP functions. + * + * addrstr A pointer to a string containing the IP address in + * textual form. + * + * addr A pointer to a 4-byte array that will be filled in with + * the numerical representation of the address. + * + * Return: 0 If the IP address could not be parsed. + * Return: Non-zero If the IP address was parsed. + */ + +extern bool uiplib_ipaddrconv(const char *addrstr, uint8_t *addr); + +/* Get and set IP/MAC addresses (Ethernet L2 only) */ + +#ifdef CONFIG_NET_ETHERNET +extern int uip_setmacaddr(const char *ifname, const uint8_t *macaddr); +extern int uip_getmacaddr(const char *ifname, uint8_t *macaddr); +#endif + +/* IP address support */ + +#ifdef CONFIG_NET_IPv6 +extern int uip_gethostaddr(const char *ifname, struct in6_addr *addr); +extern int uip_sethostaddr(const char *ifname, const struct in6_addr *addr); +extern int uip_setdraddr(const char *ifname, const struct in6_addr *addr); +extern int uip_setnetmask(const char *ifname, const struct in6_addr *addr); +#else +extern int uip_gethostaddr(const char *ifname, struct in_addr *addr); +extern int uip_sethostaddr(const char *ifname, const struct in_addr *addr); +extern int uip_setdraddr(const char *ifname, const struct in_addr *addr); +extern int uip_setnetmask(const char *ifname, const struct in_addr *addr); +#endif + +/* HTTP support */ + +extern int uip_parsehttpurl(const char *url, uint16_t *port, + char *hostname, int hostlen, + char *filename, int namelen); + +/* Generic server logic */ + +extern void uip_server(uint16_t portno, pthread_startroutine_t handler, int stacksize); + +#endif /* __APPS_NETUTILS_UIPLIB_H */ diff --git a/nuttx/include/apps/netutils/webclient.h b/nuttx/include/apps/netutils/webclient.h new file mode 100644 index 000000000..c80626e3b --- /dev/null +++ b/nuttx/include/apps/netutils/webclient.h @@ -0,0 +1,149 @@ +/**************************************************************************** + * include/apps/netutils/webclient.h + * Header file for the HTTP client + * + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Based remotely on the uIP webclient which also has a BSD style license: + * + * Author: Adam Dunkels + * Copyright (c) 2002, Adam Dunkels. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __APPS_NETUTILS_WEBCLIENT_H +#define __APPS_NETUTILS_WEBCLIENT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#ifndef CONFIG_WEBCLIENT_HOST +# include +#endif +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef CONFIG_WEBCLIENT_MAXHTTPLINE +# define CONFIG_WEBCLIENT_MAXHTTPLINE 200 +#endif + +#ifndef CONFIG_WEBCLIENT_MAXMIMESIZE +# define CONFIG_WEBCLIENT_MAXMIMESIZE 32 +#endif + +#ifndef CONFIG_WEBCLIENT_MAXHOSTNAME +# define CONFIG_WEBCLIENT_MAXHOSTNAME 40 +#endif + +#ifndef CONFIG_WEBCLIENT_MAXFILENAME +# define CONFIG_WEBCLIENT_MAXFILENAME 100 +#endif + +/**************************************************************************** + * Public types + ****************************************************************************/ + +/* wget calls a user provided function of the follwoing type to process + * each received chuck of the incoming file data. If the system has a file + * system, then it may just write the data to a file. Or it may buffer the + * file in memory. To facilitate this latter case, the caller may modify + * the buffer address in this callback by writing to buffer and buflen. This + * may be used, for example, to implement double buffering. + * + * Input Parameters: + * buffer - A pointer to a pointer to a buffer. If the callee wishes to + * change the buffer address, it may do so in the callback by writing + * to buffer. + * offset - Offset to the beginning of valid data in the buffer. Offset + * is used to skip over any HTTP header info that may be at the + * beginning of the buffer. + * datend - The end+1 offset of valid data in the buffer. The total number + * of valid bytes is datend - offset. + * buflen - A pointer to the length of the buffer. If the callee wishes + * to change the size of the buffer, it may write to buflen. + */ + +typedef void (*wget_callback_t)(FAR char **buffer, int offset, + int datend, FAR int *buflen, FAR void *arg); + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: wget + * + * Description: + * Obtain the requested file from an HTTP server using the GET method. + * + * Note: If the function is passed a host name, it must already be in + * the resolver cache in order for the function to connect to the web + * server. It is therefore up to the calling module to implement the + * resolver calls and the signal handler used for reporting a resolv + * query answer. + * + * Input Parameters + * url - A pointer to a string containing either the full URL to + * the file to get (e.g., http://www.nutt.org/index.html, or + * http://192.168.23.1:80/index.html). + * buffer - A user provided buffer to receive the file data (also + * used for the outgoing GET request + * buflen - The size of the user provided buffer + * callback - As data is obtained from the host, this function is + * to dispose of each block of file data as it is received. + * arg - User argument passed to callback. + * + * Returned Value: + * 0: if the GET operation completed successfully; + * -1: On a failure with errno set appropriately + * + ****************************************************************************/ + +EXTERN int wget(FAR const char *url, FAR char *buffer, int buflen, + wget_callback_t callback, FAR void *arg); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_NETUTILS_WEBCLIENT_H */ diff --git a/nuttx/include/net/uip/dhcpc.h b/nuttx/include/net/uip/dhcpc.h deleted file mode 100644 index 3d2fe4109..000000000 --- a/nuttx/include/net/uip/dhcpc.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * net/uip/dhcpc.n - * - * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This logic was leveraged from uIP which also has a BSD-style license: - * - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __NET_UIP_DHCPC_H -#define __NET_UIP_DHCPC_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -struct dhcpc_state -{ - struct in_addr serverid; - struct in_addr ipaddr; - struct in_addr netmask; - struct in_addr dnsaddr; - struct in_addr default_router; - uint32_t lease_time; /* Lease expires in this number of seconds */ -}; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -EXTERN void *dhcpc_open(const void *mac_addr, int mac_len); -EXTERN int dhcpc_request(void *handle, struct dhcpc_state *presult); -EXTERN void dhcpc_close(void *handle); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __NET_UIP_DHCPC_H */ diff --git a/nuttx/include/net/uip/dhcpd.h b/nuttx/include/net/uip/dhcpd.h deleted file mode 100644 index f9aea86f3..000000000 --- a/nuttx/include/net/uip/dhcpd.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - * net/uipt/dhcpd.h - * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This logic was leveraged from uIP which also has a BSD-style license: - * - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __NET_UIP_DHCPD_H -#define __NET_UIP_DHCPD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -EXTERN int dhcpd_run(void); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __NET_UIP_DHCPD_H */ diff --git a/nuttx/include/net/uip/httpd.h b/nuttx/include/net/uip/httpd.h deleted file mode 100644 index cd850e51d..000000000 --- a/nuttx/include/net/uip/httpd.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * net/uip/httpd.h - * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef _NET_UIP_HTTPD_H -#define _NET_UIP_HTTPD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -extern void httpd_init(void); -extern int httpd_listen(void); - -#endif /* _NET_UIP_HTTPD_H */ diff --git a/nuttx/include/net/uip/ipmsfilter.h b/nuttx/include/net/uip/ipmsfilter.h deleted file mode 100755 index df792d50b..000000000 --- a/nuttx/include/net/uip/ipmsfilter.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - * net/uip/ipmsfilter.h - * User interface to add/remove IP multicast address - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __NET_UIP_IPMSFILTER_H -#define __NET_UIP_IPMSFILTER_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#ifdef CONFIG_NET_IGMP - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifdef CONFIG_NET_IPv6 -# error "IGMP for IPv6 not supported" -#endif - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: ipmsfilter - * - * Description: - * Add or remove an IP address from a multicast filter set. - * (See netutils/uiplib/uip_ipmsfilter.c) - * - * Parameters: - * ifname The name of the interface to use, size must less than IMSFNAMSIZ - * multiaddr Multicast group address to add/remove - * fmode MCAST_INCLUDE: Add multicast address - * MCAST_EXCLUDE: Remove multicast address - * - * Return: - * 0 on sucess; Negated errno on failure - * - ****************************************************************************/ - -EXTERN int ipmsfilter(FAR const char *ifname, - FAR const struct in_addr *multiaddr, - uint32_t fmode); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* CONFIG_NET_IGMP */ -#endif /* __NET_UIP_IPMSFILTER_H */ diff --git a/nuttx/include/net/uip/resolv.h b/nuttx/include/net/uip/resolv.h deleted file mode 100644 index 8b9f3bace..000000000 --- a/nuttx/include/net/uip/resolv.h +++ /dev/null @@ -1,65 +0,0 @@ -/* resolv.h - * DNS resolver code header file. - * Authtor Adam Dunkels - * - * Copyright (c) 2002-2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __UIP_RESOLV_H__ -#define __UIP_RESOLV_H__ - -#include - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -/* Functions. */ - -EXTERN int resolv_init(void); - -#ifdef CONFIG_NET_IPv6 -EXTERN void resolv_conf(const struct in6_addr *dnsserver); -EXTERN void resolv_getserver(const struct in_addr *dnsserver); -EXTERN int resolv_query(const char *name, struct sockaddr_in6 *addr); -#else -EXTERN void resolv_conf(const struct in_addr *dnsserver); -EXTERN void resolv_getserver(struct in_addr *dnsserver); -EXTERN int resolv_query(const char *name, struct sockaddr_in *addr); -#endif - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __UIP_RESOLV_H__ */ diff --git a/nuttx/include/net/uip/smtp.h b/nuttx/include/net/uip/smtp.h deleted file mode 100644 index 4653443ff..000000000 --- a/nuttx/include/net/uip/smtp.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - * smtp.h - * SMTP header file - * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Heavily leveraged from uIP 1.0 which also has a BSD-like license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __SMTP_H__ -#define __SMTP_H__ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -extern void *smtp_open(void); -extern void smtp_configure(void *handle, const char *localhostname, - const uip_ipaddr_t *paddr); -extern int smtp_send(void *handle, const char *to, const char *cc, - const char *from, const char *subject, - const char *msg, int msglen); -extern void smtp_close(void *handle); - -#endif /* __SMTP_H__ */ diff --git a/nuttx/include/net/uip/telnetd.h b/nuttx/include/net/uip/telnetd.h deleted file mode 100644 index 32247c206..000000000 --- a/nuttx/include/net/uip/telnetd.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - * include/net/uip/telnetd.h - * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This is a leverage of similar logic from uIP: - * - * Author: Adam Dunkels - * Copyright (c) 2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - ****************************************************************************/ - -#ifndef __NET_UIP_TELNETD_H -#define __NET_UIP_TELNETD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -/* Start the telnet server -- does not return unless an error occurs */ - -EXTERN void telnetd_init(void); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __NET_UIP_TELNETD_H */ diff --git a/nuttx/include/net/uip/tftp.h b/nuttx/include/net/uip/tftp.h deleted file mode 100644 index 7aa77c109..000000000 --- a/nuttx/include/net/uip/tftp.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - * include/net/uip/tftp.h - * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __NET_UIP_TFTP_H -#define __NET_UIP_TFTP_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary); -EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __NET_UIP_TFTP_H */ \ No newline at end of file diff --git a/nuttx/include/net/uip/thttpd.h b/nuttx/include/net/uip/thttpd.h deleted file mode 100644 index bd445766c..000000000 --- a/nuttx/include/net/uip/thttpd.h +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - * net/uip/thttpd.h - * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __NET_UIP_THTTPD_H -#define __NET_UIP_THTTPD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -/* These values must be provided by the user before the THTTPD task daemon - * is started: - * - * g_thttpdsymtab: A symbol table describing all of the symbols exported - * from the base system. These symbols are used to bind address references - * in CGI programs to NuttX. - * g_nsymbols: The number of symbols in g_thttpdsymtab[]. - * - * (See examples/nxflat and examples/thttpd for examples of how such a symbol - * table may be created.) - */ - -EXTERN FAR const struct symtab_s *g_thttpdsymtab; -EXTERN int g_thttpdnsymbols; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Function: thttpd_main - * - * Description: - * This function is the entrypoint into the THTTPD server. It does not - * return. It may be called, the normal mechanism for starting the server - * is: - * - * 1) Set is g_thttpdsymtab and g_thttpdnsymbols. The user is required - * to provide a symbol table to use for binding CGI programs (if CGI - * is enabled. See examples/nxflat and examples/thttpd for examples of - * how such a symbol table may be created.) - * 2) Call task_create() to start thttpd_main() - * - ****************************************************************************/ - -EXTERN int thttpd_main(int argc, char **argv); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __NET_UIP_THTTPD_H */ diff --git a/nuttx/include/net/uip/uip-lib.h b/nuttx/include/net/uip/uip-lib.h deleted file mode 100644 index 813245953..000000000 --- a/nuttx/include/net/uip/uip-lib.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** - * net/uip/uiplib.h - * Various non-standard APIs to support netutils. All non-standard and - * intended only for internal use. - * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Some of these APIs derive from uIP but all of them use the uip_ prefix - * to identify them as members of this library. uIP also has a BSD style - * license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __NET_UIP_UIP_LIB_H -#define __NET_UIP_UIP_LIB_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* SOCK_DGRAM is the preferred socket type to use when we just want a - * socket for performing drive ioctls. However, we can't use SOCK_DRAM - * if UDP is disabled. - */ - -#ifdef CONFIG_NET_UDP -# define UIPLIB_SOCK_IOCTL SOCK_DGRAM -#else -# define UIPLIB_SOCK_IOCTL SOCK_STREAM -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/* Convert a textual representation of an IP address to a numerical representation. - * - * This function takes a textual representation of an IP address in - * the form a.b.c.d and converts it into a 4-byte array that can be - * used by other uIP functions. - * - * addrstr A pointer to a string containing the IP address in - * textual form. - * - * addr A pointer to a 4-byte array that will be filled in with - * the numerical representation of the address. - * - * Return: 0 If the IP address could not be parsed. - * Return: Non-zero If the IP address was parsed. - */ - -extern bool uiplib_ipaddrconv(const char *addrstr, uint8_t *addr); - -/* Get and set IP/MAC addresses (Ethernet L2 only) */ - -#ifdef CONFIG_NET_ETHERNET -extern int uip_setmacaddr(const char *ifname, const uint8_t *macaddr); -extern int uip_getmacaddr(const char *ifname, uint8_t *macaddr); -#endif - -/* IP address support */ - -#ifdef CONFIG_NET_IPv6 -extern int uip_gethostaddr(const char *ifname, struct in6_addr *addr); -extern int uip_sethostaddr(const char *ifname, const struct in6_addr *addr); -extern int uip_setdraddr(const char *ifname, const struct in6_addr *addr); -extern int uip_setnetmask(const char *ifname, const struct in6_addr *addr); -#else -extern int uip_gethostaddr(const char *ifname, struct in_addr *addr); -extern int uip_sethostaddr(const char *ifname, const struct in_addr *addr); -extern int uip_setdraddr(const char *ifname, const struct in_addr *addr); -extern int uip_setnetmask(const char *ifname, const struct in_addr *addr); -#endif - -/* HTTP support */ - -extern int uip_parsehttpurl(const char *url, uint16_t *port, - char *hostname, int hostlen, - char *filename, int namelen); - -/* Generic server logic */ - -extern void uip_server(uint16_t portno, pthread_startroutine_t handler, int stacksize); - -#endif /* __NET_UIP_UIP_LIB_H */ diff --git a/nuttx/include/net/uip/webclient.h b/nuttx/include/net/uip/webclient.h deleted file mode 100644 index 6e91bfb23..000000000 --- a/nuttx/include/net/uip/webclient.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - * include/net/uip/webclient.h - * Header file for the HTTP client - * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based remotely on the uIP webclient which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __NET_UIP_WEBCLIENT_H -#define __NET_UIP_WEBCLIENT_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#ifndef CONFIG_WEBCLIENT_HOST -# include -#endif -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_WEBCLIENT_MAXHTTPLINE -# define CONFIG_WEBCLIENT_MAXHTTPLINE 200 -#endif - -#ifndef CONFIG_WEBCLIENT_MAXMIMESIZE -# define CONFIG_WEBCLIENT_MAXMIMESIZE 32 -#endif - -#ifndef CONFIG_WEBCLIENT_MAXHOSTNAME -# define CONFIG_WEBCLIENT_MAXHOSTNAME 40 -#endif - -#ifndef CONFIG_WEBCLIENT_MAXFILENAME -# define CONFIG_WEBCLIENT_MAXFILENAME 100 -#endif - -/**************************************************************************** - * Public types - ****************************************************************************/ - -/* wget calls a user provided function of the follwoing type to process - * each received chuck of the incoming file data. If the system has a file - * system, then it may just write the data to a file. Or it may buffer the - * file in memory. To facilitate this latter case, the caller may modify - * the buffer address in this callback by writing to buffer and buflen. This - * may be used, for example, to implement double buffering. - * - * Input Parameters: - * buffer - A pointer to a pointer to a buffer. If the callee wishes to - * change the buffer address, it may do so in the callback by writing - * to buffer. - * offset - Offset to the beginning of valid data in the buffer. Offset - * is used to skip over any HTTP header info that may be at the - * beginning of the buffer. - * datend - The end+1 offset of valid data in the buffer. The total number - * of valid bytes is datend - offset. - * buflen - A pointer to the length of the buffer. If the callee wishes - * to change the size of the buffer, it may write to buflen. - */ - -typedef void (*wget_callback_t)(FAR char **buffer, int offset, - int datend, FAR int *buflen, FAR void *arg); - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Name: wget - * - * Description: - * Obtain the requested file from an HTTP server using the GET method. - * - * Note: If the function is passed a host name, it must already be in - * the resolver cache in order for the function to connect to the web - * server. It is therefore up to the calling module to implement the - * resolver calls and the signal handler used for reporting a resolv - * query answer. - * - * Input Parameters - * url - A pointer to a string containing either the full URL to - * the file to get (e.g., http://www.nutt.org/index.html, or - * http://192.168.23.1:80/index.html). - * buffer - A user provided buffer to receive the file data (also - * used for the outgoing GET request - * buflen - The size of the user provided buffer - * callback - As data is obtained from the host, this function is - * to dispose of each block of file data as it is received. - * arg - User argument passed to callback. - * - * Returned Value: - * 0: if the GET operation completed successfully; - * -1: On a failure with errno set appropriately - * - ****************************************************************************/ - -EXTERN int wget(FAR const char *url, FAR char *buffer, int buflen, - wget_callback_t callback, FAR void *arg); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __NET_UIP_WEBCLIENT_H */ diff --git a/nuttx/netutils/dhcpc/dhcpc.c b/nuttx/netutils/dhcpc/dhcpc.c index 79f806ad5..dc80988bb 100644 --- a/nuttx/netutils/dhcpc/dhcpc.c +++ b/nuttx/netutils/dhcpc/dhcpc.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/dhcpc/dhcpc.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based heavily on portions of uIP: @@ -53,8 +53,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/netutils/dhcpd/dhcpd.c b/nuttx/netutils/dhcpd/dhcpd.c index 0e498541c..39050bd62 100644 --- a/nuttx/netutils/dhcpd/dhcpd.c +++ b/nuttx/netutils/dhcpd/dhcpd.c @@ -52,12 +52,12 @@ # define ERROR (-1) # define OK (0) #else -# include /* NuttX configuration */ -# include /* For ndbg, vdbg */ -# include /* For CONFIG_CPP_HAVE_WARNING */ -# include /* For irqstore() and friends -- REVISIT */ -# include /* For low-level ARP interfaces -- REVISIT */ -# include /* Advertised DHCPD APIs */ +# include /* NuttX configuration */ +# include /* For ndbg, vdbg */ +# include /* For CONFIG_CPP_HAVE_WARNING */ +# include /* For irqstore() and friends -- REVISIT */ +# include /* For low-level ARP interfaces -- REVISIT */ +# include /* Advertised DHCPD APIs */ #endif #include diff --git a/nuttx/netutils/resolv/resolv.c b/nuttx/netutils/resolv/resolv.c index 60da2015b..db9e00085 100644 --- a/nuttx/netutils/resolv/resolv.c +++ b/nuttx/netutils/resolv/resolv.c @@ -63,7 +63,7 @@ #include #include -#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/netutils/smtp/smtp.c b/nuttx/netutils/smtp/smtp.c index cd0b6b1e0..d758c6f6b 100644 --- a/nuttx/netutils/smtp/smtp.c +++ b/nuttx/netutils/smtp/smtp.c @@ -1,8 +1,8 @@ /**************************************************************************** - * smtp.c + * apps/netutitls/smtp/smtp.c * smtp SMTP E-mail sender * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Heavily leveraged from uIP 1.0 which also has a BSD-like license: @@ -58,7 +58,7 @@ #include #include -#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/netutils/telnetd/telnetd.c b/nuttx/netutils/telnetd/telnetd.c index 00151713c..ccadd60dd 100644 --- a/nuttx/netutils/telnetd/telnetd.c +++ b/nuttx/netutils/telnetd/telnetd.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/telnetd/telnetd.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This is a leverage of similar logic from uIP: @@ -53,8 +53,8 @@ #include #include -#include -#include +#include +#include #include "shell.h" diff --git a/nuttx/netutils/tftpc/tftpc_get.c b/nuttx/netutils/tftpc/tftpc_get.c index 39040cd7d..e0779d17d 100644 --- a/nuttx/netutils/tftpc/tftpc_get.c +++ b/nuttx/netutils/tftpc/tftpc_get.c @@ -1,7 +1,7 @@ /**************************************************************************** * netuils/tftp/tftpc_get.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include #include -#include +#include #include "tftpc_internal.h" diff --git a/nuttx/netutils/tftpc/tftpc_packets.c b/nuttx/netutils/tftpc/tftpc_packets.c index 169f068cc..d43410ff4 100644 --- a/nuttx/netutils/tftpc/tftpc_packets.c +++ b/nuttx/netutils/tftpc/tftpc_packets.c @@ -1,7 +1,7 @@ /**************************************************************************** * netuils/tftp/tftpc_packets.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -53,7 +53,7 @@ #include #include -#include +#include #include "tftpc_internal.h" diff --git a/nuttx/netutils/tftpc/tftpc_put.c b/nuttx/netutils/tftpc/tftpc_put.c index d16fc95bd..4d87ba908 100644 --- a/nuttx/netutils/tftpc/tftpc_put.c +++ b/nuttx/netutils/tftpc/tftpc_put.c @@ -1,7 +1,7 @@ /**************************************************************************** * netuils/tftp/tftpc_put.c * - * Copyright (C) 2008-2009Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ #include #include -#include +#include #include "tftpc_internal.h" diff --git a/nuttx/netutils/thttpd/libhttpd.c b/nuttx/netutils/thttpd/libhttpd.c index f258b81ed..05831b335 100644 --- a/nuttx/netutils/thttpd/libhttpd.c +++ b/nuttx/netutils/thttpd/libhttpd.c @@ -2,7 +2,7 @@ * netutils/thttpd/libhttpd.c * HTTP Protocol Library * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Derived from the file of the same name in the original THTTPD package: @@ -59,7 +59,7 @@ #include #include -#include +#include #include "config.h" #include "libhttpd.h" diff --git a/nuttx/netutils/thttpd/thttpd.c b/nuttx/netutils/thttpd/thttpd.c index cd2092fa8..3b49c0141 100644 --- a/nuttx/netutils/thttpd/thttpd.c +++ b/nuttx/netutils/thttpd/thttpd.c @@ -2,7 +2,7 @@ * netutils/thttpd/thttpd.c * Tiny HTTP Server * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Derived from the file of the same name in the original THTTPD package: @@ -55,7 +55,7 @@ #include #include -#include +#include #include "config.h" #include "fdwatch.h" diff --git a/nuttx/netutils/thttpd/thttpd_cgi.c b/nuttx/netutils/thttpd/thttpd_cgi.c index 739fd7712..ee126795a 100755 --- a/nuttx/netutils/thttpd/thttpd_cgi.c +++ b/nuttx/netutils/thttpd/thttpd_cgi.c @@ -2,7 +2,7 @@ * netutils/thttpd/thttpd_cgi.c * CGI support * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Derived from the file libhttpd.c in the original THTTPD package: @@ -55,7 +55,7 @@ #include #include -#include +#include #include "config.h" #include "libhttpd.h" diff --git a/nuttx/netutils/uiplib/uip_gethostaddr.c b/nuttx/netutils/uiplib/uip_gethostaddr.c index a04df437c..0de639d6c 100644 --- a/nuttx/netutils/uiplib/uip_gethostaddr.c +++ b/nuttx/netutils/uiplib/uip_gethostaddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_gethostaddr.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/netutils/uiplib/uip_getmacaddr.c b/nuttx/netutils/uiplib/uip_getmacaddr.c index 05dbf34f4..c99bc7a7d 100644 --- a/nuttx/netutils/uiplib/uip_getmacaddr.c +++ b/nuttx/netutils/uiplib/uip_getmacaddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_getmacaddr.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ #include #include -#include +#include /**************************************************************************** * Global Functions diff --git a/nuttx/netutils/uiplib/uip_ipmsfilter.c b/nuttx/netutils/uiplib/uip_ipmsfilter.c index 11f15a180..ccae4a680 100755 --- a/nuttx/netutils/uiplib/uip_ipmsfilter.c +++ b/nuttx/netutils/uiplib/uip_ipmsfilter.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_setmultiaddr.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,8 +50,8 @@ #include #include -#include -#include +#include +#include #ifdef CONFIG_NET_IGMP diff --git a/nuttx/netutils/uiplib/uip_parsehttpurl.c b/nuttx/netutils/uiplib/uip_parsehttpurl.c index 22fcf0e5f..bda5502b7 100644 --- a/nuttx/netutils/uiplib/uip_parsehttpurl.c +++ b/nuttx/netutils/uiplib/uip_parsehttpurl.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_parsehttpurl.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,12 @@ *****************************************************************************/ #include + #include #include #include -#include + +#include /**************************************************************************** * Private Data diff --git a/nuttx/netutils/uiplib/uip_server.c b/nuttx/netutils/uiplib/uip_server.c index ca062d4dd..f58f063de 100644 --- a/nuttx/netutils/uiplib/uip_server.c +++ b/nuttx/netutils/uiplib/uip_server.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_server.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ #include #include -#include +#include /**************************************************************************** * Public Functions diff --git a/nuttx/netutils/uiplib/uip_setdraddr.c b/nuttx/netutils/uiplib/uip_setdraddr.c index 36a9c34e1..79eac5b97 100644 --- a/nuttx/netutils/uiplib/uip_setdraddr.c +++ b/nuttx/netutils/uiplib/uip_setdraddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_setdraddr.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ #include #include -#include +#include /**************************************************************************** * Global Functions diff --git a/nuttx/netutils/uiplib/uip_sethostaddr.c b/nuttx/netutils/uiplib/uip_sethostaddr.c index d06b22075..ccc7526b9 100644 --- a/nuttx/netutils/uiplib/uip_sethostaddr.c +++ b/nuttx/netutils/uiplib/uip_sethostaddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_sethostaddr.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ #include #include -#include +#include /**************************************************************************** * Global Functions diff --git a/nuttx/netutils/uiplib/uip_setmacaddr.c b/nuttx/netutils/uiplib/uip_setmacaddr.c index f1bf0d71b..28188b7f8 100644 --- a/nuttx/netutils/uiplib/uip_setmacaddr.c +++ b/nuttx/netutils/uiplib/uip_setmacaddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_setmacaddr.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/netutils/uiplib/uip_setnetmask.c b/nuttx/netutils/uiplib/uip_setnetmask.c index 837bdc1e3..2cdc38474 100644 --- a/nuttx/netutils/uiplib/uip_setnetmask.c +++ b/nuttx/netutils/uiplib/uip_setnetmask.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/uiplib/uip_setnetmask.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ #include #include -#include +#include /**************************************************************************** * Global Functions diff --git a/nuttx/netutils/uiplib/uiplib.c b/nuttx/netutils/uiplib/uiplib.c index b45527f45..99f716f5c 100644 --- a/nuttx/netutils/uiplib/uiplib.c +++ b/nuttx/netutils/uiplib/uiplib.c @@ -2,7 +2,7 @@ * netutils/uiplib/uiplib.c * Various uIP library functions. * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on uIP which also has a BSD style license: @@ -45,8 +45,13 @@ #include #include + #include -#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ bool uiplib_ipaddrconv(const char *addrstr, uint8_t *ipaddr) { diff --git a/nuttx/netutils/webclient/webclient.c b/nuttx/netutils/webclient/webclient.c index 8b5ba107c..2c5108a4a 100644 --- a/nuttx/netutils/webclient/webclient.c +++ b/nuttx/netutils/webclient/webclient.c @@ -2,7 +2,7 @@ * netutils/webclient/webclient.c * Implementation of the HTTP client. * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on uIP which also has a BSD style license: @@ -64,13 +64,13 @@ #ifdef CONFIG_HAVE_GETHOSTBYNAME # include #else -# include +# include #endif #include #include -#include -#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/netutils/webserver/httpd.c b/nuttx/netutils/webserver/httpd.c index 91519e1dd..9322b58dc 100644 --- a/nuttx/netutils/webserver/httpd.c +++ b/nuttx/netutils/webserver/httpd.c @@ -2,7 +2,7 @@ * netutils/webserver/httpd.c * httpd Web server * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This is a leverage of similar logic from uIP: @@ -59,8 +59,8 @@ #include #include -#include -#include +#include +#include #include "httpd.h" #include "httpd_cgi.h" diff --git a/nuttx/netutils/webserver/httpd_cgi.c b/nuttx/netutils/webserver/httpd_cgi.c index a51a4e273..967ef9b9c 100644 --- a/nuttx/netutils/webserver/httpd_cgi.c +++ b/nuttx/netutils/webserver/httpd_cgi.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "httpd_cgi.h" diff --git a/nuttx/netutils/webserver/httpd_cgi.h b/nuttx/netutils/webserver/httpd_cgi.h index f56176778..9547bca33 100644 --- a/nuttx/netutils/webserver/httpd_cgi.h +++ b/nuttx/netutils/webserver/httpd_cgi.h @@ -33,7 +33,7 @@ #ifndef __HTTPD_CGI_H__ #define __HTTPD_CGI_H__ -#include +#include #include "httpd.h" diff --git a/nuttx/netutils/webserver/httpd_fs.c b/nuttx/netutils/webserver/httpd_fs.c index f6403fa37..731f19498 100644 --- a/nuttx/netutils/webserver/httpd_fs.c +++ b/nuttx/netutils/webserver/httpd_fs.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/webserver/httpd_fs.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on uIP which also has a BSD style license: @@ -43,7 +43,7 @@ #include -#include +#include #include "httpd.h" #include "httpd_fsdata.h" -- cgit v1.2.3