uIP webserver now uses listen/accept

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@386 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2007-11-19 18:17:23 +00:00
parent 5698f351b1
commit ca5e8b5998
23 changed files with 494 additions and 136 deletions
+21 -4
View File
@@ -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);
+28
View File
@@ -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__ */