📄 tcp__ip_8h-source.html
字号:
00330 <span class="preprocessor"></span>00331 <span class="comment">/* TCP States. For more detailed descriptions see RFC793 */</span>00332 <a name="l00333"></a><a class="code" href="tcp__ip_8h.html#a42">00333</a> <span class="preprocessor">#define TCP_STATE_FREE 1 </span><a name="l00334"></a><a class="code" href="tcp__ip_8h.html#a43">00334</a> <span class="preprocessor">#define TCP_STATE_RESERVED 2 </span><a name="l00335"></a><a class="code" href="tcp__ip_8h.html#a44">00335</a> <span class="preprocessor">#define TCP_STATE_CLOSED 3 </span><a name="l00336"></a><a class="code" href="tcp__ip_8h.html#a45">00336</a> <span class="preprocessor">#define TCP_STATE_LISTENING 4 </span><a name="l00339"></a><a class="code" href="tcp__ip_8h.html#a46">00339</a> <span class="preprocessor">#define TCP_STATE_SYN_RECEIVED 5 </span><a name="l00343"></a><a class="code" href="tcp__ip_8h.html#a47">00343</a> <span class="preprocessor">#define TCP_STATE_SYN_SENT 6 </span><a name="l00346"></a><a class="code" href="tcp__ip_8h.html#a48">00346</a> <span class="preprocessor">#define TCP_STATE_FINW1 7 </span><a name="l00349"></a><a class="code" href="tcp__ip_8h.html#a49">00349</a> <span class="preprocessor">#define TCP_STATE_FINW2 8 </span><a name="l00353"></a><a class="code" href="tcp__ip_8h.html#a50">00353</a> <span class="preprocessor">#define TCP_STATE_CLOSING 9 </span><a name="l00356"></a><a class="code" href="tcp__ip_8h.html#a51">00356</a> <span class="preprocessor">#define TCP_STATE_LAST_ACK 10 </span><a name="l00359"></a><a class="code" href="tcp__ip_8h.html#a52">00359</a> <span class="preprocessor">#define TCP_STATE_TIMED_WAIT 11 </span><a name="l00362"></a><a class="code" href="tcp__ip_8h.html#a53">00362</a> <span class="preprocessor">#define TCP_STATE_CONNECTED 12 </span>00368 <span class="preprocessor"></span><span class="comment">/* TCP callback events */</span>00369 <a name="l00387"></a><a class="code" href="tcp__ip_8h.html#a54">00387</a> <span class="preprocessor">#define TCP_EVENT_CONREQ 1</span>00388 <span class="preprocessor"></span><a name="l00397"></a><a class="code" href="tcp__ip_8h.html#a55">00397</a> <span class="preprocessor">#define TCP_EVENT_CONNECTED 2</span>00398 <span class="preprocessor"></span><a name="l00405"></a><a class="code" href="tcp__ip_8h.html#a56">00405</a> <span class="preprocessor">#define TCP_EVENT_CLOSE 4</span>00406 <span class="preprocessor"></span><a name="l00418"></a><a class="code" href="tcp__ip_8h.html#a57">00418</a> <span class="preprocessor">#define TCP_EVENT_ABORT 8</span>00419 <span class="preprocessor"></span><a name="l00428"></a><a class="code" href="tcp__ip_8h.html#a58">00428</a> <span class="preprocessor">#define TCP_EVENT_ACK 16</span>00429 <span class="preprocessor"></span><a name="l00437"></a><a class="code" href="tcp__ip_8h.html#a59">00437</a> <span class="preprocessor">#define TCP_EVENT_REGENERATE 32</span>00438 <span class="preprocessor"></span><a name="l00445"></a><a class="code" href="tcp__ip_8h.html#a60">00445</a> <span class="preprocessor">#define TCP_EVENT_DATA 64</span>00446 <span class="preprocessor"></span>00447 00448 00449 <span class="comment">/* TCP and UDP buffer handling */</span>00450 <a name="l00459"></a><a class="code" href="tcp__ip_8h.html#a61">00459</a> <span class="preprocessor">#define TCP_APP_OFFSET MIN_TCP_HLEN </span><span class="comment">/* Application buffers must have */</span>00460 <span class="comment">/* this much free on start of buf */</span>00461 <a name="l00471"></a><a class="code" href="tcp__ip_8h.html#a62">00471</a> <span class="preprocessor">#define UDP_APP_OFFSET UDP_HLEN</span>00472 <span class="preprocessor"></span>00473 00474 00475 <span class="comment">/* UDP Structures */</span>00476 <a name="l00488"></a><a class="code" href="structudp__frame.html">00488</a> <span class="keyword">struct </span><a class="code" href="structudp__frame.html">udp_frame</a>00489 {<a name="l00490"></a><a class="code" href="structudp__frame.html#m0">00490</a> UINT16 <a class="code" href="structudp__frame.html#m0">sport</a>; <a name="l00491"></a><a class="code" href="structudp__frame.html#m1">00491</a> UINT16 <a class="code" href="structudp__frame.html#m1">dport</a>; <a name="l00492"></a><a class="code" href="structudp__frame.html#m2">00492</a> UINT16 <a class="code" href="structudp__frame.html#m2">tlen</a>; <a name="l00493"></a><a class="code" href="structudp__frame.html#m3">00493</a> UINT16 <a class="code" href="structudp__frame.html#m3">checksum</a>; <a name="l00494"></a><a class="code" href="structudp__frame.html#m4">00494</a> UINT16 <a class="code" href="structudp__frame.html#m4">buf_index</a>; 00497 };00498 <a name="l00506"></a><a class="code" href="structucb.html">00506</a> <span class="keyword">struct </span><a class="code" href="structucb.html">ucb</a>00507 {<a name="l00516"></a><a class="code" href="structucb.html#m0">00516</a> <a class="code" href="structucb.html#m5">UINT8</a> <a class="code" href="structucb.html#m0">state</a>; 00517 <a name="l00523"></a><a class="code" href="structucb.html#m1">00523</a> <a class="code" href="structucb.html#m5">UINT8</a> <a class="code" href="structucb.html#m1">tos</a>;00524 <a name="l00525"></a><a class="code" href="structucb.html#m2">00525</a> <a class="code" href="structucb.html#m7">UINT16</a> <a class="code" href="structucb.html#m2">locport</a>; <a name="l00539"></a><a class="code" href="structucb.html#m3">00539</a> <a class="code" href="structucb.html#m5">UINT8</a> <a class="code" href="structucb.html#m3">opts</a>; 00540 00546 INT32 (*event_listener)<a name="l00547"></a><a class="code" href="structucb.html#m5">00547</a> (<a class="code" href="structucb.html#m4">INT8</a>, <a class="code" href="structucb.html#m5">UINT8</a>, <a class="code" href="structucb.html#m6">UINT32</a>, <a class="code" href="structucb.html#m7">UINT16</a>, <a class="code" href="structucb.html#m7">UINT16</a>, <a class="code" href="structucb.html#m7">UINT16</a> );00548 }; 00549 00550 00551 00552 <span class="comment">/* TCP Structures */</span>00553 <a name="l00564"></a><a class="code" href="structtcp__frame.html">00564</a> <span class="keyword">struct </span><a class="code" href="structtcp__frame.html">tcp_frame</a>00565 {<a name="l00566"></a><a class="code" href="structtcp__frame.html#m0">00566</a> UINT16 <a class="code" href="structtcp__frame.html#m0">sport</a>; <a name="l00567"></a><a class="code" href="structtcp__frame.html#m1">00567</a> UINT16 <a class="code" href="structtcp__frame.html#m1">dport</a>; <a name="l00568"></a><a class="code" href="structtcp__frame.html#m2">00568</a> UINT32 <a class="code" href="structtcp__frame.html#m2">seqno</a>; <a name="l00569"></a><a class="code" href="structtcp__frame.html#m3">00569</a> UINT32 <a class="code" href="structtcp__frame.html#m3">ackno</a>; <a name="l00570"></a><a class="code" href="structtcp__frame.html#m4">00570</a> UINT16 <a class="code" href="structtcp__frame.html#m4">hlen_flags</a>; <a name="l00571"></a><a class="code" href="structtcp__frame.html#m5">00571</a> UINT16 <a class="code" href="structtcp__frame.html#m5">window</a>; <a name="l00572"></a><a class="code" href="structtcp__frame.html#m6">00572</a> UINT16 <a class="code" href="structtcp__frame.html#m6">checksum</a>; <a name="l00573"></a><a class="code" href="structtcp__frame.html#m7">00573</a> UINT16 <a class="code" href="structtcp__frame.html#m7">urgent</a>; <a name="l00574"></a><a class="code" href="structtcp__frame.html#m8">00574</a> UINT8 <a class="code" href="structtcp__frame.html#m8">opt</a>[MAX_TCP_OPTLEN + 1]; <a name="l00575"></a><a class="code" href="structtcp__frame.html#m9">00575</a> UINT16 <a class="code" href="structtcp__frame.html#m9">buf_index</a>; 00578 };00579 <a name="l00589"></a><a class="code" href="structtcb.html">00589</a> <span class="keyword">struct </span><a class="code" href="structtcb.html">tcb</a>00590 {<a name="l00609"></a><a class="code" href="structtcb.html#m0">00609</a> UINT8 <a class="code" href="structtcb.html#m0">state</a>; 00610 <a name="l00621"></a><a class="code" href="structtcb.html#m1">00621</a> UINT8 <a class="code" href="structtcb.html#m1">type</a>; <a name="l00622"></a><a class="code" href="structtcb.html#m2">00622</a> UINT8 <a class="code" href="structtcb.html#m2">flags</a>; <a name="l00623"></a><a class="code" href="structtcb.html#m3">00623</a> UINT32 <a class="code" href="structtcb.html#m3">rem_ip</a>; <a name="l00624"></a><a class="code" href="structtcb.html#m4">00624</a> UINT16 <a class="code" href="structtcb.html#m4">remport</a>; <a name="l00625"></a><a class="code" href="structtcb.html#m5">00625</a> UINT16 <a class="code" href="structtcb.html#m5">locport</a>; 00626 UINT32 send_unacked;<a name="l00627"></a><a class="code" href="structtcb.html#m7">00627</a> UINT8 <a class="code" href="structtcb.html#m7">myflags</a>; 00628 UINT32 send_next;00629 UINT16 send_mtu;<a name="l00630"></a><a class="code" href="structtcb.html#m10">00630</a> UINT16 <a class="code" href="structtcb.html#m10">tout</a>; <a name="l00631"></a><a class="code" href="structtcb.html#m11">00631</a> UINT8 <a class="code" href="structtcb.html#m11">tos</a>; 00632 UINT32 receive_next;<a name="l00633"></a><a class="code" href="structtcb.html#m13">00633</a> UINT16 <a class="code" href="structtcb.html#m13">persist_timerh</a>; <a name="l00634"></a><a class="code" href="structtcb.html#m14">00634</a> UINT16 <a class="code" href="structtcb.html#m14">retransmit_timerh</a>; <a name="l00635"></a><a class="code" href="structtcb.html#m15">00635</a> UINT8 <a class="code" href="structtcb.html#m15">retries_left</a>; 00644 INT32 (*<a class="code" href="structtcb.html#m16">event_listener</a>)(INT8, UINT8, UINT32, UINT32); 00645 00646 };00647 00648 <span class="comment">/* ICMP function prototypes */</span>00649 00650 INT16 <a class="code" href="icmp_8c.html#a2">process_icmp_in</a>(<span class="keyword">struct</span> <a class="code" href="structip__frame.html">ip_frame</a>*, UINT16);00651 00652 <span class="comment">/* UDP Function prototypes */</span>00653 INT8 <a class="code" href="group__core__initializer.html#a4">udp_init</a> (<span class="keywordtype">void</span>);00654 INT8 <a class="code" href="udp_8c.html#a3">udp_getsocket</a> (UINT8 , INT32 (* )(INT8, UINT8, UINT32, UINT16, UINT16, UINT16), UINT8 );00655 INT8 <a class="code" href="udp_8c.html#a4">udp_releasesocket</a> (INT8 );00656 INT8 <a class="code" href="udp_8c.html#a5">udp_open</a> (INT8 , UINT16 );00657 INT8 <a class="code" href="udp_8c.html#a6">udp_close</a> (INT8 );00658 INT16 <a class="code" href="udp_8c.html#a7">udp_send</a> (INT8 , UINT32 , UINT16 , UINT8* , UINT16 , UINT16 );00659 INT16 <a class="code" href="udp_8c.html#a8">process_udp_in</a>(<span class="keyword">struct</span> <a class="code" href="structip__frame.html">ip_frame</a>* , UINT16 );00660 UINT16 <a class="code" href="udp_8c.html#a71">udp_getfreeport</a>(<span class="keywordtype">void</span>); 00661 00662 <span class="comment">/* TCP Function prototypes */</span>00663 00664 INT16 <a class="code" href="tcp_8c.html#a14">process_tcp_in</a>(<span class="keyword">struct</span> <a class="code" href="structip__frame.html">ip_frame</a>*, UINT16);00665 INT16 <a class="code" href="tcp_8c.html#a15">process_tcp_out</a>(INT8, UINT8*, UINT16, UINT16);00666 INT8 <a class="code" href="group__core__initializer.html#a2">tcp_init</a>(<span class="keywordtype">void</span>);00667 INT8 <a class="code" href="tcp_8c.html#a5">tcp_listen</a>(INT8, UINT16);00668 INT8 <a class="code" href="tcp_8c.html#a19">tcp_mapsocket</a>(<span class="keyword">struct</span> <a class="code" href="structip__frame.html">ip_frame</a>*, <span class="keyword">struct</span> <a class="code" href="structtcp__frame.html">tcp_frame</a>*);00669 UINT8 <a class="code" href="tcp_8c.html#a22">tcp_check_cs</a>(<span class="keyword">struct</span> <a class="code" href="structip__frame.html">ip_frame</a>*, UINT16);00670 <span class="keywordtype">void</span> <a class="code" href="tcp_8c.html#a16">tcp_sendcontrol</a>(INT8);00671 UINT32 <a class="code" href="tcp_8c.html#a79">tcp_initseq</a>(<span class="keywordtype">void</span>);00672 <span class="keywordtype">void</span> <a class="code" href="group__periodic__functions.html#a4">tcp_poll</a>(<span class="keywordtype">void</span>);00673 <span class="keywordtype">void</span> <a class="code" href="tcp_8c.html#a20">tcp_newstate</a>(<span class="keyword">struct</span> <a class="code" href="structtcb.html">tcb</a>*, UINT8);00674 INT8 <a class="code" href="tcp_8c.html#a3">tcp_getsocket</a>(UINT8, UINT8, UINT16, INT32 (*)(INT8, UINT8, UINT32, UINT32) );00675 INT8 <a class="code" href="tcp_8c.html#a4">tcp_releasesocket</a>(INT8);00676 INT8 <a class="code" href="tcp_8c.html#a6">tcp_connect</a>(INT8, UINT32, UINT16, UINT16);00677 INT16 <a class="code" href="tcp_8c.html#a7">tcp_send</a>(INT8, UINT8*, UINT16, UINT16);00678 INT8 <a class="code" href="tcp_8c.html#a8">tcp_close</a>(INT8);00679 <span class="keywordtype">void</span> <a class="code" href="tcp_8c.html#a17">tcp_sendreset</a>(<span class="keyword">struct</span> <a class="code" href="structtcp__frame.html">tcp_frame</a>*, UINT32);00680 INT8 <a class="code" href="tcp_8c.html#a9">tcp_getstate</a>(INT8);00681 UINT16 <a class="code" href="tcp_8c.html#a89">tcp_getfreeport</a>(<span class="keywordtype">void</span>);00682 INT16 <a class="code" href="tcp_8c.html#a10">tcp_checksend</a>(INT8);00683 INT8 <a class="code" href="tcp_8c.html#a11">tcp_abort</a>(INT8);00684 00685 00686 00687 <span class="preprocessor">#endif</span>00688 <span class="preprocessor"></span>00689 </pre></div><hr><address style="align: right;"><small>Generated on Sun Aug 3 20:32:59 2003 for OpenTCP by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -