?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&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</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> | <a class="qindex" href="pages.html">Related&nbsp;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 &nbsp;</td><td class="memItemRight" valign="bottom"><b>netEthAddr</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netEthHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netArpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netIpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netIcmpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netUdpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netTcpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netEthArpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>netEthIpHeader</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>tcpip_hdr</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>icmpip_hdr</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><b>ETH_HEADER_LEN</b>&nbsp;&nbsp;&nbsp;14</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="net::ETHTYPE_ARP"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ETHTYPE_ARP</b>&nbsp;&nbsp;&nbsp;0x0806</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga12" doxytag="net::ETHTYPE_IP"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ETHTYPE_IP</b>&nbsp;&nbsp;&nbsp;0x0800</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="net::ETHTYPE_IP6"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ETHTYPE_IP6</b>&nbsp;&nbsp;&nbsp;0x86dd</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="net::ARP_OPCODE_REQUEST"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ARP_OPCODE_REQUEST</b>&nbsp;&nbsp;&nbsp;1</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga15" doxytag="net::ARP_OPCODE_REPLY"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ARP_OPCODE_REPLY</b>&nbsp;&nbsp;&nbsp;2</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga16" doxytag="net::ARP_HWTYPE_ETH"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ARP_HWTYPE_ETH</b>&nbsp;&nbsp;&nbsp;1</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="net::IP_HEADER_LEN"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>IP_HEADER_LEN</b>&nbsp;&nbsp;&nbsp;20</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="net::IP_PROTO_ICMP"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>IP_PROTO_ICMP</b>&nbsp;&nbsp;&nbsp;1</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="net::IP_PROTO_TCP"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>IP_PROTO_TCP</b>&nbsp;&nbsp;&nbsp;6</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga20" doxytag="net::IP_PROTO_UDP"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>IP_PROTO_UDP</b>&nbsp;&nbsp;&nbsp;17</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga21" doxytag="net::ICMP_HEADER_LEN"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ICMP_HEADER_LEN</b>&nbsp;&nbsp;&nbsp;8</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga22" doxytag="net::ICMP_TYPE_ECHOREPLY"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ICMP_TYPE_ECHOREPLY</b>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="net::ICMP_TYPE_ECHOREQUEST"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>ICMP_TYPE_ECHOREQUEST</b>&nbsp;&nbsp;&nbsp;8</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="net::UDP_HEADER_LEN"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>UDP_HEADER_LEN</b>&nbsp;&nbsp;&nbsp;8</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="net::TCP_HEADER_LEN"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_HEADER_LEN</b>&nbsp;&nbsp;&nbsp;20</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="net::TCP_FLAGS_FIN"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_FIN</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="net::TCP_FLAGS_SYN"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_SYN</b>&nbsp;&nbsp;&nbsp;0x02</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="net::TCP_FLAGS_RST"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_RST</b>&nbsp;&nbsp;&nbsp;0x04</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga29" doxytag="net::TCP_FLAGS_PSH"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_PSH</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga30" doxytag="net::TCP_FLAGS_ACK"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_ACK</b>&nbsp;&nbsp;&nbsp;0x10</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga31" doxytag="net::TCP_FLAGS_URG"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>TCP_FLAGS_URG</b>&nbsp;&nbsp;&nbsp;0x20</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga32">IPDOT</a>(a, b, c, d)&nbsp;&nbsp;&nbsp;((a&lt;&lt;24)|(b&lt;&lt;16)|(c&lt;&lt;8)|(d))</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga33" doxytag="net::HTONS"></a>
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga33">HTONS</a>(s)&nbsp;&nbsp;&nbsp;((s&lt;&lt;8) | (s&gt;&gt;8))</td></tr>

<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__net.html#ga34">HTONL</a>(l)&nbsp;&nbsp;&nbsp;((l&lt;&lt;24) | ((l&amp;0x00FF0000l)&gt;&gt;8) | ((l&amp;0x0000FF00l)&lt;&lt;8) | (l&gt;&gt;24))</td></tr>

<tr><td class="mdescLeft">&nbsp;</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&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">&nbsp;</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&nbsp;</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">(&nbsp;</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&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;((a&lt;&lt;24)|(b&lt;&lt;16)|(c&lt;&lt;8)|(d))</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </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&nbsp;
<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