forked from Imagelibrary/uip
214 lines
10 KiB
HTML
214 lines
10 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: 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 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>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 </td><td class="memItemRight" valign=bottom><a class="el" href="a00071.html">uip_arch.h</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </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"> </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> </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"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a3">uip_ipchksum</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a4">uip_tcpchksum</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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> </td><td class="memItemRight" valign=bottom><a class="el" href="a00082.html#a0">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="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">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a0">u8_t</a> * </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> </td>
|
|
<td class="mdname" nowrap> <em>op16</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>
|
|
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> </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> </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">( </td>
|
|
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a1">u16_t</a> * </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> </td>
|
|
<td class="mdname" nowrap> <em>len</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>
|
|
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> </td><td>A pointer to the buffer over which the checksum is to be computed.</td></tr>
|
|
<tr><td valign=top><em>len</em> </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">( </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>
|
|
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">( </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>
|
|
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>
|