Files
uip/doc/html/a00081.html
2013-03-27 21:30:25 +01:00

150 lines
6.7 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: 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>