📄 group__netstack.html
字号:
<!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 Stack (netstack.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></div><h1>Network Stack (netstack.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="netstack_8h.html">net/netstack.h</a>"</span> </pre></div> <dl compact><dt><b>Description</b></dt><dd>This library co-ordinates the various pieces of a typical IP network stack into one unit. Included are handling for ARP, ICMP, and IP packets. UDP and TCP packets are processed and passed to the user.</dd></dl><dl compact><dt><b>Note:</b></dt><dd>This is an example of how to use the various network libraries, and is meant to be useful out-of-the-box for most users. However, some users may find it restrictive and write their own handlers instead.<p>This is NOT a full-blown TCP/IP stack. It merely handles lower level stack functions so that UDP and TCP packets can be sent and received easily. End-to-end TCP functionality may be added in a future version. Until then, I can recommend using other embedded TCP/IP stacks like Adam Dunkel's uIP. </dd></dl><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 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__netstack.html#ga4">NET_BUFFERSIZE</a> 500</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="group__netstack.html#ga0">netstackService</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__netstack.html#ga1">netstackIPProcess</a> (unsigned int len, ip_hdr *packet)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__netstack.html#ga2">netstackUDPIPProcess</a> (unsigned int len, udpip_hdr *packet) __attribute__((weak))</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__netstack.html#ga3">netstackTCPIPProcess</a> (unsigned int len, tcpip_hdr *packet) __attribute__((weak))</td></tr></table><hr><h2>Define Documentation</h2><a class="anchor" name="ga4" doxytag="netstack.h::NET_BUFFERSIZE"></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 NET_BUFFERSIZE 500 </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>NET_BUFFERSIZE is the common receive/process/transmit buffer Network packets larger than NET_BUFFERSIZE will not be accepted. <p>Definition at line <a class="el" href="netstack_8h-source.html#l00049">49</a> of file <a class="el" href="netstack_8h-source.html">netstack.h</a>. </td> </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="ga1" doxytag="netstack.h::netstackIPProcess"></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">void netstackIPProcess </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname" nowrap> <em>len</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>ip_hdr * </td> <td class="mdname" nowrap> <em>packet</em></td> </tr> <tr> <td class="md"></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>netstackIPProcess handles distribution of IP received packets. <p>Definition at line <a class="el" href="netstack_8c-source.html#l00063">63</a> of file <a class="el" href="netstack_8c-source.html">netstack.c</a>. </td> </tr></table><a class="anchor" name="ga0" doxytag="netstack.h::netstackService"></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">void netstackService </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>netstackService should be called in the main loop of the user program. The function will process one received network packet per call. <p>Definition at line <a class="el" href="netstack_8c-source.html#l00022">22</a> of file <a class="el" href="netstack_8c-source.html">netstack.c</a>. </td> </tr></table><a class="anchor" name="ga3" doxytag="netstack.h::netstackTCPIPProcess"></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">void netstackTCPIPProcess </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname" nowrap> <em>len</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>tcpip_hdr * </td> <td class="mdname" nowrap> <em>packet</em></td> </tr> <tr> <td class="md"></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>Replace this weakly-defined function with a user function that accepts TCP/IP packets. <p>Definition at line <a class="el" href="netstack_8c-source.html#l00109">109</a> of file <a class="el" href="netstack_8c-source.html">netstack.c</a>. </td> </tr></table><a class="anchor" name="ga2" doxytag="netstack.h::netstackUDPIPProcess"></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">void netstackUDPIPProcess </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname" nowrap> <em>len</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>udpip_hdr * </td> <td class="mdname" nowrap> <em>packet</em></td> </tr> <tr> <td class="md"></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>Replace this weakly-defined function with a user function that accepts UDP/IP packets. <p>Definition at line <a class="el" href="netstack_8c-source.html#l00102">102</a> of file <a class="el" href="netstack_8c-source.html">netstack.c</a>. </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Mon Aug 22 04:29:30 2005 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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -