⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netstack_8h-source.html

📁 单片机的软件
💻 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: net/netstack.h Source File</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></div><div class="nav"><a class="el" href="dir_000001.html">net</a></div><h1>netstack.h</h1><a href="netstack_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*! \file netstack.h \brief Network Stack. */</span>00002 <span class="comment">//*****************************************************************************</span>00003 <span class="comment">//</span>00004 <span class="comment">// File Name    : 'netstack.h'</span>00005 <span class="comment">// Title        : Network Stack</span>00006 <span class="comment">// Author       : Pascal Stang</span>00007 <span class="comment">// Created      : 6/28/2005</span>00008 <span class="comment">// Revised      : 7/3/2005</span>00009 <span class="comment">// Version      : 0.1</span>00010 <span class="comment">// Target MCU   : Atmel AVR series</span>00011 <span class="comment">// Editor Tabs  : 4</span>00012 <span class="comment">//</span><span class="comment"></span>00013 <span class="comment">/// \ingroup network</span>00014 <span class="comment">/// \defgroup netstack Network Stack (netstack.c)</span>00015 <span class="comment">/// \code #include "net/netstack.h" \endcode</span>00016 <span class="comment">/// \par Description</span>00017 <span class="comment">///     This library co-ordinates the various pieces of a typical IP network</span>00018 <span class="comment">///     stack into one unit.  Included are handling for ARP, ICMP, and IP</span>00019 <span class="comment">///     packets.  UDP and TCP packets are processed and passed to the user.</span>00020 <span class="comment">///</span>00021 <span class="comment">/// \note This is an example of how to use the various network libraries, and</span>00022 <span class="comment">///     is meant to be useful out-of-the-box for most users.  However, some</span>00023 <span class="comment">///     users may find it restrictive and write their own handlers instead.</span>00024 <span class="comment">///</span>00025 <span class="comment">/// \note This is NOT a full-blown TCP/IP stack.  It merely handles lower</span>00026 <span class="comment">///     level stack functions so that UDP and TCP packets can be sent</span>00027 <span class="comment">///     and received easily.  End-to-end TCP functionality may be added</span>00028 <span class="comment">///     in a future version.  Until then, I can recommend using other embedded</span>00029 <span class="comment">///     TCP/IP stacks like Adam Dunkel's uIP.</span>00030 <span class="comment"></span><span class="comment">//</span>00031 <span class="comment">//  This code is distributed under the GNU Public License</span>00032 <span class="comment">//      which can be found at http://www.gnu.org/licenses/gpl.txt</span>00033 <span class="comment">//*****************************************************************************</span><span class="comment"></span>00034 <span class="comment">//@{</span>00035 <span class="comment"></span>00036 <span class="preprocessor">#ifndef NETSTACK_H</span>00037 <span class="preprocessor"></span><span class="preprocessor">#define NETSTACK_H</span>00038 <span class="preprocessor"></span>00039 <span class="preprocessor">#include "<a class="code" href="net_8h.html">net.h</a>"</span>00040 <span class="preprocessor">#include "<a class="code" href="arp_8h.html">arp.h</a>"</span>00041 <span class="preprocessor">#include "<a class="code" href="icmp_8h.html">icmp.h</a>"</span>00042 <span class="preprocessor">#include "<a class="code" href="ip_8h.html">ip.h</a>"</span>00043 <span class="preprocessor">#include "<a class="code" href="nic_8h.html">nic.h</a>"</span>00044 00045 <span class="comment">//#define NETSTACK_DEBUG</span>00046 <span class="comment"></span>00047 <span class="comment">/// NET_BUFFERSIZE is the common receive/process/transmit buffer</span>00048 <span class="comment">/// Network packets larger than NET_BUFFERSIZE will not be accepted.</span><a name="l00049"></a><a class="code" href="group__netstack.html#ga4">00049</a> <span class="comment"></span><span class="preprocessor">#define NET_BUFFERSIZE      500</span>00050 <span class="preprocessor"></span><span class="comment"></span>00051 <span class="comment">/// netstackService should be called in the main loop of the user program.</span>00052 <span class="comment">/// The function will process one received network packet per call.</span>00053 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__netstack.html#ga0">netstackService</a>(<span class="keywordtype">void</span>);00054 <span class="comment"></span>00055 <span class="comment">/// netstackIPProcess handles distribution of IP received packets.</span>00056 <span class="comment">///</span>00057 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__netstack.html#ga1">netstackIPProcess</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len, ip_hdr* packet);00058 <span class="comment"></span>00059 <span class="comment">/// Replace this weakly-defined function with a user function that accepts UDP/IP packets.</span>00060 <span class="comment">///</span>00061 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__netstack.html#ga2">netstackUDPIPProcess</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len, udpip_hdr* packet) __attribute__ ((weak));00062 <span class="comment"></span>00063 <span class="comment">/// Replace this weakly-defined function with a user function that accepts TCP/IP packets.</span>00064 <span class="comment">///</span>00065 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__netstack.html#ga3">netstackTCPIPProcess</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len, tcpip_hdr* packet) __attribute__ ((weak));00066 00067 <span class="preprocessor">#endif</span>00068 <span class="preprocessor"></span><span class="comment">//@}</span></span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Aug 22 04:29:27 2005 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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -