📄 tcp__ip_8h-source.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>/opentcp/include/inet/tcp_ip.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><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="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> <a class="qindex" href="examples.html">Examples</a> </center><hr><h1>/opentcp/include/inet/tcp_ip.h</h1><a href="tcp__ip_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> *Copyright (c) 2000-2002 Viola Systems Ltd.</span>00003 <span class="comment"> *All rights reserved.</span>00004 <span class="comment"> *</span>00005 <span class="comment"> *Redistribution and use in source and binary forms, with or without </span>00006 <span class="comment"> *modification, are permitted provided that the following conditions </span>00007 <span class="comment"> *are met:</span>00008 <span class="comment"> *</span>00009 <span class="comment"> *1. Redistributions of source code must retain the above copyright </span>00010 <span class="comment"> *notice, this list of conditions and the following disclaimer.</span>00011 <span class="comment"> *</span>00012 <span class="comment"> *2. Redistributions in binary form must reproduce the above copyright </span>00013 <span class="comment"> *notice, this list of conditions and the following disclaimer in the </span>00014 <span class="comment"> *documentation and/or other materials provided with the distribution.</span>00015 <span class="comment"> *</span>00016 <span class="comment"> *3. The end-user documentation included with the redistribution, if </span>00017 <span class="comment"> *any, must include the following acknowledgment:</span>00018 <span class="comment"> * "This product includes software developed by Viola </span>00019 <span class="comment"> * Systems (http://www.violasystems.com/)."</span>00020 <span class="comment"> *</span>00021 <span class="comment"> *Alternately, this acknowledgment may appear in the software itself, </span>00022 <span class="comment"> *if and wherever such third-party acknowledgments normally appear.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> *4. The names "OpenTCP" and "Viola Systems" must not be used to </span>00025 <span class="comment"> *endorse or promote products derived from this software without prior </span>00026 <span class="comment"> *written permission. For written permission, please contact </span>00027 <span class="comment"> *opentcp@opentcp.org.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> *5. Products derived from this software may not be called "OpenTCP", </span>00030 <span class="comment"> *nor may "OpenTCP" appear in their name, without prior written </span>00031 <span class="comment"> *permission of the Viola Systems Ltd.</span>00032 <span class="comment"> *</span>00033 <span class="comment"> *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED </span>00034 <span class="comment"> *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF </span>00035 <span class="comment"> *MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. </span>00036 <span class="comment"> *IN NO EVENT SHALL VIOLA SYSTEMS LTD. OR ITS CONTRIBUTORS BE LIABLE </span>00037 <span class="comment"> *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR </span>00038 <span class="comment"> *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF </span>00039 <span class="comment"> *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR </span>00040 <span class="comment"> *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, </span>00041 <span class="comment"> *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE </span>00042 <span class="comment"> *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, </span>00043 <span class="comment"> *EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>00044 <span class="comment"> *====================================================================</span>00045 <span class="comment"> *</span>00046 <span class="comment"> *OpenTCP is the unified open source TCP/IP stack available on a series </span>00047 <span class="comment"> *of 8/16-bit microcontrollers, please see <http://www.opentcp.org>.</span>00048 <span class="comment"> *</span>00049 <span class="comment"> *For more information on how to network-enable your devices, or how to </span>00050 <span class="comment"> *obtain commercial technical support for OpenTCP, please see </span>00051 <span class="comment"> *<http://www.violasystems.com/>.</span>00052 <span class="comment"> */</span>00053 00064 <span class="preprocessor">#ifndef INCLUDE_TCP_IP_H</span>00065 <span class="preprocessor"></span><span class="preprocessor">#define INCLUDE_TCP_IP_H</span>00066 <span class="preprocessor"></span>00067 <span class="preprocessor">#include <<a class="code" href="datatypes_8h.html">inet/datatypes.h</a>></span>00068 <span class="preprocessor">#include <<a class="code" href="ethernet_8h.html">inet/ethernet.h</a>></span>00069 <span class="preprocessor">#include <<a class="code" href="ip_8h.html">inet/ip.h</a>></span>00070 00071 <span class="comment">/* User define */</span>00072 <a name="l00081"></a><a class="code" href="group__opentcp__config.html#a5">00081</a> <span class="preprocessor">#define NO_OF_TCPSOCKETS 8</span>00082 <span class="preprocessor"></span><a name="l00091"></a><a class="code" href="group__opentcp__config.html#a6">00091</a> <span class="preprocessor">#define NO_OF_UDPSOCKETS 4</span>00092 <span class="preprocessor"></span><a name="l00100"></a><a class="code" href="group__opentcp__config.html#a7">00100</a> <span class="preprocessor">#define TCP_PORTS_END 1023</span>00101 <span class="preprocessor"></span><a name="l00109"></a><a class="code" href="group__opentcp__config.html#a8">00109</a> <span class="preprocessor">#define UDP_PORTS_END 1023 </span>00110 <span class="preprocessor"></span>00111 <span class="comment">/* UDP Control optios */</span>00112 <a name="l00122"></a><a class="code" href="tcp__ip_8h.html#a4">00122</a> <span class="preprocessor">#define UDP_OPT_NONE 0</span>00123 <span class="preprocessor"></span><a name="l00132"></a><a class="code" href="tcp__ip_8h.html#a5">00132</a> <span class="preprocessor">#define UDP_OPT_SEND_CS 1</span>00133 <span class="preprocessor"></span><a name="l00140"></a><a class="code" href="tcp__ip_8h.html#a6">00140</a> <span class="preprocessor">#define UDP_OPT_CHECK_CS 2</span>00141 <span class="preprocessor"></span>00142 <span class="preprocessor">#define UDP_SEND_MTU ETH_MTU - ETH_HEADER_LEN - UDP_HLEN - IP_MAX_HLEN</span>00143 <span class="preprocessor"></span><a name="l00144"></a><a class="code" href="tcp__ip_8h.html#a8">00144</a> <span class="preprocessor">#define UDP_HLEN 8 </span>00146 <span class="preprocessor">#define MIN_TCP_HLEN 20</span>00147 <span class="preprocessor"></span><span class="preprocessor">#define MAX_TCP_OPTLEN 40 </span>00148 <span class="preprocessor"></span><span class="preprocessor">#define TCP_DEF_MTU 512 </span><span class="comment">/* Default MTU for TCP */</span>00149 <a name="l00160"></a><a class="code" href="group__opentcp__config.html#a9">00160</a> <span class="preprocessor">#define TCP_DEF_RETRIES 7 </span>00161 <span class="preprocessor"></span>00169 <span class="preprocessor">#define TCP_CON_ATTEMPTS 7</span>00170 <span class="preprocessor"></span><a name="l00180"></a><a class="code" href="group__opentcp__config.html#a10">00180</a> <span class="preprocessor">#define TCP_DEF_KEEPALIVE 4 </span>00181 <span class="preprocessor"></span><a name="l00189"></a><a class="code" href="group__opentcp__config.html#a11">00189</a> <span class="preprocessor">#define TCP_DEF_RETRY_TOUT 4</span>00190 <span class="preprocessor"></span><a name="l00198"></a><a class="code" href="group__opentcp__config.html#a12">00198</a> <span class="preprocessor">#define TCP_INIT_RETRY_TOUT 1</span>00199 <span class="preprocessor"></span><a name="l00206"></a><a class="code" href="group__opentcp__config.html#a13">00206</a> <span class="preprocessor">#define TCP_SYN_RETRY_TOUT 2</span>00207 <span class="preprocessor"></span><a name="l00214"></a><a class="code" href="tcp__ip_8h.html#a18">00214</a> <span class="preprocessor">#define TCP_TOS_NORMAL 0</span>00215 <span class="preprocessor"></span><a name="l00225"></a><a class="code" href="group__opentcp__config.html#a14">00225</a> <span class="preprocessor">#define TCP_DEF_TOUT 120 </span>00226 <span class="preprocessor"></span>00227 <span class="preprocessor">#define TCP_HALF_SEQ_SPACE 0x0000FFFF </span><span class="comment">/* For detecting sequence space */</span>00228 00229 00230 <span class="comment">/* ICMP message types */</span>00231 00232 <span class="preprocessor">#define ICMP_TYPE_DEST_UNREACHABLE 3</span>00233 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ECHO_REQUEST 8</span>00234 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ECHO_REPLY 0</span>00235 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_CODE_FRAGMENTATION_NEEDED_DF_SET 4</span>00236 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_MTUMSG_LEN 16</span>00237 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_ECHOREQ_HLEN 8</span>00238 <span class="preprocessor"></span><span class="preprocessor">#define ICMP_TEMPIPSET_DATALEN 102</span>00239 <span class="preprocessor"></span>00240 00241 <span class="comment">/* UDP States */</span>00242 <a name="l00249"></a><a class="code" href="tcp__ip_8h.html#a28">00249</a> <span class="preprocessor">#define UDP_STATE_FREE 1</span>00250 <span class="preprocessor"></span><a name="l00258"></a><a class="code" href="tcp__ip_8h.html#a29">00258</a> <span class="preprocessor">#define UDP_STATE_CLOSED 2</span>00259 <span class="preprocessor"></span><a name="l00266"></a><a class="code" href="tcp__ip_8h.html#a30">00266</a> <span class="preprocessor">#define UDP_STATE_OPENED 3</span>00267 <span class="preprocessor"></span>00268 <span class="comment">/* UDP Events */</span>00269 <a name="l00276"></a><a class="code" href="tcp__ip_8h.html#a31">00276</a> <span class="preprocessor">#define UDP_EVENT_DATA 64</span>00277 <span class="preprocessor"></span>00278 00279 <span class="comment">/* TCP FLAGS */</span>00280 00281 <span class="preprocessor">#define TCP_FLAG_ACK 0x10</span>00282 <span class="preprocessor"></span><span class="preprocessor">#define TCP_FLAG_PUSH 0x08</span>00283 <span class="preprocessor"></span><span class="preprocessor">#define TCP_FLAG_RESET 0x04</span>00284 <span class="preprocessor"></span><span class="preprocessor">#define TCP_FLAG_SYN 0x02</span>00285 <span class="preprocessor"></span><span class="preprocessor">#define TCP_FLAG_FIN 0x01</span>00286 <span class="preprocessor"></span>00287 <span class="comment">/* TCP Internal flags */</span>00288 00289 <span class="preprocessor">#define TCP_INTFLAGS_CLOSEPENDING 0x01</span>00290 <span class="preprocessor"></span>00291 <span class="comment">/* TCP socket types */</span><a name="l00300"></a><a class="code" href="tcp__ip_8h.html#a38">00300</a> <span class="preprocessor">#define TCP_TYPE_NONE 0x00</span>00301 <span class="preprocessor"></span><a name="l00310"></a><a class="code" href="tcp__ip_8h.html#a39">00310</a> <span class="preprocessor">#define TCP_TYPE_SERVER 0x01</span>00311 <span class="preprocessor"></span><a name="l00320"></a><a class="code" href="tcp__ip_8h.html#a40">00320</a> <span class="preprocessor">#define TCP_TYPE_CLIENT 0x02</span>00321 <span class="preprocessor"></span><a name="l00329"></a><a class="code" href="tcp__ip_8h.html#a41">00329</a> <span class="preprocessor">#define TCP_TYPE_CLIENT_SERVER 0x03</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -