?lang_form?
?lang_select?
?lang_submit?
?lang_endform?
{HEADER END}
{FILE START}
library
?curdirlinks? - Rev 6
?prevdifflink? - Blame - ?getfile?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Procyon AVRlib: Network support library (net.c)</title>
<link href="dox.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</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> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>Network support library (net.c)<br>
<small>
[<a class="el" href="group__network.html">Network Library</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="net_8h.html">net/net.h</a>"</span>
</pre></div> <dl compact><dt><b>Description</b></dt><dd>This is a general network support library including a multitude of structure definitions for various types of network packets, functions and macros for switching byte order, and an RFC-compliant function for calculating checksums. </dd></dl>
<p>
<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 </td><td class="memItemRight" valign="bottom"><b>netEthAddr</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netEthHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netArpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netIpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netIcmpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netUdpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netTcpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netEthArpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>netEthIpHeader</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>tcpip_hdr</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>icmpip_hdr</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><b>udpip_hdr</b></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga10" doxytag="net::ETH_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ETH_HEADER_LEN</b> 14</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="net::ETHTYPE_ARP"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ETHTYPE_ARP</b> 0x0806</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga12" doxytag="net::ETHTYPE_IP"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ETHTYPE_IP</b> 0x0800</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="net::ETHTYPE_IP6"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ETHTYPE_IP6</b> 0x86dd</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="net::ARP_OPCODE_REQUEST"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ARP_OPCODE_REQUEST</b> 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga15" doxytag="net::ARP_OPCODE_REPLY"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ARP_OPCODE_REPLY</b> 2</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga16" doxytag="net::ARP_HWTYPE_ETH"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ARP_HWTYPE_ETH</b> 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="net::IP_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>IP_HEADER_LEN</b> 20</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="net::IP_PROTO_ICMP"></a>
#define </td><td class="memItemRight" valign="bottom"><b>IP_PROTO_ICMP</b> 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="net::IP_PROTO_TCP"></a>
#define </td><td class="memItemRight" valign="bottom"><b>IP_PROTO_TCP</b> 6</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga20" doxytag="net::IP_PROTO_UDP"></a>
#define </td><td class="memItemRight" valign="bottom"><b>IP_PROTO_UDP</b> 17</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga21" doxytag="net::ICMP_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ICMP_HEADER_LEN</b> 8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga22" doxytag="net::ICMP_TYPE_ECHOREPLY"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ICMP_TYPE_ECHOREPLY</b> 0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="net::ICMP_TYPE_ECHOREQUEST"></a>
#define </td><td class="memItemRight" valign="bottom"><b>ICMP_TYPE_ECHOREQUEST</b> 8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="net::UDP_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>UDP_HEADER_LEN</b> 8</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="net::TCP_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_HEADER_LEN</b> 20</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="net::TCP_FLAGS_FIN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_FIN</b> 0x01</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="net::TCP_FLAGS_SYN"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_SYN</b> 0x02</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="net::TCP_FLAGS_RST"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_RST</b> 0x04</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga29" doxytag="net::TCP_FLAGS_PSH"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_PSH</b> 0x08</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga30" doxytag="net::TCP_FLAGS_ACK"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_ACK</b> 0x10</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga31" doxytag="net::TCP_FLAGS_URG"></a>
#define </td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_URG</b> 0x20</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga32">IPDOT</a>(a, b, c, d) ((a<<24)|(b<<16)|(c<<8)|(d))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga33" doxytag="net::HTONS"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga33">HTONS</a>(s) ((s<<8) | (s>>8))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Host-to-Network SHORT (16-bit) byte-order swap (macro). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga34" doxytag="net::HTONL"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga34">HTONL</a>(l) ((l<<24) | ((l&0x00FF0000l)>>8) | ((l&0x0000FF00l)<<8) | (l>>24))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Host-to-Network LONG (32-bit) byte-order swap (macro). <br></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1" doxytag="net::ip_hdr"></a>
typedef netIpHeader </td><td class="memItemRight" valign="bottom"><b>ip_hdr</b></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga2" doxytag="net::htons"></a>
uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga2">htons</a> (uint16_t val)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Host-to-Network SHORT (16-bit) byte-order swap (function). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga3" doxytag="net::htonl"></a>
uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga3">htonl</a> (uint32_t val)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Host-to-Network LONG (32-bit) byte-order swap (function). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga4" doxytag="net::netChecksum"></a>
uint16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga4">netChecksum</a> (void *data, uint16_t len)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Calculate IP-style checksum from data. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga5" doxytag="net::netPrintEthAddr"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga5">netPrintEthAddr</a> (struct netEthAddr *ethaddr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print Ethernet address in XX:XX:XX:XX:XX:XX format. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga6" doxytag="net::netPrintIPAddr"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga6">netPrintIPAddr</a> (uint32_t ipaddr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print IP address in dot notation. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga7" doxytag="net::netPrintEthHeader"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga7">netPrintEthHeader</a> (struct netEthHeader *eth_hdr)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print Ethernet header information. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga8" doxytag="net::netPrintIpHeader"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga8">netPrintIpHeader</a> (struct netIpHeader *ipheader)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print IP header information. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="net::netPrintTcpHeader"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga9">netPrintTcpHeader</a> (struct netTcpHeader *tcpheader)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Print TCP header information. <br></td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="net::GNUC_PACKED"></a>
netEthAddr </td><td class="memItemRight" valign="bottom"><b>GNUC_PACKED</b></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="ga32" doxytag="net.h::IPDOT"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define IPDOT </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">a, <tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>b, <tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>c, <tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>d </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> ((a<<24)|(b<<16)|(c<<8)|(d))</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Convert dot-notation IP address into 32-bit word. Example: <a class="el" href="group__net.html#ga32">IPDOT(192l,168l,1l,1l)</a>
<p>
Definition at line <a class="el" href="net_8h-source.html#l00178">178</a> of file <a class="el" href="net_8h-source.html">net.h</a>. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:10 2006 for Procyon AVRlib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>
|
{FILE END}
{FOOTER START}
Powered by WebSVN v2.8.3