The original uIP 0.9 sources

This commit is contained in:
Adam Dunkels
2013-03-27 21:30:25 +01:00
parent 8ba1ecb51b
commit be901e957e
204 changed files with 17733 additions and 2869 deletions

View File

@@ -1,36 +0,0 @@
/*
* 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
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: COPYRIGHT,v 1.3 2002/01/15 18:08:43 adam Exp $
*
*/

13
README
View File

@@ -1,12 +1,11 @@
uIP is a very small implementation of the TCP/IP stack that is written
by Adam Dunkels <adam@dunkels.com>. More information can be obtained
at the uIP homepage at <http://dunkels.com/adam/uip/>.
This is version $Name: uip-0-6 $.
at the uIP homepage at
http://dunkels.com/adam/uip/
The directory structure look as follows:
apps/ - contains some sample applications
cc65/ - uIP for the 6502 CPU
uip/ - actual uIP TCP/IP and ARP code
unix - uIP as a user space process under FreeBSD or Linux
apps/ - example applications
doc/ - documentation
uip/ - actual uIP TCP/IP, SLIP and ARP code
unix/ - Example of how to run uIP as a user space process under FreeBSD or Linux

View File

@@ -1,3 +1,22 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server script language C functions file.
* \author Adam Dunkels <adam@dunkels.com>
*
* This file contains functions that are called by the web server
* scripts. The functions takes one argument, and the return value is
* interpreted as follows. A zero means that the function did not
* complete and should be invoked for the next packet as well. A
* non-zero value indicates that the function has completed and that
* the web server should move along to the next script line.
*
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
@@ -10,10 +29,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,17 +47,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: cgi.c,v 1.21 2002/01/13 21:12:40 adam Exp $
*
*/
/*
* This file includes functions that are called by the web server
* scripts. The functions takes no argument, and the return value is
* interpreted as follows. A zero means that the function did not
* complete and should be invoked for the next packet as well. A
* non-zero value indicates that the function has completed and that
* the web server should move along to the next script line.
* $Id: cgi.c,v 1.23.2.4 2003/10/07 13:22:27 adam Exp $
*
*/
@@ -53,9 +59,9 @@
#include <stdio.h>
#include <string.h>
static u8_t print_stats(void);
static u8_t file_stats(void);
static u8_t tcp_stats(void);
static u8_t print_stats(u8_t next);
static u8_t file_stats(u8_t next);
static u8_t tcp_stats(u8_t next);
cgifunction cgitab[] = {
print_stats, /* CGI function "a" */
@@ -110,14 +116,14 @@ static const char *states[] = {
* packet.
*/
static u8_t
print_stats(void)
print_stats(u8_t next)
{
#if UIP_STATISTICS
u16_t i, j;
u8_t *buf;
u16_t *databytes;
if(uip_acked()) {
if(next) {
/* If our last data has been acknowledged, we move on the next
chunk of statistics. */
hs->count = hs->count + 4;
@@ -151,12 +157,12 @@ print_stats(void)
}
/*-----------------------------------------------------------------------------------*/
static u8_t
file_stats(void)
file_stats(u8_t next)
{
/* We use sprintf() to print the number of file accesses to a
particular file (given as an argument to the function in the
script). We then use uip_send() to actually send the data. */
if(uip_acked()) {
if(next) {
return 1;
}
uip_send(uip_appdata, sprintf((char *)uip_appdata, "%5u", fs_count(&hs->script[4])));
@@ -164,11 +170,11 @@ file_stats(void)
}
/*-----------------------------------------------------------------------------------*/
static u8_t
tcp_stats(void)
tcp_stats(u8_t next)
{
struct uip_conn *conn;
if(uip_acked()) {
if(next) {
/* If the previously sent data has been acknowledged, we move
forward one connection. */
if(++hs->count == UIP_CONNS) {
@@ -181,24 +187,24 @@ tcp_stats(void)
conn = &uip_conns[hs->count];
if((conn->tcpstateflags & TS_MASK) == CLOSED) {
uip_send(uip_appdata, sprintf((char *)uip_appdata,
"<tr align=\"center\"><td>-</td><td>-</td><td>%d</td><td>%d</td><td>%c %c</td></tr>\r\n",
"<tr align=\"center\"><td>-</td><td>-</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
conn->nrtx,
conn->timer,
(conn->tcpstateflags & UIP_OUTSTANDING)? '*':' ',
(conn->tcpstateflags & UIP_STOPPED)? '!':' '));
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' '));
} else {
uip_send(uip_appdata, sprintf((char *)uip_appdata,
"<tr align=\"center\"><td>%d.%d.%d.%d:%d</td><td>%s</td><td>%d</td><td>%d</td><td>%c %c</td></tr>\r\n",
ntohs(conn->ripaddr[0]) >> 8,
ntohs(conn->ripaddr[0]) & 0xff,
ntohs(conn->ripaddr[1]) >> 8,
ntohs(conn->ripaddr[1]) & 0xff,
ntohs(conn->rport),
"<tr align=\"center\"><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
htons(conn->ripaddr[0]) >> 8,
htons(conn->ripaddr[0]) & 0xff,
htons(conn->ripaddr[1]) >> 8,
htons(conn->ripaddr[1]) & 0xff,
htons(conn->rport),
states[conn->tcpstateflags & TS_MASK],
conn->nrtx,
conn->timer,
(conn->tcpstateflags & UIP_OUTSTANDING)? '*':' ',
(conn->tcpstateflags & UIP_STOPPED)? '!':' '));
(uip_outstanding(conn))? '*':' ',
(uip_stopped(conn))? '!':' '));
}
return 0;
}

View File

@@ -1,3 +1,14 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP script language header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
@@ -10,10 +21,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,15 +39,19 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: cgi.h,v 1.3 2002/01/10 19:18:12 adam Exp $
* $Id: cgi.h,v 1.3.2.4 2003/10/07 13:22:27 adam Exp $
*
*/
#ifndef __CGI_H__
#define __CGI_H__
typedef u8_t (* cgifunction)(void);
typedef u8_t (* cgifunction)(u8_t next);
/**
* A table containing pointers to C functions that can be called from
* a web server script.
*/
extern cgifunction cgitab[];
#endif /* __CGI_H__ */

View File

@@ -1,3 +1,16 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server read-only file system code.
* \author Adam Dunkels <adam@dunkels.com>
*
* A simple read-only filesystem.
*/
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
@@ -10,11 +23,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Swedish Institute
* of Computer Science and its contributors.
* 4. Neither the name of the Institute nor the names of its contributors
* 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.
*
@@ -34,10 +43,11 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: fs.c,v 1.6 2001/11/25 18:47:36 adam Exp $
* $Id: fs.c,v 1.7.2.3 2003/10/07 13:22:27 adam Exp $
*/
#include "uip.h"
#include "httpd.h"
#include "fs.h"
#include "fsdata.h"

View File

@@ -1,3 +1,14 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server read-only file system header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
@@ -10,11 +21,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Swedish Institute
* of Computer Science and its contributors.
* 4. Neither the name of the Institute nor the names of its contributors
* 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.
*
@@ -34,20 +41,29 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: fs.h,v 1.6 2001/11/25 18:47:36 adam Exp $
* $Id: fs.h,v 1.6.2.3 2003/10/07 13:22:27 adam Exp $
*/
#ifndef __FS_H__
#define __FS_H__
#include "uip.h"
/**
* An open file in the read-only file system.
*/
struct fs_file {
char *data;
int len;
char *data; /**< The actual file data. */
int len; /**< The length of the file data. */
};
/* file must be allocated by caller and will be filled in
by the function. */
/**
* Open a file in the read-only file system.
*
* \param name The name of the file.
*
* \param file The file pointer, which must be allocated by caller and
* will be filled in by the function.
*/
int fs_open(const char *name, struct fs_file *file);
#ifdef FS_STATISTICS
@@ -56,6 +72,9 @@ u16_t fs_count(char *name);
#endif /* FS_STATISTICS */
#endif /* FS_STATISTICS */
/**
* Initialize the read-only file system.
*/
void fs_init(void);
#endif /* __FS_H__ */

1
apps/httpd/fs/404.html Normal file
View File

@@ -0,0 +1 @@
<html><body bgcolor="white"><center><h1>404 - file not found</h1></center></body></html>

18
apps/httpd/fs/about.html Normal file
View File

@@ -0,0 +1,18 @@
<html>
<body bgcolor="white">
<center>
<table width="600" border="0"><tr><td>
<h2>Welcome</h2>
<p align="justify">
These web pages are served by the small web server running on top of
the <a href="http://dunkels.com/adam/uip/" target="_top">uIP TCP/IP
stack</a>.
</p>
<p align="justify">
Click on the links above to see some status information about the web
server and the TCP/IP stack.
</p>
</td></tr></table>
</center>
</body>
</html>

View File

@@ -7,14 +7,19 @@ i /files_header.html
# the access statistics of that file.
t <tr><td><a href="/index.html">/index.html</a></td><td>
c b /index.html
t </td></tr>
t <tr><td><a href="/cgi/files">/cgi/files</a></td><td>
t </td></tr> <tr><td><a href="/about.html">/about.html</a></td><td>
c b /about.html
t </td></tr> <tr><td><a href="/control.html">/control.html</a></td><td>
c b /control.html
t </td></tr> <tr><td><a href="/img/bg.png">/img/bg.png</a></td><td>
c b /img/bg.png
t </td></tr> <tr><td><a href="/404.html">/404.html</a></td><td>
c b /404.html
t </td></tr> <tr><td><a href="/cgi/files">/cgi/files</a></td><td>
c b /cgi/files
t </td></tr>
t <tr><td><a href="/cgi/stats">/cgi/stats</a></td><td>
t </td></tr> <tr><td><a href="/cgi/stats">/cgi/stats</a></td><td>
c b /cgi/stats
t </td></tr>
t <tr><td><a href="/cgi/tcp">/cgi/tcp</a></td><td>
t </td></tr> <tr><td><a href="/cgi/tcp">/cgi/tcp</a></td><td>
c b /cgi/tcp
t </td></tr>
# Include the HTML footer.

View File

@@ -0,0 +1,14 @@
<html>
<body bgcolor="white">
<center>
<table width="797" height="94" border="0" cellpadding="0"
cellspacing="0" background="/img/bg.png"><tr><td align="center">
<h1>uIP web server test pages</h1>
[ <a href="about.html" target="main">About</a> |
<a href="/cgi/tcp" target="main">Connections</a> |
<a href="/cgi/files" target="main">Files</a> |
<a href="/cgi/stats" target="main">Statistics</a> ]
</td></tr></table>
</center>
</body>
</html>

View File

@@ -1,30 +1,3 @@
</table>
</center>
<p align="right">
<font size="-1"><i>
$Date: 2001/11/24 15:43:36 $
</i></font>
</p>
</tr></td></table>
</td>
<td width="10" bgcolor="#a0a0e3">&nbsp;</td>
</tr></table>
<table width="540" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="10">
</td>
<td width="530" bgcolor="#a0a0e3"><div align="right">
<font size="-2">&copy;
Copyright <a href="http://dunkels.com/adam/">Adam Dunkels</a> 2001</font></div
></td>
</tr>
</table>
</td></tr></table>
</body>
</html>

View File

@@ -1,15 +1,4 @@
<html>
<head><title>uIP web server page hits</title></head>
<body bgcolor="white">
<table width="540" cellspacing="0" cellpadding="0" border="0"><tr>
<td width="530" bgcolor="#c0c0f0">
<div align="right"><b>uIP web server page hits</b></div>
</td>
<td width="10">&nbsp;</td>
</tr>
<tr valign="top">
<td bgcolor="#c0c0f0" width="530">
<table cellpadding="10" border="0" width="100%"><tr><td>
<center>
<table width="80%" cellspacing="10" cellpadding="0" border="0">
<table width="600" border="0">

BIN
apps/httpd/fs/img/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,65 +1,14 @@
<html>
<head><title>uIP web server test page</title></head>
<body bgcolor="white">
<table width="540" cellspacing="0" cellpadding="0" border="0"><tr>
<td width="530" bgcolor="#c0c0f0">
<div align="right"><b>uIP web server test page</b></div>
</td>
<td width="10">&nbsp;</td>
</tr>
<tr valign="top">
<td bgcolor="#c0c0f0" width="530">
<table cellpadding="10" border="0" width="100%"><tr><td>
<p align="justify">
This is a simple test page for the HTTP server running on top of the
uIP TCP/IP stack. This page is served by the small web server.
</p>
<p align="justify">
The web server also supports a few virtual pages:<br>
<li>
<a href="/cgi/files">/cgi/files</a> which shows individual page
hits.<br>
<li>
<a href="/cgi/tcp">/cgi/tcp</a> which shows current TCP connection
states.<br>
<li>
<a href="/cgi/stats">/cgi/stats</a> which shows uIP TCP/IP
statistics.<br>
</p>
<p align="justify">
For more information, see the <a
href="http://dunkels.com/adam/uip/">uIP</a> home page.
</p>
<p align="right">
<font size="-1"><i>
$Date: 2001/11/24 15:43:36 $
</i></font>
</p>
</tr></td></table>
</td>
<td width="10" bgcolor="#a0a0e3">&nbsp;</td>
</tr></table>
<table width="540" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="10">
</td>
<td width="530" bgcolor="#a0a0e3"><div align="right">
<font size="-2">&copy;
Copyright <a href="http://dunkels.com/adam/">Adam Dunkels</a> 2001</font></div
></td>
</tr>
</table>
<frameset cols="*" rows="120,*" frameborder="no">
<frame src="control.html">
<frame src="about.html" name="main">
</frameset>
<noframes>
<body>
Your browser must support frames
</body>
</html>
</noframes>
</html>

View File

@@ -1,29 +1,3 @@
</td></tr></table>
</center>
<p align="right">
<font size="-1"><i>
$Date: 2001/11/24 15:43:36 $
</i></font>
</p>
</tr></td></table>
</td>
<td width="10" bgcolor="#a0a0e3">&nbsp;</td>
</tr></table>
<table width="540" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="10">
</td>
<td width="530" bgcolor="#a0a0e3"><div align="right">
<font size="-2">&copy;
Copyright <a href="http://dunkels.com/adam/">Adam Dunkels</a> 2001</font></div
></td>
</tr>
</table>
</body>
</html>

View File

@@ -1,19 +1,8 @@
<html>
<head><title>uIP TCP/IP statistics</title></head>
<body bgcolor="white">
<table width="540" cellspacing="0" cellpadding="0" border="0"><tr>
<td width="530" bgcolor="#c0c0f0">
<div align="right"><b>uIP TCP/IP statistics</b></div>
</td>
<td width="10">&nbsp;</td>
</tr>
<tr valign="top">
<td bgcolor="#c0c0f0" width="530">
<table cellpadding="10" border="0" width="100%"><tr><td>
<center>
<table width="80%" cellpadding="0" cellspacing="0" border="0"><tr><td>
<table width="600" border="0">
<tr><td>
<pre>
IP Packets dropped
Packets received
@@ -38,4 +27,4 @@ TCP Packets dropped
No connection avaliable
Connection attempts to closed ports
</pre>
</td><td><pre>
</td><td><pre>

View File

@@ -1,31 +1,5 @@
</table>
</td></tr></table>
</center>
<p align="right">
<font size="-1"><i>
$Date: 2001/11/24 15:43:36 $
</i></font>
</p>
</tr></td></table>
</td>
<td width="10" bgcolor="#a0a0e3">&nbsp;</td>
</tr></table>
<table width="540" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="10">
</td>
<td width="530" bgcolor="#a0a0e3"><div align="right">
<font size="-2">&copy;
Copyright <a href="http://dunkels.com/adam/">Adam Dunkels</a> 2001</font></div
></td>
</tr>
</table>
</body>
</html>
</html>

View File

@@ -1,19 +1,6 @@
<html>
<head><title>uIP TCP connection states</title></head>
<body bgcolor="white">
<table width="540" cellspacing="0" cellpadding="0" border="0"><tr>
<td width="530" bgcolor="#c0c0f0">
<div align="right"><b>uIP TCP connection states</b></div>
</td>
<td width="10">&nbsp;</td>
</tr>
<tr valign="top">
<td bgcolor="#c0c0f0" width="530">
<table cellpadding="10" border="0" width="100%"><tr><td>
<center>
<table width="80%" cellspacing="10">
<table width="600" border="0">
<tr><th>Remote</th><th>State</th><th>Retransmissions</th><th>Timer</th><th>Flags</th></tr>

File diff suppressed because it is too large Load Diff

View File

@@ -10,11 +10,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Swedish Institute
* of Computer Science and its contributors.
* 4. Neither the name of the Institute nor the names of its contributors
* 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.
*
@@ -34,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: fsdata.h,v 1.4 2001/11/25 18:47:36 adam Exp $
* $Id: fsdata.h,v 1.4.2.1 2003/10/04 22:54:06 adam Exp $
*/
#ifndef __FSDATA_H__
#define __FSDATA_H__

View File

@@ -1,3 +1,54 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \defgroup httpd Web server
* @{
*
* The uIP web server is a very simplistic implementation of an HTTP
* server. It can serve web pages and files from a read-only ROM
* filesystem, and provides a very small scripting language.
*
* The script language is very simple and works as follows. Each
* script line starts with a command character, either "i", "t", "c",
* "#" or ".". The "i" command tells the script interpreter to
* "include" a file from the virtual file system and output it to the
* web browser. The "t" command should be followed by a line of text
* that is to be output to the browser. The "c" command is used to
* call one of the C functions from the httpd-cgi.c file. A line that
* starts with a "#" is ignored (i.e., the "#" denotes a comment), and
* the "." denotes the last script line.
*
* The script that produces the file statistics page looks somewhat
* like this:
*
\code
i /header.html
t <h1>File statistics</h1><br><table width="100%">
t <tr><td><a href="/index.html">/index.html</a></td><td>
c a /index.html
t </td></tr> <tr><td><a href="/cgi/files">/cgi/files</a></td><td>
c a /cgi/files
t </td></tr> <tr><td><a href="/cgi/tcp">/cgi/tcp</a></td><td>
c a /cgi/tcp
t </td></tr> <tr><td><a href="/404.html">/404.html</a></td><td>
c a /404.html
t </td></tr></table>
i /footer.plain
.
\endcode
*
*/
/**
* \file
* HTTP server.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
@@ -10,10 +61,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,7 +79,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd.c,v 1.27 2002/01/15 17:22:08 adam Exp $
* $Id: httpd.c,v 1.28.2.6 2003/10/07 13:22:27 adam Exp $
*
*/
@@ -63,6 +111,7 @@
struct httpd_state *hs;
extern const struct fsdata_file file_index_html;
extern const struct fsdata_file file_404_html;
static void next_scriptline(void);
static void next_scriptstate(void);
@@ -83,6 +132,12 @@ static void next_scriptstate(void);
#define ISO_period 0x2e
/*-----------------------------------------------------------------------------------*/
/**
* Initialize the web server.
*
* Starts to listen for incoming connection requests on TCP port 80.
*/
/*-----------------------------------------------------------------------------------*/
void
httpd_init(void)
@@ -90,18 +145,19 @@ httpd_init(void)
fs_init();
/* Listen to port 80. */
uip_listen(80);
uip_listen(HTONS(80));
}
/*-----------------------------------------------------------------------------------*/
void
httpd(void)
httpd_appcall(void)
{
struct fs_file fsfile;
u8_t i;
switch(uip_conn->lport) {
/* This is the web server: */
case htons(80):
case HTONS(80):
/* Pick out the application state from the uip_conn structure. */
hs = (struct httpd_state *)(uip_conn->appstate);
@@ -121,9 +177,6 @@ httpd(void)
connection yet. */
hs->state = HTTP_NOGET;
hs->count = 0;
/* Don't send any data in return; we wait for the HTTP request
instead. */
uip_send(uip_appdata, 0);
return;
} else if(uip_poll()) {
@@ -161,11 +214,18 @@ httpd(void)
PRINT("request for file ");
PRINTLN(&uip_appdata[4]);
if(!fs_open((const char *)&uip_appdata[4], &fsfile)) {
PRINTLN("couldn't open file");
fs_open(file_index_html.name, &fsfile);
/* Check for a request for "/". */
if(uip_appdata[4] == ISO_slash &&
uip_appdata[5] == 0) {
fs_open(file_index_html.name, &fsfile);
} else {
if(!fs_open((const char *)&uip_appdata[4], &fsfile)) {
PRINTLN("couldn't open file");
fs_open(file_404_html.name, &fsfile);
}
}
if(uip_appdata[4] == ISO_slash &&
uip_appdata[5] == ISO_c &&
uip_appdata[6] == ISO_g &&
@@ -196,10 +256,9 @@ httpd(void)
into the file and send back more data. If we are out of data to
send, we close the connection. */
if(uip_acked()) {
if(hs->count >= uip_mss()) {
hs->count -= uip_mss();
hs->dataptr += uip_mss();
if(hs->count >= uip_conn->len) {
hs->count -= uip_conn->len;
hs->dataptr += uip_conn->len;
} else {
hs->count = 0;
}
@@ -213,11 +272,9 @@ httpd(void)
}
}
}
}
if(hs->state == HTTP_FUNC) {
} else {
/* Call the CGI function. */
if(cgitab[hs->script[2] - ISO_a]()) {
if(cgitab[hs->script[2] - ISO_a](uip_acked())) {
/* If the function returns non-zero, we jump to the next line
in the script. */
next_scriptline();
@@ -228,8 +285,7 @@ httpd(void)
if(hs->state != HTTP_FUNC && !uip_poll()) {
/* Send a piece of data, but not more than the MSS of the
connection. */
uip_send(hs->dataptr,
hs->count > uip_mss()? uip_mss(): hs->count);
uip_send(hs->dataptr, hs->count);
}
/* Finally, return to uIP. Our outgoing packet will soon be on its
@@ -284,7 +340,7 @@ next_scriptstate(void)
hs->state = HTTP_FUNC;
hs->dataptr = NULL;
hs->count = 0;
uip_reset_acked();
cgitab[hs->script[2] - ISO_a](0);
break;
case ISO_i:
/* Include a file. */
@@ -311,3 +367,5 @@ next_scriptstate(void)
}
}
/*-----------------------------------------------------------------------------------*/
/** @} */
/** @} */

View File

@@ -1,3 +1,14 @@
/**
* \addtogroup httpd
* @{
*/
/**
* \file
* HTTP server header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
@@ -10,10 +21,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,7 +39,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: httpd.h,v 1.3 2002/01/15 17:22:08 adam Exp $
* $Id: httpd.h,v 1.4.2.3 2003/10/06 22:56:44 adam Exp $
*
*/
@@ -39,12 +47,14 @@
#define __HTTPD_H__
void httpd_init(void);
void httpd(void);
void httpd_appcall(void);
/* UIP_APPCALL: the name of the application function. This function
must return void and take no arguments (i.e., C type "void
appfunc(void)"). */
#define UIP_APPCALL httpd
#ifndef UIP_APPCALL
#define UIP_APPCALL httpd_appcall
#endif
struct httpd_state {
u8_t state;
@@ -56,7 +66,9 @@ struct httpd_state {
/* UIP_APPSTATE_SIZE: The size of the application-specific state
stored in the uip_conn structure. */
#ifndef UIP_APPSTATE_SIZE
#define UIP_APPSTATE_SIZE (sizeof(struct httpd_state))
#endif
#define FS_STATISTICS 1

View File

@@ -15,8 +15,12 @@ while($file = <FILES>) {
chop($file);
open(HEADER, "> /tmp/header") || die $!;
print(HEADER "HTTP/1.0 200 OK\r\n");
print(HEADER "Server: uIP/0.5 (http://dunkels.com/adam/uip/)\r\n");
if($file =~ /404.html/) {
print(HEADER "HTTP/1.0 404 File not found\r\n");
} else {
print(HEADER "HTTP/1.0 200 OK\r\n");
}
print(HEADER "Server: uIP/0.9 (http://dunkels.com/adam/uip/)\r\n");
if($file =~ /\.html$/) {
print(HEADER "Content-type: text/html\r\n");
} elsif($file =~ /\.gif$/) {

467
apps/resolv/resolv.c Normal file
View File

@@ -0,0 +1,467 @@
/**
* \addtogroup uip
* @{
*/
/**
* \defgroup uipdns uIP hostname resolver functions
* @{
*
* The uIP DNS resolver functions are used to lookup a hostname and
* map it to a numerical IP address. It maintains a list of resolved
* hostnames that can be queried with the resolv_lookup()
* function. New hostnames can be resolved using the resolv_query()
* function.
*
* When a hostname has been resolved (or found to be non-existant),
* the resolver code calls a callback function called resolv_found()
* that must be implemented by the module that uses the resolver.
*/
/**
* \file
* DNS host name to IP address resolver.
* \author Adam Dunkels <adam@dunkels.com>
*
* This file implements a DNS host name to IP address resolver.
*/
/*
* 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: resolv.c,v 1.1.2.5 2003/10/06 22:56:44 adam Exp $
*
*/
#include "resolv.h"
#include <string.h>
#ifndef NULL
#define NULL (void *)0
#endif /* NULL */
/** \internal The maximum number of retries when asking for a name. */
#define MAX_RETRIES 8
/** \internal The DNS message header. */
struct dns_hdr {
u16_t id;
u8_t flags1, flags2;
#define DNS_FLAG1_RESPONSE 0x80
#define DNS_FLAG1_OPCODE_STATUS 0x10
#define DNS_FLAG1_OPCODE_INVERSE 0x08
#define DNS_FLAG1_OPCODE_STANDARD 0x00
#define DNS_FLAG1_AUTHORATIVE 0x04
#define DNS_FLAG1_TRUNC 0x02
#define DNS_FLAG1_RD 0x01
#define DNS_FLAG2_RA 0x80
#define DNS_FLAG2_ERR_MASK 0x0f
#define DNS_FLAG2_ERR_NONE 0x00
#define DNS_FLAG2_ERR_NAME 0x03
u16_t numquestions;
u16_t numanswers;
u16_t numauthrr;
u16_t numextrarr;
};
/** \internal The DNS answer message structure. */
struct dns_answer {
/* DNS answer record starts with either a domain name or a pointer
to a name already present somewhere in the packet. */
u16_t type;
u16_t class;
u16_t ttl[2];
u16_t len;
u16_t ipaddr[2];
};
struct namemap {
#define STATE_UNUSED 0
#define STATE_NEW 1
#define STATE_ASKING 2
#define STATE_DONE 3
#define STATE_ERROR 4
u8_t state;
u8_t tmr;
u8_t retries;
u8_t seqno;
u8_t err;
char name[32];
u16_t ipaddr[2];
};
#ifndef UIP_CONF_RESOLV_ENTRIES
#define RESOLV_ENTRIES 4
#else /* UIP_CONF_RESOLV_ENTRIES */
#define RESOLV_ENTRIES UIP_CONF_RESOLV_ENTRIES
#endif /* UIP_CONF_RESOLV_ENTRIES */
static struct namemap names[RESOLV_ENTRIES];
static u8_t seqno;
static struct uip_udp_conn *resolv_conn = NULL;
/*-----------------------------------------------------------------------------------*/
/** \internal
* Walk through a compact encoded DNS name and return the end of it.
*
* \return The end of the name.
*/
/*-----------------------------------------------------------------------------------*/
static unsigned char *
parse_name(unsigned char *query)
{
unsigned char n;
do {
n = *query++;
while(n > 0) {
/* printf("%c", *query);*/
++query;
--n;
};
/* printf(".");*/
} while(*query != 0);
/* printf("\n");*/
return query + 1;
}
/*-----------------------------------------------------------------------------------*/
/** \internal
* Runs through the list of names to see if there are any that have
* not yet been queried and, if so, sends out a query.
*/
/*-----------------------------------------------------------------------------------*/
static void
check_entries(void)
{
register struct dns_hdr *hdr;
char *query, *nptr, *nameptr;
static u8_t i;
static u8_t n;
register struct namemap *namemapptr;
for(i = 0; i < RESOLV_ENTRIES; ++i) {
namemapptr = &names[i];
if(namemapptr->state == STATE_NEW ||
namemapptr->state == STATE_ASKING) {
if(namemapptr->state == STATE_ASKING) {
if(--namemapptr->tmr == 0) {
if(++namemapptr->retries == MAX_RETRIES) {
namemapptr->state = STATE_ERROR;
resolv_found(namemapptr->name, NULL);
continue;
}
namemapptr->tmr = namemapptr->retries;
} else {
/* printf("Timer %d\n", namemapptr->tmr);*/
/* Its timer has not run out, so we move on to next
entry. */
continue;
}
} else {
namemapptr->state = STATE_ASKING;
namemapptr->tmr = 1;
namemapptr->retries = 0;
}
hdr = (struct dns_hdr *)uip_appdata;
memset(hdr, 0, sizeof(struct dns_hdr));
hdr->id = htons(i);
hdr->flags1 = DNS_FLAG1_RD;
hdr->numquestions = HTONS(1);
query = (char *)uip_appdata + 12;
nameptr = namemapptr->name;
--nameptr;
/* Convert hostname into suitable query format. */
do {
++nameptr;
nptr = query;
++query;
for(n = 0; *nameptr != '.' && *nameptr != 0; ++nameptr) {
*query = *nameptr;
++query;
++n;
}
*nptr = n;
} while(*nameptr != 0);
{
static unsigned char endquery[] =
{0,0,1,0,1};
memcpy(query, endquery, 5);
}
uip_udp_send((unsigned char)(query + 5 - (char *)uip_appdata));
break;
}
}
}
/*-----------------------------------------------------------------------------------*/
/** \internal
* Called when new UDP data arrives.
*/
/*-----------------------------------------------------------------------------------*/
static void
newdata(void)
{
char *nameptr;
struct dns_answer *ans;
struct dns_hdr *hdr;
static u8_t nquestions, nanswers;
static u8_t i;
register struct namemap *namemapptr;
hdr = (struct dns_hdr *)uip_appdata;
/* printf("ID %d\n", htons(hdr->id));
printf("Query %d\n", hdr->flags1 & DNS_FLAG1_RESPONSE);
printf("Error %d\n", hdr->flags2 & DNS_FLAG2_ERR_MASK);
printf("Num questions %d, answers %d, authrr %d, extrarr %d\n",
htons(hdr->numquestions),
htons(hdr->numanswers),
htons(hdr->numauthrr),
htons(hdr->numextrarr));
*/
/* The ID in the DNS header should be our entry into the name
table. */
i = htons(hdr->id);
namemapptr = &names[i];
if(i < RESOLV_ENTRIES &&
namemapptr->state == STATE_ASKING) {
/* This entry is now finished. */
namemapptr->state = STATE_DONE;
namemapptr->err = hdr->flags2 & DNS_FLAG2_ERR_MASK;
/* Check for error. If so, call callback to inform. */
if(namemapptr->err != 0) {
namemapptr->state = STATE_ERROR;
resolv_found(namemapptr->name, NULL);
return;
}
/* We only care about the question(s) and the answers. The authrr
and the extrarr are simply discarded. */
nquestions = htons(hdr->numquestions);
nanswers = htons(hdr->numanswers);
/* Skip the name in the question. XXX: This should really be
checked agains the name in the question, to be sure that they
match. */
nameptr = parse_name((char *)uip_appdata + 12) + 4;
while(nanswers > 0) {
/* The first byte in the answer resource record determines if it
is a compressed record or a normal one. */
if(*nameptr & 0xc0) {
/* Compressed name. */
nameptr +=2;
/* printf("Compressed anwser\n");*/
} else {
/* Not compressed name. */
nameptr = parse_name((char *)nameptr);
}
ans = (struct dns_answer *)nameptr;
/* printf("Answer: type %x, class %x, ttl %x, length %x\n",
htons(ans->type), htons(ans->class), (htons(ans->ttl[0])
<< 16) | htons(ans->ttl[1]), htons(ans->len));*/
/* Check for IP address type and Internet class. Others are
discarded. */
if(ans->type == HTONS(1) &&
ans->class == HTONS(1) &&
ans->len == HTONS(4)) {
/* printf("IP address %d.%d.%d.%d\n",
htons(ans->ipaddr[0]) >> 8,
htons(ans->ipaddr[0]) & 0xff,
htons(ans->ipaddr[1]) >> 8,
htons(ans->ipaddr[1]) & 0xff);*/
/* XXX: we should really check that this IP address is the one
we want. */
namemapptr->ipaddr[0] = ans->ipaddr[0];
namemapptr->ipaddr[1] = ans->ipaddr[1];
resolv_found(namemapptr->name, namemapptr->ipaddr);
return;
} else {
nameptr = nameptr + 10 + htons(ans->len);
}
--nanswers;
}
}
}
/*-----------------------------------------------------------------------------------*/
/** \internal
* The main UDP function.
*/
/*-----------------------------------------------------------------------------------*/
void
udp_appcall(void)
{
if(uip_udp_conn->rport == HTONS(53)) {
if(uip_poll()) {
check_entries();
}
if(uip_newdata()) {
newdata();
}
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Queues a name so that a question for the name will be sent out.
*
* \param name The hostname that is to be queried.
*/
/*-----------------------------------------------------------------------------------*/
void
resolv_query(char *name)
{
static u8_t i;
static u8_t lseq, lseqi;
register struct namemap *nameptr;
lseq = lseqi = 0;
for(i = 0; i < RESOLV_ENTRIES; ++i) {
nameptr = &names[i];
if(nameptr->state == STATE_UNUSED) {
break;
}
if(seqno - nameptr->seqno > lseq) {
lseq = seqno - nameptr->seqno;
lseqi = i;
}
}
if(i == RESOLV_ENTRIES) {
i = lseqi;
nameptr = &names[i];
}
/* printf("Using entry %d\n", i);*/
strcpy(nameptr->name, name);
nameptr->state = STATE_NEW;
nameptr->seqno = seqno;
++seqno;
/* if(resolv_conn != NULL) {
dispatcher_emit(uip_signal_poll_udp, resolv_conn, DISPATCHER_BROADCAST);
} */
}
/*-----------------------------------------------------------------------------------*/
/**
* Look up a hostname in the array of known hostnames.
*
* \note This function only looks in the internal array of known
* hostnames, it does not send out a query for the hostname if none
* was found. The function resolv_query() can be used to send a query
* for a hostname.
*
* \return A pointer to a 4-byte representation of the hostname's IP
* address, or NULL if the hostname was not found in the array of
* hostnames.
*/
/*-----------------------------------------------------------------------------------*/
u16_t *
resolv_lookup(char *name)
{
static u8_t i;
struct namemap *nameptr;
/* Walk through the list to see if the name is in there. If it is
not, we return NULL. */
for(i = 0; i < RESOLV_ENTRIES; ++i) {
nameptr = &names[i];
if(nameptr->state == STATE_DONE &&
strcmp(name, nameptr->name) == 0) {
return nameptr->ipaddr;
}
}
return NULL;
}
/*-----------------------------------------------------------------------------------*/
/**
* Obtain the currently configured DNS server.
*
* \return A pointer to a 4-byte representation of the IP address of
* the currently configured DNS server or NULL if no DNS server has
* been configured.
*/
/*-----------------------------------------------------------------------------------*/
u16_t *
resolv_getserver(void)
{
if(resolv_conn == NULL) {
return NULL;
}
return resolv_conn->ripaddr;
}
/*-----------------------------------------------------------------------------------*/
/**
* Configure which DNS server to use for queries.
*
* \param dnsserver A pointer to a 4-byte representation of the IP
* address of the DNS server to be configured.
*/
/*-----------------------------------------------------------------------------------*/
void
resolv_conf(u16_t *dnsserver)
{
if(resolv_conn != NULL) {
uip_udp_remove(resolv_conn);
}
resolv_conn = uip_udp_new(dnsserver, 53);
}
/*-----------------------------------------------------------------------------------*/
/**
* Initalize the resolver.
*/
/*-----------------------------------------------------------------------------------*/
void
resolv_init(void)
{
static u8_t i;
for(i = 0; i < RESOLV_ENTRIES; ++i) {
names[i].state = STATE_DONE;
}
}
/*-----------------------------------------------------------------------------------*/
/** @} */
/** @} */

View File

@@ -1,5 +1,15 @@
/**
* \addtogroup uipdns
* @{
*/
/**
* \file
* DNS resolver code header file.
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* Copyright (c) 2002-2003, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,10 +20,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,23 +38,34 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: rs232dev.h,v 1.1 2001/11/20 20:49:45 adam Exp $
* $Id: resolv.h,v 1.1.2.3 2003/10/04 21:18:59 adam Exp $
*
*/
#ifndef __RS232DEV_H__
#define __RS232DEV_H__
#ifndef __RESOLV_H__
#define __RESOLV_H__
#include "uip.h"
void rs232dev_init(void);
u8_t rs232dev_read(void);
void rs232dev_send(void);
/**
* Callback function which is called when a hostname is found.
*
* This function must be implemented by the module that uses the DNS
* resolver. It is called when a hostname is found, or when a hostname
* was not found.
*
* \param name A pointer to the name that was looked up. \param
* ipaddr A pointer to a 4-byte array containing the IP address of the
* hostname, or NULL if the hostname could not be found.
*/
void resolv_found(char *name, u16_t *ipaddr);
#if UIP_BUFSIZE > 255
u16_t rs232dev_poll(void);
#else
u8_t rs232dev_poll(void);
#endif /* UIP_BUFSIZE > 255 */
/* Functions. */
void resolv_conf(u16_t *dnsserver);
u16_t *resolv_getserver(void);
void resolv_init(void);
u16_t *resolv_lookup(char *name);
void resolv_query(char *name);
#endif /* __RS232DEV_H__ */
#endif /* __RESOLV_H__ */
/** @} */

27
apps/smtp/makesmtpstrings Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/perl
open(OUTPUTC, "> smtp-strings.c");
open(OUTPUTH, "> smtp-strings.h");
open(FILE, "smtp-strings");
while(<FILE>) {
if(/(.+) "(.+)"/) {
$var = $1;
$data = $2;
printf(OUTPUTC "char $var\[%d] = \n", length($data) + 1);
printf(OUTPUTC "/* $data */\n");
printf(OUTPUTC "{");
for($j = 0; $j < length($data); $j++) {
printf(OUTPUTC "%#02x, ", unpack("C", substr($data, $j, 1)));
}
printf(OUTPUTC "};\n");
printf(OUTPUTH "extern char $var\[%d];\n", length($data) + 1);
}
}
exit 0;
printf(OUTPUT "%#02x, ", unpack("C", $data));

9
apps/smtp/smtp-strings Normal file
View File

@@ -0,0 +1,9 @@
smtp_220 "220"
smtp_helo "HELO "
smtp_mail_from "MAIL FROM: "
smtp_rcpt_to "RCPT TO: "
smtp_data "DATA"
smtp_to "To: "
smtp_from "From: "
smtp_subject "Subject: "
smtp_quit "QUIT"

27
apps/smtp/smtp-strings.c Normal file
View File

@@ -0,0 +1,27 @@
char smtp_220[4] =
/* 220 */
{0x32, 0x32, 0x30, };
char smtp_helo[6] =
/* HELO */
{0x48, 0x45, 0x4c, 0x4f, 0x20, };
char smtp_mail_from[12] =
/* MAIL FROM: */
{0x4d, 0x41, 0x49, 0x4c, 0x20, 0x46, 0x52, 0x4f, 0x4d, 0x3a, 0x20, };
char smtp_rcpt_to[10] =
/* RCPT TO: */
{0x52, 0x43, 0x50, 0x54, 0x20, 0x54, 0x4f, 0x3a, 0x20, };
char smtp_data[5] =
/* DATA */
{0x44, 0x41, 0x54, 0x41, };
char smtp_to[5] =
/* To: */
{0x54, 0x6f, 0x3a, 0x20, };
char smtp_from[7] =
/* From: */
{0x46, 0x72, 0x6f, 0x6d, 0x3a, 0x20, };
char smtp_subject[10] =
/* Subject: */
{0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, };
char smtp_quit[5] =
/* QUIT */
{0x51, 0x55, 0x49, 0x54, };

9
apps/smtp/smtp-strings.h Normal file
View File

@@ -0,0 +1,9 @@
extern char smtp_220[4];
extern char smtp_helo[6];
extern char smtp_mail_from[12];
extern char smtp_rcpt_to[10];
extern char smtp_data[5];
extern char smtp_to[5];
extern char smtp_from[7];
extern char smtp_subject[10];
extern char smtp_quit[5];

422
apps/smtp/smtp.c Normal file
View File

@@ -0,0 +1,422 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \defgroup smtp SMTP E-mail sender
* @{
*
* The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is
* the standard way of sending and transfering e-mail on the
* Internet. This simple example implementation is intended as an
* example of how to implement protocols in uIP, and is able to send
* out e-mail but has not been extensively tested.
*/
/**
* \file
* SMTP example implementation
* \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
* 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: smtp.c,v 1.1.2.7 2003/10/07 13:47:50 adam Exp $
*
*/
#include "uip.h"
#include "smtp.h"
#include "smtp-strings.h"
#include <string.h>
#define STATE_SEND_NONE 0
#define STATE_SEND_HELO 1
#define STATE_SEND_MAIL_FROM 2
#define STATE_SEND_RCPT_TO 3
#define STATE_SEND_DATA 4
#define STATE_SEND_DATA_HEADERS 5
#define STATE_SEND_DATA_MESSAGE 6
#define STATE_SEND_DATA_END 7
#define STATE_SEND_QUIT 8
#define STATE_SEND_DONE 9
static char *localhostname;
static u16_t smtpserver[2];
#define ISO_nl 0x0a
#define ISO_cr 0x0d
#define ISO_period 0x2e
#define ISO_2 0x32
#define ISO_3 0x33
#define ISO_4 0x34
#define ISO_5 0x35
/*-----------------------------------------------------------------------------------*/
static void
senddata(struct smtp_state *s)
{
char *textptr;
if(s->textlen != 0 &&
s->textlen == s->sendptr) {
return;
}
textptr = (char *)uip_appdata;
switch(s->state) {
case STATE_SEND_HELO:
/* Create HELO message. */
strcpy(textptr, smtp_helo);
textptr += sizeof(smtp_helo) - 1;
strcpy(textptr, localhostname);
textptr += strlen(localhostname);
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
/* printf("s->sendptr %d\n", s->sendptr);*/
if(s->sendptr == 0) {
s->textlen = textptr - (char *)uip_appdata;
/* printf("s->textlen %d\n", s->textlen);*/
}
textptr = (char *)uip_appdata;
break;
case STATE_SEND_MAIL_FROM:
/* Create MAIL FROM message. */
strcpy(textptr, smtp_mail_from);
textptr += sizeof(smtp_mail_from) - 1;
strcpy(textptr, s->from);
textptr += strlen(s->from);
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
if(s->sendptr == 0) {
s->textlen = textptr - (char *)uip_appdata;
}
textptr = (char *)uip_appdata;
break;
case STATE_SEND_RCPT_TO:
/* Create RCPT_TO message. */
strcpy(textptr, smtp_rcpt_to);
textptr += sizeof(smtp_rcpt_to) - 1;
strcpy(textptr, s->to);
textptr += strlen(s->to);
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
if(s->sendptr == 0) {
s->textlen = textptr - (char *)uip_appdata;
}
textptr = (char *)uip_appdata;
break;
case STATE_SEND_DATA:
strcpy(textptr, smtp_data);
textptr += sizeof(smtp_data) - 1;
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
if(s->sendptr == 0) {
s->textlen = textptr - (char *)uip_appdata;
}
textptr = (char *)uip_appdata;
break;
case STATE_SEND_DATA_HEADERS:
/* Create mail headers-> */
strcpy(textptr, smtp_to);
textptr += sizeof(smtp_to) - 1;
strcpy(textptr, s->to);
textptr += strlen(s->to);
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
strcpy(textptr, smtp_from);
textptr += sizeof(smtp_from) - 1;
strcpy(textptr, s->from);
textptr += strlen(s->from);
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
strcpy(textptr, smtp_subject);
textptr += sizeof(smtp_subject) - 1;
strcpy(textptr, s->subject);
textptr += strlen(s->subject);
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
if(s->sendptr == 0) {
s->textlen = textptr - (char *)uip_appdata;
}
textptr = (char *)uip_appdata;
break;
case STATE_SEND_DATA_MESSAGE:
textptr = s->msg;
if(s->sendptr == 0) {
s->textlen = s->msglen;
}
break;
case STATE_SEND_DATA_END:
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
*textptr = ISO_period;
++textptr;
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
if(s->sendptr == 0) {
s->textlen = 5;
}
textptr = (char *)uip_appdata;
break;
case STATE_SEND_QUIT:
strcpy(textptr, smtp_quit);
textptr += sizeof(smtp_quit) - 1;
*textptr = ISO_cr;
++textptr;
*textptr = ISO_nl;
++textptr;
if(s->sendptr == 0) {
s->textlen = textptr - (char *)uip_appdata;
}
textptr = (char *)uip_appdata;
break;
default:
return;
}
textptr += s->sendptr;
if(s->textlen - s->sendptr > uip_mss()) {
s->sentlen = uip_mss();
} else {
s->sentlen = s->textlen - s->sendptr;
}
/* textptr[s->sentlen] = 0;
printf("Senidng '%s'\n", textptr);*/
uip_send(textptr, s->sentlen);
}
/*-----------------------------------------------------------------------------------*/
static void
acked(struct smtp_state *s)
{
s->sendptr += s->sentlen;
s->sentlen = 0;
if(s->sendptr == s->textlen) {
switch(s->state) {
case STATE_SEND_DATA_HEADERS:
s->state = STATE_SEND_DATA_MESSAGE;
s->sendptr = s->textlen = 0;
break;
case STATE_SEND_DATA_MESSAGE:
s->state = STATE_SEND_DATA_END;
s->sendptr = s->textlen = 0;
break;
case STATE_SEND_DATA_END:
s->state = STATE_SEND_QUIT;
s->sendptr = s->textlen = 0;
break;
case STATE_SEND_QUIT:
s->state = STATE_SEND_DONE;
smtp_done(SMTP_ERR_OK);
uip_close();
break;
}
}
}
/*-----------------------------------------------------------------------------------*/
static void
newdata(struct smtp_state *s)
{
if(*(char *)uip_appdata == ISO_5) {
smtp_done(1);
uip_abort();
return;
}
/* printf("Got %d bytes: '%s'\n", uip_datalen(),
uip_appdata);*/
switch(s->state) {
case STATE_SEND_NONE:
if(strncmp((char *)uip_appdata, smtp_220, 3) == 0) {
/* printf("Newdata(): SEND_NONE, got 220, towards SEND_HELO\n");*/
s->state = STATE_SEND_HELO;
s->sendptr = 0;
}
break;
case STATE_SEND_HELO:
if(*(char *)uip_appdata == ISO_2) {
/* printf("Newdata(): SEND_HELO, got 2*, towards SEND_MAIL_FROM\n");*/
s->state = STATE_SEND_MAIL_FROM;
s->sendptr = 0;
}
break;
case STATE_SEND_MAIL_FROM:
if(*(char *)uip_appdata == ISO_2) {
/* printf("Newdata(): SEND_MAIL_FROM, got 2*, towards SEND_RCPT_TO\n"); */
/* printf("2\n");*/
s->state = STATE_SEND_RCPT_TO;
s->textlen = s->sendptr = 0;
}
break;
case STATE_SEND_RCPT_TO:
if(*(char *)uip_appdata == ISO_2) {
/* printf("2\n");*/
s->state = STATE_SEND_DATA;
s->textlen = s->sendptr = 0;
}
break;
case STATE_SEND_DATA:
if(*(char *)uip_appdata == ISO_3) {
/* printf("3\n");*/
s->state = STATE_SEND_DATA_HEADERS;
s->textlen = s->sendptr = 0;
}
break;
case STATE_SEND_DATA_HEADERS:
if(*(char *)uip_appdata == ISO_3) {
/* printf("3\n");*/
s->state = STATE_SEND_DATA_MESSAGE;
s->textlen = s->sendptr = 0;
}
break;
}
}
/*-----------------------------------------------------------------------------------*/
void
smtp_appcall(void)
{
struct smtp_state *s;
s = (struct smtp_state *)uip_conn->appstate;
if(uip_connected()) {
/* senddata();*/
return;
}
if(uip_acked()) {
acked(s);
}
if(uip_newdata()) {
newdata(s);
}
if(uip_rexmit() ||
uip_newdata() ||
uip_acked()) {
senddata(s);
} else if(uip_poll()) {
senddata(s);
}
/* if(uip_closed()) {
printf("Dnoe\n");
}*/
}
/*-----------------------------------------------------------------------------------*/
/**
* Send an e-mail.
*
* \param to The e-mail address of the receiver of the e-mail.
* \param from The e-mail address of the sender of the e-mail.
* \param subject The subject of the e-mail.
* \param msg The actual e-mail message.
* \param msglen The length of the e-mail message.
*/
/*-----------------------------------------------------------------------------------*/
unsigned char
smtp_send(char *to, char *from, char *subject,
char *msg, u16_t msglen)
{
struct uip_conn *conn;
struct smtp_state *s;
conn = uip_connect(smtpserver, HTONS(25));
if(conn == NULL) {
return 0;
}
s = conn->appstate;
s->state = STATE_SEND_NONE;
s->sentlen = s->sendptr = s->textlen = 0;
s->to = to;
s->from = from;
s->subject = subject;
s->msg = msg;
s->msglen = msglen;
return 1;
}
/*-----------------------------------------------------------------------------------*/
/**
* Specificy an SMTP server and hostname.
*
* This function is used to configure the SMTP module with an SMTP
* server and the hostname of the host.
*
* \param lhostname The hostname of the uIP host.
*
* \param server A pointer to a 4-byte array representing the IP
* address of the SMTP server to be configured.
*/
/*-----------------------------------------------------------------------------------*/
void
smtp_configure(char *lhostname, u16_t *server)
{
localhostname = lhostname;
smtpserver[0] = server[0];
smtpserver[1] = server[1];
}
/*-----------------------------------------------------------------------------------*/
/** @} */

View File

@@ -1,5 +1,18 @@
/**
* \addtogroup smtp
* @{
*/
/**
* \file
* SMTP header file
* \author Adam Dunkels <adam@dunkels.com>
*/
/*
* Copyright (c) 2001, Adam Dunkels.
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,10 +23,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,23 +41,60 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arch.h,v 1.1 2002/01/10 06:22:56 adam Exp $
* $Id: smtp.h,v 1.1.2.4 2003/10/06 22:56:45 adam Exp $
*
*/
#ifndef __SMTP_H__
#define __SMTP_H__
#ifndef __UIP_ARCH_H__
#define __UIP_ARCH_H__
#include "uipopt.h"
#include "uip.h"
/**
* Error number that signifies a non-error condition.
*/
#define SMTP_ERR_OK 0
#if UIP_BUFSIZE > 255
void uip_add_rcv_nxt(u16_t n);
void uip_add_ack_nxt(u16_t n);
#else
void uip_add_rcv_nxt(u8_t n);
void uip_add_ack_nxt(u8_t n);
#endif /* UIP_BUFSIZE > 255 */
u16_t uip_ipchksum(void);
u16_t uip_tcpchksum(void);
/**
* Callback function that is called when an e-mail transmission is
* done.
*
* This function must be implemented by the module that uses the SMTP
* module.
*
* \param error The number of the error if an error occured, or
* SMTP_ERR_OK.
*/
void smtp_done(unsigned char error);
#endif /* __UIP_ARCH_H__ */
/* Functions. */
void smtp_configure(char *localhostname, u16_t *smtpserver);
unsigned char smtp_send(char *to, char *from,
char *subject, char *msg,
u16_t msglen);
void smtp_appcall(void);
struct smtp_state {
u8_t state;
char *to;
char *from;
char *subject;
char *msg;
u16_t msglen;
u16_t sentlen, textlen;
u16_t sendptr;
};
#ifndef UIP_APPCALL
#define UIP_APPCALL smtp_appcall
#endif
#ifndef UIP_APPSTATE_SIZE
#define UIP_APPSTATE_SIZE (sizeof(struct smtp_state))
#endif
#endif /* __SMTP_H__ */

151
apps/telnet/telnet.c Normal file
View File

@@ -0,0 +1,151 @@
/*
* 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: telnet.c,v 1.1.2.3 2003/10/06 11:20:45 adam Exp $
*
*/
#include "uip.h"
#include "telnet.h"
#ifndef NULL
#define NULL (void *)0
#endif /* NULL */
#define FLAG_CLOSE 1
#define FLAG_ABORT 2
/*-----------------------------------------------------------------------------------*/
unsigned char
telnet_send(struct telnet_state *s, char *text, u16_t len)
{
if(s->text != NULL) {
return 1;
}
s->text = text;
s->textlen = len;
s->sentlen = 0;
return 0;
}
/*-----------------------------------------------------------------------------------*/
unsigned char
telnet_close(struct telnet_state *s)
{
s->flags = FLAG_CLOSE;
if(s->text != NULL) {
return 1;
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
unsigned char
telnet_abort(struct telnet_state *s)
{
s->flags = FLAG_ABORT;
if(s->text != NULL) {
return 1;
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
static void
acked(struct telnet_state *s)
{
s->textlen -= s->sentlen;
if(s->textlen == 0) {
s->text = NULL;
telnet_sent(s);
} else {
s->text += s->sentlen;
}
s->sentlen = 0;
}
/*-----------------------------------------------------------------------------------*/
static void
senddata(struct telnet_state *s)
{
if(s->text == NULL) {
uip_send(s->text, 0);
return;
}
if(s->textlen > uip_mss()) {
s->sentlen = uip_mss();
} else {
s->sentlen = s->textlen;
}
uip_send(s->text, s->sentlen);
}
/*-----------------------------------------------------------------------------------*/
void telnet_app(void)
{
struct telnet_state *s = (struct telnet_state *)uip_conn->appstate;
if(uip_connected()) {
s->flags = 0;
telnet_connected(s);
senddata(s);
return;
}
if(uip_closed()) {
telnet_closed(s);
}
if(uip_aborted()) {
telnet_aborted(s);
}
if(uip_timedout()) {
telnet_timedout(s);
}
if(s->flags & FLAG_CLOSE) {
uip_close();
return;
}
if(s->flags & FLAG_ABORT) {
uip_abort();
return;
}
if(uip_acked()) {
acked(s);
}
if(uip_newdata()) {
telnet_newdata(s, (char *)uip_appdata, uip_datalen());
}
if(uip_rexmit() ||
uip_newdata() ||
uip_acked()) {
senddata(s);
} else if(uip_poll()) {
senddata(s);
}
}
/*-----------------------------------------------------------------------------------*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* Copyright (c) 2002, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,10 +10,7 @@
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
@@ -31,23 +28,39 @@
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arch.h,v 1.1 2001/11/20 20:49:45 adam Exp $
* $Id: telnet.h,v 1.1.2.4 2003/10/06 22:56:45 adam Exp $
*
*/
#ifndef __TELNET_H__
#define __TELNET_H__
#ifndef __UIP_ARCH_H__
#define __UIP_ARCH_H__
struct telnet_state {
unsigned char flags;
char *text;
u16_t textlen;
u16_t sentlen;
};
#include "uip.h"
void telnet_app(void);
#if UIP_BUFSIZE > 255
void __fastcall__ uip_add_rcv_nxt(u16_t n);
void __fastcall__ uip_add_ack_nxt(u16_t n);
#else
void __fastcall__ uip_add_rcv_nxt(u8_t n);
void __fastcall__ uip_add_ack_nxt(u8_t n);
#endif /* UIP_BUFSIZE > 255 */
u16_t uip_ipchksum(void);
u16_t uip_tcpchksum(void);
#ifndef UIP_APPCALL
#define UIP_APPCALL telnet_app
#endif
#endif /* __UIP_ARCH_H__ */
#ifndef UIP_APPSTATE_SIZE
#define UIP_APPSTATE_SIZE (sizeof(struct telnet_state))
#endif
unsigned char telnet_send(struct telnet_state *s, char *text, u16_t len);
unsigned char telnet_close(struct telnet_state *s);
unsigned char telnet_abort(struct telnet_state *s);
/* Callbacks, must be implemented by the caller. */
void telnet_connected(struct telnet_state *s);
void telnet_closed(struct telnet_state *s);
void telnet_sent(struct telnet_state *s);
void telnet_aborted(struct telnet_state *s);
void telnet_timedout(struct telnet_state *s);
void telnet_newdata(struct telnet_state *s, char *data, u16_t len);
#endif /* __TELNET_H__ */

152
apps/telnetd/memb.c Normal file
View File

@@ -0,0 +1,152 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \file
* Memory block allocation routines.
* \author Adam Dunkels <adam@sics.se>
*
* The memory block allocation routines provide a simple yet powerful
* set of functions for managing a set of memory blocks of fixed
* size. A set of memory blocks is statically declared with the
* MEMB() macro. Memory blocks are allocated from the declared
* memory by the memb_alloc() function, and are deallocated with the
* memb_free() function.
*
* \note Because of namespace clashes only one MEMB() can be
* declared per C module, and the name scope of a MEMB() memory
* block is local to each C module.
*
* The following example shows how to declare and use a memory block
* called "cmem" which has 8 chunks of memory with each memory chunk
* being 20 bytes large.
*
\code
MEMB(cmem, 20, 8);
int main(int argc, char *argv[]) {
char *ptr;
memb_init(&cmem);
ptr = memb_alloc(&cmem);
if(ptr != NULL) {
do_something(ptr);
} else {
printf("Could not allocate memory.\n");
}
if(memb_free(ptr) == 0) {
printf("Deallocation succeeded.\n");
}
}
\endcode
*
*/
#include <string.h>
#include "memb.h"
/*------------------------------------------------------------------------------*/
/**
* Initialize a memory block that was declared with MEMB().
*
* \param m A memory block previosly declared with MEMB().
*/
/*------------------------------------------------------------------------------*/
void
memb_init(struct memb_blocks *m)
{
memset(m->mem, (m->size + 1) * m->num, 0);
}
/*------------------------------------------------------------------------------*/
/**
* Allocate a memory block from a block of memory declared with MEMB().
*
* \param m A memory block previosly declared with MEMB().
*/
/*------------------------------------------------------------------------------*/
char *
memb_alloc(struct memb_blocks *m)
{
int i;
char *ptr;
ptr = m->mem;
for(i = 0; i < m->num; ++i) {
if(*ptr == 0) {
/* If this block was unused, we increase the reference count to
indicate that it now is used and return a pointer to the
first byte following the reference counter. */
++*ptr;
return ptr + 1;
}
ptr += m->size + 1;
}
/* No free block was found, so we return NULL to indicate failure to
allocate block. */
return NULL;
}
/*------------------------------------------------------------------------------*/
/**
* Deallocate a memory block from a memory block previously declared
* with MEMB().
*
* \param m m A memory block previosly declared with MEMB().
*
* \param ptr A pointer to the memory block that is to be deallocated.
*
* \return The new reference count for the memory block (should be 0
* if successfully deallocated) or -1 if the pointer "ptr" did not
* point to a legal memory block.
*/
/*------------------------------------------------------------------------------*/
char
memb_free(struct memb_blocks *m, char *ptr)
{
int i;
char *ptr2;
/* Walk through the list of blocks and try to find the block to
which the pointer "ptr" points to. */
ptr2 = m->mem;
for(i = 0; i < m->num; ++i) {
if(ptr2 == ptr - 1) {
/* We've found to block to which "ptr" points so we decrease the
reference count and return the new value of it. */
return --*ptr2;
}
ptr2 += m->size + 1;
}
return -1;
}
/*------------------------------------------------------------------------------*/
/**
* Increase the reference count for a memory chunk.
*
* \note No sanity checks are currently made.
*
* \param m m A memory block previosly declared with MEMB().
*
* \param ptr A pointer to the memory chunk for which the reference
* count should be increased.
*
* \return The new reference count.
*/
/*------------------------------------------------------------------------------*/
char
memb_ref(struct memb_blocks *m, char *ptr)
{
return ++*(ptr - 1);
}
/*------------------------------------------------------------------------------*/

43
apps/telnetd/memb.h Normal file
View File

@@ -0,0 +1,43 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \file
* Memory block allocation routines.
* \author Adam Dunkels <adam@sics.se>
*
*/
#ifndef __MEMB_H__
#define __MEMB_H__
/**
* Declare a memory block.
*
* \param name The name of the memory block (later used with
* memb_init(), memb_alloc() and memb_free()).
*
* \param size The size of each memory chunk, in bytes.
*
* \param num The total number of memory chunks in the block.
*
*/
#define MEMB(name, size, num) \
static char memb_mem[(size + 1) * num]; \
static struct memb_blocks name = {size, num, memb_mem}
struct memb_blocks {
unsigned short size;
unsigned short num;
char *mem;
};
void memb_init(struct memb_blocks *m);
char *memb_alloc(struct memb_blocks *m);
char memb_ref(struct memb_blocks *m, char *ptr);
char memb_free(struct memb_blocks *m, char *ptr);
#endif /* __MEMB_H__ */

View File

@@ -0,0 +1,181 @@
/**
* \addtogroup telnetd
* @{
*/
/**
* \file
* An example telnet server shell
* \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
* 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.
*
* This file is part of the Contiki desktop OS.
*
* $Id: telnetd-shell.c,v 1.1.2.1 2003/10/06 22:56:22 adam Exp $
*
*/
#include "uip.h"
#include "telnetd.h"
#include <string.h>
struct ptentry {
char c;
void (* pfunc)(struct telnetd_state *s, char *str);
};
/*-----------------------------------------------------------------------------------*/
static void
parse(struct telnetd_state *s, register char *str, struct ptentry *t)
{
register struct ptentry *p;
char *sstr;
sstr = str;
/* Loop over the parse table entries in t in order to find one that
matches the first character in str. */
for(p = t; p->c != 0; ++p) {
if(*str == p->c) {
/* Skip rest of the characters up to the first space. */
while(*str != ' ') {
++str;
}
/* Skip all spaces.*/
while(*str == ' ') {
++str;
}
/* Call parse table entry function and return. */
p->pfunc(s, str);
return;
}
}
/* Did not find matching entry in parse table. We just call the
default handler supplied by the caller and return. */
p->pfunc(s, str);
}
/*-----------------------------------------------------------------------------------*/
static void
exitt(struct telnetd_state *s, char *str)
{
telnetd_close(s);
}
/*-----------------------------------------------------------------------------------*/
static void
inttostr(register char *str, unsigned int i)
{
str[0] = '0' + i / 100;
if(str[0] == '0') {
str[0] = ' ';
}
str[1] = '0' + (i / 10) % 10;
if(str[1] == '0') {
str[1] = ' ';
}
str[2] = '0' + i % 10;
str[3] = ' ';
str[4] = 0;
}
/*-----------------------------------------------------------------------------------*/
static void
stats(struct telnetd_state *s, char *strr)
{
char str[10];
inttostr(str, uip_stat.ip.recv);
telnetd_output(s, "IP packets received ", str);
inttostr(str, uip_stat.ip.sent);
telnetd_output(s, "IP packets sent ", str);
inttostr(str, uip_stat.ip.drop);
telnetd_output(s, "IP packets dropped ", str);
inttostr(str, uip_stat.icmp.recv);
telnetd_output(s, "ICMP packets received ", str);
inttostr(str, uip_stat.icmp.sent);
telnetd_output(s, "ICMP packets sent ", str);
inttostr(str, uip_stat.icmp.drop);
telnetd_output(s, "ICMP packets dropped ", str);
inttostr(str, uip_stat.tcp.recv);
telnetd_output(s, "TCP packets received ", str);
inttostr(str, uip_stat.tcp.sent);
telnetd_output(s, "TCP packets sent ", str);
inttostr(str, uip_stat.tcp.drop);
telnetd_output(s, "TCP packets dropped ", str);
inttostr(str, uip_stat.tcp.rexmit);
telnetd_output(s, "TCP packets retransmitted ", str);
inttostr(str, uip_stat.tcp.synrst);
telnetd_output(s, "TCP connection attempts ", str);
}
/*-----------------------------------------------------------------------------------*/
static void
help(struct telnetd_state *s, char *str)
{
telnetd_output(s, "Available commands:", "");
telnetd_output(s, "stats - show uIP statistics", "");
telnetd_output(s, "exit - exit shell", "");
telnetd_output(s, "? - show this help", "");
}
/*-----------------------------------------------------------------------------------*/
static void
none(struct telnetd_state *s, char *str)
{
if(strlen(str) > 0) {
telnetd_output(s, "Unknown command", "");
}
}
/*-----------------------------------------------------------------------------------*/
static struct ptentry configparsetab[] =
{{'s', stats},
{'e', exitt},
{'?', help},
/* Default action */
{0, none}};
/*-----------------------------------------------------------------------------------*/
void
telnetd_connected(struct telnetd_state *s)
{
telnetd_output(s, "uIP command shell", "");
telnetd_output(s, "Type '?' for help", "");
telnetd_prompt(s, "uIP-0.9> ");
}
/*-----------------------------------------------------------------------------------*/
void
telnetd_input(struct telnetd_state *s, char *cmd)
{
parse(s, cmd, configparsetab);
telnetd_prompt(s, "uIP-0.9> ");
}
/*-----------------------------------------------------------------------------------*/

392
apps/telnetd/telnetd.c Normal file
View File

@@ -0,0 +1,392 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \defgroup telnetd Telnet server
* @{
*
* The uIP telnet server provides a command based interface to uIP. It
* allows using the "telnet" application to access uIP, and implements
* the required telnet option negotiation.
*
* The code is structured in a way which makes it possible to add
* commands without having to rewrite the main telnet code. The main
* telnet code calls two callback functions, telnetd_connected() and
* telnetd_input(), when a telnet connection has been established and
* when a line of text arrives on a telnet connection. These two
* functions can be implemented in a way which suits the particular
* application or environment in which the uIP system is intended to
* be run.
*
* The uIP distribution contains an example telnet shell
* implementation that provides a basic set of commands.
*/
/**
* \file
* Implementation of the Telnet server.
* \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
* 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: telnetd.c,v 1.1.2.2 2003/10/07 13:47:50 adam Exp $
*
*/
#include "uip.h"
#include "memb.h"
#include "telnetd.h"
#include <string.h>
#define ISO_nl 0x0a
#define ISO_cr 0x0d
MEMB(linemem, TELNETD_LINELEN, TELNETD_NUMLINES);
static u8_t i;
#define STATE_NORMAL 0
#define STATE_IAC 1
#define STATE_WILL 2
#define STATE_WONT 3
#define STATE_DO 4
#define STATE_DONT 5
#define STATE_CLOSE 6
#define TELNET_IAC 255
#define TELNET_WILL 251
#define TELNET_WONT 252
#define TELNET_DO 253
#define TELNET_DONT 254
/*-----------------------------------------------------------------------------------*/
static char *
alloc_line(void)
{
return memb_alloc(&linemem);
}
/*-----------------------------------------------------------------------------------*/
static void
dealloc_line(char *line)
{
memb_free(&linemem, line);
}
/*-----------------------------------------------------------------------------------*/
static void
sendline(struct telnetd_state *s, char *line)
{
static unsigned int i;
for(i = 0; i < TELNETD_NUMLINES; ++i) {
if(s->lines[i] == NULL) {
s->lines[i] = line;
break;
}
}
if(i == TELNETD_NUMLINES) {
dealloc_line(line);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Close a telnet session.
*
* This function can be called from a telnet command in order to close
* the connection.
*
* \param s The connection which is to be closed.
*
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_close(struct telnetd_state *s)
{
s->state = STATE_CLOSE;
}
/*-----------------------------------------------------------------------------------*/
/**
* Print a prompt on a telnet connection.
*
* This function can be called by the telnet command shell in order to
* print out a command prompt.
*
* \param s A telnet connection.
*
* \param str The command prompt.
*
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_prompt(struct telnetd_state *s, char *str)
{
char *line;
line = alloc_line();
if(line != NULL) {
strncpy(line, str, TELNETD_LINELEN);
sendline(s, line);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Print out a string on a telnet connection.
*
* This function can be called from a telnet command parser in order
* to print out a string of text on the connection. The two strings
* given as arguments to the function will be concatenated, a carrige
* return and a new line character will be added, and the line is
* sent.
*
* \param s The telnet connection.
*
* \param str1 The first string.
*
* \param str2 The second string.
*
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_output(struct telnetd_state *s, char *str1, char *str2)
{
static unsigned len;
char *line;
line = alloc_line();
if(line != NULL) {
len = strlen(str1);
strncpy(line, str1, TELNETD_LINELEN);
if(len < TELNETD_LINELEN) {
strncpy(line + len, str2, TELNETD_LINELEN - len);
}
len = strlen(line);
if(len < TELNETD_LINELEN - 2) {
line[len] = ISO_cr;
line[len+1] = ISO_nl;
line[len+2] = 0;
}
sendline(s, line);
}
}
/*-----------------------------------------------------------------------------------*/
/**
* Initialize the telnet server.
*
* This function will perform the necessary initializations and start
* listening on TCP port 23.
*/
/*-----------------------------------------------------------------------------------*/
void
telnetd_init(void)
{
memb_init(&linemem);
uip_listen(HTONS(23));
}
/*-----------------------------------------------------------------------------------*/
static void
acked(struct telnetd_state *s)
{
dealloc_line(s->lines[0]);
for(i = 1; i < TELNETD_NUMLINES; ++i) {
s->lines[i - 1] = s->lines[i];
}
}
/*-----------------------------------------------------------------------------------*/
static void
senddata(struct telnetd_state *s)
{
if(s->lines[0] != NULL) {
uip_send(s->lines[0], strlen(s->lines[0]));
}
}
/*-----------------------------------------------------------------------------------*/
static void
getchar(struct telnetd_state *s, u8_t c)
{
if(c == ISO_cr) {
return;
}
s->buf[(int)s->bufptr] = c;
if(s->buf[(int)s->bufptr] == ISO_nl ||
s->bufptr == sizeof(s->buf) - 1) {
if(s->bufptr > 0) {
s->buf[(int)s->bufptr] = 0;
}
telnetd_input(s, s->buf);
s->bufptr = 0;
} else {
++s->bufptr;
}
}
/*-----------------------------------------------------------------------------------*/
static void
sendopt(struct telnetd_state *s, u8_t option, u8_t value)
{
char *line;
line = alloc_line();
if(line != NULL) {
line[0] = TELNET_IAC;
line[1] = option;
line[2] = value;
line[3] = 0;
sendline(s, line);
}
}
/*-----------------------------------------------------------------------------------*/
static void
newdata(struct telnetd_state *s)
{
u16_t len;
u8_t c;
len = uip_datalen();
while(len > 0 && s->bufptr < sizeof(s->buf)) {
c = *uip_appdata;
++uip_appdata;
--len;
switch(s->state) {
case STATE_IAC:
if(c == TELNET_IAC) {
getchar(s, c);
s->state = STATE_NORMAL;
} else {
switch(c) {
case TELNET_WILL:
s->state = STATE_WILL;
break;
case TELNET_WONT:
s->state = STATE_WONT;
break;
case TELNET_DO:
s->state = STATE_DO;
break;
case TELNET_DONT:
s->state = STATE_DONT;
break;
default:
s->state = STATE_NORMAL;
break;
}
}
break;
case STATE_WILL:
/* Reply with a DONT */
sendopt(s, TELNET_DONT, c);
s->state = STATE_NORMAL;
break;
case STATE_WONT:
/* Reply with a DONT */
sendopt(s, TELNET_DONT, c);
s->state = STATE_NORMAL;
break;
case STATE_DO:
/* Reply with a WONT */
sendopt(s, TELNET_WONT, c);
s->state = STATE_NORMAL;
break;
case STATE_DONT:
/* Reply with a WONT */
sendopt(s, TELNET_WONT, c);
s->state = STATE_NORMAL;
break;
case STATE_NORMAL:
if(c == TELNET_IAC) {
s->state = STATE_IAC;
} else {
getchar(s, c);
}
break;
}
}
}
/*-----------------------------------------------------------------------------------*/
void
telnetd_app(void)
{
struct telnetd_state *s;
s = (struct telnetd_state *)uip_conn->appstate;
if(uip_connected()) {
for(i = 0; i < TELNETD_NUMLINES; ++i) {
s->lines[i] = NULL;
}
s->bufptr = 0;
s->state = STATE_NORMAL;
telnetd_connected(s);
senddata(s);
return;
}
if(s->state == STATE_CLOSE) {
s->state = STATE_NORMAL;
uip_close();
return;
}
if(uip_closed()) {
telnetd_output(s, "Connection closed", "");
}
if(uip_aborted()) {
telnetd_output(s, "Connection reset", "");
}
if(uip_timedout()) {
telnetd_output(s, "Connection timed out", "");
}
if(uip_acked()) {
acked(s);
}
if(uip_newdata()) {
newdata(s);
}
if(uip_rexmit() ||
uip_newdata() ||
uip_acked()) {
senddata(s);
} else if(uip_poll()) {
senddata(s);
}
}
/*-----------------------------------------------------------------------------------*/

114
apps/telnetd/telnetd.h Normal file
View File

@@ -0,0 +1,114 @@
/**
* \addtogroup telnetd
* @{
*/
/**
* \file
* Header file for the telnet server.
* \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
* 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: telnetd.h,v 1.1.2.2 2003/10/07 13:22:27 adam Exp $
*
*/
#ifndef __TELNETD_H__
#define __TELNETD_H__
#include "uip.h"
/**
* The maximum length of a telnet line.
*
* \hideinitializer
*/
#define TELNETD_LINELEN 36
/**
* The number of output lines being buffered for all telnet
* connections.
*
* \hideinitializer
*/
#define TELNETD_NUMLINES 24
/**
* A telnet connection structure.
*/
struct telnetd_state {
char *lines[TELNETD_NUMLINES];
char buf[TELNETD_LINELEN];
char bufptr;
u8_t state;
};
/**
* Callback function that is called when a telnet connection has been
* established.
*
* \param s The telnet connection.
*/
void telnetd_connected(struct telnetd_state *s);
/**
* Callback function that is called when a line of text has arrived on
* a telnet connection.
*
* \param s The telnet connection.
*
* \param cmd The line of text.
*/
void telnetd_input(struct telnetd_state *s, char *cmd);
void telnetd_close(struct telnetd_state *s);
void telnetd_output(struct telnetd_state *s, char *s1, char *s2);
void telnetd_prompt(struct telnetd_state *s, char *str);
void telnetd_app(void);
#ifndef UIP_APPCALL
#define UIP_APPCALL telnetd_app
#endif
#ifndef UIP_APPSTATE_SIZE
#define UIP_APPSTATE_SIZE (sizeof(struct telnetd_state))
#endif
void telnetd_init(void);
#endif /* __TELNET_H__ */
/** @} */

View File

@@ -0,0 +1,12 @@
http_200 "200 "
http_301 "301 "
http_302 "302 "
http_get "GET "
http_10 "HTTP/1.0"
http_11 "HTTP/1.1"
http_content_type "Content-Type: "
http_texthtml "text/html"
http_location "Location: "
http_host "Host: "
http_connection_close "Connection: close"
http_user_agent "User-Agent: Contiki/1.0 (Commodore 64; http://dunkels.com/adam/contiki/)"

View File

@@ -0,0 +1,39 @@
char http_200[5] =
/* 200 */
{0x32, 0x30, 0x30, 0x20, };
char http_301[5] =
/* 301 */
{0x33, 0x30, 0x31, 0x20, };
char http_302[5] =
/* 302 */
{0x33, 0x30, 0x32, 0x20, };
char http_get[5] =
/* GET */
{0x47, 0x45, 0x54, 0x20, };
char http_10[9] =
/* HTTP/1.0 */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, };
char http_11[9] =
/* HTTP/1.1 */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, };
char http_content_type[15] =
/* Content-Type: */
{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, };
char http_texthtml[10] =
/* text/html */
{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, };
char http_location[11] =
/* Location: */
{0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, };
char http_host[7] =
/* Host: */
{0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20, };
char http_connection_close[18] =
/* Connection: close */
{0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, };
char http_user_agent[73] =
/* User-Agent: Contiki/1.0 (Commodore 64; http://dunkels.com/adam/contiki/) */
{0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x28, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x6f, 0x72, 0x65, 0x20, 0x36, 0x34, 0x3b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x29, };
char test_httpstring[16] =
/* HTTP/1.0 200 OK */
{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, };

View File

@@ -0,0 +1,13 @@
extern char http_200[5];
extern char http_301[5];
extern char http_302[5];
extern char http_get[5];
extern char http_10[9];
extern char http_11[9];
extern char http_content_type[15];
extern char http_texthtml[10];
extern char http_location[11];
extern char http_host[7];
extern char http_connection_close[18];
extern char http_user_agent[73];
extern char test_httpstring[16];

27
apps/webclient/makehttpstrings Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/perl
open(OUTPUTC, "> http-strings.c");
open(OUTPUTH, "> http-strings.h");
open(FILE, "http-strings");
while(<FILE>) {
if(/(.+) "(.+)"/) {
$var = $1;
$data = $2;
printf(OUTPUTC "char $var\[%d] = \n", length($data) + 1);
printf(OUTPUTC "/* $data */\n");
printf(OUTPUTC "{");
for($j = 0; $j < length($data); $j++) {
printf(OUTPUTC "%#02x, ", unpack("C", substr($data, $j, 1)));
}
printf(OUTPUTC "};\n");
printf(OUTPUTH "extern char $var\[%d];\n", length($data) + 1);
}
}
exit 0;
printf(OUTPUT "%#02x, ", unpack("C", $data));

460
apps/webclient/webclient.c Normal file
View File

@@ -0,0 +1,460 @@
/**
* \addtogroup exampleapps
* @{
*/
/**
* \defgroup webclient Web client
* @{
*
* 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().
*/
/**
* \file
* Implementation of the HTTP client.
* \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
* 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.
*
* This file is part of the "contiki" web browser.
*
* $Id: webclient.c,v 1.1.2.5 2003/10/06 22:56:45 adam Exp $
*
*/
#include "uip.h"
#include "webclient.h"
#include "resolv.h"
#include <string.h>
#define WEBCLIENT_TIMEOUT 100
#define WEBCLIENT_STATE_STATUSLINE 0
#define WEBCLIENT_STATE_HEADERS 1
#define WEBCLIENT_STATE_DATA 2
#define WEBCLIENT_STATE_CLOSE 3
#define HTTPFLAG_NONE 0
#define HTTPFLAG_OK 1
#define HTTPFLAG_MOVED 2
#define HTTPFLAG_ERROR 3
#define ISO_nl 0x0a
#define ISO_cr 0x0d
#define ISO_space 0x20
struct webclient_state {
u8_t timer;
u8_t state;
u8_t httpflag;
u16_t port;
char host[40];
char file[WWW_CONF_MAX_URLLEN];
u16_t getrequestptr;
u16_t getrequestleft;
char httpheaderline[200];
u16_t httpheaderlineptr;
char mimetype[32];
};
static struct webclient_state s;
/*-----------------------------------------------------------------------------------*/
char *
webclient_mimetype(void)
{
return s.mimetype;
}
/*-----------------------------------------------------------------------------------*/
char *
webclient_filename(void)
{
return s.file;
}
/*-----------------------------------------------------------------------------------*/
char *
webclient_hostname(void)
{
return s.host;
}
/*-----------------------------------------------------------------------------------*/
unsigned short
webclient_port(void)
{
return s.port;
}
/*-----------------------------------------------------------------------------------*/
void
webclient_init(void)
{
}
/*-----------------------------------------------------------------------------------*/
static void
init_connection(void)
{
s.state = WEBCLIENT_STATE_STATUSLINE;
s.getrequestleft = sizeof(http_get) - 1 + 1 +
sizeof(http_10) - 1 +
sizeof(http_crnl) - 1 +
sizeof(http_host) - 1 +
sizeof(http_crnl) - 1 +
strlen(http_user_agent_fields) +
strlen(s.file) + strlen(s.host);
s.getrequestptr = 0;
s.httpheaderlineptr = 0;
}
/*-----------------------------------------------------------------------------------*/
void
webclient_close(void)
{
s.state = WEBCLIENT_STATE_CLOSE;
}
/*-----------------------------------------------------------------------------------*/
unsigned char
webclient_get(char *host, u16_t port, char *file)
{
struct uip_conn *conn;
u16_t *ipaddr;
static u16_t addr[2];
/* First check if the host is an IP address. */
ipaddr = &addr[0];
if(uip_main_ipaddrconv(host, (unsigned char *)addr) == 0) {
ipaddr = resolv_lookup(host);
if(ipaddr == NULL) {
return 0;
}
}
conn = uip_connect(ipaddr, htons(port));
if(conn == NULL) {
return 0;
}
s.port = port;
strncpy(s.file, file, sizeof(s.file));
strncpy(s.host, host, sizeof(s.host));
init_connection();
return 1;
}
/*-----------------------------------------------------------------------------------*/
static unsigned char * CC_FASTCALL
copy_string(unsigned char *dest,
const unsigned char *src, unsigned char len)
{
return strcpy(dest, src) + len;
}
/*-----------------------------------------------------------------------------------*/
static void
senddata(void)
{
u16_t len;
char *getrequest;
char *cptr;
if(s.getrequestleft > 0) {
cptr = getrequest = (char *)uip_appdata;
cptr = copy_string(cptr, http_get, sizeof(http_get) - 1);
cptr = copy_string(cptr, s.file, strlen(s.file));
*cptr++ = ISO_space;
cptr = copy_string(cptr, http_10, sizeof(http_10) - 1);
cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1);
cptr = copy_string(cptr, http_host, sizeof(http_host) - 1);
cptr = copy_string(cptr, s.host, strlen(s.host));
cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1);
cptr = copy_string(cptr, http_user_agent_fields,
strlen(http_user_agent_fields));
len = s.getrequestleft > uip_mss()?
uip_mss():
s.getrequestleft;
uip_send(&(getrequest[s.getrequestptr]), len);
}
}
/*-----------------------------------------------------------------------------------*/
static void
acked(void)
{
u16_t len;
if(s.getrequestleft > 0) {
len = s.getrequestleft > uip_mss()?
uip_mss():
s.getrequestleft;
s.getrequestleft -= len;
s.getrequestptr += len;
}
}
/*-----------------------------------------------------------------------------------*/
static u16_t
parse_statusline(u16_t len)
{
char *cptr;
while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) {
s.httpheaderline[s.httpheaderlineptr] = *uip_appdata;
++uip_appdata;
--len;
if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) {
if((strncmp(s.httpheaderline, http_10,
sizeof(http_10) - 1) == 0) ||
(strncmp(s.httpheaderline, http_11,
sizeof(http_11) - 1) == 0)) {
cptr = &(s.httpheaderline[9]);
s.httpflag = HTTPFLAG_NONE;
if(strncmp(cptr, http_200, sizeof(http_200) - 1) == 0) {
/* 200 OK */
s.httpflag = HTTPFLAG_OK;
} else if(strncmp(cptr, http_301, sizeof(http_301) - 1) == 0 ||
strncmp(cptr, http_302, sizeof(http_302) - 1) == 0) {
/* 301 Moved permanently or 302 Found. Location: header line
will contain thw new location. */
s.httpflag = HTTPFLAG_MOVED;
} else {
s.httpheaderline[s.httpheaderlineptr - 1] = 0;
}
} else {
uip_abort();
webclient_aborted();
return 0;
}
/* We're done parsing the status line, so we reset the pointer
and start parsing the HTTP headers.*/
s.httpheaderlineptr = 0;
s.state = WEBCLIENT_STATE_HEADERS;
break;
} else {
++s.httpheaderlineptr;
}
}
return len;
}
/*-----------------------------------------------------------------------------------*/
static char
casecmp(char *str1, const char *str2, char len)
{
static char c;
while(len > 0) {
c = *str1;
/* Force lower-case characters. */
if(c & 0x40) {
c |= 0x20;
}
if(*str2 != c) {
return 1;
}
++str1;
++str2;
--len;
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
static u16_t
parse_headers(u16_t len)
{
char *cptr;
static unsigned char i;
while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) {
s.httpheaderline[s.httpheaderlineptr] = *uip_appdata;
++uip_appdata;
--len;
if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) {
/* We have an entire HTTP header line in s.httpheaderline, so
we parse it. */
if(s.httpheaderline[0] == ISO_cr) {
/* This was the last header line (i.e., and empty "\r\n"), so
we are done with the headers and proceed with the actual
data. */
s.state = WEBCLIENT_STATE_DATA;
return len;
}
s.httpheaderline[s.httpheaderlineptr - 1] = 0;
/* Check for specific HTTP header fields. */
if(casecmp(s.httpheaderline, http_content_type,
sizeof(http_content_type) - 1) == 0) {
/* Found Content-type field. */
cptr = strchr(s.httpheaderline, ';');
if(cptr != NULL) {
*cptr = 0;
}
strncpy(s.mimetype, s.httpheaderline +
sizeof(http_content_type) - 1, sizeof(s.mimetype));
} else if(casecmp(s.httpheaderline, http_location,
sizeof(http_location) - 1) == 0) {
cptr = s.httpheaderline +
sizeof(http_location) - 1;
if(strncmp(cptr, http_http, 7) == 0) {
cptr += 7;
for(i = 0; i < s.httpheaderlineptr - 7; ++i) {
if(*cptr == 0 ||
*cptr == '/' ||
*cptr == ' ' ||
*cptr == ':') {
s.host[i] = 0;
break;
}
s.host[i] = *cptr;
++cptr;
}
}
strncpy(s.file, cptr, sizeof(s.file));
/* s.file[s.httpheaderlineptr - i] = 0;*/
}
/* We're done parsing, so we reset the pointer and start the
next line. */
s.httpheaderlineptr = 0;
} else {
++s.httpheaderlineptr;
}
}
return len;
}
/*-----------------------------------------------------------------------------------*/
static void
newdata(void)
{
u16_t len;
len = uip_datalen();
if(s.state == WEBCLIENT_STATE_STATUSLINE) {
len = parse_statusline(len);
}
if(s.state == WEBCLIENT_STATE_HEADERS && len > 0) {
len = parse_headers(len);
}
if(len > 0 && s.state == WEBCLIENT_STATE_DATA &&
s.httpflag != HTTPFLAG_MOVED) {
webclient_datahandler((char *)uip_appdata, len);
}
}
/*-----------------------------------------------------------------------------------*/
void webclient_appcall(void)
{
if(uip_connected()) {
s.timer = 0;
s.state = WEBCLIENT_STATE_STATUSLINE;
senddata();
webclient_connected();
return;
}
if(state == NULL) {
uip_abort();
return;
}
if(s.state == WEBCLIENT_STATE_CLOSE) {
webclient_closed();
uip_abort();
return;
}
if(uip_aborted()) {
webclient_aborted();
}
if(uip_timedout()) {
webclient_timedout();
}
if(uip_acked()) {
s.timer = 0;
acked();
}
if(uip_newdata()) {
s.timer = 0;
newdata();
}
if(uip_rexmit() ||
uip_newdata() ||
uip_acked()) {
senddata();
} else if(uip_poll()) {
++s.timer;
if(s.timer == WEBCLIENT_TIMEOUT) {
webclient_timedout();
uip_abort();
return;
}
/* senddata();*/
}
if(uip_closed()) {
if(s.httpflag != HTTPFLAG_MOVED) {
/* Send NULL data to signal EOF. */
webclient_datahandler(NULL, 0);
} else {
if(resolv_lookup(s.host) == NULL) {
resolv_query(s.host);
}
webclient_get(s.host, s.port, s.file);
}
}
}
/*-----------------------------------------------------------------------------------*/
/** @} */
/** @} */

207
apps/webclient/webclient.h Normal file
View File

@@ -0,0 +1,207 @@
/**
* \addtogroup webclient
* @{
*/
/**
* \file
* Header file for the HTTP client.
* \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
* 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.
*
* This file is part of the "contiki" web browser.
*
* $Id: webclient.h,v 1.1.2.5 2003/10/06 22:56:45 adam Exp $
*
*/
#ifndef __WEBCLIENT_H__
#define __WEBCLIENT_H__
#include "http-strings.h"
#include "http-user-agent-string.h"
struct webclient_state;
/**
* Callback function that is called from the webclient code when HTTP
* data has been received.
*
* This function must be implemented by the module that uses the
* webclient code. The function is called from the webclient module
* when HTTP data has been received. The function is not called when
* HTTP headers are received, only for the actual data.
*
* \note This function is called many times, repetedly, when data is
* being received, and not once when all data has been received.
*
* \param data A pointer to the data that has been received.
* \param len The length of the data that has been received.
*/
void webclient_datahandler(char *data, u16_t len);
/**
* Callback function that is called from the webclient code when the
* HTTP connection has been connected to the web server.
*
* This function must be implemented by the module that uses the
* webclient code.
*/
void webclient_connected(void);
/**
* Callback function that is called from the webclient code if the
* HTTP connection to the web server has timed out.
*
* This function must be implemented by the module that uses the
* webclient code.
*/
void webclient_timedout(void);
/**
* Callback function that is called from the webclient code if the
* HTTP connection to the web server has been aborted by the web
* server.
*
* This function must be implemented by the module that uses the
* webclient code.
*/
void webclient_aborted(void);
/**
* Callback function that is called from the webclient code when the
* HTTP connection to the web server has been closed.
*
* This function must be implemented by the module that uses the
* webclient code.
*/
void webclient_closed(void);
/**
* Initialize the webclient module.
*/
void webclient_init(void);
/**
* Open an HTTP connection to a web server and ask for a file using
* the GET method.
*
* This function opens an HTTP connection to the specified web server
* and requests the specified file using the GET method. When the HTTP
* connection has been connected, the webclient_connected() callback
* function is called and when the HTTP data arrives the
* webclient_datahandler() callback function is called.
*
* The callback function webclient_timedout() is called if the web
* server could not be contacted, and the webclient_aborted() callback
* function is called if the HTTP connection is aborted by the web
* server.
*
* When the HTTP request has been completed and the HTTP connection is
* closed, the webclient_closed() callback function will be called.
*
* \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.
*
* \param host A pointer to a string containing either a host name or
* a numerical IP address in dotted decimal notation (e.g., 192.168.23.1).
*
* \param port The port number to which to connect, in host byte order.
*
* \param file A pointer to the name of the file to get.
*
* \retval 0 if the host name could not be found in the cache, or
* if a TCP connection could not be created.
*
* \retval 1 if the connection was initiated.
*/
unsigned char webclient_get(char *host, u16_t port, char *file);
/**
* Close the currently open HTTP connection.
*/
void webclient_close(void);
void webclient_appcall(void);
/**
* Obtain the MIME type of the current HTTP data stream.
*
* \return A pointer to a string contaning the MIME type. The string
* may be empty if no MIME type was reported by the web server.
*/
char *webclient_mimetype(void);
/**
* Obtain the filename of the current HTTP data stream.
*
* The filename of an HTTP request may be changed by the web server,
* and may therefore not be the same as when the original GET request
* was made with webclient_get(). This function is used for obtaining
* the current filename.
*
* \return A pointer to the current filename.
*/
char *webclient_filename(void);
/**
* Obtain the hostname of the current HTTP data stream.
*
* The hostname of the web server of an HTTP request may be changed
* by the web server, and may therefore not be the same as when the
* original GET request was made with webclient_get(). This function
* is used for obtaining the current hostname.
*
* \return A pointer to the current hostname.
*/
char *webclient_hostname(void);
/**
* Obtain the port number of the current HTTP data stream.
*
* The port number of an HTTP request may be changed by the web
* server, and may therefore not be the same as when the original GET
* request was made with webclient_get(). This function is used for
* obtaining the current port number.
*
* \return The port number of the current HTTP data stream, in host byte order.
*/
unsigned short webclient_port(void);
#endif /* __WEBCLIENT_H__ */
/** @} */

View File

@@ -1,70 +0,0 @@
# 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
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed by Adam Dunkels.
# 4. 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.
#
# This file is part of the uIP TCP/IP stack.
#
# $Id: Makefile,v 1.2 2001/11/24 16:03:59 adam Exp $
#
# Change the target system type here
SYS=c64
CC=cc65
AS=ca65
AR=ar65
ARFLAGS=a
CFLAGS= -I ../uip -I ../apps/httpd -t $(SYS) -Oi
%.o:
$(CC) $(CFLAGS) -o $(patsubst %c, %s, $(notdir $<)) $<
$(AS) -o $@ $(AFLAGS) $(*).s
uip: uip.o uip_arch.o rs232dev.o main.o httpd.o fs.o cgi.o
cl65 -o uip -t $(SYS) $^
tunslip: tunslip.c
gcc -o tunslip tunslip.c
rs232dev.o: rs232dev.c ../uip/uip.h uipopt.h
main.o: main.c ../uip/uip.h uipopt.h \
rs232dev.h
uip.o: ../uip/uip.c uipopt.h
httpd.o: ../apps/httpd/httpd.c ../apps/httpd/httpd.h ../uip/uip.h uipopt.h \
../apps/httpd/fs.c ../apps/httpd/fs.h \
../apps/httpd/fsdata.c ../apps/httpd/fsdata.h
cgi.o: ../apps/httpd/cgi.c ../apps/httpd/cgi.h
fs.o: ../apps/httpd/fs.c ../apps/httpd/fs.h ../apps/httpd/fsdata.c
uip_arch.o: uip_arch.c uip_arch.h ../uip/uip.h uipopt.h \
../apps/httpd/httpd.h
clean:
rm -f *.o *~ *core uip *.s

View File

@@ -1,5 +0,0 @@
This directory is a port of uIP to the popular Commodore 64 home
computer. In order to compile it, you need the cc65 C compiler that
can be downloaded from <http://www.cc65.org/>.
The "tunslip" executable can be used on a FreeBSD system to create a virtual SLIP interface between the kernel and the Vice emulator.

View File

@@ -1,141 +0,0 @@
/*
* 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
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: slipdev.c,v 1.1 2001/11/20 20:49:45 adam Exp $
*
*/
#include "uip.h"
#define SLIP_END 0300
#define SLIP_ESC 0333
#define SLIP_ESC_END 0334
#define SLIP_ESC_ESC 0335
#define SIO_RECV(c) while(rs232_get(&c) == RS_ERR_NO_DATA)
#define SIO_SEND(c) while(rs232_put(c) == RS_ERR_OVERFLOW)
#define MAX_SIZE UIP_BUFSIZE
static const unsigned char slip_end = SLIP_END,
slip_esc = SLIP_ESC,
slip_esc_end = SLIP_ESC_END,
slip_esc_esc = SLIP_ESC_ESC;
/*-----------------------------------------------------------------------------------*/
void
slipdev_send(void)
{
u8_t i;
u8_t *ptr;
u8_t c;
SIO_SEND(slip_end);
ptr = uip_buf;
for(i = 0; i < uip_len; i++) {
c = *ptr++;
switch(c) {
case SLIP_END:
SIO_SEND(slip_esc);
SIO_SEND(slip_esc_end);
break;
case SLIP_ESC:
SIO_SEND(slip_esc);
SIO_SEND(slip_esc_esc);
break;
default:
SIO_SEND(c);
break;
}
}
SIO_SEND(slip_end);
}
/*-----------------------------------------------------------------------------------*/
u8_t
slipdev_read(void)
{
u8_t c;
start:
uip_len = 0;
while(1) {
if(uip_len >= MAX_SIZE) {
goto start;
}
SIO_RECV(c);
switch(c) {
case SLIP_END:
if(uip_len > 0) {
return uip_len;
} else {
goto start;
}
break;
case SLIP_ESC:
SIO_RECV(c);
switch(c) {
case SLIP_ESC_END:
c = SLIP_END;
break;
case SLIP_ESC_ESC:
c = SLIP_ESC;
break;
}
/* FALLTHROUGH */
default:
if(uip_len < MAX_SIZE) {
uip_buf[uip_len] = c;
uip_len++;
}
break;
}
}
return 0;
}
/*-----------------------------------------------------------------------------------*/
void
slipdev_init(void)
{
}
/*-----------------------------------------------------------------------------------*/

View File

@@ -1,186 +0,0 @@
/*
* 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
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: tunslip.c,v 1.1 2001/11/20 20:49:45 adam Exp $
*
*/
#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#define SLIP_END 0300
#define SLIP_ESC 0333
#define SLIP_ESC_END 0334
#define SLIP_ESC_ESC 0335
/*-----------------------------------------------------------------------------------*/
void
do_slip(int infd, int outfd)
{
static unsigned char inbuf[2000];
static int inbufptr = 0;
unsigned char c;
if(read(infd, &c, 1) == -1) {
perror("do_slip: read");
}
fprintf(stderr, ".");
switch(c) {
case SLIP_END:
if(inbufptr > 0) {
if(write(outfd, inbuf, inbufptr) == -1) {
perror("do_slip: write");
}
inbufptr = 0;
}
return;
case SLIP_ESC:
if(read(infd, &c, 1) == -1) {
perror("do_slip: read after esc");
}
switch(c) {
case SLIP_ESC_END:
c = SLIP_END;
break;
case SLIP_ESC_ESC:
c = SLIP_ESC;
break;
}
/* FALLTHROUGH */
default:
inbuf[inbufptr++] = c;
break;
}
}
/*-----------------------------------------------------------------------------------*/
void
slip_send(int outfd, unsigned char data)
{
unsigned char d;
d = data;
write(outfd, &d, 1);
}
/*-----------------------------------------------------------------------------------*/
void
do_tun(int infd, int outfd)
{
unsigned char inbuf[2000];
int i, size;
if((size = read(infd, inbuf, 2000)) == -1) {
perror("do_tun: read");
}
for(i = 0; i < size; i++) {
switch(inbuf[i]) {
case SLIP_END:
slip_send(outfd, SLIP_ESC);
slip_send(outfd, SLIP_ESC_END);
break;
case SLIP_ESC:
slip_send(outfd, SLIP_ESC);
slip_send(outfd, SLIP_ESC_ESC);
break;
default:
slip_send(outfd, inbuf[i]);
break;
}
}
slip_send(outfd, SLIP_END);
}
/*-----------------------------------------------------------------------------------*/
int
main(int argc, char **argv)
{
int tunfd, infd, outfd, maxfd;
int ret;
fd_set fdset;
infd = STDIN_FILENO;
outfd = STDOUT_FILENO;
fprintf(stderr, "tunslip started...\n");
tunfd = open("/dev/tun0", O_RDWR);
if(tunfd == -1) {
perror("main: open");
exit(1);
}
fprintf(stderr, "opened device...\n");
#ifdef linux
system("ifconfig tun0 inet 192.168.0.2 192.168.0.1");
system("route add -net 192.168.0.0 netmask 255.255.255.0 dev tun0");
#else
/* system("ifconfig tun0 inet sidewalker rallarsnus"); */
system("ifconfig tun0 inet 192.168.0.1 192.168.0.2");
#endif /* linux */
fprintf(stderr, "configured interface...\n");
while(1) {
maxfd = 0;
FD_ZERO(&fdset);
FD_SET(infd, &fdset);
if(infd > maxfd) maxfd = infd;
FD_SET(outfd, &fdset);
if(outfd > maxfd) maxfd = outfd;
FD_SET(tunfd, &fdset);
if(tunfd > maxfd) maxfd = tunfd;
ret = select(maxfd + 1, &fdset, NULL, NULL, NULL);
if(ret == -1) {
perror("select");
exit(0);
} else if(ret > 0) {
if(FD_ISSET(infd, &fdset)) {
do_slip(infd, tunfd);
} else if(FD_ISSET(tunfd, &fdset)) {
do_tun(tunfd, outfd);
} else {
exit(0);
}
} else {
exit(0);
}
}
}
/*-----------------------------------------------------------------------------------*/

View File

@@ -1,299 +0,0 @@
/*
* 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
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uip_arch.c,v 1.1 2001/11/20 20:49:45 adam Exp $
*
*/
#include "uip_arch.h"
#include "uip.h"
/* This is assembler versions of the uIP support functions for the
6502 CPU. Note that the checksum function ("_chksum()", defined
under uip_ipchksum()) does not support buffer sizes > 255 bytes. */
/*-----------------------------------------------------------------------------------*/
static u16_t chksum_ptr, chksum_len, chksum_tmp;
static u16_t chksum(void);
/*-----------------------------------------------------------------------------------*/
u16_t
uip_ipchksum(void)
{
chksum_ptr = (u16_t)uip_buf;
chksum_len = 20;
return chksum();
}
/*asm("__chksum:");*/
u16_t chksum(void) {
asm("lda #0");
asm("sta tmp1");
asm("sta tmp1+1");
asm("lda _chksum_ptr");
asm("sta ptr1");
asm("lda _chksum_ptr+1");
asm("sta ptr1+1");
asm("lda _chksum_len");
asm("lsr");
asm("bcc chksum_noodd");
asm("pha");
asm("ldy _chksum_len");
asm("dey");
asm("lda (ptr1),y");
asm("sta tmp1");
asm("pla");
asm("chksum_noodd:");
asm("asl");
asm("tay");
asm("clc");
asm("php");
asm("chksum_loop1:");
asm("cpy #0");
asm("beq chksum_loop1_end");
asm("plp");
asm("dey");
asm("dey");
asm("lda (ptr1),y");
asm("adc tmp1");
asm("sta tmp1");
asm("iny");
asm("lda (ptr1),y");
asm("adc tmp1+1");
asm("sta tmp1+1");
asm("dey");
asm("php");
asm("jmp chksum_loop1");
asm("chksum_loop1_end:");
asm("plp");
asm("chksum_endloop:");
asm("lda tmp1");
asm("adc #0");
asm("sta tmp1");
asm("lda tmp1+1");
asm("adc #0");
asm("sta tmp1+1");
asm("bcs chksum_endloop");
asm("lda tmp1");
asm("ldx tmp1+1");
asm("rts");
}
/*-----------------------------------------------------------------------------------*/
u16_t
uip_tcpchksum(void)
{
chksum_ptr = (u16_t)&uip_buf[20];
chksum_len = 20;
chksum_tmp = chksum();
chksum_ptr = (u16_t)uip_appdata;
asm("lda _uip_buf+3");
asm("sec");
asm("sbc #40");
asm("sta _chksum_len");
/* asm("lda _uip_buf+2");
asm("sbc #0");*/
asm("lda #0");
asm("sta _chksum_len+1");
asm("jsr %v", chksum);
asm("clc");
asm("adc _chksum_tmp");
asm("sta _chksum_tmp");
asm("txa");
asm("adc _chksum_tmp+1");
asm("sta _chksum_tmp+1");
asm("tcpchksum_loop1:");
asm("lda _chksum_tmp");
asm("adc #0");
asm("sta _chksum_tmp");
asm("lda _chksum_tmp+1");
asm("adc #0");
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop1");
asm("lda _uip_buf+3");
asm("sec");
asm("sbc #20");
asm("sta _chksum_len");
asm("lda _uip_buf+2");
asm("sbc #0");
asm("sta _chksum_len+1");
asm("ldy #$0c");
asm("clc");
asm("php");
asm("tcpchksum_loop2:");
asm("plp");
asm("lda _uip_buf,y");
asm("adc _chksum_tmp");
asm("sta _chksum_tmp");
asm("iny");
asm("lda _uip_buf,y");
asm("adc _chksum_tmp+1");
asm("sta _chksum_tmp+1");
asm("iny");
asm("php");
asm("cpy #$14");
asm("bne tcpchksum_loop2");
asm("plp");
asm("lda _chksum_tmp");
asm("adc #0");
asm("sta _chksum_tmp");
asm("lda _chksum_tmp+1");
asm("adc #6"); /* IP_PROTO_TCP */
asm("sta _chksum_tmp+1");
asm("lda _chksum_tmp");
asm("adc _chksum_len+1");
asm("sta _chksum_tmp");
asm("lda _chksum_tmp+1");
asm("adc _chksum_len");
asm("sta _chksum_tmp+1");
asm("tcpchksum_loop3:");
asm("lda _chksum_tmp");
asm("adc #0");
asm("sta _chksum_tmp");
asm("lda _chksum_tmp+1");
asm("adc #0");
asm("sta _chksum_tmp+1");
asm("bcs tcpchksum_loop3");
return chksum_tmp;
}
/*-----------------------------------------------------------------------------------*/
/*void
uip_add_rcv_nxt(u8_t n)
{
uip_conn->rcv_nxt[3] += n;
if(uip_conn->rcv_nxt[3] < n) {
uip_conn->rcv_nxt[2]++;
if(uip_conn->rcv_nxt[2] == 0) {
uip_conn->rcv_nxt[1]++;
if(uip_conn->rcv_nxt[1] == 0) {
uip_conn->rcv_nxt[0]++;
}
}
}
}*/
void __fastcall__
uip_add_rcv_nxt(u8_t n) {
/*asm("_uip_add_rcv_nxt:");*/
asm("pha");
asm("lda _uip_conn");
asm("sta ptr1");
asm("lda _uip_conn+1");
asm("sta ptr1+1");
asm("pla");
asm("clc");
asm("ldy #12");
asm("adc (ptr1),y");
asm("sta (ptr1),y");
asm("dey");
#if UIP_BUFSIZE > 255
asm("txa");
#else
asm("lda #0");
#endif /* UIP_BUFSIZE > 255 */
asm("adc (ptr1),y");
asm("sta (ptr1),y");
asm("dey");
asm("lda #0");
asm("adc (ptr1),y");
asm("sta (ptr1),y");
asm("dey");
asm("lda #0");
asm("adc (ptr1),y");
asm("sta (ptr1),y");
/*asm("rts");
asm(".export _uip_add_rcv_nxt");*/
}
/*-----------------------------------------------------------------------------------*/
/*void
uip_add_ack_nxt(u8_t n)
{
uip_conn->ack_nxt[3] += n;
if(uip_conn->ack_nxt[3] < n) {
uip_conn->ack_nxt[2]++;
if(uip_conn->ack_nxt[2] == 0) {
uip_conn->ack_nxt[1]++;
if(uip_conn->ack_nxt[1] == 0) {
uip_conn->ack_nxt[0]++;
}
}
}
}*/
void __fastcall__
uip_add_ack_nxt(u8_t n) {
/*asm("_uip_add_ack_nxt:");*/
asm("pha");
asm("lda _uip_conn");
asm("sta ptr1");
asm("lda _uip_conn+1");
asm("sta ptr1+1");
asm("pla");
asm("clc");
asm("ldy #20");
asm("adc (ptr1),y");
asm("sta (ptr1),y");
asm("dey");
#if UIP_BUFSIZE > 255
asm("txa");
#else
asm("lda #0");
#endif /* UIP_BUFSIZE > 255 */
asm("adc (ptr1),y");
asm("sta (ptr1),y");
asm("dey");
asm("lda #0");
asm("adc (ptr1),y");
asm("sta (ptr1),y");
asm("dey");
asm("lda #0");
asm("adc (ptr1),y");
asm("sta (ptr1),y");
/*asm("rts");
asm(".export _uip_add_ack_nxt");*/
}
/*-----------------------------------------------------------------------------------*/

View File

@@ -1,189 +0,0 @@
/*
* 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
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. 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.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: uipopt.h,v 1.6 2002/01/11 12:43:14 adam Exp $
*
*/
#ifndef __UIPOPT_H__
#define __UIPOPT_H__
/* This file is used for tweaking various configuration options for
uIP. You should make a copy of this file into one of your project's
directories instead of editing this example "uipopt.h" file that
comes with the uIP distribution. */
/*-----------------------------------------------------------------------------------*/
/* First, two typedefs that may have to be tweaked for your particular
compiler. The uX_t types are unsigned integer types, where the X is
the number of bits in the integer type. Most compilers use
"unsigned char" and "unsigned short" for those two,
respectively. */
typedef unsigned char u8_t;
typedef unsigned short u16_t;
/*-----------------------------------------------------------------------------------*/
/* The configuration options for a specific node. This includes IP
* address, netmask and default router as well as the Ethernet
* address. The netmask, default router and Ethernet address are
* appliciable only if uIP should be run over Ethernet.
*
* All of these should be changed to suit your project.
*/
/* UIP_IPADDR: The IP address of this uIP node. */
#define UIP_IPADDR0 192
#define UIP_IPADDR1 168
#define UIP_IPADDR2 0
#define UIP_IPADDR3 2
/* UIP_NETMASK: The netmask. */
#define UIP_NETMASK0 255
#define UIP_NETMASK1 255
#define UIP_NETMASK2 255
#define UIP_NETMASK3 0
/* UIP_DRIPADDR: IP address of the default router. */
#define UIP_DRIPADDR0 192
#define UIP_DRIPADDR1 168
#define UIP_DRIPADDR2 0
#define UIP_DRIPADDR3 1
/* UIP_ETHADDR: The Ethernet address. */
#define UIP_ETHADDR0 0x00
#define UIP_ETHADDR1 0xbd
#define UIP_ETHADDR2 0x3b
#define UIP_ETHADDR3 0x33
#define UIP_ETHADDR4 0x05
#define UIP_ETHADDR5 0x71
/*-----------------------------------------------------------------------------------*/
/* The following options are used to configure application specific
* setting such as how many TCP ports that should be avaliable and if
* the uIP should be configured to support active opens.
*
* These should probably be tweaked to suite your project.
*/
/* Include the header file for the application program that should be
used. If you don't use the example web server, you should change
this. */
#include "httpd.h"
/* UIP_CONNS: The maximum number of simultaneously active
connections. */
#define UIP_CONNS 10
/* UIP_LISTENPORTS: The maximum number of simultaneously listening TCP
ports. */
#define UIP_LISTENPORTS 1
/* UIP_ACTIVE_OPEN: Determines if support for opening connections from
uIP should be compiled in. If this isn't needed for your
application, don't turn it on. (A web server doesn't need this, for
instance.) */
#define UIP_ACTIVE_OPEN 0
/* UIP_BUFSIZE: The size of the buffer that holds incoming and
outgoing packets. */
#define UIP_BUFSIZE 160
/* UIP_STATISTICS: Determines if statistics support should be compiled
in. The statistics is useful for debugging and to show the user. */
#define UIP_STATISTICS 1
/* UIP_LOGGING: Determines if logging of certain events should be
compiled in. Useful mostly for debugging. The function uip_log(char
*msg) must be implemented to suit your architecture if logging is
turned on. */
#define UIP_LOGGING 0
/* UIP_LLH_LEN: The link level header length; this is the offset into
the uip_buf where the IP header can be found. For Ethernet, this
should be set to 14. For SLIP, this should be set to 0. */
#define UIP_LLH_LEN 0
/*-----------------------------------------------------------------------------------*/
/* The following configuration options can be tweaked for your
* project, but you are probably safe to use the default values. The
* options are listed in order of importance.
*/
/* UIP_MAXRTX: The maximum number of times a segment should be
retransmitted before the connection should be aborted. */
#define UIP_MAXRTX 8
/* UIP_ARPTAB_SIZE: The size of the ARP table - use a larger value if
this uIP node will have many connections from the local network. */
#define UIP_ARPTAB_SIZE 8
/* The maxium age of ARP table entries measured in 10ths of
seconds. An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD
default). */
#define UIP_ARP_MAXAGE 120
/* UIP_RTO: The retransmission timeout counted in timer pulses (i.e.,
the speed of the periodic timer, usually one second). */
#define UIP_RTO 3
/* UIP_TCP_MSS: The TCP maximum segment size. This should be set to
at most UIP_BUFSIZE - UIP_LLH_LEN - 40. */
#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - 40)
/* UIP_TTL: The IP TTL (time to live) of IP packets sent by uIP. */
#define UIP_TTL 255
/* UIP_TIME_WAIT_TIMEOUT: How long a connection should stay in the
TIME_WAIT state. Has no real implication, so it should be left
untouched. */
#define UIP_TIME_WAIT_TIMEOUT 120
/*-----------------------------------------------------------------------------------*/
/* This is where you configure if your CPU architecture is big or
* little endian. Most CPUs today are little endian. The most notable
* exception are the Motorolas which are big endian. Tweak the
* definition of the BYTE_ORDER macro to configure uIP for your
* project.
*/
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 3412
#endif /* LITTLE_ENDIAN */
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 1234
#endif /* BIGE_ENDIAN */
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* BYTE_ORDER */
#endif /* __UIPOPT_H__ */

234
doc/Doxyfile Normal file
View File

@@ -0,0 +1,234 @@
# Doxyfile 1.3.3
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "uIP 0.9"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = .
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = ../ \
../../
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
SHORT_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST= NO
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SHOW_USED_FILES = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = uip-doc.txt \
../uip/uip.h \
../uip/uip.c \
../uip/uip_arch.h \
../uip/uip_arp.h \
../uip/uip_arp.c \
../uip/slipdev.h \
../uip/slipdev.c \
../unix/uipopt.h \
../apps/webclient/webclient.h \
../apps/webclient/webclient.c \
../apps/smtp/smtp.h \
../apps/smtp/smtp.c \
../apps/telnetd/telnetd.h \
../apps/telnetd/telnetd.c \
../apps/telnetd/telnetd-shell.c \
../apps/telnetd/memb.h \
../apps/telnetd/memb.c \
../apps/httpd/httpd.h \
../apps/httpd/httpd.c \
../apps/httpd/cgi.h \
../apps/httpd/cgi.c \
../apps/httpd/fs.h \
../apps/httpd/fs.c \
../apps/resolv/resolv.h \
../apps/resolv/resolv.c
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = YES
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = YES
BINARY_TOC = YES
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = UIP_UDP
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
CLASS_GRAPH = NO
COLLABORATION_GRAPH = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 0
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =

5
doc/Makefile Normal file
View File

@@ -0,0 +1,5 @@
htmldoc:
doxygen Doxyfile
pdfdoc: htmldoc
cd latex; make refman.pdf && mv refman.pdf ../uip-refman.pdf

12
doc/README Normal file
View File

@@ -0,0 +1,12 @@
The files in this directory comprise the uIP documentation. The files
are:
html/ The uIP reference manual in HTML format.
uip-refman.pdf The uIP reference manual in a printable PDF version.
mobisys2003.pdf Conference paper about uIP from the First
International Conference on Mobile Systems,
Applications and Services (MobiSys), San
Francisco, May 2003.

33
doc/html/a00030.html Normal file
View File

@@ -0,0 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: fs_file struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>fs_file Struct Reference<br>
<small>
[<a class="el" href="a00098.html">Web server</a>]</small>
</h1><code>#include &lt;fs.h&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
An open file in the read-only file system.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o0" doxytag="fs_file::data"></a>
char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00030.html#o0">data</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The actual file data. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o1" doxytag="fs_file::len"></a>
int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00030.html#o1">len</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of the file data. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:41 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

24
doc/html/a00036.html Normal file
View File

@@ -0,0 +1,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: telnetd_state struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>telnetd_state Struct Reference<br>
<small>
[<a class="el" href="a00097.html">Telnet server</a>]</small>
</h1><code>#include &lt;telnetd.h&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A telnet connection structure.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:41 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

87
doc/html/a00037.html Normal file
View File

@@ -0,0 +1,87 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_conn struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip_conn Struct Reference<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><code>#include &lt;uip.h&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Representation of a uIP TCP connection.
<p>
The uip_conn structure is used for identifying a connection. All but one field in the structure are to be considered read-only by an application. The only exception is the appstate field whos purpose is to let the application store application-specific state (e.g., file pointers) for the connection. The size of this field is configured in the "uipopt.h" header file.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o0" doxytag="uip_conn::ripaddr"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o0">ripaddr</a> [2]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The IP address of the remote host. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o1" doxytag="uip_conn::lport"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o1">lport</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The local TCP port, in network byte order. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o2" doxytag="uip_conn::rport"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o2">rport</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The local remote TCP port, in network byte order. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o3" doxytag="uip_conn::rcv_nxt"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o3">rcv_nxt</a> [4]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The sequence number that we expect to receive next. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o4" doxytag="uip_conn::snd_nxt"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o4">snd_nxt</a> [4]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The sequence number that was last sent by us. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o5" doxytag="uip_conn::len"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o5">len</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Length of the data that was previously sent. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o6" doxytag="uip_conn::mss"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o6">mss</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Current maximum segment size for the connection. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o7" doxytag="uip_conn::initialmss"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o7">initialmss</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initial maximum segment size for the connection. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o8" doxytag="uip_conn::sa"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o8">sa</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retransmission time-out calculation state variable. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o9" doxytag="uip_conn::sv"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o9">sv</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retransmission time-out calculation state variable. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o10" doxytag="uip_conn::rto"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o10">rto</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retransmission time-out. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o11" doxytag="uip_conn::tcpstateflags"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o11">tcpstateflags</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">TCP state and flags. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o12" doxytag="uip_conn::timer"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o12">timer</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The retransmission timer. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o13" doxytag="uip_conn::nrtx"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o13">nrtx</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The number of retransmissions for the last segment sent. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o14" doxytag="uip_conn::appstate"></a>
<a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html#o14">appstate</a> [UIP_APPSTATE_SIZE]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The application state. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:41 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

24
doc/html/a00038.html Normal file
View File

@@ -0,0 +1,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_eth_addr struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip_eth_addr Struct Reference<br>
<small>
[<a class="el" href="a00083.html">uIP Address Resolution Protocol</a>]</small>
</h1><code>#include &lt;uip_arp.h&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Representation of a 48-bit Ethernet address.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:41 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

28
doc/html/a00039.html Normal file
View File

@@ -0,0 +1,28 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_eth_hdr struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip_eth_hdr Struct Reference<br>
<small>
[<a class="el" href="a00083.html">uIP Address Resolution Protocol</a>]</small>
</h1><code>#include &lt;uip_arp.h&gt;</code>
<p>
Collaboration diagram for uip_eth_hdr:<p><center><img src="a00137.png" border="0" usemap="#a00138" alt="Collaboration graph"></center>
<map name="a00138">
<area href="a00038.html" shape="rect" coords="7,16,100,37" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><hr><a name="_details"></a><h2>Detailed Description</h2>
The Ethernet header.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:42 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

448
doc/html/a00041.html Normal file
View File

@@ -0,0 +1,448 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_stats struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip_stats Struct Reference<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><code>#include &lt;uip.h&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap><a name="o9" doxytag="uip_stats::ip"></a>
struct {</td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o0">drop</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o1">recv</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o2">sent</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o3">vhlerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o4">hblenerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o5">lblenerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o6">fragerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o7">chkerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o8">protoerr</a></td></tr>
<tr><td class="memItemLeft" nowrap valign=top>}&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00041.html#o9">ip</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">IP statistics. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap><a name="o11" doxytag="uip_stats::icmp"></a>
struct {</td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o0">drop</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o1">recv</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o2">sent</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o10">typeerr</a></td></tr>
<tr><td class="memItemLeft" nowrap valign=top>}&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00041.html#o11">icmp</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ICMP statistics. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap><a name="o17" doxytag="uip_stats::tcp"></a>
struct {</td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o0">drop</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o1">recv</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o2">sent</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o7">chkerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o12">ackerr</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o13">rst</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o14">rexmit</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o15">syndrop</a></td></tr>
<tr><td class="memItemLeft" nowrap>&nbsp;&nbsp;&nbsp;<a class="el" href="a00086.html#a2">uip_stats_t</a>&nbsp;&nbsp;&nbsp;<a class="el" href="a00041.html#o16">synrst</a></td></tr>
<tr><td class="memItemLeft" nowrap valign=top>}&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00041.html#o17">tcp</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">TCP statistics. <br><br></td></tr>
</table>
<hr><h2>Field Documentation</h2>
<a name="o12" doxytag="uip_stats::ackerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o12">uip_stats::ackerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of TCP segments with a bad ACK number.
<p>
</td>
</tr>
</table>
<a name="o7" doxytag="uip_stats::chkerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o7">uip_stats::chkerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of TCP segments with a bad checksum.
<p>
</td>
</tr>
</table>
<a name="o0" doxytag="uip_stats::drop"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o0">uip_stats::drop</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of dropped TCP segments.
<p>
</td>
</tr>
</table>
<a name="o6" doxytag="uip_stats::fragerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o6">uip_stats::fragerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of packets dropped since they were IP fragments.
<p>
</td>
</tr>
</table>
<a name="o4" doxytag="uip_stats::hblenerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o4">uip_stats::hblenerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of packets dropped due to wrong IP length, high byte.
<p>
</td>
</tr>
</table>
<a name="o5" doxytag="uip_stats::lblenerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o5">uip_stats::lblenerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of packets dropped due to wrong IP length, low byte.
<p>
</td>
</tr>
</table>
<a name="o8" doxytag="uip_stats::protoerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o8">uip_stats::protoerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of packets dropped since they were neither ICMP, UDP nor TCP.
<p>
</td>
</tr>
</table>
<a name="o1" doxytag="uip_stats::recv"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o1">uip_stats::recv</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of recived TCP segments.
<p>
</td>
</tr>
</table>
<a name="o14" doxytag="uip_stats::rexmit"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o14">uip_stats::rexmit</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of retransmitted TCP segments.
<p>
</td>
</tr>
</table>
<a name="o13" doxytag="uip_stats::rst"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o13">uip_stats::rst</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of recevied TCP RST (reset) segments.
<p>
</td>
</tr>
</table>
<a name="o2" doxytag="uip_stats::sent"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o2">uip_stats::sent</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of sent TCP segments.
<p>
</td>
</tr>
</table>
<a name="o15" doxytag="uip_stats::syndrop"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o15">uip_stats::syndrop</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of dropped SYNs due to too few connections was avaliable.
<p>
</td>
</tr>
</table>
<a name="o16" doxytag="uip_stats::synrst"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o16">uip_stats::synrst</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of SYNs for closed ports, triggering a RST.
<p>
</td>
</tr>
</table>
<a name="o10" doxytag="uip_stats::typeerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o10">uip_stats::typeerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of ICMP packets with a wrong type.
<p>
</td>
</tr>
</table>
<a name="o3" doxytag="uip_stats::vhlerr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a2">uip_stats_t</a> <a class="el" href="a00041.html#o3">uip_stats::vhlerr</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Number of packets dropped due to wrong IP version or header length.
<p>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

37
doc/html/a00046.html Normal file
View File

@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_udp_conn struct Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip_udp_conn Struct Reference<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><code>#include &lt;uip.h&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Representation of a uIP UDP connection.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o0" doxytag="uip_udp_conn::ripaddr"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00046.html#o0">ripaddr</a> [2]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The IP address of the remote peer. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o1" doxytag="uip_udp_conn::lport"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00046.html#o1">lport</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The local port number in network byte order. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="o2" doxytag="uip_udp_conn::rport"></a>
<a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00046.html#o2">rport</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The remote port number in network byte order. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

43
doc/html/a00049.html Normal file
View File

@@ -0,0 +1,43 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: cgi.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/httpd/cgi.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
HTTP server script language C functions file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
This file contains functions that are called by the web server scripts. The functions takes one argument, and the return value is interpreted as follows. A zero means that the function did not complete and should be invoked for the next packet as well. A non-zero value indicates that the function has completed and that the web server should move along to the next script line.
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00050.html">cgi.h</a>"</code><br>
<code>#include "<a class="el" href="a00054.html">httpd.h</a>"</code><br>
<code>#include "<a class="el" href="a00052.html">fs.h</a>"</code><br>
<code>#include &lt;stdio.h&gt;</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for cgi.c:<p><center><img src="a00103.png" border="0" usemap="#cgi.c_map" alt="Include dependency graph"></center>
<map name="cgi.c_map">
<area href="a00070.html" shape="rect" coords="65,155,105,176" alt="">
<area href="a00052.html" shape="rect" coords="108,224,145,245" alt="">
<area href="a00074.html" shape="rect" coords="57,85,113,107" alt="">
<area href="a00054.html" shape="rect" coords="27,16,77,37" alt="">
<area href="a00050.html" shape="rect" coords="169,224,209,245" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a0" doxytag="cgi.c::cgitab"></a>
cgifunction&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a0">cgitab</a> []</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A table containing pointers to C functions that can be called from a web server script. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:03 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

34
doc/html/a00050.html Normal file
View File

@@ -0,0 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: cgi.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/httpd/cgi.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
HTTP script language header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00104.png" border="0" usemap="#cgi.hdep_map" alt="Included by dependency graph"></center>
<map name="cgi.hdep_map">
<area href="a00053.html" shape="rect" coords="7,16,57,37" alt="">
<area href="a00049.html" shape="rect" coords="81,16,121,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a4" doxytag="cgi.h::cgitab"></a>
cgifunction&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a4">cgitab</a> []</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A table containing pointers to C functions that can be called from a web server script. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:04 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

44
doc/html/a00051.html Normal file
View File

@@ -0,0 +1,44 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: fs.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/httpd/fs.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
HTTP server read-only file system code.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
A simple read-only filesystem.
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00054.html">httpd.h</a>"</code><br>
<code>#include "<a class="el" href="a00052.html">fs.h</a>"</code><br>
<code>#include "fsdata.h"</code><br>
<code>#include "fsdata.c"</code><br>
<p>
Include dependency graph for fs.c:<p><center><img src="a00105.png" border="0" usemap="#fs.c_map" alt="Include dependency graph"></center>
<map name="fs.c_map">
<area href="a00070.html" shape="rect" coords="65,155,105,176" alt="">
<area href="a00052.html" shape="rect" coords="108,224,145,245" alt="">
<area href="a00074.html" shape="rect" coords="57,85,113,107" alt="">
<area href="a00054.html" shape="rect" coords="27,16,77,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a4">fs_open</a> (const char *name, struct <a class="el" href="a00030.html">fs_file</a> *file)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open a file in the read-only file system. </em> <a href="a00098.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a5" doxytag="fs.c::fs_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a5">fs_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the read-only file system. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:05 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

51
doc/html/a00052.html Normal file
View File

@@ -0,0 +1,51 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: fs.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/httpd/fs.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
HTTP server read-only file system header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for fs.h:<p><center><img src="a00106.png" border="0" usemap="#fs.h_map" alt="Include dependency graph"></center>
<map name="fs.h_map">
<area href="a00070.html" shape="rect" coords="15,155,55,176" alt="">
<area href="a00074.html" shape="rect" coords="7,86,63,107" alt="">
<area href="a00054.html" shape="rect" coords="9,16,60,38" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00107.png" border="0" usemap="#fs.hdep_map" alt="Included by dependency graph"></center>
<map name="fs.hdep_map">
<area href="a00053.html" shape="rect" coords="7,16,57,37" alt="">
<area href="a00049.html" shape="rect" coords="81,16,121,37" alt="">
<area href="a00051.html" shape="rect" coords="145,16,183,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00030.html">fs_file</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">An open file in the read-only file system. </em> <a href="a00030.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a23">fs_open</a> (const char *name, struct <a class="el" href="a00030.html">fs_file</a> *file)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open a file in the read-only file system. </em> <a href="a00098.html#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a24" doxytag="fs.h::fs_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a24">fs_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the read-only file system. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:07 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

41
doc/html/a00053.html Normal file
View File

@@ -0,0 +1,41 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: httpd.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/httpd/httpd.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
HTTP server.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00054.html">httpd.h</a>"</code><br>
<code>#include "<a class="el" href="a00052.html">fs.h</a>"</code><br>
<code>#include "fsdata.h"</code><br>
<code>#include "<a class="el" href="a00050.html">cgi.h</a>"</code><br>
<p>
Include dependency graph for httpd.c:<p><center><img src="a00108.png" border="0" usemap="#httpd.c_map" alt="Include dependency graph"></center>
<map name="httpd.c_map">
<area href="a00070.html" shape="rect" coords="65,155,105,176" alt="">
<area href="a00052.html" shape="rect" coords="108,224,145,245" alt="">
<area href="a00074.html" shape="rect" coords="57,85,113,107" alt="">
<area href="a00054.html" shape="rect" coords="27,16,77,37" alt="">
<area href="a00050.html" shape="rect" coords="249,224,289,245" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a27">httpd_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the web server. </em> <a href="a00098.html#a27"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:07 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

38
doc/html/a00054.html Normal file
View File

@@ -0,0 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: httpd.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/httpd/httpd.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
HTTP server header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00109.png" border="0" usemap="#httpd.hdep_map" alt="Included by dependency graph"></center>
<map name="httpd.hdep_map">
<area href="a00074.html" shape="rect" coords="133,155,189,176" alt="">
<area href="a00070.html" shape="rect" coords="180,86,220,107" alt="">
<area href="a00069.html" shape="rect" coords="115,16,155,38" alt="">
<area href="a00053.html" shape="rect" coords="17,16,68,38" alt="">
<area href="a00049.html" shape="rect" coords="191,16,231,38" alt="">
<area href="a00051.html" shape="rect" coords="277,16,315,38" alt="">
<area href="a00058.html" shape="rect" coords="108,86,156,107" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00098.html#a16">httpd_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the web server. </em> <a href="a00098.html#a16"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:09 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

50
doc/html/a00055.html Normal file
View File

@@ -0,0 +1,50 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: resolv.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/resolv/resolv.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
DNS host name to IP address resolver.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
This file implements a DNS host name to IP address resolver.
<p>
<code>#include "<a class="el" href="a00056.html">resolv.h</a>"</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for resolv.c:<p><center><img src="a00110.png" border="0" usemap="#resolv.c_map" alt="Include dependency graph"></center>
<map name="resolv.c_map">
<area href="a00056.html" shape="rect" coords="7,224,63,245" alt="">
<area href="a00070.html" shape="rect" coords="15,155,55,176" alt="">
<area href="a00074.html" shape="rect" coords="7,85,63,107" alt="">
<area href="a00054.html" shape="rect" coords="9,16,60,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a26">resolv_query</a> (char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Queues a name so that a question for the name will be sent out. </em> <a href="a00099.html#a26"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a27">resolv_lookup</a> (char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Look up a hostname in the array of known hostnames. </em> <a href="a00099.html#a27"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a28">resolv_getserver</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the currently configured DNS server. </em> <a href="a00099.html#a28"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a29">resolv_conf</a> (<a class="el" href="a00086.html#a1">u16_t</a> *dnsserver)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure which DNS server to use for queries. </em> <a href="a00099.html#a29"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a30" doxytag="resolv.c::resolv_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a30">resolv_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initalize the resolver. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:09 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

58
doc/html/a00056.html Normal file
View File

@@ -0,0 +1,58 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: resolv.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/resolv/resolv.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
DNS resolver code header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for resolv.h:<p><center><img src="a00111.png" border="0" usemap="#resolv.h_map" alt="Include dependency graph"></center>
<map name="resolv.h_map">
<area href="a00070.html" shape="rect" coords="15,155,55,176" alt="">
<area href="a00074.html" shape="rect" coords="7,86,63,107" alt="">
<area href="a00054.html" shape="rect" coords="9,16,60,38" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00112.png" border="0" usemap="#resolv.hdep_map" alt="Included by dependency graph"></center>
<map name="resolv.hdep_map">
<area href="a00064.html" shape="rect" coords="7,16,84,37" alt="">
<area href="a00055.html" shape="rect" coords="108,16,164,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a3">resolv_found</a> (char *name, <a class="el" href="a00086.html#a1">u16_t</a> *ipaddr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function which is called when a hostname is found. </em> <a href="a00099.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a4">resolv_conf</a> (<a class="el" href="a00086.html#a1">u16_t</a> *dnsserver)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure which DNS server to use for queries. </em> <a href="a00099.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a5">resolv_getserver</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the currently configured DNS server. </em> <a href="a00099.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a6" doxytag="resolv.h::resolv_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a6">resolv_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initalize the resolver. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a7">resolv_lookup</a> (char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Look up a hostname in the array of known hostnames. </em> <a href="a00099.html#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00099.html#a8">resolv_query</a> (char *name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Queues a name so that a question for the name will be sent out. </em> <a href="a00099.html#a8"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:11 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

42
doc/html/a00057.html Normal file
View File

@@ -0,0 +1,42 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: smtp.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/smtp/smtp.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
SMTP example implementation.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00058.html">smtp.h</a>"</code><br>
<code>#include "smtp-strings.h"</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for smtp.c:<p><center><img src="a00113.png" border="0" usemap="#smtp.c_map" alt="Include dependency graph"></center>
<map name="smtp.c_map">
<area href="a00070.html" shape="rect" coords="7,155,47,176" alt="">
<area href="a00074.html" shape="rect" coords="32,86,88,107" alt="">
<area href="a00058.html" shape="rect" coords="71,155,119,176" alt="">
<area href="a00054.html" shape="rect" coords="35,16,85,38" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00096.html#a23">smtp_send</a> (char *to, char *from, char *subject, char *msg, <a class="el" href="a00086.html#a1">u16_t</a> msglen)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send an e-mail. </em> <a href="a00096.html#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00096.html#a24">smtp_configure</a> (char *lhostname, <a class="el" href="a00086.html#a1">u16_t</a> *server)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specificy an SMTP server and hostname. </em> <a href="a00096.html#a24"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:12 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

59
doc/html/a00058.html Normal file
View File

@@ -0,0 +1,59 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: smtp.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/smtp/smtp.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
SMTP header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00074.html">uipopt.h</a>"</code><br>
<p>
Include dependency graph for smtp.h:<p><center><img src="a00114.png" border="0" usemap="#smtp.h_map" alt="Include dependency graph"></center>
<map name="smtp.h_map">
<area href="a00074.html" shape="rect" coords="7,85,63,106" alt="">
<area href="a00054.html" shape="rect" coords="9,16,60,37" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00115.png" border="0" usemap="#smtp.hdep_map" alt="Included by dependency graph"></center>
<map name="smtp.hdep_map">
<area href="a00057.html" shape="rect" coords="7,16,57,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a9" doxytag="smtp.h::SMTP_ERR_OK"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00096.html#a9">SMTP_ERR_OK</a>&nbsp;&nbsp;&nbsp;0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Error number that signifies a non-error condition. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a0" doxytag="smtp.h::UIP_APPCALL"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00094.html#a0">UIP_APPCALL</a>&nbsp;&nbsp;&nbsp;smtp_appcall</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The name of the application function that uIP should call in response to TCP/IP events. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a1" doxytag="smtp.h::UIP_APPSTATE_SIZE"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00094.html#a1">UIP_APPSTATE_SIZE</a>&nbsp;&nbsp;&nbsp;(sizeof(struct smtp_state))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The size of the application state that is to be stored in the <a class="el" href="a00037.html">uip_conn</a> structure. <br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00096.html#a2">smtp_done</a> (unsigned char error)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called when an e-mail transmission is done. </em> <a href="a00096.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00096.html#a3">smtp_configure</a> (char *localhostname, <a class="el" href="a00086.html#a1">u16_t</a> *smtpserver)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specificy an SMTP server and hostname. </em> <a href="a00096.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00096.html#a4">smtp_send</a> (char *to, char *from, char *subject, char *msg, <a class="el" href="a00086.html#a1">u16_t</a> msglen)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send an e-mail. </em> <a href="a00096.html#a4"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:14 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

65
doc/html/a00059.html Normal file
View File

@@ -0,0 +1,65 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: memb.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/telnetd/memb.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Memory block allocation routines.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@sics.se">adam@sics.se</a>&gt;</dd></dl>
The memory block allocation routines provide a simple yet powerful set of functions for managing a set of memory blocks of fixed size. A set of memory blocks is statically declared with the <a class="el" href="a00076.html#a4">MEMB()</a> macro. Memory blocks are allocated from the declared memory by the <a class="el" href="a00076.html#a1">memb_alloc()</a> function, and are deallocated with the <a class="el" href="a00076.html#a3">memb_free()</a> function.<p>
<dl compact><dt><b>Note:</b></dt><dd>Because of namespace clashes only one <a class="el" href="a00076.html#a4">MEMB()</a> can be declared per C module, and the name scope of a <a class="el" href="a00076.html#a4">MEMB()</a> memory block is local to each C module.</dd></dl>
The following example shows how to declare and use a memory block called "cmem" which has 8 chunks of memory with each memory chunk being 20 bytes large.<p>
<div class="fragment"><pre> <a class="code" href="a00076.html#a4">MEMB</a>(cmem, 20, 8);
<span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[]) {
<span class="keywordtype">char</span> *ptr;
<a class="code" href="a00076.html#a0">memb_init</a>(&amp;cmem);
ptr = <a class="code" href="a00076.html#a1">memb_alloc</a>(&amp;cmem);
<span class="keywordflow">if</span>(ptr != NULL) {
do_something(ptr);
} <span class="keywordflow">else</span> {
printf(<span class="stringliteral">"Could not allocate memory.\n"</span>);
}
<span class="keywordflow">if</span>(<a class="code" href="a00076.html#a2">memb_free</a>(ptr) == 0) {
printf(<span class="stringliteral">"Deallocation succeeded.\n"</span>);
}
}
</pre></div>
<p>
<code>#include &lt;string.h&gt;</code><br>
<code>#include "<a class="el" href="a00060.html">memb.h</a>"</code><br>
<p>
Include dependency graph for memb.c:<p><center><img src="a00116.png" border="0" usemap="#memb.c_map" alt="Include dependency graph"></center>
<map name="memb.c_map">
<area href="a00060.html" shape="rect" coords="84,16,143,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a0">memb_init</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize a memory block that was declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="a00076.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a1">memb_alloc</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a memory block from a block of memory declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="a00076.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a2">memb_free</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocate a memory block from a memory block previously declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="a00076.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a3">memb_ref</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Increase the reference count for a memory chunk. </em> <a href="a00076.html#a3"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:14 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

46
doc/html/a00060.html Normal file
View File

@@ -0,0 +1,46 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: memb.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/telnetd/memb.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Memory block allocation routines.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@sics.se">adam@sics.se</a>&gt;</dd></dl>
<p>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00117.png" border="0" usemap="#memb.hdep_map" alt="Included by dependency graph"></center>
<map name="memb.hdep_map">
<area href="a00062.html" shape="rect" coords="7,16,68,37" alt="">
<area href="a00059.html" shape="rect" coords="92,16,153,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a4">MEMB</a>(name, size, num)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Declare a memory block. </em> <a href="a00076.html#a4"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a0">memb_init</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize a memory block that was declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="a00076.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a1">memb_alloc</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a memory block from a block of memory declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="a00076.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a2">memb_ref</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Increase the reference count for a memory chunk. </em> <a href="a00076.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a3">memb_free</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocate a memory block from a memory block previously declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="a00076.html#a3"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:15 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

41
doc/html/a00061.html Normal file
View File

@@ -0,0 +1,41 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: telnetd-shell.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/telnetd/telnetd-shell.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
An example telnet server shell.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00063.html">telnetd.h</a>"</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for telnetd-shell.c:<p><center><img src="a00118.png" border="0" usemap="#telnetd-shell.c_map" alt="Include dependency graph"></center>
<map name="telnetd-shell.c_map">
<area href="a00070.html" shape="rect" coords="33,155,73,176" alt="">
<area href="a00063.html" shape="rect" coords="57,224,119,245" alt="">
<area href="a00074.html" shape="rect" coords="25,85,81,107" alt="">
<area href="a00054.html" shape="rect" coords="28,16,79,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a7">telnetd_connected</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called when a telnet connection has been established. </em> <a href="a00097.html#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a8">telnetd_input</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s, char *cmd)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called when a line of text has arrived on a telnet connection. </em> <a href="a00097.html#a8"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:16 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

49
doc/html/a00062.html Normal file
View File

@@ -0,0 +1,49 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: telnetd.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/telnetd/telnetd.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Implementation of the Telnet server.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00060.html">memb.h</a>"</code><br>
<code>#include "<a class="el" href="a00063.html">telnetd.h</a>"</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for telnetd.c:<p><center><img src="a00119.png" border="0" usemap="#telnetd.c_map" alt="Include dependency graph"></center>
<map name="telnetd.c_map">
<area href="a00070.html" shape="rect" coords="33,155,73,176" alt="">
<area href="a00063.html" shape="rect" coords="57,224,119,245" alt="">
<area href="a00074.html" shape="rect" coords="25,85,81,107" alt="">
<area href="a00054.html" shape="rect" coords="28,16,79,37" alt="">
<area href="a00060.html" shape="rect" coords="143,224,201,245" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a19">telnetd_close</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close a telnet session. </em> <a href="a00097.html#a19"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a20">telnetd_prompt</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s, char *str)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print a prompt on a telnet connection. </em> <a href="a00097.html#a20"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a21">telnetd_output</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s, char *str1, char *str2)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print out a string on a telnet connection. </em> <a href="a00097.html#a21"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a22">telnetd_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the telnet server. </em> <a href="a00097.html#a22"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:17 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

70
doc/html/a00063.html Normal file
View File

@@ -0,0 +1,70 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: telnetd.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/telnetd/telnetd.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Header file for the telnet server.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for telnetd.h:<p><center><img src="a00120.png" border="0" usemap="#telnetd.h_map" alt="Include dependency graph"></center>
<map name="telnetd.h_map">
<area href="a00070.html" shape="rect" coords="17,155,57,176" alt="">
<area href="a00074.html" shape="rect" coords="9,86,65,107" alt="">
<area href="a00054.html" shape="rect" coords="12,16,63,38" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00121.png" border="0" usemap="#telnetd.hdep_map" alt="Included by dependency graph"></center>
<map name="telnetd.hdep_map">
<area href="a00062.html" shape="rect" coords="7,16,68,37" alt="">
<area href="a00061.html" shape="rect" coords="92,16,185,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00036.html">telnetd_state</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A telnet connection structure. </em> <a href="a00036.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a24" doxytag="telnetd.h::TELNETD_LINELEN"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a24">TELNETD_LINELEN</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum length of a telnet line. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a25" doxytag="telnetd.h::TELNETD_NUMLINES"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a25">TELNETD_NUMLINES</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The number of output lines being buffered for all telnet connections. <br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a2">telnetd_connected</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called when a telnet connection has been established. </em> <a href="a00097.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a3">telnetd_input</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s, char *cmd)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called when a line of text has arrived on a telnet connection. </em> <a href="a00097.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a4">telnetd_close</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close a telnet session. </em> <a href="a00097.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a5">telnetd_output</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s, char *s1, char *s2)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print out a string on a telnet connection. </em> <a href="a00097.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a6">telnetd_prompt</a> (struct <a class="el" href="a00036.html">telnetd_state</a> *s, char *str)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print a prompt on a telnet connection. </em> <a href="a00097.html#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00097.html#a8">telnetd_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the telnet server. </em> <a href="a00097.html#a8"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:21 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

60
doc/html/a00064.html Normal file
View File

@@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: webclient.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/webclient/webclient.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Implementation of the HTTP client.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00065.html">webclient.h</a>"</code><br>
<code>#include "<a class="el" href="a00056.html">resolv.h</a>"</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for webclient.c:<p><center><img src="a00122.png" border="0" usemap="#webclient.c_map" alt="Include dependency graph"></center>
<map name="webclient.c_map">
<area href="a00070.html" shape="rect" coords="32,155,72,176" alt="">
<area href="a00056.html" shape="rect" coords="57,224,113,245" alt="">
<area href="a00074.html" shape="rect" coords="24,85,80,107" alt="">
<area href="a00054.html" shape="rect" coords="27,16,77,37" alt="">
<area href="a00065.html" shape="rect" coords="137,224,215,245" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a13">webclient_mimetype</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the MIME type of the current HTTP data stream. </em> <a href="a00095.html#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a14">webclient_filename</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the filename of the current HTTP data stream. </em> <a href="a00095.html#a14"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a15">webclient_hostname</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the hostname of the current HTTP data stream. </em> <a href="a00095.html#a15"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a16">webclient_port</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the port number of the current HTTP data stream. </em> <a href="a00095.html#a16"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a17" doxytag="webclient.c::webclient_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a17">webclient_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the webclient module. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a19" doxytag="webclient.c::webclient_close"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a19">webclient_close</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the currently open HTTP connection. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a20">webclient_get</a> (char *host, <a class="el" href="a00086.html#a1">u16_t</a> port, char *file)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open an HTTP connection to a web server and ask for a file using the GET method. </em> <a href="a00095.html#a20"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:24 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

72
doc/html/a00065.html Normal file
View File

@@ -0,0 +1,72 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: webclient.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>apps/webclient/webclient.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Header file for the HTTP client.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "http-strings.h"</code><br>
<code>#include "http-user-agent-string.h"</code><br>
<p>
Include dependency graph for webclient.h:<p><center><img src="a00123.png" border="0" usemap="#webclient.h_map" alt="Include dependency graph"></center>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00124.png" border="0" usemap="#webclient.hdep_map" alt="Included by dependency graph"></center>
<map name="webclient.hdep_map">
<area href="a00064.html" shape="rect" coords="7,16,84,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a1">webclient_datahandler</a> (char *data, <a class="el" href="a00086.html#a1">u16_t</a> len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called from the webclient code when HTTP data has been received. </em> <a href="a00095.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a2">webclient_connected</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called from the webclient code when the HTTP connection has been connected to the web server. </em> <a href="a00095.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a3">webclient_timedout</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called from the webclient code if the HTTP connection to the web server has timed out. </em> <a href="a00095.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a4">webclient_aborted</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called from the webclient code if the HTTP connection to the web server has been aborted by the web server. </em> <a href="a00095.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a5">webclient_closed</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback function that is called from the webclient code when the HTTP connection to the web server has been closed. </em> <a href="a00095.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a6" doxytag="webclient.h::webclient_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a6">webclient_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the webclient module. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a7">webclient_get</a> (char *host, <a class="el" href="a00086.html#a1">u16_t</a> port, char *file)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open an HTTP connection to a web server and ask for a file using the GET method. </em> <a href="a00095.html#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a8" doxytag="webclient.h::webclient_close"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a8">webclient_close</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the currently open HTTP connection. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a10">webclient_mimetype</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the MIME type of the current HTTP data stream. </em> <a href="a00095.html#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a11">webclient_filename</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the filename of the current HTTP data stream. </em> <a href="a00095.html#a11"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a12">webclient_hostname</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the hostname of the current HTTP data stream. </em> <a href="a00095.html#a12"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00095.html#a13">webclient_port</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Obtain the port number of the current HTTP data stream. </em> <a href="a00095.html#a13"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:29 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

41
doc/html/a00067.html Normal file
View File

@@ -0,0 +1,41 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: slipdev.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/slipdev.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
SLIP protocol implementation.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for slipdev.c:<p><center><img src="a00125.png" border="0" usemap="#slipdev.c_map" alt="Include dependency graph"></center>
<map name="slipdev.c_map">
<area href="a00070.html" shape="rect" coords="19,155,59,176" alt="">
<area href="a00074.html" shape="rect" coords="11,86,67,107" alt="">
<area href="a00054.html" shape="rect" coords="13,16,64,38" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a8">slipdev_send</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol. </em> <a href="a00084.html#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a9">slipdev_poll</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the SLIP device for an available packet. </em> <a href="a00084.html#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a10">slipdev_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the SLIP module. </em> <a href="a00084.html#a10"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:30 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

47
doc/html/a00068.html Normal file
View File

@@ -0,0 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: slipdev.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/slipdev.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
SLIP header file.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for slipdev.h:<p><center><img src="a00126.png" border="0" usemap="#slipdev.h_map" alt="Include dependency graph"></center>
<map name="slipdev.h_map">
<area href="a00070.html" shape="rect" coords="19,155,59,176" alt="">
<area href="a00074.html" shape="rect" coords="11,86,67,107" alt="">
<area href="a00054.html" shape="rect" coords="13,16,64,38" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a4">slipdev_char_put</a> (<a class="el" href="a00086.html#a0">u8_t</a> c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Put a character on the serial device. </em> <a href="a00084.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a5">slipdev_char_poll</a> (<a class="el" href="a00086.html#a0">u8_t</a> *c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the serial device for a character. </em> <a href="a00084.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a6">slipdev_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the SLIP module. </em> <a href="a00084.html#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a7">slipdev_send</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol. </em> <a href="a00084.html#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a8">slipdev_poll</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the SLIP device for an available packet. </em> <a href="a00084.html#a8"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:31 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

61
doc/html/a00069.html Normal file
View File

@@ -0,0 +1,61 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/uip.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The uIP TCP/IP stack code.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<code>#include "<a class="el" href="a00074.html">uipopt.h</a>"</code><br>
<code>#include "<a class="el" href="a00071.html">uip_arch.h</a>"</code><br>
<p>
Include dependency graph for uip.c:<p><center><img src="a00127.png" border="0" usemap="#uip.c_map" alt="Include dependency graph"></center>
<map name="uip.c_map">
<area href="a00070.html" shape="rect" coords="57,155,97,176" alt="">
<area href="a00071.html" shape="rect" coords="108,224,180,245" alt="">
<area href="a00074.html" shape="rect" coords="20,85,76,107" alt="">
<area href="a00054.html" shape="rect" coords="23,16,73,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a22">uip_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">uIP initialization function. </em> <a href="a00075.html#a22"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00046.html">uip_udp_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a23">uip_udp_new</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> rport)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set up a new UDP connection. </em> <a href="a00075.html#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a24">uip_unlisten</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop listening to the specified port. </em> <a href="a00075.html#a24"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a25">uip_listen</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start listening to the specified port. </em> <a href="a00075.html#a25"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a27">htons</a> (<a class="el" href="a00086.html#a1">u16_t</a> val)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert 16-bit quantity from host byte order to network byte order. </em> <a href="a00075.html#a27"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a13">uip_buf</a> [UIP_BUFSIZE+2]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP packet buffer. </em> <a href="a00075.html#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>volatile <a class="el" href="a00086.html#a0">u8_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a19">uip_appdata</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pointer to the application data in the packet buffer. </em> <a href="a00075.html#a19"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a17" doxytag="uip.c::uip_acc32"></a>
volatile <a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a17">uip_acc32</a> [4]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">4-byte array used for the 32-bit sequence number calculations. <br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:32 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

183
doc/html/a00070.html Normal file
View File

@@ -0,0 +1,183 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/uip.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Header file for the uIP TCP/IP stack.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
The uIP TCP/IP stack header file contains definitions for a number of C macros that are used by uIP programs as well as internal uIP structures, TCP/IP header structures and function declarations.
<p>
<code>#include "<a class="el" href="a00074.html">uipopt.h</a>"</code><br>
<p>
Include dependency graph for uip.h:<p><center><img src="a00128.png" border="0" usemap="#uip.h_map" alt="Include dependency graph"></center>
<map name="uip.h_map">
<area href="a00074.html" shape="rect" coords="7,85,63,106" alt="">
<area href="a00054.html" shape="rect" coords="9,16,60,37" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00129.png" border="0" usemap="#uip.hdep_map" alt="Included by dependency graph"></center>
<map name="uip.hdep_map">
<area href="a00069.html" shape="rect" coords="44,29,84,50" alt="">
<area href="a00071.html" shape="rect" coords="160,5,232,26" alt="">
<area href="a00073.html" shape="rect" coords="163,101,229,122" alt="">
<area href="a00068.html" shape="rect" coords="164,146,228,168" alt="">
<area href="a00067.html" shape="rect" coords="164,192,228,213" alt="">
<area href="a00064.html" shape="rect" coords="25,284,103,305" alt="">
<area href="a00056.html" shape="rect" coords="168,237,224,258" alt="">
<area href="a00057.html" shape="rect" coords="171,282,221,304" alt="">
<area href="a00063.html" shape="rect" coords="165,429,227,450" alt="">
<area href="a00062.html" shape="rect" coords="33,405,95,426" alt="">
<area href="a00061.html" shape="rect" coords="17,464,111,485" alt="">
<area href="a00053.html" shape="rect" coords="39,554,89,576" alt="">
<area href="a00052.html" shape="rect" coords="177,626,215,648" alt="">
<area href="a00049.html" shape="rect" coords="44,613,84,634" alt="">
<area href="a00051.html" shape="rect" coords="45,660,83,681" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html">uip_conn</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of a uIP TCP connection. </em> <a href="a00037.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00041.html">uip_stats</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. </em> <a href="a00041.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00046.html">uip_udp_conn</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of a uIP UDP connection. </em> <a href="a00046.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a0">uip_sethostaddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the IP address of this host. </em> <a href="a00077.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a1">uip_gethostaddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the IP address of this host. </em> <a href="a00077.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a1">uip_input</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process an incoming packet. </em> <a href="a00079.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a2">uip_periodic</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a connection identified by its number. </em> <a href="a00079.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a3">uip_periodic_conn</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a connection identified by a pointer to its structure. </em> <a href="a00079.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a4">uip_udp_periodic</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a UDP connection identified by its number. </em> <a href="a00079.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a5">uip_udp_periodic_conn</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a UDP connection identified by a pointer to its structure. </em> <a href="a00079.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a5">uip_send</a>(data, len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send data on the current connection. </em> <a href="a00080.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a6">uip_datalen</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer. </em> <a href="a00080.html#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a7">uip_urgdatalen</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of any out-of-band data (urgent data) that has arrived on the connection. </em> <a href="a00080.html#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a8">uip_close</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the current connection. </em> <a href="a00080.html#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a9">uip_abort</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Abort the current connection. </em> <a href="a00080.html#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a10">uip_stop</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tell the sending host to stop sending data. </em> <a href="a00080.html#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a11" doxytag="uip.h::uip_stopped"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a11">uip_stopped</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find out if the current connection has been previously stopped with <a class="el" href="a00080.html#a10">uip_stop()</a>. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a12">uip_restart</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Restart the current connection, if is has previously been stopped with <a class="el" href="a00080.html#a10">uip_stop()</a>. </em> <a href="a00080.html#a12"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a13">uip_newdata</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is new incoming data available? </em> <a href="a00080.html#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a14">uip_acked</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has previously sent data been acknowledged? </em> <a href="a00080.html#a14"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a15">uip_connected</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection just been connected? </em> <a href="a00080.html#a15"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a16">uip_closed</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been closed by the other end? </em> <a href="a00080.html#a16"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a17">uip_aborted</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been aborted by the other end? </em> <a href="a00080.html#a17"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a18">uip_timedout</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection timed out? </em> <a href="a00080.html#a18"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a19">uip_rexmit</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Do we need to retransmit previously data? </em> <a href="a00080.html#a19"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a20">uip_poll</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is the connection being polled by uIP? </em> <a href="a00080.html#a20"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a21" doxytag="uip.h::uip_initialmss"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a21">uip_initialmss</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the initial maxium segment size (MSS) of the current connection. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a22">uip_mss</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current maxium segment size that can be sent on the current connection. </em> <a href="a00080.html#a22"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a23">uip_udp_remove</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removed a UDP connection. </em> <a href="a00080.html#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a24">uip_udp_send</a>(len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a UDP datagram of length len on the current connection. </em> <a href="a00080.html#a24"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00081.html#a1">uip_ipaddr</a>(addr, addr0, addr1, addr2, addr3)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pack an IP address into a 4-byte array which is used by uIP to represent IP addresses. </em> <a href="a00081.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00081.html#a2">HTONS</a>(n)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert 16-bit quantity from host byte order to network byte order. </em> <a href="a00081.html#a2"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00078.html#a0">uip_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">uIP initialization function. </em> <a href="a00078.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a0">uip_listen</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start listening to the specified port. </em> <a href="a00080.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a1">uip_unlisten</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop listening to the specified port. </em> <a href="a00080.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00037.html">uip_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a2">uip_connect</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connect to a remote host using TCP. </em> <a href="a00080.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00046.html">uip_udp_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a3">uip_udp_new</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> rport)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set up a new UDP connection. </em> <a href="a00080.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00081.html#a0">htons</a> (<a class="el" href="a00086.html#a1">u16_t</a> val)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert 16-bit quantity from host byte order to network byte order. </em> <a href="a00081.html#a0"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a0">uip_buf</a> [UIP_BUFSIZE+2]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP packet buffer. </em> <a href="a00079.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>volatile <a class="el" href="a00086.html#a0">u8_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a0">uip_appdata</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pointer to the application data in the packet buffer. </em> <a href="a00075.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a0" doxytag="uip.h::uip_acc32"></a>
volatile <a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a0">uip_acc32</a> [4]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">4-byte array used for the 32-bit sequence number calculations. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00041.html">uip_stats</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a8">uip_stat</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP TCP/IP statistics. </em> <a href="a00075.html#a8"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:34 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

50
doc/html/a00071.html Normal file
View File

@@ -0,0 +1,50 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_arch.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/uip_arch.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Declarations of architecture specific functions.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for uip_arch.h:<p><center><img src="a00130.png" border="0" usemap="#uip_arch.h_map" alt="Include dependency graph"></center>
<map name="uip_arch.h_map">
<area href="a00070.html" shape="rect" coords="23,155,63,176" alt="">
<area href="a00074.html" shape="rect" coords="15,86,71,107" alt="">
<area href="a00054.html" shape="rect" coords="17,16,68,38" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00131.png" border="0" usemap="#uip_arch.hdep_map" alt="Included by dependency graph"></center>
<map name="uip_arch.hdep_map">
<area href="a00069.html" shape="rect" coords="23,16,63,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a1">uip_add32</a> (<a class="el" href="a00086.html#a0">u8_t</a> *op32, <a class="el" href="a00086.html#a1">u16_t</a> op16)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Carry out a 32-bit addition. </em> <a href="a00082.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a2">uip_chksum</a> (<a class="el" href="a00086.html#a1">u16_t</a> *buf, <a class="el" href="a00086.html#a1">u16_t</a> len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate the Internet checksum over a buffer. </em> <a href="a00082.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a3">uip_ipchksum</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate the IP header checksum of the packet header in uip_buf. </em> <a href="a00082.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a4">uip_tcpchksum</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate the TCP checksum of the packet in uip_buf and uip_appdata. </em> <a href="a00082.html#a4"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:36 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

50
doc/html/a00072.html Normal file
View File

@@ -0,0 +1,50 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_arp.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/uip_arp.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Implementation of the ARP Address Resolution Protocol.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00073.html">uip_arp.h</a>"</code><br>
<code>#include &lt;string.h&gt;</code><br>
<p>
Include dependency graph for uip_arp.c:<p><center><img src="a00132.png" border="0" usemap="#uip_arp.c_map" alt="Include dependency graph"></center>
<map name="uip_arp.c_map">
<area href="a00073.html" shape="rect" coords="7,224,73,245" alt="">
<area href="a00070.html" shape="rect" coords="20,155,60,176" alt="">
<area href="a00074.html" shape="rect" coords="12,85,68,107" alt="">
<area href="a00054.html" shape="rect" coords="15,16,65,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a12" doxytag="uip_arp.c::uip_arp_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a12">uip_arp_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the ARP module. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a13">uip_arp_timer</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic ARP processing function. </em> <a href="a00083.html#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a15">uip_arp_ipin</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ARP processing for incoming IP packets. </em> <a href="a00083.html#a15"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a16">uip_arp_arpin</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ARP processing for incoming ARP packets. </em> <a href="a00083.html#a16"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a17">uip_arp_out</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request. </em> <a href="a00083.html#a17"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:37 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

77
doc/html/a00073.html Normal file
View File

@@ -0,0 +1,77 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uip_arp.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uip/uip_arp.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Macros and definitions for the ARP module.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
<p>
<code>#include "<a class="el" href="a00070.html">uip.h</a>"</code><br>
<p>
Include dependency graph for uip_arp.h:<p><center><img src="a00133.png" border="0" usemap="#uip_arp.h_map" alt="Include dependency graph"></center>
<map name="uip_arp.h_map">
<area href="a00070.html" shape="rect" coords="20,155,60,176" alt="">
<area href="a00074.html" shape="rect" coords="12,86,68,107" alt="">
<area href="a00054.html" shape="rect" coords="15,16,65,38" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00134.png" border="0" usemap="#uip_arp.hdep_map" alt="Included by dependency graph"></center>
<map name="uip_arp.hdep_map">
<area href="a00072.html" shape="rect" coords="7,16,76,37" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00038.html">uip_eth_addr</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of a 48-bit Ethernet address. </em> <a href="a00038.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00039.html">uip_eth_hdr</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The Ethernet header. </em> <a href="a00039.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a2">uip_setdraddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the default router's IP address. </em> <a href="a00077.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a3">uip_setnetmask</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the netmask. </em> <a href="a00077.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a4">uip_getdraddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the default router's IP address. </em> <a href="a00077.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a5">uip_getnetmask</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the netmask. </em> <a href="a00077.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a6">uip_setethaddr</a>(eaddr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specifiy the Ethernet MAC address. </em> <a href="a00077.html#a6"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a7" doxytag="uip_arp.h::uip_arp_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a7">uip_arp_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the ARP module. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a8">uip_arp_ipin</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ARP processing for incoming IP packets. </em> <a href="a00083.html#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a9">uip_arp_arpin</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ARP processing for incoming ARP packets. </em> <a href="a00083.html#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a10">uip_arp_out</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request. </em> <a href="a00083.html#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a11">uip_arp_timer</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic ARP processing function. </em> <a href="a00083.html#a11"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:39 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

209
doc/html/a00074.html Normal file
View File

@@ -0,0 +1,209 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uipopt.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>unix/uipopt.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Configuration options for uIP.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Adam Dunkels &lt;<a href="mailto:adam@dunkels.com">adam@dunkels.com</a>&gt;</dd></dl>
This file is used for tweaking various configuration options for uIP. You should make a copy of this file into one of your project's directories instead of editing this example "uipopt.h" file that comes with the uIP distribution.
<p>
<code>#include "<a class="el" href="a00054.html">httpd.h</a>"</code><br>
<p>
Include dependency graph for uipopt.h:<p><center><img src="a00135.png" border="0" usemap="#uipopt.h_map" alt="Include dependency graph"></center>
<map name="uipopt.h_map">
<area href="a00054.html" shape="rect" coords="9,16,60,37" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="a00136.png" border="0" usemap="#uipopt.hdep_map" alt="Included by dependency graph"></center>
<map name="uipopt.hdep_map">
<area href="a00070.html" shape="rect" coords="57,85,97,106" alt="">
<area href="a00069.html" shape="rect" coords="28,16,68,37" alt="">
<area href="a00058.html" shape="rect" coords="121,85,169,106" alt="">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a0">UIP_FIXEDADDR</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if uIP should use a fixed IP address or not. </em> <a href="a00087.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a1">UIP_PINGADDRCONF</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ping IP address asignment. </em> <a href="a00087.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a2" doxytag="uipopt.h::UIP_IPADDR0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a2">UIP_IPADDR0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a3" doxytag="uipopt.h::UIP_IPADDR1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a3">UIP_IPADDR1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a4" doxytag="uipopt.h::UIP_IPADDR2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a4">UIP_IPADDR2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a5" doxytag="uipopt.h::UIP_IPADDR3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a5">UIP_IPADDR3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a6" doxytag="uipopt.h::UIP_NETMASK0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a6">UIP_NETMASK0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a7" doxytag="uipopt.h::UIP_NETMASK1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a7">UIP_NETMASK1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a8" doxytag="uipopt.h::UIP_NETMASK2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a8">UIP_NETMASK2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a9" doxytag="uipopt.h::UIP_NETMASK3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a9">UIP_NETMASK3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a10" doxytag="uipopt.h::UIP_DRIPADDR0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a10">UIP_DRIPADDR0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a11" doxytag="uipopt.h::UIP_DRIPADDR1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a11">UIP_DRIPADDR1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a12" doxytag="uipopt.h::UIP_DRIPADDR2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a12">UIP_DRIPADDR2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a13" doxytag="uipopt.h::UIP_DRIPADDR3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a13">UIP_DRIPADDR3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a14">UIP_FIXEDETHADDR</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not. </em> <a href="a00087.html#a14"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a15" doxytag="uipopt.h::UIP_ETHADDR0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a15">UIP_ETHADDR0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a16" doxytag="uipopt.h::UIP_ETHADDR1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a16">UIP_ETHADDR1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a17" doxytag="uipopt.h::UIP_ETHADDR2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a17">UIP_ETHADDR2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a18" doxytag="uipopt.h::UIP_ETHADDR3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a18">UIP_ETHADDR3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a19" doxytag="uipopt.h::UIP_ETHADDR4"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a19">UIP_ETHADDR4</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fifth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a20" doxytag="uipopt.h::UIP_ETHADDR5"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a20">UIP_ETHADDR5</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The sixth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00088.html#a0">UIP_TTL</a>&nbsp;&nbsp;&nbsp;255</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The IP TTL (time to live) of IP packets sent by uIP. </em> <a href="a00088.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00088.html#a1">UIP_REASSEMBLY</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Turn on support for IP packet reassembly. </em> <a href="a00088.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a2" doxytag="uipopt.h::UIP_REASS_MAXAGE"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00088.html#a2">UIP_REASS_MAXAGE</a>&nbsp;&nbsp;&nbsp;40</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum time an IP fragment should wait in the reassembly buffer before it is dropped. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a0" doxytag="uipopt.h::UIP_UDP"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00089.html#a0">UIP_UDP</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Toggles wether UDP support should be compiled in or not. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00089.html#a1">UIP_UDP_CHECKSUMS</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Toggles if UDP checksums should be used or not. </em> <a href="a00089.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a2" doxytag="uipopt.h::UIP_UDP_CONNS"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00089.html#a2">UIP_UDP_CONNS</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum amount of concurrent UDP connections. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a3" doxytag="uipopt.h::UIP_UDP_APPCALL"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00089.html#a3">UIP_UDP_APPCALL</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The name of the function that should be called when UDP datagrams arrive. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a0">UIP_ACTIVE_OPEN</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if support for opening connections from uIP should be compiled in. </em> <a href="a00090.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a1">UIP_CONNS</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum number of simultaneously open TCP connections. </em> <a href="a00090.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a2">UIP_LISTENPORTS</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum number of simultaneously listening TCP ports. </em> <a href="a00090.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a3">UIP_RECEIVE_WINDOW</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The size of the advertised receiver's window. </em> <a href="a00090.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a4">UIP_URGDATA</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if support for TCP urgent data notification should be compiled in. </em> <a href="a00090.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a5">UIP_RTO</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The initial retransmission timeout counted in timer pulses. </em> <a href="a00090.html#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a6">UIP_MAXRTX</a>&nbsp;&nbsp;&nbsp;8</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum number of times a segment should be retransmitted before the connection should be aborted. </em> <a href="a00090.html#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a7">UIP_MAXSYNRTX</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum number of times a SYN segment should be retransmitted before a connection request should be deemed to have been unsuccessful. </em> <a href="a00090.html#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a8">UIP_TCP_MSS</a>&nbsp;&nbsp;&nbsp;(UIP_BUFSIZE - UIP_LLH_LEN - 40)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The TCP maximum segment size. </em> <a href="a00090.html#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00090.html#a9">UIP_TIME_WAIT_TIMEOUT</a>&nbsp;&nbsp;&nbsp;120</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">How long a connection should stay in the TIME_WAIT state. </em> <a href="a00090.html#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00091.html#a0">UIP_ARPTAB_SIZE</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The size of the ARP table. </em> <a href="a00091.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00091.html#a1">UIP_ARP_MAXAGE</a>&nbsp;&nbsp;&nbsp;120</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maxium age of ARP table entries measured in 10ths of seconds. </em> <a href="a00091.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00092.html#a1">UIP_BUFSIZE</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The size of the uIP packet buffer. </em> <a href="a00092.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00092.html#a2">UIP_STATISTICS</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if statistics support should be compiled in. </em> <a href="a00092.html#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00092.html#a3">UIP_LOGGING</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if logging of certain events should be compiled in. </em> <a href="a00092.html#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00092.html#a4">UIP_LLH_LEN</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The link level header length. </em> <a href="a00092.html#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00093.html#a2">BYTE_ORDER</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The byte order of the CPU architecture on which uIP is to be run. </em> <a href="a00093.html#a2"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00086.html#a0">u8_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The 8-bit unsigned data type. </em> <a href="a00086.html#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00086.html#a1">u16_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The 16-bit unsigned data type. </em> <a href="a00086.html#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00086.html#a2">uip_stats_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The statistics data type. </em> <a href="a00086.html#a2"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00092.html#a0">uip_log</a> (char *msg)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print out a uIP log message. </em> <a href="a00092.html#a0"></a><em><br><br></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:41 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

358
doc/html/a00075.html Normal file
View File

@@ -0,0 +1,358 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: The uIP TCP/IP stack</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>The uIP TCP/IP stack</h1>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00069.html">uip.c</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP TCP/IP stack code. <br><br></td></tr>
<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00070.html">uip.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Header file for the uIP TCP/IP stack. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00077.html">uIP configuration functions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00078.html">uIP initialization functions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00079.html">uIP device driver functions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00080.html">uIP application functions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00081.html">uIP conversion functions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00083.html">uIP Address Resolution Protocol</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00084.html">Serial Line IP (SLIP) protocol</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00099.html">uIP hostname resolver functions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00082.html">Architecture specific uIP functions</a></td></tr>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html">uip_conn</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of a uIP TCP connection. </em> <a href="a00037.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00041.html">uip_stats</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. </em> <a href="a00041.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00046.html">uip_udp_conn</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of a uIP UDP connection. </em> <a href="a00046.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a22">uip_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">uIP initialization function. </em> <a href="#a22"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00046.html">uip_udp_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a23">uip_udp_new</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> rport)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set up a new UDP connection. </em> <a href="#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a24">uip_unlisten</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop listening to the specified port. </em> <a href="#a24"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a25">uip_listen</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start listening to the specified port. </em> <a href="#a25"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a27">htons</a> (<a class="el" href="a00086.html#a1">u16_t</a> val)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert 16-bit quantity from host byte order to network byte order. </em> <a href="#a27"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>volatile <a class="el" href="a00086.html#a0">u8_t</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a0">uip_appdata</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pointer to the application data in the packet buffer. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00041.html">uip_stats</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a8">uip_stat</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP TCP/IP statistics. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a13">uip_buf</a> [UIP_BUFSIZE+2]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP packet buffer. </em> <a href="#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a17" doxytag="uip::uip_acc32"></a>
volatile <a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a17">uip_acc32</a> [4]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">4-byte array used for the 32-bit sequence number calculations. <br><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a27" doxytag="uip.c::htons"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> htons </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>val</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Convert 16-bit quantity from host byte order to network byte order.
<p>
This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the <a class="el" href="a00081.html#a2">HTONS()</a> macro instead. </td>
</tr>
</table>
<a name="a22" doxytag="uip.c::uip_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
uIP initialization function.
<p>
This function should be called at boot up to initilize the uIP TCP/IP stack. </td>
</tr>
</table>
<a name="a25" doxytag="uip.c::uip_listen"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_listen </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Start listening to the specified port.
<p>
<dl compact><dt><b>Note:</b></dt><dd>Since this function expects the port number in network byte order, a conversion using <a class="el" href="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00080.html#a25">uip_listen</a>(<a class="code" href="a00081.html#a2">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a23" doxytag="uip.c::uip_udp_new"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> struct <a class="el" href="a00046.html">uip_udp_conn</a>* uip_udp_new </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>rport</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set up a new UDP connection.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>ripaddr</em>&nbsp;</td><td>A pointer to a 4-byte structure representing the IP address of the remote host.</td></tr>
<tr><td valign=top><em>rport</em>&nbsp;</td><td>The remote port number in network byte order.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The <a class="el" href="a00046.html">uip_udp_conn</a> structure for the new connection or NULL if no connection could be allocated. </dd></dl>
</td>
</tr>
</table>
<a name="a24" doxytag="uip.c::uip_unlisten"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_unlisten </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Stop listening to the specified port.
<p>
<dl compact><dt><b>Note:</b></dt><dd>Since this function expects the port number in network byte order, a conversion using <a class="el" href="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00080.html#a24">uip_unlisten</a>(<a class="code" href="a00081.html#a2">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Variable Documentation</h2>
<a name="a0" doxytag="uip.h::uip_appdata"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> volatile <a class="el" href="a00086.html#a0">u8_t</a>* <a class="el" href="a00075.html#a19">uip_appdata</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pointer to the application data in the packet buffer.
<p>
This pointer points to the application data when the application is called. If the application wishes to send data, the application may use this space to write the data into before calling <a class="el" href="a00080.html#a5">uip_send()</a>. </td>
</tr>
</table>
<a name="a13" doxytag="uip.c::uip_buf"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a0">u8_t</a> <a class="el" href="a00075.html#a13">uip_buf</a>[UIP_BUFSIZE+2]
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The uIP packet buffer.
<p>
The uip_buf array is used to hold incoming and outgoing packets. The device driver should place incoming data into this buffer. When sending data, the device driver should read the link level headers and the TCP/IP headers from this buffer. The size of the link level headers is configured by the UIP_LLH_LEN define.<p>
<dl compact><dt><b>Note:</b></dt><dd>The application data need not be placed in this buffer, so the device driver must read it from the place pointed to by the uip_appdata pointer as illustrated by the following example: <div class="fragment"><pre> <span class="keywordtype">void</span>
devicedriver_send(<span class="keywordtype">void</span>)
{
hwsend(&amp;uip_buf[0], UIP_LLH_LEN);
hwsend(&amp;uip_buf[UIP_LLH_LEN], 40);
hwsend(uip_appdata, uip_len - 40 - UIP_LLH_LEN);
}
</pre></div></dd></dl>
</td>
</tr>
</table>
<a name="a8" doxytag="uip.h::uip_stat"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> struct <a class="el" href="a00041.html">uip_stats</a> <a class="el" href="a00075.html#a8">uip_stat</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The uIP TCP/IP statistics.
<p>
This is the variable in which the uIP TCP/IP statistics are gathered. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

269
doc/html/a00076.html Normal file
View File

@@ -0,0 +1,269 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Example applications</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Example applications</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The uIP distribution contains a number of example applications that can be either used directory or studied when learning to develop applications for uIP.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00059.html">memb.c</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory block allocation routines. <br><br></td></tr>
<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00060.html">memb.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory block allocation routines. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00095.html">Web client</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00096.html">SMTP E-mail sender</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00097.html">Telnet server</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00098.html">Web server</a></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a4">MEMB</a>(name, size, num)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Declare a memory block. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a0">memb_init</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize a memory block that was declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a1">memb_alloc</a> (struct memb_blocks *m)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a memory block from a block of memory declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a2">memb_ref</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Increase the reference count for a memory chunk. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00076.html#a3">memb_free</a> (struct memb_blocks *m, char *ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deallocate a memory block from a memory block previously declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </em> <a href="#a3"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a4" doxytag="memb.h::MEMB"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define MEMB</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">name, <tr>
<td></td>
<td></td>
<td class="md" nowrap>size, <tr>
<td></td>
<td></td>
<td class="md" nowrap>num&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<b>Value:</b><div class="fragment"><pre><span class="keyword">static</span> <span class="keywordtype">char</span> memb_mem[(size + 1) * num]; \
<span class="keyword">static</span> <span class="keyword">struct </span>memb_blocks name = {size, num, memb_mem}
</pre></div>Declare a memory block.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>name</em>&nbsp;</td><td>The name of the memory block (later used with <a class="el" href="a00076.html#a0">memb_init()</a>, <a class="el" href="a00076.html#a1">memb_alloc()</a> and <a class="el" href="a00076.html#a3">memb_free()</a>).</td></tr>
<tr><td valign=top><em>size</em>&nbsp;</td><td>The size of each memory chunk, in bytes.</td></tr>
<tr><td valign=top><em>num</em>&nbsp;</td><td>The total number of memory chunks in the block. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a1" doxytag="memb.h::memb_alloc"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char* memb_alloc </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>m</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Allocate a memory block from a block of memory declared with <a class="el" href="a00076.html#a4">MEMB()</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a3" doxytag="memb.h::memb_free"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char memb_free </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname" nowrap> <em>m</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char *&nbsp;</td>
<td class="mdname" nowrap> <em>ptr</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Deallocate a memory block from a memory block previously declared with <a class="el" href="a00076.html#a4">MEMB()</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>m A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>.</td></tr>
<tr><td valign=top><em>ptr</em>&nbsp;</td><td>A pointer to the memory block that is to be deallocated.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The new reference count for the memory block (should be 0 if successfully deallocated) or -1 if the pointer "ptr" did not point to a legal memory block. </dd></dl>
</td>
</tr>
</table>
<a name="a0" doxytag="memb.h::memb_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void memb_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>m</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initialize a memory block that was declared with <a class="el" href="a00076.html#a4">MEMB()</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a2" doxytag="memb.h::memb_ref"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char memb_ref </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">struct memb_blocks *&nbsp;</td>
<td class="mdname" nowrap> <em>m</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char *&nbsp;</td>
<td class="mdname" nowrap> <em>ptr</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Increase the reference count for a memory chunk.
<p>
<dl compact><dt><b>Note:</b></dt><dd>No sanity checks are currently made.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>m</em>&nbsp;</td><td>m A memory block previosly declared with <a class="el" href="a00076.html#a4">MEMB()</a>.</td></tr>
<tr><td valign=top><em>ptr</em>&nbsp;</td><td>A pointer to the memory chunk for which the reference count should be increased.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The new reference count. </dd></dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

287
doc/html/a00077.html Normal file
View File

@@ -0,0 +1,287 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP configuration functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP configuration functions<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The uIP configuration functions are used for setting run-time parameters in uIP such as IP addresses.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a0">uip_sethostaddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the IP address of this host. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a1">uip_gethostaddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the IP address of this host. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a2">uip_setdraddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the default router's IP address. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a3">uip_setnetmask</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the netmask. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a4">uip_getdraddr</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the default router's IP address. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a5">uip_getnetmask</a>(addr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the netmask. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00077.html#a6">uip_setethaddr</a>(eaddr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specifiy the Ethernet MAC address. </em> <a href="#a6"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a4" doxytag="uip_arp.h::uip_getdraddr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_getdraddr</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the default router's IP address.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte array that will be filled in with the IP address of the default router. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a1" doxytag="uip.h::uip_gethostaddr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_gethostaddr</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the IP address of this host.
<p>
The IP address is represented as a 4-byte array where the first octet of the IP address is put in the first member of the 4-byte array.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte array that will be filled in with the currently configured IP address. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a5" doxytag="uip_arp.h::uip_getnetmask"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_getnetmask</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the netmask.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte array that will be filled in with the value of the netmask. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a2" doxytag="uip_arp.h::uip_setdraddr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_setdraddr</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the default router's IP address.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte array containing the IP address of the default router. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a6" doxytag="uip_arp.h::uip_setethaddr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_setethaddr</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">eaddr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Specifiy the Ethernet MAC address.
<p>
The ARP code needs to know the MAC address of the Ethernet card in order to be able to respond to ARP queries and to generate working Ethernet headers.<p>
<dl compact><dt><b>Note:</b></dt><dd>This macro only specifies the Ethernet MAC address to the ARP code. It cannot be used to change the MAC address of the Ethernet card.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>eaddr</em>&nbsp;</td><td>A pointer to a struct <a class="el" href="a00038.html">uip_eth_addr</a> containing the Ethernet MAC address of the Ethernet card. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a0" doxytag="uip.h::uip_sethostaddr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_sethostaddr</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the IP address of this host.
<p>
The IP address is represented as a 4-byte array where the first octet of the IP address is put in the first member of the 4-byte array.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte representation of the IP address. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a3" doxytag="uip_arp.h::uip_setnetmask"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_setnetmask</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the netmask.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte array containing the IP address of the netmask. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

58
doc/html/a00078.html Normal file
View File

@@ -0,0 +1,58 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP initialization functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP initialization functions<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The uIP initialization functions are used for booting uIP.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00078.html#a0">uip_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">uIP initialization function. </em> <a href="#a0"></a><em><br><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a0" doxytag="uip.h::uip_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
uIP initialization function.
<p>
This function should be called at boot up to initilize the uIP TCP/IP stack. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

303
doc/html/a00079.html Normal file
View File

@@ -0,0 +1,303 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP device driver functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP device driver functions<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
These functions are used by a network device driver for interacting with uIP.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a1">uip_input</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process an incoming packet. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a2">uip_periodic</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a connection identified by its number. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a3">uip_periodic_conn</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a connection identified by a pointer to its structure. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a4">uip_udp_periodic</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a UDP connection identified by its number. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a5">uip_udp_periodic_conn</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic processing for a UDP connection identified by a pointer to its structure. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00079.html#a0">uip_buf</a> [UIP_BUFSIZE+2]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The uIP packet buffer. </em> <a href="#a0"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a1" doxytag="uip.h::uip_input"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_input</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Process an incoming packet.
<p>
This function should be called when the device driver has received a packet from the network. The packet from the device driver must be present in the uip_buf buffer, and the length of the packet should be placed in the uip_len variable.<p>
When the function returns, there may be an outbound packet placed in the uip_buf packet buffer. If so, the uip_len variable is set to the length of the packet. If no packet is to be sent out, the uip_len variable is set to 0.<p>
The usual way of calling the function is presented by the source code below. <div class="fragment"><pre> uip_len = devicedriver_poll();
<span class="keywordflow">if</span>(uip_len &gt; 0) {
<a class="code" href="a00079.html#a1">uip_input</a>();
<span class="keywordflow">if</span>(uip_len &gt; 0) {
devicedriver_send();
}
}
</pre></div><p>
<dl compact><dt><b>Note:</b></dt><dd>If you are writing a uIP device driver that needs ARP (Address Resolution Protocol), e.g., when running uIP over Ethernet, you will need to call the uIP ARP code before calling this function: <div class="fragment"><pre><span class="preprocessor"> #define BUF ((struct uip_eth_hdr *)&amp;uip_buf[0])</span>
<span class="preprocessor"></span> uip_len = ethernet_devicedrver_poll();
<span class="keywordflow">if</span>(uip_len &gt; 0) {
<span class="keywordflow">if</span>(BUF-&gt;type == <a class="code" href="a00081.html#a2">HTONS</a>(UIP_ETHTYPE_IP)) {
<a class="code" href="a00083.html#a15">uip_arp_ipin</a>();
<a class="code" href="a00079.html#a1">uip_input</a>();
<span class="keywordflow">if</span>(uip_len &gt; 0) {
<a class="code" href="a00083.html#a17">uip_arp_out</a>();
ethernet_devicedriver_send();
}
} <span class="keywordflow">else</span> <span class="keywordflow">if</span>(BUF-&gt;type == <a class="code" href="a00081.html#a2">HTONS</a>(UIP_ETHTYPE_ARP)) {
<a class="code" href="a00083.html#a16">uip_arp_arpin</a>();
<span class="keywordflow">if</span>(uip_len &gt; 0) {
ethernet_devicedriver_send();
}
}
</pre></div></dd></dl>
</td>
</tr>
</table>
<a name="a2" doxytag="uip.h::uip_periodic"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_periodic</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Periodic processing for a connection identified by its number.
<p>
This function does the necessary periodic processing (timers, polling) for a uIP TCP conneciton, and should be called when the periodic uIP timer goes off. It should be called for every connection, regardless of whether they are open of closed.<p>
When the function returns, it may have an outbound packet waiting for service in the uIP packet buffer, and if so the uip_len variable is set to a value larger than zero. The device driver should be called to send out the packet.<p>
The ususal way of calling the function is through a for() loop like this: <div class="fragment"><pre> <span class="keywordflow">for</span>(i = 0; i &lt; <a class="code" href="a00090.html#a1">UIP_CONNS</a>; ++i) {
<a class="code" href="a00079.html#a2">uip_periodic</a>(i);
<span class="keywordflow">if</span>(uip_len &gt; 0) {
devicedriver_send();
}
}
</pre></div><p>
<dl compact><dt><b>Note:</b></dt><dd>If you are writing a uIP device driver that needs ARP (Address Resolution Protocol), e.g., when running uIP over Ethernet, you will need to call the <a class="el" href="a00083.html#a10">uip_arp_out()</a> function before calling the device driver: <div class="fragment"><pre> <span class="keywordflow">for</span>(i = 0; i &lt; <a class="code" href="a00090.html#a1">UIP_CONNS</a>; ++i) {
<a class="code" href="a00079.html#a2">uip_periodic</a>(i);
<span class="keywordflow">if</span>(uip_len &gt; 0) {
<a class="code" href="a00083.html#a17">uip_arp_out</a>();
ethernet_devicedriver_send();
}
}
</pre></div></dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>conn</em>&nbsp;</td><td>The number of the connection which is to be periodically polled. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a3" doxytag="uip.h::uip_periodic_conn"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_periodic_conn</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Periodic processing for a connection identified by a pointer to its structure.
<p>
Same as <a class="el" href="a00079.html#a2">uip_periodic()</a> but takes a pointer to the actual <a class="el" href="a00037.html">uip_conn</a> struct instead of an integer as its argument. This function can be used to force periodic processing of a specific connection.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>conn</em>&nbsp;</td><td>A pointer to the <a class="el" href="a00037.html">uip_conn</a> struct for the connection to be processed. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a4" doxytag="uip.h::uip_udp_periodic"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_udp_periodic</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Periodic processing for a UDP connection identified by its number.
<p>
This function is essentially the same as uip_prerioic(), but for UDP connections. It is called in a similar fashion as the <a class="el" href="a00079.html#a2">uip_periodic()</a> function: <div class="fragment"><pre> <span class="keywordflow">for</span>(i = 0; i &lt; <a class="code" href="a00089.html#a2">UIP_UDP_CONNS</a>; i++) {
<a class="code" href="a00079.html#a4">uip_udp_periodic</a>(i);
<span class="keywordflow">if</span>(uip_len &gt; 0) {
devicedriver_send();
}
}
</pre></div><p>
<dl compact><dt><b>Note:</b></dt><dd>As for the <a class="el" href="a00079.html#a2">uip_periodic()</a> function, special care has to be taken when using uIP together with ARP and Ethernet: <div class="fragment"><pre> <span class="keywordflow">for</span>(i = 0; i &lt; <a class="code" href="a00089.html#a2">UIP_UDP_CONNS</a>; i++) {
<a class="code" href="a00079.html#a4">uip_udp_periodic</a>(i);
<span class="keywordflow">if</span>(uip_len &gt; 0) {
<a class="code" href="a00083.html#a17">uip_arp_out</a>();
ethernet_devicedriver_send();
}
}
</pre></div></dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>conn</em>&nbsp;</td><td>The number of the UDP connection to be processed. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a5" doxytag="uip.h::uip_udp_periodic_conn"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_udp_periodic_conn</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Periodic processing for a UDP connection identified by a pointer to its structure.
<p>
Same as <a class="el" href="a00079.html#a4">uip_udp_periodic()</a> but takes a pointer to the actual <a class="el" href="a00037.html">uip_conn</a> struct instead of an integer as its argument. This function can be used to force periodic processing of a specific connection.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>conn</em>&nbsp;</td><td>A pointer to the <a class="el" href="a00046.html">uip_udp_conn</a> struct for the connection to be processed. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Variable Documentation</h2>
<a name="a0" doxytag="uip.h::uip_buf"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a0">u8_t</a> <a class="el" href="a00075.html#a13">uip_buf</a>[UIP_BUFSIZE+2]
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The uIP packet buffer.
<p>
The uip_buf array is used to hold incoming and outgoing packets. The device driver should place incoming data into this buffer. When sending data, the device driver should read the link level headers and the TCP/IP headers from this buffer. The size of the link level headers is configured by the UIP_LLH_LEN define.<p>
<dl compact><dt><b>Note:</b></dt><dd>The application data need not be placed in this buffer, so the device driver must read it from the place pointed to by the uip_appdata pointer as illustrated by the following example: <div class="fragment"><pre> <span class="keywordtype">void</span>
devicedriver_send(<span class="keywordtype">void</span>)
{
hwsend(&amp;uip_buf[0], UIP_LLH_LEN);
hwsend(&amp;uip_buf[UIP_LLH_LEN], 40);
hwsend(uip_appdata, uip_len - 40 - UIP_LLH_LEN);
}
</pre></div></dd></dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

827
doc/html/a00080.html Normal file
View File

@@ -0,0 +1,827 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP application functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP application functions<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
Functions used by an application running of top of uIP.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a5">uip_send</a>(data, len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send data on the current connection. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a6">uip_datalen</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer. </em> <a href="#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a7">uip_urgdatalen</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The length of any out-of-band data (urgent data) that has arrived on the connection. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a8">uip_close</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the current connection. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a9">uip_abort</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Abort the current connection. </em> <a href="#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a10">uip_stop</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tell the sending host to stop sending data. </em> <a href="#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a11" doxytag="uipappfunc::uip_stopped"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a11">uip_stopped</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find out if the current connection has been previously stopped with <a class="el" href="a00080.html#a10">uip_stop()</a>. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a12">uip_restart</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Restart the current connection, if is has previously been stopped with <a class="el" href="a00080.html#a10">uip_stop()</a>. </em> <a href="#a12"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a13">uip_newdata</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is new incoming data available? </em> <a href="#a13"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a14">uip_acked</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has previously sent data been acknowledged? </em> <a href="#a14"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a15">uip_connected</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection just been connected? </em> <a href="#a15"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a16">uip_closed</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been closed by the other end? </em> <a href="#a16"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a17">uip_aborted</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection been aborted by the other end? </em> <a href="#a17"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a18">uip_timedout</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Has the connection timed out? </em> <a href="#a18"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a19">uip_rexmit</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Do we need to retransmit previously data? </em> <a href="#a19"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a20">uip_poll</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is the connection being polled by uIP? </em> <a href="#a20"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a21" doxytag="uipappfunc::uip_initialmss"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a21">uip_initialmss</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the initial maxium segment size (MSS) of the current connection. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a22">uip_mss</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current maxium segment size that can be sent on the current connection. </em> <a href="#a22"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a23">uip_udp_remove</a>(conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removed a UDP connection. </em> <a href="#a23"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a24">uip_udp_send</a>(len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a UDP datagram of length len on the current connection. </em> <a href="#a24"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a0">uip_listen</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start listening to the specified port. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a1">uip_unlisten</a> (<a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop listening to the specified port. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00037.html">uip_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a2">uip_connect</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> port)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connect to a remote host using TCP. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00046.html">uip_udp_conn</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00080.html#a3">uip_udp_new</a> (<a class="el" href="a00086.html#a1">u16_t</a> *ripaddr, <a class="el" href="a00086.html#a1">u16_t</a> rport)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set up a new UDP connection. </em> <a href="#a3"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a9" doxytag="uip.h::uip_abort"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_abort</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Abort the current connection.
<p>
This function will abort (reset) the current connection, and is usually used when an error has occured that prevents using the <a class="el" href="a00080.html#a8">uip_close()</a> function. </td>
</tr>
</table>
<a name="a17" doxytag="uip.h::uip_aborted"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_aborted</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Has the connection been aborted by the other end?
<p>
Non-zero if the current connection has been aborted (reset) by the remote host. </td>
</tr>
</table>
<a name="a14" doxytag="uip.h::uip_acked"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_acked</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Has previously sent data been acknowledged?
<p>
Will reduce to non-zero if the previously sent data has been acknowledged by the remote host. This means that the application can send new data. </td>
</tr>
</table>
<a name="a8" doxytag="uip.h::uip_close"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_close</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Close the current connection.
<p>
This function will close the current connection in a nice way. </td>
</tr>
</table>
<a name="a16" doxytag="uip.h::uip_closed"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_closed</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Has the connection been closed by the other end?
<p>
Is non-zero if the connection has been closed by the remote host. The application may then do the necessary clean-ups. </td>
</tr>
</table>
<a name="a15" doxytag="uip.h::uip_connected"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_connected</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Has the connection just been connected?
<p>
Reduces to non-zero if the current connection has been connected to a remote host. This will happen both if the connection has been actively opened (with <a class="el" href="a00080.html#a2">uip_connect()</a>) or passively opened (with <a class="el" href="a00080.html#a0">uip_listen()</a>). </td>
</tr>
</table>
<a name="a6" doxytag="uip.h::uip_datalen"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_datalen</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer.
<p>
The test function uip_data() must first be used to check if there is any data available at all. </td>
</tr>
</table>
<a name="a22" doxytag="uip.h::uip_mss"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_mss</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the current maxium segment size that can be sent on the current connection.
<p>
The current maxiumum segment size that can be sent on the connection is computed from the receiver's window and the MSS of the connection (which also is available by calling <a class="el" href="a00080.html#a21">uip_initialmss()</a>). </td>
</tr>
</table>
<a name="a13" doxytag="uip.h::uip_newdata"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_newdata</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Is new incoming data available?
<p>
Will reduce to non-zero if there is new data for the application present at the uip_appdata pointer. The size of the data is avaliable through the uip_len variable. </td>
</tr>
</table>
<a name="a20" doxytag="uip.h::uip_poll"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_poll</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Is the connection being polled by uIP?
<p>
Is non-zero if the reason the application is invoked is that the current connection has been idle for a while and should be polled.<p>
The polling event can be used for sending data without having to wait for the remote host to send data. </td>
</tr>
</table>
<a name="a12" doxytag="uip.h::uip_restart"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_restart</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Restart the current connection, if is has previously been stopped with <a class="el" href="a00080.html#a10">uip_stop()</a>.
<p>
This function will open the receiver's window again so that we start receiving data for the current connection. </td>
</tr>
</table>
<a name="a19" doxytag="uip.h::uip_rexmit"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_rexmit</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Do we need to retransmit previously data?
<p>
Reduces to non-zero if the previously sent data has been lost in the network, and the application should retransmit it. The application should send the exact same data as it did the last time, using the <a class="el" href="a00080.html#a5">uip_send()</a> function. </td>
</tr>
</table>
<a name="a5" doxytag="uip.h::uip_send"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_send</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">data, <tr>
<td></td>
<td></td>
<td class="md" nowrap>len&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Send data on the current connection.
<p>
This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.<p>
The amount of data that actually is sent out after a call to this funcion is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function <a class="el" href="a00080.html#a22">uip_mss()</a> can be used to query uIP for the amount of data that actually will be sent.<p>
<dl compact><dt><b>Note:</b></dt><dd>This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the <a class="el" href="a00080.html#a19">uip_rexmit()</a> event being set. The application will then have to resend the data using this function.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>data</em>&nbsp;</td><td>A pointer to the data which is to be sent.</td></tr>
<tr><td valign=top><em>len</em>&nbsp;</td><td>The maximum amount of data bytes to be sent. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a10" doxytag="uip.h::uip_stop"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_stop</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Tell the sending host to stop sending data.
<p>
This function will close our receiver's window so that we stop receiving data for the current connection. </td>
</tr>
</table>
<a name="a18" doxytag="uip.h::uip_timedout"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_timedout</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Has the connection timed out?
<p>
Non-zero if the current connection has been aborted due to too many retransmissions. </td>
</tr>
</table>
<a name="a23" doxytag="uip.h::uip_udp_remove"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_udp_remove</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">conn&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Removed a UDP connection.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>conn</em>&nbsp;</td><td>A pointer to the <a class="el" href="a00046.html">uip_udp_conn</a> structure for the connection. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a24" doxytag="uip.h::uip_udp_send"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_udp_send</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">len&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Send a UDP datagram of length len on the current connection.
<p>
This function can only be called in response to a UDP event (poll or newdata). The data must be present in the uip_buf buffer, at the place pointed to by the uip_appdata pointer.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>len</em>&nbsp;</td><td>The length of the data in the uip_buf buffer. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a7" doxytag="uip.h::uip_urgdatalen"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_urgdatalen</td>
<td class="md" valign="top">(&nbsp;</td>
&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The length of any out-of-band data (urgent data) that has arrived on the connection.
<p>
<dl compact><dt><b>Note:</b></dt><dd>The configuration parameter UIP_URGDATA must be set for this function to be enabled. </dd></dl>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a2" doxytag="uip.h::uip_connect"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> struct <a class="el" href="a00037.html">uip_conn</a>* uip_connect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>port</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Connect to a remote host using TCP.
<p>
This function is used to start a new connection to the specified port on the specied host. It allocates a new connection identifier, sets the connection to the SYN_SENT state and sets the retransmission timer to 0. This will cause a TCP SYN segment to be sent out the next time this connection is periodically processed, which usually is done within 0.5 seconds after the call to <a class="el" href="a00080.html#a2">uip_connect()</a>.<p>
<dl compact><dt><b>Note:</b></dt><dd>This function is avaliable only if support for active open has been configured by defining UIP_ACTIVE_OPEN to 1 in <a class="el" href="a00074.html">uipopt.h</a>.<p>
Since this function requires the port number to be in network byte order, a convertion using <a class="el" href="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00086.html#a1">u16_t</a> ipaddr[2];
<a class="code" href="a00081.html#a1">uip_ipaddr</a>(ipaddr, 192,168,1,2);
<a class="code" href="a00080.html#a2">uip_connect</a>(ipaddr, <a class="code" href="a00081.html#a2">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>ripaddr</em>&nbsp;</td><td>A pointer to a 4-byte array representing the IP address of the remote hot.</td></tr>
<tr><td valign=top><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to the uIP connection identifier for the new connection, or NULL if no connection could be allocated. </dd></dl>
</td>
</tr>
</table>
<a name="a0" doxytag="uip.h::uip_listen"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_listen </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Start listening to the specified port.
<p>
<dl compact><dt><b>Note:</b></dt><dd>Since this function expects the port number in network byte order, a conversion using <a class="el" href="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00080.html#a25">uip_listen</a>(<a class="code" href="a00081.html#a2">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a3" doxytag="uip.h::uip_udp_new"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> struct <a class="el" href="a00046.html">uip_udp_conn</a>* uip_udp_new </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>ripaddr</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>rport</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set up a new UDP connection.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>ripaddr</em>&nbsp;</td><td>A pointer to a 4-byte structure representing the IP address of the remote host.</td></tr>
<tr><td valign=top><em>rport</em>&nbsp;</td><td>The remote port number in network byte order.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The <a class="el" href="a00046.html">uip_udp_conn</a> structure for the new connection or NULL if no connection could be allocated. </dd></dl>
</td>
</tr>
</table>
<a name="a1" doxytag="uip.h::uip_unlisten"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_unlisten </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Stop listening to the specified port.
<p>
<dl compact><dt><b>Note:</b></dt><dd>Since this function expects the port number in network byte order, a conversion using <a class="el" href="a00081.html#a2">HTONS()</a> or <a class="el" href="a00081.html#a0">htons()</a> is necessary.</dd></dl>
<div class="fragment"><pre> <a class="code" href="a00080.html#a24">uip_unlisten</a>(<a class="code" href="a00081.html#a2">HTONS</a>(80));
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>port</em>&nbsp;</td><td>A 16-bit port number in network byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

149
doc/html/a00081.html Normal file
View File

@@ -0,0 +1,149 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP conversion functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP conversion functions<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
These functions can be used for converting between different data formats used by uIP.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00081.html#a1">uip_ipaddr</a>(addr, addr0, addr1, addr2, addr3)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pack an IP address into a 4-byte array which is used by uIP to represent IP addresses. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00081.html#a2">HTONS</a>(n)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert 16-bit quantity from host byte order to network byte order. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00081.html#a0">htons</a> (<a class="el" href="a00086.html#a1">u16_t</a> val)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert 16-bit quantity from host byte order to network byte order. </em> <a href="#a0"></a><em><br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a2" doxytag="uip.h::HTONS"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HTONS</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">n&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Convert 16-bit quantity from host byte order to network byte order.
<p>
This macro is primarily used for converting constants from host byte order to network byte order. For converting variables to network byte order, use the <a class="el" href="a00081.html#a0">htons()</a> function instead. </td>
</tr>
</table>
<a name="a1" doxytag="uip.h::uip_ipaddr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define uip_ipaddr</td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">addr, <tr>
<td></td>
<td></td>
<td class="md" nowrap>addr0, <tr>
<td></td>
<td></td>
<td class="md" nowrap>addr1, <tr>
<td></td>
<td></td>
<td class="md" nowrap>addr2, <tr>
<td></td>
<td></td>
<td class="md" nowrap>addr3&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pack an IP address into a 4-byte array which is used by uIP to represent IP addresses.
<p>
Example: <div class="fragment"><pre> <a class="code" href="a00086.html#a1">u16_t</a> ipaddr[2];
<a class="code" href="a00081.html#a1">uip_ipaddr</a>(&amp;ipaddr, 192,168,1,2);
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>addr</em>&nbsp;</td><td>A pointer to a 4-byte array that will be filled in with the IP addres. </td></tr>
<tr><td valign=top><em>addr0</em>&nbsp;</td><td>The first octet of the IP address. </td></tr>
<tr><td valign=top><em>addr1</em>&nbsp;</td><td>The second octet of the IP address. </td></tr>
<tr><td valign=top><em>addr2</em>&nbsp;</td><td>The third octet of the IP address. </td></tr>
<tr><td valign=top><em>addr3</em>&nbsp;</td><td>The forth octet of the IP address. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a0" doxytag="uip.h::htons"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> htons </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>val</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Convert 16-bit quantity from host byte order to network byte order.
<p>
This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the <a class="el" href="a00081.html#a2">HTONS()</a> macro instead. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:43 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

213
doc/html/a00082.html Normal file
View File

@@ -0,0 +1,213 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Architecture specific uIP functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Architecture specific uIP functions<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The functions in the architecture specific module implement the IP check sum and 32-bit additions.<p>
The IP checksum calculation is the most computationally expensive operation in the TCP/IP stack and it therefore pays off to implement this in efficient assembler. The purpose of the uip-arch module is to let the checksum functions to be implemented in architecture specific assembler.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00071.html">uip_arch.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Declarations of architecture specific functions. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a1">uip_add32</a> (<a class="el" href="a00086.html#a0">u8_t</a> *op32, <a class="el" href="a00086.html#a1">u16_t</a> op16)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Carry out a 32-bit addition. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a2">uip_chksum</a> (<a class="el" href="a00086.html#a1">u16_t</a> *buf, <a class="el" href="a00086.html#a1">u16_t</a> len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate the Internet checksum over a buffer. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a3">uip_ipchksum</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate the IP header checksum of the packet header in uip_buf. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a4">uip_tcpchksum</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate the TCP checksum of the packet in uip_buf and uip_appdata. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a0" doxytag="uiparch::uip_acc32"></a>
volatile <a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a0">uip_acc32</a> [4]</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">4-byte array used for the 32-bit sequence number calculations. <br><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a1" doxytag="uip_arch.h::uip_add32"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_add32 </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a0">u8_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>op32</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>op16</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Carry out a 32-bit addition.
<p>
Because not all architectures for which uIP is intended has native 32-bit arithmetic, uIP uses an external C function for doing the required 32-bit additions in the TCP protocol processing. This function should add the two arguments and place the result in the global variable uip_acc32.<p>
<dl compact><dt><b>Note:</b></dt><dd>The 32-bit integer pointed to by the op32 parameter and the result in the uip_acc32 variable are in network byte order (big endian).</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>op32</em>&nbsp;</td><td>A pointer to a 4-byte array representing a 32-bit integer in network byte order (big endian).</td></tr>
<tr><td valign=top><em>op16</em>&nbsp;</td><td>A 16-bit integer in host byte order. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a2" doxytag="uip_arch.h::uip_chksum"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> uip_chksum </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>buf</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td>
<td class="mdname" nowrap> <em>len</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Calculate the Internet checksum over a buffer.
<p>
The Internet checksum is the one's complement of the one's complement sum of all 16-bit words in the buffer.<p>
See RFC1071.<p>
<dl compact><dt><b>Note:</b></dt><dd>This function is not called in the current version of uIP, but future versions might make use of it.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>buf</em>&nbsp;</td><td>A pointer to the buffer over which the checksum is to be computed.</td></tr>
<tr><td valign=top><em>len</em>&nbsp;</td><td>The length of the buffer over which the checksum is to be computed.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The Internet checksum of the buffer. </dd></dl>
</td>
</tr>
</table>
<a name="a3" doxytag="uip_arch.h::uip_ipchksum"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> uip_ipchksum </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Calculate the IP header checksum of the packet header in uip_buf.
<p>
The IP header checksum is the Internet checksum of the 20 bytes of the IP header.<p>
<dl compact><dt><b>Returns:</b></dt><dd>The IP header checksum of the IP header in the uip_buf buffer. </dd></dl>
</td>
</tr>
</table>
<a name="a4" doxytag="uip_arch.h::uip_tcpchksum"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> uip_tcpchksum </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
<p>
The TCP checksum is the Internet checksum of data contents of the TCP segment, and a pseudo-header as defined in RFC793.<p>
<dl compact><dt><b>Note:</b></dt><dd>The uip_appdata pointer that points to the packet data may point anywhere in memory, so it is not possible to simply calculate the Internet checksum of the contents of the uip_buf buffer.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>The TCP checksum of the TCP segment in uip_buf and pointed to by uip_appdata. </dd></dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:44 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

190
doc/html/a00083.html Normal file
View File

@@ -0,0 +1,190 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP Address Resolution Protocol</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP Address Resolution Protocol<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The Address Resolution Protocol ARP is used for mapping between IP addresses and link level addresses such as the Ethernet MAC addresses. ARP uses broadcast queries to ask for the link level address of a known IP address and the host which is configured with the IP address for which the query was meant, will respond with its link level address.<p>
<dl compact><dt><b>Note:</b></dt><dd>This ARP implementation only supports Ethernet. </dd></dl>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00072.html">uip_arp.c</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Implementation of the ARP Address Resolution Protocol. <br><br></td></tr>
<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00073.html">uip_arp.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Macros and definitions for the ARP module. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00038.html">uip_eth_addr</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of a 48-bit Ethernet address. </em> <a href="a00038.html#_details">More...</a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00039.html">uip_eth_hdr</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The Ethernet header. </em> <a href="a00039.html#_details">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a7" doxytag="uiparp::uip_arp_init"></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a7">uip_arp_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the ARP module. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a8">uip_arp_ipin</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ARP processing for incoming IP packets. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a9">uip_arp_arpin</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ARP processing for incoming ARP packets. </em> <a href="#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a10">uip_arp_out</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request. </em> <a href="#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00083.html#a11">uip_arp_timer</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Periodic ARP processing function. </em> <a href="#a11"></a><em><br><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a9" doxytag="uip_arp.h::uip_arp_arpin"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_arp_arpin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
ARP processing for incoming ARP packets.
<p>
This function should be called by the device driver when an ARP packet has been received. The function will act differently depending on the ARP packet type: if it is a reply for a request that we previously sent out, the ARP cache will be filled in with the values from the ARP reply. If the incoming ARP packet is an ARP request for our IP address, an ARP reply packet is created and put into the uip_buf[] buffer.<p>
When the function returns, the value of the global variable uip_len indicates whether the device driver should send out a packet or not. If uip_len is zero, no packet should be sent. If uip_len is non-zero, it contains the length of the outbound packet that is present in the uip_buf[] buffer.<p>
This function expects an ARP packet with a prepended Ethernet header in the uip_buf[] buffer, and the length of the packet in the global variable uip_len. </td>
</tr>
</table>
<a name="a8" doxytag="uip_arp.h::uip_arp_ipin"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_arp_ipin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
ARP processing for incoming IP packets.
<p>
This function should be called by the device driver when an IP packet has been received. The function will check if the address is in the ARP cache, and if so the ARP cache entry will be refreshed. If no ARP cache entry was found, a new one is created.<p>
This function expects an IP packet with a prepended Ethernet header in the uip_buf[] buffer, and the length of the packet in the global variable uip_len. </td>
</tr>
</table>
<a name="a10" doxytag="uip_arp.h::uip_arp_out"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_arp_out </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request.
<p>
This function should be called before sending out an IP packet. The function checks the destination IP address of the IP packet to see what Ethernet MAC address that should be used as a destination MAC address on the Ethernet.<p>
If the destination IP address is in the local network (determined by logical ANDing of netmask and our IP address), the function checks the ARP cache to see if an entry for the destination IP address is found. If so, an Ethernet header is prepended and the function returns. If no ARP cache entry is found for the destination IP address, the packet in the uip_buf[] is replaced by an ARP request packet for the IP address. The IP packet is dropped and it is assumed that they higher level protocols (e.g., TCP) eventually will retransmit the dropped packet.<p>
If the destination IP address is not on the local network, the IP address of the default router is used instead.<p>
When the function returns, a packet is present in the uip_buf[] buffer, and the length of the packet is in the global variable uip_len. </td>
</tr>
</table>
<a name="a11" doxytag="uip_arp.h::uip_arp_timer"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void uip_arp_timer </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Periodic ARP processing function.
<p>
This function performs periodic timer processing in the ARP module and should be called at regular intervals. The recommended interval is 10 seconds between the calls. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:44 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

239
doc/html/a00084.html Normal file
View File

@@ -0,0 +1,239 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Serial Line IP (SLIP) protocol</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Serial Line IP (SLIP) protocol<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The SLIP protocol is a very simple way to transmit IP packets over a serial line. It does not provide any framing or error control, and is therefore not very widely used today.<p>
This SLIP implementation requires two functions for accessing the serial device: <a class="el" href="a00084.html#a5">slipdev_char_poll()</a> and <a class="el" href="a00084.html#a4">slipdev_char_put()</a>. These must be implemented specifically for the system on which the SLIP protocol is to be run.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00067.html">slipdev.c</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">SLIP protocol implementation. <br><br></td></tr>
<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00068.html">slipdev.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">SLIP header file. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a4">slipdev_char_put</a> (<a class="el" href="a00086.html#a0">u8_t</a> c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Put a character on the serial device. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a5">slipdev_char_poll</a> (<a class="el" href="a00086.html#a0">u8_t</a> *c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the serial device for a character. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a6">slipdev_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the SLIP module. </em> <a href="#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a7">slipdev_send</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a8">slipdev_poll</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the SLIP device for an available packet. </em> <a href="#a8"></a><em><br><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a5" doxytag="slipdev.h::slipdev_char_poll"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a0">u8_t</a> slipdev_char_poll </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a0">u8_t</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>c</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Poll the serial device for a character.
<p>
This function is used by the SLIP implementation to poll the serial device for a character. It must be implemented specifically for the system on which the SLIP implementation is to be run.<p>
The function should return immediately regardless if a character is available or not. If a character is available it should be placed at the memory location pointed to by the pointer supplied by the arguement c.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>c</em>&nbsp;</td><td>A pointer to a byte that is filled in by the function with the received character, if available.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>0</em>&nbsp;</td><td>If no character is available. </td></tr>
<tr><td valign=top><em>Non-zero</em>&nbsp;</td><td>If a character is available. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a4" doxytag="slipdev.h::slipdev_char_put"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void slipdev_char_put </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>c</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Put a character on the serial device.
<p>
This function is used by the SLIP implementation to put a character on the serial device. It must be implemented specifically for the system on which the SLIP implementation is to be run.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>c</em>&nbsp;</td><td>The character to be put on the serial device. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a6" doxytag="slipdev.h::slipdev_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void slipdev_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initialize the SLIP module.
<p>
This function does not initialize the underlying RS232 device, but only the SLIP part. </td>
</tr>
</table>
<a name="a8" doxytag="slipdev.h::slipdev_poll"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> slipdev_poll </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Poll the SLIP device for an available packet.
<p>
This function will poll the SLIP device to see if a packet is available. It uses a buffer in which all avaliable bytes from the RS232 interface are read into. When a full packet has been read into the buffer, the packet is copied into the uip_buf buffer and the length of the packet is returned.<p>
<dl compact><dt><b>Returns:</b></dt><dd>The length of the packet placed in the uip_buf buffer, or zero if no packet is available. </dd></dl>
</td>
</tr>
</table>
<p>
Here is the call graph for this function:<p><center><img src="a00084_a9_cgraph.png" border="0" usemap="#a00084_a9_cgraph_map" alt=""></center>
<map name="a00084_a9_cgraph_map">
<area href="a00084.html#a5" shape="rect" coords="151,5,268,26" alt="">
</map>
<a name="a7" doxytag="slipdev.h::slipdev_send"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void slipdev_send </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol.
<p>
The first 40 bytes of the packet (the IP and TCP headers) are read from the uip_buf buffer, and the following bytes (the application data) are read from the uip_appdata buffer. </td>
</tr>
</table>
<p>
Here is the call graph for this function:<p><center><img src="a00084_a8_cgraph.png" border="0" usemap="#a00084_a8_cgraph_map" alt=""></center>
<map name="a00084_a8_cgraph_map">
<area href="a00084.html#a4" shape="rect" coords="159,5,276,26" alt="">
</map>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:45 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

44
doc/html/a00085.html Normal file
View File

@@ -0,0 +1,44 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Configuration options for uIP</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Configuration options for uIP</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
uIP is configured using the per-project configuration file "uipopt.h". This file contains all compile-time options for uIP and should be tweaked to match each specific project. The uIP distribution contains a documented example "uipopt.h" that can be copied and modified for each project.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00074.html">uipopt.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configuration options for uIP. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html">uIP type definitions</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00087.html">Static configuration options</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00088.html">IP configuration options</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00089.html">UDP configuration options</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00090.html">TCP configuration options</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00091.html">ARP configuration options</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00092.html">General configuration options</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00093.html">CPU architecture configuration</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00094.html">Appication specific configurations</a></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:45 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

104
doc/html/a00086.html Normal file
View File

@@ -0,0 +1,104 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: uIP type definitions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>uIP type definitions<br>
<small>
[<a class="el" href="a00085.html">Configuration options for uIP</a>]</small>
</h1>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00086.html#a0">u8_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The 8-bit unsigned data type. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00086.html#a1">u16_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The 16-bit unsigned data type. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00086.html#a2">uip_stats_t</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The statistics data type. </em> <a href="#a2"></a><em><br><br></td></tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a name="a1" doxytag="uipopt.h::u16_t"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef unsigned short <a class="el" href="a00086.html#a1">u16_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The 16-bit unsigned data type.
<p>
This may have to be tweaked for your particular compiler. "unsigned short" works for most compilers. </td>
</tr>
</table>
<a name="a0" doxytag="uipopt.h::u8_t"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef unsigned char <a class="el" href="a00086.html#a0">u8_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The 8-bit unsigned data type.
<p>
This may have to be tweaked for your particular compiler. "unsigned char" works for most compilers. </td>
</tr>
</table>
<a name="a2" doxytag="uipopt.h::uip_stats_t"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef unsigned short <a class="el" href="a00086.html#a2">uip_stats_t</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The statistics data type.
<p>
This datatype determines how high the statistics counters are able to count. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:45 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

180
doc/html/a00087.html Normal file
View File

@@ -0,0 +1,180 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Static configuration options</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Static configuration options<br>
<small>
[<a class="el" href="a00085.html">Configuration options for uIP</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
These configuration options can be used for setting the IP address settings statically, but only if UIP_FIXEDADDR is set to 1. The configuration options for a specific node includes IP address, netmask and default router as well as the Ethernet address. The netmask, default router and Ethernet address are appliciable only if uIP should be run over Ethernet.<p>
All of these should be changed to suit your project.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a0">UIP_FIXEDADDR</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Determines if uIP should use a fixed IP address or not. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a1">UIP_PINGADDRCONF</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ping IP address asignment. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a2" doxytag="uipoptstaticconf::UIP_IPADDR0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a2">UIP_IPADDR0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a3" doxytag="uipoptstaticconf::UIP_IPADDR1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a3">UIP_IPADDR1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a4" doxytag="uipoptstaticconf::UIP_IPADDR2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a4">UIP_IPADDR2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a5" doxytag="uipoptstaticconf::UIP_IPADDR3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a5">UIP_IPADDR3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the IP address of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a6" doxytag="uipoptstaticconf::UIP_NETMASK0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a6">UIP_NETMASK0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a7" doxytag="uipoptstaticconf::UIP_NETMASK1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a7">UIP_NETMASK1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a8" doxytag="uipoptstaticconf::UIP_NETMASK2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a8">UIP_NETMASK2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a9" doxytag="uipoptstaticconf::UIP_NETMASK3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a9">UIP_NETMASK3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the netmask of this uIP node, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a10" doxytag="uipoptstaticconf::UIP_DRIPADDR0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a10">UIP_DRIPADDR0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a11" doxytag="uipoptstaticconf::UIP_DRIPADDR1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a11">UIP_DRIPADDR1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a12" doxytag="uipoptstaticconf::UIP_DRIPADDR2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a12">UIP_DRIPADDR2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a13" doxytag="uipoptstaticconf::UIP_DRIPADDR3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a13">UIP_DRIPADDR3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the IP address of the default router, if UIP_FIXEDADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a14">UIP_FIXEDETHADDR</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not. </em> <a href="#a14"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a15" doxytag="uipoptstaticconf::UIP_ETHADDR0"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a15">UIP_ETHADDR0</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The first octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a16" doxytag="uipoptstaticconf::UIP_ETHADDR1"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a16">UIP_ETHADDR1</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The second octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a17" doxytag="uipoptstaticconf::UIP_ETHADDR2"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a17">UIP_ETHADDR2</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The third octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a18" doxytag="uipoptstaticconf::UIP_ETHADDR3"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a18">UIP_ETHADDR3</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fourth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a19" doxytag="uipoptstaticconf::UIP_ETHADDR4"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a19">UIP_ETHADDR4</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The fifth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a20" doxytag="uipoptstaticconf::UIP_ETHADDR5"></a>
#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00087.html#a20">UIP_ETHADDR5</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The sixth octet of the Ethernet address if UIP_FIXEDETHADDR is 1. <br><br></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a0" doxytag="uipopt.h::UIP_FIXEDADDR"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define UIP_FIXEDADDR
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Determines if uIP should use a fixed IP address or not.
<p>
If uIP should use a fixed IP address, the settings are set in the <a class="el" href="a00074.html">uipopt.h</a> file. If not, the macros <a class="el" href="a00077.html#a0">uip_sethostaddr()</a>, <a class="el" href="a00077.html#a2">uip_setdraddr()</a> and <a class="el" href="a00077.html#a3">uip_setnetmask()</a> should be used instead. </td>
</tr>
</table>
<a name="a14" doxytag="uipopt.h::UIP_FIXEDETHADDR"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define UIP_FIXEDETHADDR
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not.
<p>
If this configuration option is 0, the macro <a class="el" href="a00077.html#a6">uip_setethaddr()</a> can be used to specify the Ethernet address at run-time. </td>
</tr>
</table>
<a name="a1" doxytag="uipopt.h::UIP_PINGADDRCONF"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define UIP_PINGADDRCONF
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Ping IP address asignment.
<p>
uIP uses a "ping" packets for setting its own IP address if this option is set. If so, uIP will start with an empty IP address and the destination IP address of the first incoming "ping" (ICMP echo) packet will be used for setting the hosts IP address.<p>
<dl compact><dt><b>Note:</b></dt><dd>This works only if UIP_FIXEDADDR is 0. </dd></dl>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:45 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More