forked from Imagelibrary/uip
359 lines
17 KiB
HTML
359 lines
17 KiB
HTML
<!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 Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data 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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00069.html">uip.c</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00070.html">uip.h</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00037.html">uip_conn</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00041.html">uip_stats</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00046.html">uip_udp_conn</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a22">uip_init</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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> * </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"> </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 </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"> </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 </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"> </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> </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"> </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> * </td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a0">uip_appdata</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a8">uip_stat</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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> </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"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a00075.html#a17">uip_acc32</a> [4]</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>val</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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">( </td>
|
|
<td class="md" nowrap valign="top">void </td>
|
|
<td class="mdname1" valign="top" nowrap> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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> </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">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> * </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> </td>
|
|
<td class="mdname" nowrap> <em>rport</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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> </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> </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">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>port</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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> </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>
|
|
|
|
</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>
|
|
|
|
</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(&uip_buf[0], UIP_LLH_LEN);
|
|
hwsend(&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>
|
|
|
|
</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>
|