diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-19 18:17:23 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-19 18:17:23 +0000 |
commit | befc37ada0b901ad7c315e4089976508396d496b (patch) | |
tree | 44818265dc09577601c19bf81b3576109f31a534 /nuttx/include/net | |
parent | 6f5479c267e1ed09e85461464ae73b4cbfd3d486 (diff) | |
download | px4-nuttx-befc37ada0b901ad7c315e4089976508396d496b.tar.gz px4-nuttx-befc37ada0b901ad7c315e4089976508396d496b.tar.bz2 px4-nuttx-befc37ada0b901ad7c315e4089976508396d496b.zip |
uIP webserver now uses listen/accept
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@386 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/net')
-rw-r--r-- | nuttx/include/net/uip/httpd.h | 25 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-lib.h | 28 |
2 files changed, 49 insertions, 4 deletions
diff --git a/nuttx/include/net/uip/httpd.h b/nuttx/include/net/uip/httpd.h index ef21cc6ba..44d4d8f4a 100644 --- a/nuttx/include/net/uip/httpd.h +++ b/nuttx/include/net/uip/httpd.h @@ -1,11 +1,19 @@ -/* httpd.h +/**************************************************************************** + * net/uip/httpd.h * - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. + * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * + * Based on uIP which also has a BSD style license: + * + * Author: Adam Dunkels <adam@sics.se> + * 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 @@ -26,13 +34,22 @@ * 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 + ****************************************************************************/ + #include <sys/types.h> +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + extern void httpd_init(void); extern int httpd_listen(void); diff --git a/nuttx/include/net/uip/uip-lib.h b/nuttx/include/net/uip/uip-lib.h index 3f6c9860d..d5799ee56 100644 --- a/nuttx/include/net/uip/uip-lib.h +++ b/nuttx/include/net/uip/uip-lib.h @@ -42,9 +42,33 @@ #ifndef __UIPLIB_H__ #define __UIPLIB_H__ +/**************************************************************************** + * Included Files + ****************************************************************************/ + #include <nuttx/config.h> +#include <sched.h> #include <netinet/in.h> +/**************************************************************************** + * 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 @@ -80,4 +104,8 @@ 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 +/* Generic server logic */ + +extern void uip_server(uint16 portno, main_t handler, int stacksize); + #endif /* __UIPLIB_H__ */ |