diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2007-09-08 22:41:00 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2007-09-08 22:41:00 +0000 |
commit | 565c15c7cde59f4078f7a47bf4efb2ed40dea36f (patch) | |
tree | dfbb89ff177cb40a24945fa3925c9e75230a6a5b | |
parent | bccf1c9ba0e944f87a168c6244b627667fbab693 (diff) |
Cleanup and fix problems introduce in last commit
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@337 7fd9a85b-ad96-42d3-883c-3090e2eb8679
-rw-r--r-- | nuttx/examples/uip/main.c | 24 | ||||
-rw-r--r-- | nuttx/include/nuttx/os_external.h | 4 | ||||
-rw-r--r-- | nuttx/include/sys/socket.h | 2 | ||||
-rw-r--r-- | nuttx/net/Makefile | 2 | ||||
-rw-r--r-- | nuttx/net/getsockopt.c | 13 | ||||
-rw-r--r-- | nuttx/net/net-internal.h | 2 | ||||
-rw-r--r-- | nuttx/net/recvfrom.c | 24 | ||||
-rw-r--r-- | nuttx/net/setsockopt.c | 1 | ||||
-rw-r--r-- | nuttx/net/uip/psock.c | 25 | ||||
-rw-r--r-- | nuttx/net/uip/uip-fw.h | 45 | ||||
-rw-r--r-- | nuttx/net/uip/uip-split.h | 44 | ||||
-rw-r--r-- | nuttx/netutils/telnetd/shell.h | 67 | ||||
-rw-r--r-- | nuttx/netutils/uiplib/uiplib.c | 34 | ||||
-rw-r--r-- | nuttx/netutils/uiplib/uiplib.h | 46 | ||||
-rw-r--r-- | nuttx/netutils/webclient/webclient.c | 33 | ||||
-rw-r--r-- | nuttx/netutils/webserver/httpd-fs.c | 46 | ||||
-rw-r--r-- | nuttx/netutils/webserver/httpd-fsdata.h | 26 |
17 files changed, 237 insertions, 201 deletions
diff --git a/nuttx/examples/uip/main.c b/nuttx/examples/uip/main.c index d7cfc6bb22..9771f4a9e6 100644 --- a/nuttx/examples/uip/main.c +++ b/nuttx/examples/uip/main.c @@ -1,10 +1,18 @@ -/* main.c - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. +/**************************************************************************** + * examples/uip/main.c + * + * 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: + * + * Copyright (c) 2001, 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 @@ -29,11 +37,11 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack. - * - * $Id: main.c,v 1.4 2007-09-03 20:34:43 patacongo Exp $ - * - */ + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ #include <stdio.h> #include <unistd.h> diff --git a/nuttx/include/nuttx/os_external.h b/nuttx/include/nuttx/os_external.h index d144fb9c64..410cdd6223 100644 --- a/nuttx/include/nuttx/os_external.h +++ b/nuttx/include/nuttx/os_external.h @@ -87,8 +87,8 @@ #define NSEC2TICK(nsec) (((nsec)+(NSEC_PER_TICK/2))/NSEC_PER_TICK) /* Rounds */ #define USEC2TICK(usec) (((usec)+(USEC_PER_TICK/2))/USEC_PER_TICK) /* Rounds */ #define MSEC2TICK(msec) (((msec)+(MSEC_PER_TICK/2))/MSEC_PER_TICK) /* Rounds */ -#define DSEC2TICK(dsec) MSEC2TICK((dsec)*DSEC_PER_MSEC) -#define SEC2TICK(sec) MSEC2TICK((sec)*SEC_PER_MSEC) +#define DSEC2TICK(dsec) MSEC2TICK((dsec)*MSEC_PER_DSEC) +#define SEC2TICK(sec) MSEC2TICK((sec)*MSEC_PER_SEC) /**************************************************************************** * Global Data diff --git a/nuttx/include/sys/socket.h b/nuttx/include/sys/socket.h index 15afd96627..52c20e2724 100644 --- a/nuttx/include/sys/socket.h +++ b/nuttx/include/sys/socket.h @@ -135,7 +135,7 @@ #define SO_SNDBUF 7 /* Sets send buffer size. arg: integer value (get/set). */ #define SO_RCVBUF 8 /* Sets receive buffer size. arg: integer value (get/set). */ #define SO_ERROR 9 /* Reports and clears error status (get only). arg: returns - * an integer value + * an integer value */ #define SO_TYPE 10 /* Reports the socket type (get only). return: int */ #define SO_DONTROUTE 11 /* Requests that outgoing messages bypass standard routing (get/set) * arg: pointer to integer containing a boolean value */ diff --git a/nuttx/net/Makefile b/nuttx/net/Makefile index f341e0a677..31ccd2a266 100644 --- a/nuttx/net/Makefile +++ b/nuttx/net/Makefile @@ -46,7 +46,7 @@ STD_CSRCS = socket.c bind.c connect.c send.c sendto.c recv.c recvfrom.c \ ifeq ($(CONFIG_NET_SOCKOPTS),y) STD_CSRCS += setsockopt.c getsockopt.c ifneq ($(CONFIG_DISABLE_CLOCK),y) -STD_CSRCS += net-timeout.c net-dsec2timeval.c net-timeval2dsec.c +STD_CSRCS += net-timeo.c net-dsec2timeval.c net-timeval2dsec.c endif endif diff --git a/nuttx/net/getsockopt.c b/nuttx/net/getsockopt.c index 1cd4485ac0..5b96762c00 100644 --- a/nuttx/net/getsockopt.c +++ b/nuttx/net/getsockopt.c @@ -110,7 +110,7 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ /* Verify that the socket option if valid (but might not be supported ) */ - if (!_SO_GETVALID(option) || !value) + if (!_SO_GETVALID(option) || !value || !value_len) { err = EINVAL; goto errout; @@ -138,7 +138,7 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ * that 'value' is properly aligned for an 'int' */ - if (value_len != sizeof(int)) + if (*value_len < sizeof(int)) { err = EINVAL; goto errout; @@ -150,8 +150,9 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ * a macro will do. */ - optionset = psock->options; + optionset = psock->s_options; *(int*)value = _SO_GETOPT(optionset, option); + *value_len = sizeof(int); } break; @@ -161,7 +162,7 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ * that 'value' is properly aligned for an 'int' */ - if (value_len != sizeof(int)) + if (*value_len < sizeof(int)) { err = EINVAL; goto errout; @@ -170,6 +171,7 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ /* Return the socket type */ *(int*)value = psock->s_type; + *value_len = sizeof(int); } break; @@ -185,7 +187,7 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ * that 'value' is properly aligned for an 'int' */ - if (value_len != sizeof(struct timeval)) + if (*value_len < sizeof(struct timeval)) { err = EINVAL; goto errout; @@ -207,6 +209,7 @@ int getsockopt(int sockfd, int level, int option, void *value, socklen_t *value_ /* Then return the timeout value to the caller */ net_dsec2timeval(timeo, (struct timeval *)value); + *value_len = sizeof(struct timeval); } break; #endif diff --git a/nuttx/net/net-internal.h b/nuttx/net/net-internal.h index f4345adb2f..9f7fcaea0c 100644 --- a/nuttx/net/net-internal.h +++ b/nuttx/net/net-internal.h @@ -124,7 +124,7 @@ EXTERN FAR struct socket *sockfd_socket(int sockfd); #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) EXTERN int net_timeo(uint32 start_time, socktimeo_t timeo); -EXTERN socktimeo_t socktimeo_t net_timeval2dsec(struct timeval *tv); +EXTERN socktimeo_t net_timeval2dsec(struct timeval *tv); EXTERN void net_dsec2timeval(uint16 dsec, struct timeval *tv); #endif diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index d008262bf8..d4a1898c90 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -59,7 +59,7 @@ struct recvfrom_s { #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) - FAR struct socket *rf_sock /* The parent socket structure */ + FAR struct socket *rf_sock; /* The parent socket structure */ #endif sem_t rf_sem; /* Semaphore signals recv completion */ sint16 rf_buflen; /* Length of receive buffer (error if <0) */ @@ -102,7 +102,7 @@ void recvfrom_interrupt(void *private) /* Don't allow any further call backs. */ - uip_conn->private = NULL; + uip_conn->private = NULL; uip_conn->callback = NULL; /* Wake up the waiting thread, returning the number of bytes @@ -113,23 +113,33 @@ void recvfrom_interrupt(void *private) sem_post(&pstate-> rf_sem); } - /* No data has been received. If this is a poll event, then check - * for a timeout. + /* No data has been received -- this is some other event... probably a + * poll -- check for a timeout. */ #if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK) - else if (uip_newdata() && pstate->rf_sock) + else if (pstate->rf_sock) { /* Check if SO_RCVTIMEO has been selected for this socket */ - uint rcvtimeo = ; if (pstate->rf_sock->s_rcvtimeo) { /* Yes.. Check if the timeout has elapsed */ if (net_timeo(pstate->rf_starttime, pstate->rf_sock->s_rcvtimeo)) { - } + /* Don't allow any further call backs. */ + + uip_conn->private = NULL; + uip_conn->callback = NULL; + + /* Wake up the waiting thread, returning the error -EAGAIN + * that signals the timeout event + */ + + pstate->rf_buflen = -EAGAIN; + sem_post(&pstate-> rf_sem); + } } } #endif diff --git a/nuttx/net/setsockopt.c b/nuttx/net/setsockopt.c index b90b9ae3a1..0c4e3d9e41 100644 --- a/nuttx/net/setsockopt.c +++ b/nuttx/net/setsockopt.c @@ -43,6 +43,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <errno.h> +#include <arch/irq.h> #include "net-internal.h" diff --git a/nuttx/net/uip/psock.c b/nuttx/net/uip/psock.c index 24269a60ad..55676c3c21 100644 --- a/nuttx/net/uip/psock.c +++ b/nuttx/net/uip/psock.c @@ -1,10 +1,18 @@ -/* - * Copyright (c) 2004, Swedish Institute of Computer Science. - * All rights reserved. +/**************************************************************************** + * net/uip/psock.c + * + * 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: + * + * Copyright (c) 2004, 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 @@ -26,12 +34,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels <adam@sics.se> - * - * $Id: psock.c,v 1.2 2007-09-01 18:06:13 patacongo Exp $ - */ + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ #include <stdio.h> #include <string.h> diff --git a/nuttx/net/uip/uip-fw.h b/nuttx/net/uip/uip-fw.h index cba0bea133..b3153cd315 100644 --- a/nuttx/net/uip/uip-fw.h +++ b/nuttx/net/uip/uip-fw.h @@ -1,21 +1,20 @@ -/** - * \addtogroup uipfw - * @{ - */ - -/** - * \file +/**************************************************************************** + * net/uip/uip-fw.h * uIP packet forwarding header file. - * \author Adam Dunkels <adam@sics.se> - */ - -/* - * Copyright (c) 2004, Swedish Institute of Computer Science. - * 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) 2004, 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 @@ -37,21 +36,21 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels <adam@sics.se> - * - * $Id: uip-fw.h,v 1.1.1.1 2007-08-26 23:04:07 patacongo Exp $ - */ + ****************************************************************************/ + #ifndef __UIP_FW_H__ #define __UIP_FW_H__ +/**************************************************************************** + * Included Files + ****************************************************************************/ + #include <net/uip/uip.h> -/** - * Representation of a uIP network interface. - */ -struct uip_fw_netif { +/* Representation of a uIP network interface. */ + +struct uip_fw_netif +{ struct uip_fw_netif *next; /**< Pointer to the next interface when linked in a list. */ uint16 ipaddr[2]; /**< The IP address of this interface. */ diff --git a/nuttx/net/uip/uip-split.h b/nuttx/net/uip/uip-split.h index 99f36ccdb3..4779b017a4 100644 --- a/nuttx/net/uip/uip-split.h +++ b/nuttx/net/uip/uip-split.h @@ -1,10 +1,21 @@ -/* - * Copyright (c) 2004, Swedish Institute of Computer Science. - * All rights reserved. +/**************************************************************************** + * net/uip/uip-split.h + * Module for splitting outbound TCP segments in two to avoid the + * delayed ACK throughput degradation. + * + * 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) 2004, 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 @@ -26,20 +37,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels <adam@sics.se> - * - * $Id: uip-split.h,v 1.1.1.1 2007-08-26 23:04:08 patacongo Exp $ - */ -/** - * \addtogroup uip - * @{ - */ + ****************************************************************************/ -/** - * \defgroup uipsplit uIP TCP throughput booster hack - * @{ +/* uipsplit uIP TCP throughput booster hack * * The basic uIP TCP implementation only allows each TCP connection to * have a single TCP segment in flight at any given time. Because of @@ -59,15 +59,9 @@ * to work. */ - -/** - * \file - * Module for splitting outbound TCP segments in two to avoid the - * delayed ACK throughput degradation. - * \author - * Adam Dunkels <adam@sics.se> - * - */ +/**************************************************************************** + * Included Files + ****************************************************************************/ #ifndef __UIP_SPLIT_H__ #define __UIP_SPLIT_H__ diff --git a/nuttx/netutils/telnetd/shell.h b/nuttx/netutils/telnetd/shell.h index 7d81849c77..8f89b2119c 100644 --- a/nuttx/netutils/telnetd/shell.h +++ b/nuttx/netutils/telnetd/shell.h @@ -1,21 +1,20 @@ -/** - * \file +/**************************************************************************** + * netutils/telnetd/shell.h * Interface for the Contiki shell. - * \author Adam Dunkels <adam@dunkels.com> * - * Some of the functions declared in this file must be implemented as - * a shell back-end in the architecture specific files of a Contiki - * port. - */ - - -/* - * Copyright (c) 2003, 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@dunkels.com> + * 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 @@ -37,68 +36,68 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * This file is part of the Contiki desktop OS. - * - * $Id: shell.h,v 1.1.1.1 2007-08-26 23:07:06 patacongo Exp $ - * + ****************************************************************************/ + +/* Some of the functions declared in this file must be implemented as + * a shell back-end in the architecture specific files of a Contiki + * port. */ + #ifndef __SHELL_H__ #define __SHELL_H__ -/** - * Initialize the shell. +/* Initialize the shell. * * Called when the shell front-end process starts. This function may * be used to start listening for signals. */ + void shell_init(void); -/** - * Start the shell back-end. +/* Start the shell back-end. * * Called by the front-end when a new shell is started. */ + void shell_start(void); -/** - * Process a shell command. +/* Process a shell command. * * This function will be called by the shell GUI / telnet server whan * a command has been entered that should be processed by the shell * back-end. * - * \param command The command to be processed. + * command The command to be processed. */ + void shell_input(char *command); -/** - * Quit the shell. - * - */ +/* Quit the shell. */ + void shell_quit(char *); -/** - * Print a string to the shell window. +/* Print a string to the shell window. * * This function is implemented by the shell GUI / telnet server and * can be called by the shell back-end to output a string in the * shell window. The string is automatically appended with a linebreak. * - * \param str1 The first half of the string to be output. - * \param str2 The second half of the string to be output. + * str1 The first half of the string to be output. + * str2 The second half of the string to be output. */ + void shell_output(char *str1, char *str2); -/** - * Print a prompt to the shell window. +/* Print a prompt to the shell window. * * This function can be used by the shell back-end to print out a * prompt to the shell window. * - * \param prompt The prompt to be printed. + * prompt The prompt to be printed. * */ + void shell_prompt(char *prompt); #endif /* __SHELL_H__ */ diff --git a/nuttx/netutils/uiplib/uiplib.c b/nuttx/netutils/uiplib/uiplib.c index 1b6f7528c8..569c59ae3b 100644 --- a/nuttx/netutils/uiplib/uiplib.c +++ b/nuttx/netutils/uiplib/uiplib.c @@ -1,11 +1,21 @@ -/* - * Copyright (c) 2004, Adam Dunkels and the Swedish Institute of - * Computer Science. - * All rights reserved. +/**************************************************************************** + * netutils/uiplib/uiplib.c + * Various uIP library functions. + * + * 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) 2004, Adam Dunkels and the 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 @@ -27,19 +37,17 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack - * - * $Id: uiplib.c,v 1.1.1.1 2007-08-26 23:07:05 patacongo Exp $ - * - */ + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ #include <net/uip/uip.h> #include "uiplib.h" -/*-----------------------------------------------------------------------------------*/ -unsigned char -uiplib_ipaddrconv(char *addrstr, unsigned char *ipaddr) +unsigned char uiplib_ipaddrconv(char *addrstr, unsigned char *ipaddr) { unsigned char tmp; char c; @@ -69,5 +77,3 @@ uiplib_ipaddrconv(char *addrstr, unsigned char *ipaddr) } return 1; } - -/*-----------------------------------------------------------------------------------*/ diff --git a/nuttx/netutils/uiplib/uiplib.h b/nuttx/netutils/uiplib/uiplib.h index a980e389e3..b33134a418 100644 --- a/nuttx/netutils/uiplib/uiplib.h +++ b/nuttx/netutils/uiplib/uiplib.h @@ -1,18 +1,20 @@ -/** - * \file +/**************************************************************************** + * netutils/uiplib/uiplib.h * Various uIP library functions. - * \author - * Adam Dunkels <adam@sics.se> * - */ - -/* - * Copyright (c) 2002, 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) 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 @@ -35,37 +37,27 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack - * - * $Id: uiplib.h,v 1.1.1.1 2007-08-26 23:07:05 patacongo Exp $ - * - */ + ****************************************************************************/ + #ifndef __UIPLIB_H__ #define __UIPLIB_H__ -/** - * \addtogroup uipconvfunc - * @{ - */ - -/** - * Convert a textual representation of an IP address to a numerical representation. +/* 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. * - * \param addrstr A pointer to a string containing the IP address in + * addrstr A pointer to a string containing the IP address in * textual form. * - * \param addr A pointer to a 4-byte array that will be filled in with + * addr A pointer to a 4-byte array that will be filled in with * the numerical representation of the address. * - * \retval 0 If the IP address could not be parsed. - * \retval Non-zero If the IP address was parsed. + * Return: 0 If the IP address could not be parsed. + * Return: Non-zero If the IP address was parsed. */ -unsigned char uiplib_ipaddrconv(char *addrstr, unsigned char *addr); -/** @} */ +unsigned char uiplib_ipaddrconv(char *addrstr, unsigned char *addr); #endif /* __UIPLIB_H__ */ diff --git a/nuttx/netutils/webclient/webclient.c b/nuttx/netutils/webclient/webclient.c index be937db41b..e26d5017f9 100644 --- a/nuttx/netutils/webclient/webclient.c +++ b/nuttx/netutils/webclient/webclient.c @@ -1,15 +1,15 @@ -/* webclient.c +/**************************************************************************** + * netutils/webclient/webclient.c * Implementation of the HTTP client. - * Author: Adam Dunkels <adam@dunkels.com> * - * This example shows a HTTP client that is able to download web pages - * and files from web servers. It requires a number of callback - * functions to be implemented by the module that utilizes the code: - * webclient_datahandler(), webclient_connected(), - * webclient_timedout(), webclient_aborted(), webclient_closed(). + * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. + * Based on uIP which also has a BSD style license: + * + * Author: Adam Dunkels <adam@dunkels.com> + * 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 @@ -36,12 +36,19 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * This file is part of the uIP TCP/IP stack. - * - * $Id: webclient.c,v 1.4 2007-09-03 23:35:17 patacongo Exp $ - * + ****************************************************************************/ + +/* This example shows a HTTP client that is able to download web pages + * and files from web servers. It requires a number of callback + * functions to be implemented by the module that utilizes the code: + * webclient_datahandler(), webclient_connected(), + * webclient_timedout(), webclient_aborted(), webclient_closed(). */ +/**************************************************************************** + * Included Files + ****************************************************************************/ + #include <sys/types.h> #include <string.h> #include <sys/socket.h> diff --git a/nuttx/netutils/webserver/httpd-fs.c b/nuttx/netutils/webserver/httpd-fs.c index 679b65be24..3b446ac431 100644 --- a/nuttx/netutils/webserver/httpd-fs.c +++ b/nuttx/netutils/webserver/httpd-fs.c @@ -1,10 +1,19 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. +/**************************************************************************** + * netutils/webserver/httpd-fs.c + * + * 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, 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 @@ -26,12 +35,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels <adam@sics.se> - * - * $Id: httpd-fs.c,v 1.1.1.1 2007-08-26 23:07:02 patacongo Exp $ - */ + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ #include <sys/types.h> @@ -49,9 +57,7 @@ static uint16 count[HTTPD_FS_NUMFILES]; #endif /* HTTPD_FS_STATISTICS */ -/*-----------------------------------------------------------------------------------*/ -static uint8 -httpd_fs_strcmp(const char *str1, const char *str2) +static uint8 httpd_fs_strcmp(const char *str1, const char *str2) { uint8 i; i = 0; @@ -71,9 +77,8 @@ httpd_fs_strcmp(const char *str1, const char *str2) ++i; goto loop; } -/*-----------------------------------------------------------------------------------*/ -int -httpd_fs_open(const char *name, struct httpd_fs_file *file) + +int httpd_fs_open(const char *name, struct httpd_fs_file *file) { #if HTTPD_FS_STATISTICS uint16 i = 0; @@ -99,9 +104,8 @@ httpd_fs_open(const char *name, struct httpd_fs_file *file) } return 0; } -/*-----------------------------------------------------------------------------------*/ -void -httpd_fs_init(void) + +void httpd_fs_init(void) { #if HTTPD_FS_STATISTICS uint16 i; @@ -110,10 +114,9 @@ httpd_fs_init(void) } #endif /* HTTPD_FS_STATISTICS */ } -/*-----------------------------------------------------------------------------------*/ + #if HTTPD_FS_STATISTICS -uint16 httpd_fs_count -(char *name) +uint16 httpd_fs_count(char *name) { struct httpd_fsdata_file_noconst *f; uint16 i; @@ -131,4 +134,3 @@ uint16 httpd_fs_count return 0; } #endif /* HTTPD_FS_STATISTICS */ -/*-----------------------------------------------------------------------------------*/ diff --git a/nuttx/netutils/webserver/httpd-fsdata.h b/nuttx/netutils/webserver/httpd-fsdata.h index bc36cbb542..a7ff24b6c6 100644 --- a/nuttx/netutils/webserver/httpd-fsdata.h +++ b/nuttx/netutils/webserver/httpd-fsdata.h @@ -1,6 +1,14 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. +/**************************************************************************** + * netutils/webserver/httpd-fsdata.h + * + * 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, 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 @@ -26,15 +34,15 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels <adam@sics.se> - * - * $Id: httpd-fsdata.h,v 1.1.1.1 2007-08-26 23:07:04 patacongo Exp $ - */ + ****************************************************************************/ + #ifndef __HTTPD_FSDATA_H__ #define __HTTPD_FSDATA_H__ +/**************************************************************************** + * Included Files + ****************************************************************************/ + #include <sys/types.h> #include <net/uip/uip.h> |