summaryrefslogtreecommitdiff
path: root/nuttx/netutils
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-09-08 22:41:00 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-09-08 22:41:00 +0000
commit712b9f5349a81fe56fa060ccb8aa13e0db830657 (patch)
treedfbb89ff177cb40a24945fa3925c9e75230a6a5b /nuttx/netutils
parent255e1fe83691a2c5a3328bcec13e2bce0a140696 (diff)
downloadpx4-nuttx-712b9f5349a81fe56fa060ccb8aa13e0db830657.tar.gz
px4-nuttx-712b9f5349a81fe56fa060ccb8aa13e0db830657.tar.bz2
px4-nuttx-712b9f5349a81fe56fa060ccb8aa13e0db830657.zip
Cleanup and fix problems introduce in last commit
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@337 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils')
-rw-r--r--nuttx/netutils/telnetd/shell.h67
-rw-r--r--nuttx/netutils/uiplib/uiplib.c34
-rw-r--r--nuttx/netutils/uiplib/uiplib.h46
-rw-r--r--nuttx/netutils/webclient/webclient.c33
-rw-r--r--nuttx/netutils/webserver/httpd-fs.c46
-rw-r--r--nuttx/netutils/webserver/httpd-fsdata.h26
6 files changed, 133 insertions, 119 deletions
diff --git a/nuttx/netutils/telnetd/shell.h b/nuttx/netutils/telnetd/shell.h
index 7d81849c7..8f89b2119 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 1b6f7528c..569c59ae3 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 a980e389e..b33134a41 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 be937db41..e26d5017f 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 679b65be2..3b446ac43 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 bc36cbb54..a7ff24b6c 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>