[353] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 3 | <title>mixpp: tcp.h Source File</title> |
---|
| 4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
| 5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 6 | </head><body> |
---|
| 7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
| 8 | <script type="text/javascript"> |
---|
| 9 | <!-- |
---|
| 10 | function changeDisplayState (e){ |
---|
| 11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
| 12 | var button=this.firstChild; |
---|
| 13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
| 14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
| 15 | sectionDiv.style.display='block'; |
---|
| 16 | button.src='open.gif'; |
---|
| 17 | }else{ |
---|
| 18 | sectionDiv.style.display='none'; |
---|
| 19 | button.src='closed.gif'; |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | function initDynSections(){ |
---|
| 23 | var divs=document.getElementsByTagName('div'); |
---|
| 24 | var sectionCounter=1; |
---|
| 25 | for(var i=0;i<divs.length-1;i++){ |
---|
| 26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
| 27 | var header=divs[i]; |
---|
| 28 | var section=divs[i+1]; |
---|
| 29 | var button=header.firstChild; |
---|
| 30 | if (button!='IMG'){ |
---|
| 31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
| 32 | button=document.createElement('img'); |
---|
| 33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
| 34 | } |
---|
| 35 | header.style.cursor='pointer'; |
---|
| 36 | header.onclick=changeDisplayState; |
---|
| 37 | header.id='dynheader'+sectionCounter; |
---|
| 38 | button.src='closed.gif'; |
---|
| 39 | section.id='dynsection'+sectionCounter; |
---|
| 40 | section.style.display='none'; |
---|
| 41 | section.style.marginLeft='14px'; |
---|
| 42 | sectionCounter++; |
---|
| 43 | } |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | window.onload = initDynSections; |
---|
| 47 | --> |
---|
| 48 | </script> |
---|
| 49 | <div class="navigation" id="top"> |
---|
| 50 | <div class="tabs"> |
---|
| 51 | <ul> |
---|
| 52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
| 53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
| 54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
| 55 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
| 56 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
| 57 | </ul> |
---|
| 58 | </div> |
---|
| 59 | <div class="tabs"> |
---|
| 60 | <ul> |
---|
| 61 | <li><a href="files.html"><span>File List</span></a></li> |
---|
| 62 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
| 63 | </ul> |
---|
| 64 | </div> |
---|
| 65 | <h1>tcp.h</h1><a href="tcp_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
| 66 | <a name="l00032"></a>00032 <span class="preprocessor">#ifndef TCP_H</span> |
---|
| 67 | <a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define TCP_H</span> |
---|
| 68 | <a name="l00034"></a>00034 <span class="preprocessor"></span> |
---|
| 69 | <a name="l00035"></a>00035 <span class="preprocessor">#include <<a class="code" href="vec_8h.html" title="Templated Vector Class Definitions.">itpp/base/vec.h</a>></span> |
---|
| 70 | <a name="l00036"></a>00036 <span class="preprocessor">#include <<a class="code" href="converters_8h.html" title="Definitions of converters between different vector and matrix types.">itpp/base/converters.h</a>></span> |
---|
| 71 | <a name="l00037"></a>00037 <span class="preprocessor">#include <<a class="code" href="packet_8h.html" title="Definition of a Packet class.">itpp/protocol/packet.h</a>></span> |
---|
| 72 | <a name="l00038"></a>00038 <span class="preprocessor">#include <<a class="code" href="events_8h.html" title="Definitions of an event-based simulation class.">itpp/protocol/events.h</a>></span> |
---|
| 73 | <a name="l00039"></a>00039 |
---|
| 74 | <a name="l00040"></a>00040 |
---|
| 75 | <a name="l00041"></a>00041 <span class="keyword">namespace </span>itpp |
---|
| 76 | <a name="l00042"></a>00042 { |
---|
| 77 | <a name="l00043"></a>00043 |
---|
| 78 | <a name="l00045"></a>00045 |
---|
| 79 | <a name="l00046"></a>00046 |
---|
| 80 | <a name="l00061"></a><a class="code" href="classitpp_1_1Sequence__Number.html">00061</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> |
---|
| 81 | <a name="l00062"></a>00062 { |
---|
| 82 | <a name="l00063"></a>00063 <span class="keyword">public</span>: |
---|
| 83 | <a name="l00065"></a><a class="code" href="classitpp_1_1Sequence__Number.html#582d25efb59588a2f2f24fd6e3e5ab9a">00065</a> <a class="code" href="classitpp_1_1Sequence__Number.html#582d25efb59588a2f2f24fd6e3e5ab9a" title="Default constructor.">Sequence_Number</a>() : <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>(0) { } |
---|
| 84 | <a name="l00067"></a><a class="code" href="classitpp_1_1Sequence__Number.html#a8739baef4d4938bf739d29a28d96e8a">00067</a> <a class="code" href="classitpp_1_1Sequence__Number.html#a8739baef4d4938bf739d29a28d96e8a" title="ADD DOCUMENTATION HERE.">Sequence_Number</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n) : <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>(n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>) { } |
---|
| 85 | <a name="l00069"></a><a class="code" href="classitpp_1_1Sequence__Number.html#87f29a844cd357b5ae431816acbe9f2f">00069</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &<a class="code" href="classitpp_1_1Sequence__Number.html#87f29a844cd357b5ae431816acbe9f2f" title="ADD DOCUMENTATION HERE.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n) { <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> = n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
| 86 | <a name="l00071"></a><a class="code" href="classitpp_1_1Sequence__Number.html#aad581ad8c75034b22d2471a373ef67f">00071</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &<a class="code" href="classitpp_1_1Sequence__Number.html#aad581ad8c75034b22d2471a373ef67f" title="ADD DOCUMENTATION HERE.">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &rep) { <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> = rep; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
| 87 | <a name="l00072"></a>00072 |
---|
| 88 | <a name="l00073"></a>00073 <span class="comment">//relational operators</span> |
---|
| 89 | <a name="l00075"></a><a class="code" href="classitpp_1_1Sequence__Number.html#1f9739b17b4bf0c7eedae40c1e46534b">00075</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Sequence__Number.html#1f9739b17b4bf0c7eedae40c1e46534b" title="ADD DOCUMENTATION HERE.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> == n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; } |
---|
| 90 | <a name="l00077"></a><a class="code" href="classitpp_1_1Sequence__Number.html#0d6204068a566cd9199529feb695c435">00077</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Sequence__Number.html#0d6204068a566cd9199529feb695c435" title="ADD DOCUMENTATION HERE.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> != n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; } |
---|
| 91 | <a name="l00079"></a><a class="code" href="classitpp_1_1Sequence__Number.html#155aef7a63461db47094064648fd040e">00079</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Sequence__Number.html#155aef7a63461db47094064648fd040e" title="ADD DOCUMENTATION HERE.">operator></a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> - n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>) > 0; } |
---|
| 92 | <a name="l00081"></a><a class="code" href="classitpp_1_1Sequence__Number.html#b9691c4e30b0db5621a09648ba6495ee">00081</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Sequence__Number.html#b9691c4e30b0db5621a09648ba6495ee" title="ADD DOCUMENTATION HERE.">operator>=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> - n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>) >= 0; } |
---|
| 93 | <a name="l00083"></a><a class="code" href="classitpp_1_1Sequence__Number.html#51c23eec4be89c1edde8636462f2b32c">00083</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Sequence__Number.html#51c23eec4be89c1edde8636462f2b32c" title="ADD DOCUMENTATION HERE.">operator<</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> - n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>) < 0; } |
---|
| 94 | <a name="l00085"></a><a class="code" href="classitpp_1_1Sequence__Number.html#47388fd084107dbc127f7e2b1491c195">00085</a> <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1Sequence__Number.html#47388fd084107dbc127f7e2b1491c195" title="ADD DOCUMENTATION HERE.">operator<=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> - n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>) <= 0; } |
---|
| 95 | <a name="l00086"></a>00086 |
---|
| 96 | <a name="l00087"></a>00087 <span class="comment">//addition and subtraction</span> |
---|
| 97 | <a name="l00089"></a><a class="code" href="classitpp_1_1Sequence__Number.html#fd156263992c86596d641933d401f305">00089</a> <span class="comment"></span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1Sequence__Number.html#fd156263992c86596d641933d401f305" title="ADD DOCUMENTATION HERE.">operator+</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#582d25efb59588a2f2f24fd6e3e5ab9a" title="Default constructor.">Sequence_Number</a>(<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> + n); } |
---|
| 98 | <a name="l00091"></a><a class="code" href="classitpp_1_1Sequence__Number.html#ba1ee9585cb3b916d6066969c7800204">00091</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &<a class="code" href="classitpp_1_1Sequence__Number.html#ba1ee9585cb3b916d6066969c7800204" title="ADD DOCUMENTATION HERE.">operator+=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n) { <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> += n; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
| 99 | <a name="l00093"></a><a class="code" href="classitpp_1_1Sequence__Number.html#15e019871553b45c3d184351dc97a84c">00093</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1Sequence__Number.html#15e019871553b45c3d184351dc97a84c" title="ADD DOCUMENTATION HERE.">operator-</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#582d25efb59588a2f2f24fd6e3e5ab9a" title="Default constructor.">Sequence_Number</a>(<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> - n); } |
---|
| 100 | <a name="l00095"></a><a class="code" href="classitpp_1_1Sequence__Number.html#631e2e9982523e7792b1db038d836058">00095</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &<a class="code" href="classitpp_1_1Sequence__Number.html#631e2e9982523e7792b1db038d836058" title="ADD DOCUMENTATION HERE.">operator-=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n) { <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> -= n; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } |
---|
| 101 | <a name="l00097"></a><a class="code" href="classitpp_1_1Sequence__Number.html#ff894d6999e515f1000053dbcb315130">00097</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Sequence__Number.html#ff894d6999e515f1000053dbcb315130" title="ADD DOCUMENTATION HERE.">operator-</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a> - n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; } |
---|
| 102 | <a name="l00098"></a>00098 |
---|
| 103 | <a name="l00100"></a><a class="code" href="classitpp_1_1Sequence__Number.html#03a465e50cee4cb6b85193cc6a62ead1">00100</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Sequence__Number.html#03a465e50cee4cb6b85193cc6a62ead1" title="Access to internal representation.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; } |
---|
| 104 | <a name="l00101"></a>00101 |
---|
| 105 | <a name="l00103"></a><a class="code" href="classitpp_1_1Sequence__Number.html#090a998977a68449dbb441947b45a4dd">00103</a> <span class="keyword">friend</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1Sequence__Number.html#090a998977a68449dbb441947b45a4dd" title="ADD DOCUMENTATION HERE.">operator+</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n1, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n2) { <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1Sequence__Number.html#582d25efb59588a2f2f24fd6e3e5ab9a" title="Default constructor.">Sequence_Number</a>(n1 + n2.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>); } |
---|
| 106 | <a name="l00105"></a><a class="code" href="classitpp_1_1Sequence__Number.html#86cabb669821e642f84eb49bd36700a9">00105</a> <span class="keyword">friend</span> std::ostream &<a class="code" href="classitpp_1_1Sequence__Number.html#86cabb669821e642f84eb49bd36700a9" title="ADD DOCUMENTATION HERE.">operator<<</a>(std::ostream &os, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n) { os << n.<a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; <span class="keywordflow">return</span> os; } |
---|
| 107 | <a name="l00106"></a>00106 |
---|
| 108 | <a name="l00107"></a>00107 <span class="keyword">protected</span>: |
---|
| 109 | <a name="l00109"></a><a class="code" href="classitpp_1_1Sequence__Number.html#84f8b374fe8018b59cec59d75c5a2f44">00109</a> <a class="code" href="classitpp_1_1Sequence__Number.html#84f8b374fe8018b59cec59d75c5a2f44" title="ADD DOCUMENTATION HERE.">Sequence_Number</a>(<span class="keywordtype">int</span> n) : <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>(n) {} |
---|
| 110 | <a name="l00111"></a><a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0">00111</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1Sequence__Number.html#5d5c03e8f57eceb55987815f0ebdfcf0" title="ADD DOCUMENTATION HERE.">seq</a>; |
---|
| 111 | <a name="l00112"></a>00112 }; |
---|
| 112 | <a name="l00113"></a>00113 |
---|
| 113 | <a name="l00115"></a><a class="code" href="group__protocol.html#g27dde5be5aac902c0de838b4b872cd2f">00115</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> & <a class="code" href="group__protocol.html#g27dde5be5aac902c0de838b4b872cd2f" title="ADD DOCUMENTATION HERE.">min</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n1, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n2) { <span class="keywordflow">return</span> (n1 < n2) ? n1 : n2; } |
---|
| 114 | <a name="l00117"></a><a class="code" href="group__protocol.html#g3e4e78a5230c444344a135c661163ef2">00117</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> & <a class="code" href="group__protocol.html#g3e4e78a5230c444344a135c661163ef2" title="ADD DOCUMENTATION HERE.">max</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n1, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &n2) { <span class="keywordflow">return</span> (n1 > n2) ? n1 : n2; } |
---|
| 115 | <a name="l00118"></a>00118 |
---|
| 116 | <a name="l00119"></a>00119 |
---|
| 117 | <a name="l00120"></a>00120 |
---|
| 118 | <a name="l00135"></a><a class="code" href="classitpp_1_1TCP__Segment.html">00135</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> |
---|
| 119 | <a name="l00136"></a>00136 { |
---|
| 120 | <a name="l00137"></a>00137 <span class="keyword">public</span>: |
---|
| 121 | <a name="l00139"></a>00139 <a class="code" href="classitpp_1_1TCP__Segment.html#ca21e0ca2d17d993f07126bdce7c3903" title="ADD DOCUMENTATION HERE.">TCP_Segment</a>(); |
---|
| 122 | <a name="l00141"></a>00141 <a class="code" href="classitpp_1_1TCP__Segment.html#ca21e0ca2d17d993f07126bdce7c3903" title="ADD DOCUMENTATION HERE.">TCP_Segment</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn_begin, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn_end); |
---|
| 123 | <a name="l00143"></a>00143 <a class="code" href="classitpp_1_1TCP__Segment.html#ca21e0ca2d17d993f07126bdce7c3903" title="ADD DOCUMENTATION HERE.">TCP_Segment</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment); |
---|
| 124 | <a name="l00144"></a>00144 |
---|
| 125 | <a name="l00145"></a>00145 <span class="comment">//modification</span> |
---|
| 126 | <a name="l00147"></a>00147 <span class="comment"></span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &<a class="code" href="classitpp_1_1TCP__Segment.html#549fbf13c3ca7c009da9fefa3bd38054" title="ADD DOCUMENTATION HERE.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment); |
---|
| 127 | <a name="l00149"></a>00149 <span class="keywordtype">void</span> <a class="code" href="group__protocol.html#gdf1e7e6fc51aab68c7c8fa571bf00edd" title="ADD DOCUMENTATION HERE.">set_begin</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn); |
---|
| 128 | <a name="l00151"></a>00151 <span class="keywordtype">void</span> <a class="code" href="group__protocol.html#gcc81e83b9a513142363f6388b1abf9c6" title="ADD DOCUMENTATION HERE.">set_end</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn); |
---|
| 129 | <a name="l00153"></a>00153 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Segment.html#7e7f318913d188634a26389102ff66cb" title="ADD DOCUMENTATION HERE.">combine</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment); |
---|
| 130 | <a name="l00154"></a>00154 |
---|
| 131 | <a name="l00155"></a>00155 <span class="comment">//query</span> |
---|
| 132 | <a name="l00157"></a>00157 <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#g621cc3bc951211d85ea9d01dd0a242e1" title="ADD DOCUMENTATION HERE.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment) <span class="keyword">const</span>; |
---|
| 133 | <a name="l00159"></a>00159 <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#g250e7dff8c2620d37e0181f9145675f0" title="ADD DOCUMENTATION HERE.">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment) <span class="keyword">const</span>; |
---|
| 134 | <a name="l00161"></a>00161 <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#g1dea82fb7b04634cff8e01afa45881f0" title="ADD DOCUMENTATION HERE.">can_be_combined</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment) <span class="keyword">const</span>; |
---|
| 135 | <a name="l00163"></a>00163 <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#geffe232b6370e7d57ec9b28045f83168" title="ADD DOCUMENTATION HERE.">is_contained</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment) <span class="keyword">const</span>; |
---|
| 136 | <a name="l00165"></a>00165 <span class="keywordtype">unsigned</span> <a class="code" href="group__protocol.html#ga582b8271e033fdead7e875e8872936c" title="ADD DOCUMENTATION HERE.">length</a>() <span class="keyword">const</span>; |
---|
| 137 | <a name="l00167"></a><a class="code" href="classitpp_1_1TCP__Segment.html#656bd8f6c297e86df8b6060590f164a5">00167</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Segment.html#656bd8f6c297e86df8b6060590f164a5" title="ADD DOCUMENTATION HERE.">begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>; } |
---|
| 138 | <a name="l00169"></a><a class="code" href="classitpp_1_1TCP__Segment.html#ddbd28a0830ed97af204c28322731be3">00169</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Segment.html#ddbd28a0830ed97af204c28322731be3" title="ADD DOCUMENTATION HERE.">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>; } |
---|
| 139 | <a name="l00170"></a>00170 |
---|
| 140 | <a name="l00172"></a>00172 <span class="keyword">friend</span> std::ostream & <a class="code" href="classitpp_1_1TCP__Segment.html#22c1b8913ce9662f7ded6a242166cbce" title="ADD DOCUMENTATION HERE.">operator<<</a>(std::ostream &os, <span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment); |
---|
| 141 | <a name="l00173"></a>00173 |
---|
| 142 | <a name="l00174"></a>00174 <span class="keyword">protected</span>: |
---|
| 143 | <a name="l00175"></a><a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778">00175</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>; |
---|
| 144 | <a name="l00176"></a><a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974">00176</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>; |
---|
| 145 | <a name="l00177"></a>00177 }; |
---|
| 146 | <a name="l00178"></a>00178 |
---|
| 147 | <a name="l00179"></a>00179 |
---|
| 148 | <a name="l00201"></a><a class="code" href="classitpp_1_1TCP__Packet.html">00201</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> : <span class="keyword">public</span> itpp::<a class="code" href="classitpp_1_1Packet.html">Packet</a> |
---|
| 149 | <a name="l00202"></a>00202 { |
---|
| 150 | <a name="l00203"></a>00203 <span class="keyword">public</span>: |
---|
| 151 | <a name="l00205"></a>00205 <a class="code" href="classitpp_1_1TCP__Packet.html#b40a8e2c4f9793f4e21bf25d50d05263" title="ADD DOCUMENTATION HERE.">TCP_Packet</a>(); |
---|
| 152 | <a name="l00207"></a>00207 <a class="code" href="classitpp_1_1TCP__Packet.html#b40a8e2c4f9793f4e21bf25d50d05263" title="ADD DOCUMENTATION HERE.">TCP_Packet</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> &packet); |
---|
| 153 | <a name="l00209"></a>00209 <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1TCP__Packet.html#0d15e5fdca8dbbc71079bc1f78e68244" title="ADD DOCUMENTATION HERE.">~TCP_Packet</a>(); |
---|
| 154 | <a name="l00211"></a>00211 <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> &<a class="code" href="classitpp_1_1TCP__Packet.html#36022f7549182aef626bf3197b321e75" title="ADD DOCUMENTATION HERE.">clone</a>() <span class="keyword">const</span>; |
---|
| 155 | <a name="l00212"></a>00212 |
---|
| 156 | <a name="l00213"></a>00213 <span class="comment">//TCP window mechanism</span> |
---|
| 157 | <a name="l00215"></a><a class="code" href="classitpp_1_1TCP__Packet.html#0a5a0f704dd7233180dcb8ea4fb1a7ce">00215</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#0a5a0f704dd7233180dcb8ea4fb1a7ce" title="ADD DOCUMENTATION HERE.">set_segment</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &seg) { <a class="code" href="classitpp_1_1TCP__Packet.html#50299d45bfb880e05291bbf0a10f2d8d" title="data segment to be transmitted">fSegment</a> = seg; } |
---|
| 158 | <a name="l00217"></a><a class="code" href="classitpp_1_1TCP__Packet.html#038d2d8e51614d84235b1dc6077ccaff">00217</a> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> <a class="code" href="classitpp_1_1TCP__Packet.html#038d2d8e51614d84235b1dc6077ccaff" title="ADD DOCUMENTATION HERE.">get_segment</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Packet.html#50299d45bfb880e05291bbf0a10f2d8d" title="data segment to be transmitted">fSegment</a>; } |
---|
| 159 | <a name="l00219"></a><a class="code" href="classitpp_1_1TCP__Packet.html#b2753bb7fc242bb3e1895fc415bf7ac7">00219</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#b2753bb7fc242bb3e1895fc415bf7ac7" title="ADD DOCUMENTATION HERE.">set_wnd</a>(<span class="keywordtype">unsigned</span> val) { <a class="code" href="classitpp_1_1TCP__Packet.html#5ed0e92aae1f436f809490d7865ca974" title="window size (advertised by receiver)">fWnd</a> = val; } |
---|
| 160 | <a name="l00221"></a><a class="code" href="classitpp_1_1TCP__Packet.html#353d296dc7b9b0cf7ba78880f3d9a640">00221</a> <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Packet.html#353d296dc7b9b0cf7ba78880f3d9a640" title="ADD DOCUMENTATION HERE.">get_wnd</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Packet.html#5ed0e92aae1f436f809490d7865ca974" title="window size (advertised by receiver)">fWnd</a>; } |
---|
| 161 | <a name="l00223"></a><a class="code" href="classitpp_1_1TCP__Packet.html#abf35d145fda5dfb16df7ca1667694c3">00223</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#abf35d145fda5dfb16df7ca1667694c3" title="ADD DOCUMENTATION HERE.">set_ACK</a>(<a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> val) { <a class="code" href="classitpp_1_1TCP__Packet.html#f85ab6089bd4e91f25fd717c308108f6" title="acknowledgment (next expected sn)">fACK</a> = val; } |
---|
| 162 | <a name="l00225"></a><a class="code" href="classitpp_1_1TCP__Packet.html#c886ced3c75bf5b443fa65bc2a32181c">00225</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Packet.html#c886ced3c75bf5b443fa65bc2a32181c" title="ADD DOCUMENTATION HERE.">get_ACK</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Packet.html#f85ab6089bd4e91f25fd717c308108f6" title="acknowledgment (next expected sn)">fACK</a>; } |
---|
| 163 | <a name="l00226"></a>00226 |
---|
| 164 | <a name="l00227"></a>00227 <span class="comment">//session control</span> |
---|
| 165 | <a name="l00229"></a><a class="code" href="classitpp_1_1TCP__Packet.html#ace73245d812e815d3247041f159cae1">00229</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#ace73245d812e815d3247041f159cae1" title="ADD DOCUMENTATION HERE.">set_session_id</a>(<span class="keywordtype">int</span> val) { <a class="code" href="classitpp_1_1TCP__Packet.html#2776b4ccba30e29c90d61e2c63dbdfc1" title="session identifier">fSessionId</a> = val; } |
---|
| 166 | <a name="l00231"></a><a class="code" href="classitpp_1_1TCP__Packet.html#2a5f4222176104378bd40868b3ee75ee">00231</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1TCP__Packet.html#2a5f4222176104378bd40868b3ee75ee" title="ADD DOCUMENTATION HERE.">get_session_id</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Packet.html#2776b4ccba30e29c90d61e2c63dbdfc1" title="session identifier">fSessionId</a>; } |
---|
| 167 | <a name="l00232"></a>00232 |
---|
| 168 | <a name="l00233"></a>00233 <span class="comment">//debugging support</span> |
---|
| 169 | <a name="l00235"></a><a class="code" href="classitpp_1_1TCP__Packet.html#7b4eb9df2053bd36df2c9c9a20675bd0">00235</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#7b4eb9df2053bd36df2c9c9a20675bd0" title="ADD DOCUMENTATION HERE.">set_destination_port</a>(<span class="keywordtype">unsigned</span> val) { <a class="code" href="classitpp_1_1TCP__Packet.html#992fb1614e72d6389f917423379b1bbf" title="ADD DOCUMENTATION HERE.">fDestinationPort</a> = val; } |
---|
| 170 | <a name="l00237"></a><a class="code" href="classitpp_1_1TCP__Packet.html#88ea751e629d3cb9f49b1d049c97cd2d">00237</a> <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Packet.html#88ea751e629d3cb9f49b1d049c97cd2d" title="ADD DOCUMENTATION HERE.">get_destination_port</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Packet.html#992fb1614e72d6389f917423379b1bbf" title="ADD DOCUMENTATION HERE.">fDestinationPort</a>; } |
---|
| 171 | <a name="l00239"></a><a class="code" href="classitpp_1_1TCP__Packet.html#d149c6f1189fa2c3e32a9f141c53e489">00239</a> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#d149c6f1189fa2c3e32a9f141c53e489" title="ADD DOCUMENTATION HERE.">set_source_port</a>(<span class="keywordtype">unsigned</span> val) { <a class="code" href="classitpp_1_1TCP__Packet.html#d5639fb1e064b005cb81d24367035b67" title="ADD DOCUMENTATION HERE.">fSourcePort</a> = val; } |
---|
| 172 | <a name="l00241"></a><a class="code" href="classitpp_1_1TCP__Packet.html#25d8113dbaa3736e9d546942c7fe20ee">00241</a> <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Packet.html#25d8113dbaa3736e9d546942c7fe20ee" title="ADD DOCUMENTATION HERE.">get_source_port</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Packet.html#d5639fb1e064b005cb81d24367035b67" title="ADD DOCUMENTATION HERE.">fSourcePort</a>; } |
---|
| 173 | <a name="l00243"></a>00243 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#ba382815eddcd7e36229427165cd2ec1" title="ADD DOCUMENTATION HERE.">set_info</a>(<span class="keywordtype">unsigned</span> ssThresh, <span class="keywordtype">unsigned</span> recWnd, <span class="keywordtype">unsigned</span> cWnd, <span class="keywordtype">double</span> estRTT, <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> sndUna, <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> sndNxt, <span class="keywordtype">bool</span> isRtx); |
---|
| 174 | <a name="l00245"></a>00245 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Packet.html#3391d701238845916e03acd60c94a93a" title="ADD DOCUMENTATION HERE.">print_header</a>(std::ostream &) <span class="keyword">const</span>; |
---|
| 175 | <a name="l00246"></a>00246 |
---|
| 176 | <a name="l00247"></a>00247 <span class="keyword">protected</span>: |
---|
| 177 | <a name="l00249"></a><a class="code" href="classitpp_1_1TCP__Packet.html#992fb1614e72d6389f917423379b1bbf">00249</a> <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Packet.html#992fb1614e72d6389f917423379b1bbf" title="ADD DOCUMENTATION HERE.">fDestinationPort</a>; |
---|
| 178 | <a name="l00251"></a><a class="code" href="classitpp_1_1TCP__Packet.html#d5639fb1e064b005cb81d24367035b67">00251</a> <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Packet.html#d5639fb1e064b005cb81d24367035b67" title="ADD DOCUMENTATION HERE.">fSourcePort</a>; |
---|
| 179 | <a name="l00252"></a>00252 |
---|
| 180 | <a name="l00253"></a><a class="code" href="classitpp_1_1TCP__Packet.html#50299d45bfb880e05291bbf0a10f2d8d">00253</a> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> <a class="code" href="classitpp_1_1TCP__Packet.html#50299d45bfb880e05291bbf0a10f2d8d" title="data segment to be transmitted">fSegment</a>; |
---|
| 181 | <a name="l00254"></a><a class="code" href="classitpp_1_1TCP__Packet.html#f85ab6089bd4e91f25fd717c308108f6">00254</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Packet.html#f85ab6089bd4e91f25fd717c308108f6" title="acknowledgment (next expected sn)">fACK</a>; |
---|
| 182 | <a name="l00255"></a><a class="code" href="classitpp_1_1TCP__Packet.html#5ed0e92aae1f436f809490d7865ca974">00255</a> <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Packet.html#5ed0e92aae1f436f809490d7865ca974" title="window size (advertised by receiver)">fWnd</a>; |
---|
| 183 | <a name="l00256"></a><a class="code" href="classitpp_1_1TCP__Packet.html#2776b4ccba30e29c90d61e2c63dbdfc1">00256</a> <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1TCP__Packet.html#2776b4ccba30e29c90d61e2c63dbdfc1" title="session identifier">fSessionId</a>; |
---|
| 184 | <a name="l00258"></a>00258 <span class="comment">//Tracing</span> |
---|
| 185 | <a name="l00259"></a>00259 |
---|
| 186 | <a name="l00261"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html">00261</a> <span class="keyword">struct </span><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html" title="ADD DOCUMENTATION HERE.">TDebugInfo</a> { |
---|
| 187 | <a name="l00262"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#ba4312509f979f1a897d2c3cbfb3b435">00262</a> <span class="keywordtype">unsigned</span> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#ba4312509f979f1a897d2c3cbfb3b435" title="ADD DOCUMENTATION HERE.">fSSThresh</a>; |
---|
| 188 | <a name="l00263"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#436d52192edc5eabd66b0555175f8ff2">00263</a> <span class="keywordtype">unsigned</span> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#436d52192edc5eabd66b0555175f8ff2" title="ADD DOCUMENTATION HERE.">fRecWnd</a>; |
---|
| 189 | <a name="l00264"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#cd67799b801c2e92e30fd79c57a58533">00264</a> <span class="keywordtype">unsigned</span> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#cd67799b801c2e92e30fd79c57a58533" title="ADD DOCUMENTATION HERE.">fCWnd</a>; |
---|
| 190 | <a name="l00265"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#c00c9c71daf9404c6346123425d641f2">00265</a> <span class="keywordtype">double</span> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#c00c9c71daf9404c6346123425d641f2" title="ADD DOCUMENTATION HERE.">fRTTEstimate</a>; |
---|
| 191 | <a name="l00266"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#7a40d11fba4df24ff80e6e2292499d67">00266</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#7a40d11fba4df24ff80e6e2292499d67" title="ADD DOCUMENTATION HERE.">fSndUna</a>; |
---|
| 192 | <a name="l00267"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#e22f4b3afd9738ffbfa35b1f09f0d0f9">00267</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#e22f4b3afd9738ffbfa35b1f09f0d0f9" title="ADD DOCUMENTATION HERE.">fSndNxt</a>; |
---|
| 193 | <a name="l00268"></a><a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#aefc6c7e86535061cfb21ceb04a88e06">00268</a> <span class="keywordtype">bool</span> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html#aefc6c7e86535061cfb21ceb04a88e06" title="ADD DOCUMENTATION HERE.">fRtxFlag</a>; |
---|
| 194 | <a name="l00269"></a>00269 }; |
---|
| 195 | <a name="l00270"></a>00270 |
---|
| 196 | <a name="l00272"></a><a class="code" href="classitpp_1_1TCP__Packet.html#598e39cbbfa6f55a0a5e2ab48c78d6b9">00272</a> <a class="code" href="structitpp_1_1TCP__Packet_1_1TDebugInfo.html" title="ADD DOCUMENTATION HERE.">TDebugInfo</a> *<a class="code" href="classitpp_1_1TCP__Packet.html#598e39cbbfa6f55a0a5e2ab48c78d6b9" title="ADD DOCUMENTATION HERE.">fInfo</a>; |
---|
| 197 | <a name="l00273"></a>00273 |
---|
| 198 | <a name="l00275"></a>00275 <span class="keyword">friend</span> std::ostream & <a class="code" href="classitpp_1_1TCP__Packet.html#aacdd69a92b18940bad95a4d08f789cf" title="ADD DOCUMENTATION HERE.">operator<<</a>(std::ostream &, <a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> &); |
---|
| 199 | <a name="l00276"></a>00276 }; |
---|
| 200 | <a name="l00277"></a>00277 |
---|
| 201 | <a name="l00278"></a>00278 |
---|
| 202 | <a name="l00313"></a><a class="code" href="classitpp_1_1TCP__Sender.html">00313</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1TCP__Sender.html">TCP_Sender</a> |
---|
| 203 | <a name="l00314"></a>00314 { |
---|
| 204 | <a name="l00315"></a>00315 <span class="keyword">public</span>: |
---|
| 205 | <a name="l00317"></a>00317 <a class="code" href="classitpp_1_1TCP__Sender.html#1efb7fa4a28bcb306c828a0bccc1ee2e" title="ADD DOCUMENTATION HERE.">TCP_Sender</a>(<span class="keywordtype">int</span> label); |
---|
| 206 | <a name="l00318"></a>00318 |
---|
| 207 | <a name="l00320"></a>00320 <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1TCP__Sender.html#978a2f60b478d41f382af74dd2a9c8bd" title="ADD DOCUMENTATION HERE.">~TCP_Sender</a>(); |
---|
| 208 | <a name="l00321"></a>00321 |
---|
| 209 | <a name="l00322"></a>00322 <span class="comment">//connection control</span> |
---|
| 210 | <a name="l00324"></a>00324 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#b2149c496426d2b72b00956bb1d3cfbb" title="ADD DOCUMENTATION HERE.">setup</a>(); |
---|
| 211 | <a name="l00326"></a>00326 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#2cd17485375e55996c8e4c617c67dcb1" title="ADD DOCUMENTATION HERE.">release</a>(std::string trace_filename = <span class="stringliteral">""</span>); |
---|
| 212 | <a name="l00327"></a>00327 |
---|
| 213 | <a name="l00329"></a>00329 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#d1bcc3e0c49093f08994452246e73fd4" title="Print support.">print_item</a>(std::ostream &, <span class="keyword">const</span> std::string &); |
---|
| 214 | <a name="l00330"></a>00330 |
---|
| 215 | <a name="l00332"></a>00332 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#c51165b900333fd243b453ae86984c3b" title="ADD DOCUMENTATION HERE.">set_debug</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> enable_debug = <span class="keyword">true</span>); |
---|
| 216 | <a name="l00334"></a>00334 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#c51165b900333fd243b453ae86984c3b" title="ADD DOCUMENTATION HERE.">set_debug</a>(<span class="keywordtype">bool</span> enable_debug, <span class="keywordtype">bool</span> enable_signal_debug); |
---|
| 217 | <a name="l00336"></a>00336 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#1f5a13675928a288ce736363ce9bdf2c" title="ADD DOCUMENTATION HERE.">set_trace</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> enable_trace = <span class="keyword">true</span>); |
---|
| 218 | <a name="l00338"></a>00338 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Sender.html#dfd8ed5e8e46cf481d99784a03538d63" title="ADD DOCUMENTATION HERE.">save_trace</a>(std::string filename); |
---|
| 219 | <a name="l00339"></a>00339 |
---|
| 220 | <a name="l00341"></a><a class="code" href="classitpp_1_1TCP__Sender.html#c78143630d62c965192299a86893f92c">00341</a> <a class="code" href="classitpp_1_1Signal.html">Signal<itpp::Packet*></a> <a class="code" href="classitpp_1_1TCP__Sender.html#c78143630d62c965192299a86893f92c" title="ADD DOCUMENTATION HERE.">tcp_send</a>; |
---|
| 221 | <a name="l00343"></a><a class="code" href="classitpp_1_1TCP__Sender.html#4ee84caca57541e168259a09d6be5a3a">00343</a> <a class="code" href="classitpp_1_1Slot.html">Slot<TCP_Sender, itpp::Packet*></a> <a class="code" href="classitpp_1_1TCP__Sender.html#4ee84caca57541e168259a09d6be5a3a" title="ADD DOCUMENTATION HERE.">tcp_receive_ack</a>; |
---|
| 222 | <a name="l00345"></a><a class="code" href="classitpp_1_1TCP__Sender.html#8ea6b37f1515de6ad3de75095cd8a781">00345</a> <a class="code" href="classitpp_1_1Slot.html">Slot<TCP_Sender, itpp::Packet*></a> <a class="code" href="classitpp_1_1TCP__Sender.html#8ea6b37f1515de6ad3de75095cd8a781" title="ADD DOCUMENTATION HERE.">tcp_socket_write</a>; |
---|
| 223 | <a name="l00347"></a><a class="code" href="classitpp_1_1TCP__Sender.html#4873bed02d114fa31df7384152a7f1a5">00347</a> <a class="code" href="classitpp_1_1Slot.html">Slot<TCP_Sender, std::string></a> <a class="code" href="classitpp_1_1TCP__Sender.html#4873bed02d114fa31df7384152a7f1a5" title="ADD DOCUMENTATION HERE.">tcp_release</a>; |
---|
| 224 | <a name="l00348"></a>00348 |
---|
| 225 | <a name="l00349"></a>00349 |
---|
| 226 | <a name="l00350"></a>00350 <span class="comment">//Signal<itpp::Packet*> TcpSendSignal;</span> |
---|
| 227 | <a name="l00351"></a>00351 <span class="comment">//Slot<TCP_Sender, itpp::Packet*> TcpRecvAckSlot;</span> |
---|
| 228 | <a name="l00352"></a>00352 <span class="comment">//Slot<TCP_Sender, itpp::Packet*> SocketWriteSlot;</span> |
---|
| 229 | <a name="l00353"></a>00353 <span class="comment">//Slot<TCP_Sender, string> ReleaseSlot;</span> |
---|
| 230 | <a name="l00354"></a>00354 |
---|
| 231 | <a name="l00355"></a>00355 <span class="keyword">private</span>: |
---|
| 232 | <a name="l00356"></a>00356 std::queue<itpp::Packet*> SocketWriteQueue; |
---|
| 233 | <a name="l00357"></a>00357 |
---|
| 234 | <a name="l00358"></a>00358 <span class="keyword">virtual</span> <span class="keywordtype">void</span> InitStatistics(); |
---|
| 235 | <a name="l00359"></a>00359 <span class="keyword">virtual</span> <span class="keywordtype">void</span> HandleACK(<a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> &); |
---|
| 236 | <a name="l00360"></a>00360 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SendNewData(<span class="keywordtype">bool</span> skipSWSA = <span class="keyword">false</span>); |
---|
| 237 | <a name="l00361"></a>00361 <span class="keyword">virtual</span> <span class="keywordtype">void</span> UnaRetransmit(); |
---|
| 238 | <a name="l00362"></a>00362 <span class="keyword">virtual</span> <span class="keywordtype">void</span> FinishFastRecovery(); |
---|
| 239 | <a name="l00363"></a>00363 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ReduceSSThresh(); |
---|
| 240 | <a name="l00364"></a>00364 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SendMsg(<a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> & msg); |
---|
| 241 | <a name="l00365"></a>00365 <span class="keyword">virtual</span> <span class="keywordtype">void</span> HandleRtxTimeout(<a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a>); |
---|
| 242 | <a name="l00366"></a>00366 <span class="keyword">virtual</span> <span class="keywordtype">void</span> IdleCheck(); |
---|
| 243 | <a name="l00367"></a>00367 <span class="keyword">virtual</span> <span class="keywordtype">void</span> HandleSWSATimeout(<a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a>); |
---|
| 244 | <a name="l00368"></a>00368 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> GetNextSegmentSize(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> & begin); |
---|
| 245 | <a name="l00369"></a>00369 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> SendWindow() <span class="keyword">const</span>; |
---|
| 246 | <a name="l00370"></a>00370 <span class="keyword">virtual</span> <span class="keywordtype">double</span> CalcRTOValue() <span class="keyword">const</span>; |
---|
| 247 | <a name="l00371"></a>00371 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetRtxTimer(); |
---|
| 248 | <a name="l00372"></a>00372 <span class="keyword">virtual</span> <span class="keywordtype">void</span> UpdateRTTVariables(<span class="keywordtype">double</span> sampleRTT); |
---|
| 249 | <a name="l00373"></a>00373 <span class="keyword">virtual</span> <span class="keywordtype">void</span> TraceCWnd(); |
---|
| 250 | <a name="l00374"></a>00374 <span class="keyword">virtual</span> <span class="keywordtype">void</span> TraceSentSeqNo(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> sn); |
---|
| 251 | <a name="l00375"></a>00375 <span class="keyword">virtual</span> <span class="keywordtype">void</span> TraceACKedSeqNo(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> sn); |
---|
| 252 | <a name="l00376"></a>00376 <span class="keyword">virtual</span> <span class="keywordtype">void</span> TraceRTTVariables(<span class="keywordtype">double</span> sampleRTT); |
---|
| 253 | <a name="l00377"></a>00377 <span class="keyword">virtual</span> <span class="keywordtype">void</span> TraceSSThresh(); |
---|
| 254 | <a name="l00378"></a>00378 <span class="keyword">virtual</span> std::string GenerateFilename(); |
---|
| 255 | <a name="l00379"></a>00379 |
---|
| 256 | <a name="l00380"></a>00380 <span class="keywordtype">void</span> StopTransientPhase(); |
---|
| 257 | <a name="l00382"></a>00382 <span class="keyword">enum</span> eTCPVersion {kTahoe, kReno, kNewReno}; |
---|
| 258 | <a name="l00383"></a>00383 |
---|
| 259 | <a name="l00384"></a>00384 <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_label(<span class="keywordtype">int</span> label); |
---|
| 260 | <a name="l00385"></a>00385 |
---|
| 261 | <a name="l00386"></a>00386 <span class="comment">//socket variables</span> |
---|
| 262 | <a name="l00387"></a>00387 <span class="keywordtype">unsigned</span> fLabel; <span class="comment">// end point identification also used at receiver</span> |
---|
| 263 | <a name="l00388"></a>00388 |
---|
| 264 | <a name="l00389"></a>00389 <span class="comment">//message handling</span> |
---|
| 265 | <a name="l00390"></a>00390 <span class="keyword">virtual</span> <span class="keywordtype">void</span> HandleUserMessageIndication(<a class="code" href="classitpp_1_1Packet.html">itpp::Packet</a> *user_data); |
---|
| 266 | <a name="l00391"></a>00391 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ReceiveMessageFromNet(<a class="code" href="classitpp_1_1Packet.html">itpp::Packet</a> *msg); |
---|
| 267 | <a name="l00392"></a>00392 |
---|
| 268 | <a name="l00393"></a>00393 <span class="comment">//parameters parsed from input file</span> |
---|
| 269 | <a name="l00394"></a>00394 eTCPVersion fTCPVersion; <span class="comment">// one of Reno, Tahoe, NewReno</span> |
---|
| 270 | <a name="l00395"></a>00395 <span class="keywordtype">unsigned</span> fMSS; <span class="comment">// maximum segment size</span> |
---|
| 271 | <a name="l00396"></a>00396 <span class="keywordtype">unsigned</span> fTCPIPHeaderLength; |
---|
| 272 | <a name="l00397"></a>00397 <span class="keywordtype">double</span> fInitialRTT; |
---|
| 273 | <a name="l00398"></a>00398 <span class="keywordtype">unsigned</span> fInitialCWnd; |
---|
| 274 | <a name="l00399"></a>00399 <span class="keywordtype">unsigned</span> fInitialSSThresh; |
---|
| 275 | <a name="l00400"></a>00400 <span class="keywordtype">unsigned</span> fMaxCWnd; |
---|
| 276 | <a name="l00401"></a>00401 <span class="keywordtype">unsigned</span> fDupACKThreshold; |
---|
| 277 | <a name="l00402"></a>00402 <span class="keywordtype">double</span> fTimerGranularity; |
---|
| 278 | <a name="l00403"></a>00403 <span class="keywordtype">double</span> fMaxRTO; <span class="comment">// max value of retransmission TO</span> |
---|
| 279 | <a name="l00404"></a>00404 <span class="keywordtype">unsigned</span> fMaxBackoff; |
---|
| 280 | <a name="l00405"></a>00405 <span class="keywordtype">bool</span> fImmediateBackoffReset; |
---|
| 281 | <a name="l00406"></a>00406 <span class="keywordtype">bool</span> fKarn; |
---|
| 282 | <a name="l00407"></a>00407 <span class="keywordtype">bool</span> fGoBackN; |
---|
| 283 | <a name="l00408"></a>00408 <span class="keywordtype">bool</span> fFlightSizeRecovery;<span class="comment">// use flight size on fast rec. exit</span> |
---|
| 284 | <a name="l00409"></a>00409 <span class="keywordtype">bool</span> fRenoConservation; |
---|
| 285 | <a name="l00410"></a>00410 <span class="keywordtype">bool</span> fCarefulSSThreshReduction; |
---|
| 286 | <a name="l00411"></a>00411 <span class="keywordtype">bool</span> fIgnoreDupACKOnTORecovery; |
---|
| 287 | <a name="l00412"></a>00412 <span class="keywordtype">bool</span> fCarefulMulFastRtxAvoidance; |
---|
| 288 | <a name="l00413"></a>00413 <span class="keywordtype">bool</span> fNagle; |
---|
| 289 | <a name="l00414"></a>00414 <span class="keywordtype">double</span> fSWSATimerValue; |
---|
| 290 | <a name="l00415"></a>00415 <span class="keywordtype">bool</span> fRestartAfterIdle; |
---|
| 291 | <a name="l00416"></a>00416 <span class="keywordtype">bool</span> fTraceCWnd; <span class="comment">// print CWnd trace to cout</span> |
---|
| 292 | <a name="l00417"></a>00417 <span class="keywordtype">bool</span> fTraceSentSeqNo; |
---|
| 293 | <a name="l00418"></a>00418 <span class="keywordtype">bool</span> fTraceACKedSeqNo; |
---|
| 294 | <a name="l00419"></a>00419 <span class="keywordtype">bool</span> fDebug; <span class="comment">// print additional information to cout</span> |
---|
| 295 | <a name="l00420"></a>00420 <span class="keywordtype">bool</span> fTrace; <span class="comment">// store trace info in vectors</span> |
---|
| 296 | <a name="l00421"></a>00421 |
---|
| 297 | <a name="l00422"></a>00422 <span class="comment">//session identification</span> |
---|
| 298 | <a name="l00423"></a>00423 <span class="keywordtype">int</span> fSessionId; |
---|
| 299 | <a name="l00425"></a>00425 <span class="comment">//TCP flow control (RFC 793)</span> |
---|
| 300 | <a name="l00426"></a>00426 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fSndUna; <span class="comment">// lowest unacknowledged sn</span> |
---|
| 301 | <a name="l00427"></a>00427 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fSndNxt; <span class="comment">// next byte to be sent</span> |
---|
| 302 | <a name="l00428"></a>00428 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fSndMax; |
---|
| 303 | <a name="l00429"></a>00429 <span class="keywordtype">unsigned</span> fRecWnd; <span class="comment">// receiver advertised window</span> |
---|
| 304 | <a name="l00430"></a>00430 <span class="keywordtype">unsigned</span> fMaxRecWnd; |
---|
| 305 | <a name="l00431"></a>00431 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fUserNxt; <span class="comment">// next byte to be received from user</span> |
---|
| 306 | <a name="l00432"></a>00432 |
---|
| 307 | <a name="l00433"></a>00433 <span class="comment">//TCP congestion avoidance (RFC 2581, RFC 2001, RFC 2582)</span> |
---|
| 308 | <a name="l00434"></a>00434 <span class="keywordtype">unsigned</span> fCWnd; <span class="comment">// congestion window</span> |
---|
| 309 | <a name="l00435"></a>00435 <span class="keywordtype">unsigned</span> fSSThresh; |
---|
| 310 | <a name="l00436"></a>00436 <span class="keywordtype">unsigned</span> fDupACKCnt; |
---|
| 311 | <a name="l00437"></a>00437 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fRecoveryDupACK; |
---|
| 312 | <a name="l00438"></a>00438 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fRecoveryTO; |
---|
| 313 | <a name="l00440"></a>00440 <span class="comment">//TCP timers</span> |
---|
| 314 | <a name="l00441"></a>00441 <a class="code" href="classitpp_1_1TTimer.html">TTimer<TCP_Sender></a> fRtxTimer; |
---|
| 315 | <a name="l00442"></a>00442 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fTimUna; |
---|
| 316 | <a name="l00443"></a>00443 <a class="code" href="classitpp_1_1TTimer.html">TTimer<TCP_Sender></a> fSWSATimer; |
---|
| 317 | <a name="l00444"></a>00444 <span class="keywordtype">int</span> fBackoff; |
---|
| 318 | <a name="l00445"></a>00445 <span class="keywordtype">bool</span> fPendingBackoffReset; |
---|
| 319 | <a name="l00446"></a>00446 <a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a> fLastSendTime; |
---|
| 320 | <a name="l00448"></a>00448 <span class="comment">//round trip time measurement (RTTM)</span> |
---|
| 321 | <a name="l00449"></a>00449 <span class="keywordtype">double</span> fSRTT; |
---|
| 322 | <a name="l00450"></a>00450 <span class="keywordtype">double</span> fRTTVar; |
---|
| 323 | <a name="l00451"></a>00451 <span class="keywordtype">double</span> fRTTEstimate; |
---|
| 324 | <a name="l00452"></a>00452 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fRTTMByte; |
---|
| 325 | <a name="l00453"></a>00453 <span class="keywordtype">bool</span> fRTTMPending; |
---|
| 326 | <a name="l00454"></a>00454 <span class="keywordtype">double</span> fRTTMStartTime; |
---|
| 327 | <a name="l00456"></a>00456 <span class="comment">//statistic counters</span> |
---|
| 328 | <a name="l00457"></a>00457 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> fNumberOfTimeouts; |
---|
| 329 | <a name="l00458"></a>00458 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> fNumberOfFastRetransmits; |
---|
| 330 | <a name="l00459"></a>00459 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> fNumberOfRTTMeasurements; |
---|
| 331 | <a name="l00460"></a>00460 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> fNumberOfReceivedACKs; |
---|
| 332 | <a name="l00461"></a>00461 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> fNumberOfIdleTimeouts; |
---|
| 333 | <a name="l00462"></a>00462 |
---|
| 334 | <a name="l00463"></a>00463 vec CWnd_val; |
---|
| 335 | <a name="l00464"></a>00464 vec CWnd_time; |
---|
| 336 | <a name="l00465"></a>00465 <span class="keywordtype">int</span> CWnd_index; |
---|
| 337 | <a name="l00466"></a>00466 |
---|
| 338 | <a name="l00467"></a>00467 vec SSThresh_val; |
---|
| 339 | <a name="l00468"></a>00468 vec SSThresh_time; |
---|
| 340 | <a name="l00469"></a>00469 <span class="keywordtype">int</span> SSThresh_index; |
---|
| 341 | <a name="l00470"></a>00470 |
---|
| 342 | <a name="l00471"></a>00471 ivec sent_seq_num_val; |
---|
| 343 | <a name="l00472"></a>00472 vec sent_seq_num_time; |
---|
| 344 | <a name="l00473"></a>00473 <span class="keywordtype">int</span> sent_seq_num_index; |
---|
| 345 | <a name="l00474"></a>00474 |
---|
| 346 | <a name="l00475"></a>00475 ivec sender_recv_ack_seq_num_val; |
---|
| 347 | <a name="l00476"></a>00476 vec sender_recv_ack_seq_num_time; |
---|
| 348 | <a name="l00477"></a>00477 <span class="keywordtype">int</span> sender_recv_ack_seq_num_index; |
---|
| 349 | <a name="l00478"></a>00478 |
---|
| 350 | <a name="l00479"></a>00479 vec RTTEstimate_val; |
---|
| 351 | <a name="l00480"></a>00480 vec RTTEstimate_time; |
---|
| 352 | <a name="l00481"></a>00481 <span class="keywordtype">int</span> RTTEstimate_index; |
---|
| 353 | <a name="l00482"></a>00482 |
---|
| 354 | <a name="l00483"></a>00483 vec RTTsample_val; |
---|
| 355 | <a name="l00484"></a>00484 vec RTTsample_time; |
---|
| 356 | <a name="l00485"></a>00485 <span class="keywordtype">int</span> RTTsample_index; |
---|
| 357 | <a name="l00486"></a>00486 }; |
---|
| 358 | <a name="l00487"></a>00487 |
---|
| 359 | <a name="l00488"></a>00488 |
---|
| 360 | <a name="l00509"></a><a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html">00509</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html">TCP_Receiver_Buffer</a> |
---|
| 361 | <a name="l00510"></a>00510 { |
---|
| 362 | <a name="l00511"></a>00511 <span class="keyword">public</span>: |
---|
| 363 | <a name="l00513"></a>00513 <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#59342d3b7bfea3d39c6e8250f3655c77" title="ADD DOCUMENTATION HERE.">TCP_Receiver_Buffer</a>(); |
---|
| 364 | <a name="l00515"></a>00515 <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#59342d3b7bfea3d39c6e8250f3655c77" title="ADD DOCUMENTATION HERE.">TCP_Receiver_Buffer</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html">TCP_Receiver_Buffer</a> &); |
---|
| 365 | <a name="l00517"></a>00517 <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#769ffd3c7e2100898d2a1ea2916a3011" title="ADD DOCUMENTATION HERE.">~TCP_Receiver_Buffer</a>(); |
---|
| 366 | <a name="l00518"></a>00518 |
---|
| 367 | <a name="l00519"></a>00519 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#f13e62167676e2041919162c46f45e70" title="clears internal list structure">reset</a>(); |
---|
| 368 | <a name="l00521"></a>00521 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#f7047da0b210859f97482fbb8610c9eb" title="add segment to the queue">write</a>(<a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> newBlock); |
---|
| 369 | <a name="l00522"></a>00522 <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#32afd95a20f00d16654eb246f11c1e76" title="read up to &quot;noOfBytes&quot; bytes from queue">read</a>(<span class="keywordtype">unsigned</span> noOfBytes); |
---|
| 370 | <a name="l00524"></a>00524 <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#c1506205ce876c839d4c477cf29c0d28" title="size of first complete block">first_block_size</a>() <span class="keyword">const</span>; |
---|
| 371 | <a name="l00525"></a>00525 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="group__protocol.html#g9c64cbc6c944a611a7bc1946db93082e" title="first byte stored or missing">first_byte</a>() <span class="keyword">const</span>; |
---|
| 372 | <a name="l00526"></a>00526 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="group__protocol.html#gcfed25ee9a35dcd9860eb817dac466b4" title="highest byte received (+1)">last_byte</a>() <span class="keyword">const</span>; |
---|
| 373 | <a name="l00527"></a>00527 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="group__protocol.html#g516a93b62f601031d00a1bdfb982fd56" title="first byte missing">next_expected</a>() <span class="keyword">const</span>; |
---|
| 374 | <a name="l00528"></a>00528 |
---|
| 375 | <a name="l00529"></a>00529 <span class="keywordtype">unsigned</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#4a901fe92f4513569c337796dd5551d2" title="ADD DOCUMENTATION HERE.">window</a>() <span class="keyword">const</span>; |
---|
| 376 | <a name="l00530"></a>00530 |
---|
| 377 | <a name="l00531"></a>00531 std::ostream &<a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#fba4ad5261d32f0847c398b6d2d367ca" title="print info">info</a>(std::ostream &os, <span class="keywordtype">int</span> detail = 0) <span class="keyword">const</span>; |
---|
| 378 | <a name="l00533"></a>00533 <span class="keyword">protected</span>: |
---|
| 379 | <a name="l00534"></a><a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#44bfe4a22a27117bf7af1384d9d63578">00534</a> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#44bfe4a22a27117bf7af1384d9d63578" title="first byte stored or missing">fFirstByte</a>; |
---|
| 380 | <a name="l00536"></a>00536 |
---|
| 381 | <a name="l00537"></a><a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#ddd625dbb86178976ecb5010f1b0896b">00537</a> std::list <TCP_Segment> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#ddd625dbb86178976ecb5010f1b0896b" title="ADD DOCUMENTATION HERE.">fBufList</a>; |
---|
| 382 | <a name="l00538"></a>00538 }; |
---|
| 383 | <a name="l00539"></a>00539 |
---|
| 384 | <a name="l00540"></a>00540 |
---|
| 385 | <a name="l00541"></a>00541 |
---|
| 386 | <a name="l00542"></a>00542 |
---|
| 387 | <a name="l00572"></a><a class="code" href="classitpp_1_1TCP__Receiver.html">00572</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1TCP__Receiver.html">TCP_Receiver</a> |
---|
| 388 | <a name="l00573"></a>00573 { |
---|
| 389 | <a name="l00574"></a>00574 <span class="keyword">public</span>: |
---|
| 390 | <a name="l00575"></a>00575 |
---|
| 391 | <a name="l00577"></a>00577 <a class="code" href="classitpp_1_1TCP__Receiver.html#292137238c2e689b06b8c2b0c14b92bd" title="ADD DOCUMENTATION HERE.">TCP_Receiver</a>(<span class="keywordtype">int</span> label); |
---|
| 392 | <a name="l00579"></a>00579 <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#a20bc9efb49443cdf8fed3db6ef49bb0" title="ADD DOCUMENTATION HERE.">~TCP_Receiver</a>(); |
---|
| 393 | <a name="l00580"></a>00580 |
---|
| 394 | <a name="l00581"></a>00581 <span class="comment">//name connection control</span> |
---|
| 395 | <a name="l00583"></a>00583 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#2d9c335981c19c627bf6b1978c59a985" title="ADD DOCUMENTATION HERE.">setup</a>(); |
---|
| 396 | <a name="l00585"></a>00585 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#0e3548264fc67ce63780944b8643de2b" title="ADD DOCUMENTATION HERE.">release</a>(std::string trace_filename = <span class="stringliteral">""</span>); |
---|
| 397 | <a name="l00586"></a>00586 |
---|
| 398 | <a name="l00587"></a>00587 <span class="comment">//message handling</span> |
---|
| 399 | <a name="l00588"></a>00588 <a class="code" href="classitpp_1_1Packet.html">itpp::Packet</a> & <a class="code" href="classitpp_1_1TCP__Receiver.html#f0755a2cd71399c37a5a2bf6a12dd42c" title="called by higher layer">get_user_message</a>(); |
---|
| 400 | <a name="l00589"></a>00589 <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#9a9df15130878acd5e75a97a3ee38ed7" title="called by higher layer">is_user_message_available</a>(); |
---|
| 401 | <a name="l00591"></a>00591 |
---|
| 402 | <a name="l00592"></a>00592 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#dc5daf51ba36f4f3b9774b3694681ff3" title="ADD DOCUMENTATION HERE.">set_debug</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> enable_debug = <span class="keyword">true</span>); |
---|
| 403 | <a name="l00594"></a>00594 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#dc5daf51ba36f4f3b9774b3694681ff3" title="ADD DOCUMENTATION HERE.">set_debug</a>(<span class="keywordtype">bool</span> enable_debug, <span class="keywordtype">bool</span> enable_signal_debug); |
---|
| 404 | <a name="l00596"></a>00596 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#d01c2d42ae98e3ea132f9c69a01a0de8" title="ADD DOCUMENTATION HERE.">set_trace</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> enable_trace = <span class="keyword">true</span>); |
---|
| 405 | <a name="l00598"></a>00598 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1TCP__Receiver.html#805fabf64f55f705d7d119db95d204e8" title="ADD DOCUMENTATION HERE.">save_trace</a>(std::string filename); |
---|
| 406 | <a name="l00599"></a>00599 |
---|
| 407 | <a name="l00601"></a><a class="code" href="classitpp_1_1TCP__Receiver.html#2b440d09349a194f4bf943da9634f7c7">00601</a> <a class="code" href="classitpp_1_1Signal.html">Signal<itpp::Packet*></a> <a class="code" href="classitpp_1_1TCP__Receiver.html#2b440d09349a194f4bf943da9634f7c7" title="ADD DOCUMENTATION HERE.">tcp_send_ack</a>; |
---|
| 408 | <a name="l00603"></a><a class="code" href="classitpp_1_1TCP__Receiver.html#5bf494bcd08ad86837e22f83877fb59a">00603</a> <a class="code" href="classitpp_1_1Slot.html">Slot<TCP_Receiver, itpp::Packet*></a> <a class="code" href="classitpp_1_1TCP__Receiver.html#5bf494bcd08ad86837e22f83877fb59a" title="ADD DOCUMENTATION HERE.">tcp_receive</a>; |
---|
| 409 | <a name="l00604"></a><a class="code" href="classitpp_1_1TCP__Receiver.html#bbab0658b36792c135ed6c32e23ea40b">00604</a> <a class="code" href="classitpp_1_1Signal.html">Signal<int></a> <a class="code" href="classitpp_1_1TCP__Receiver.html#bbab0658b36792c135ed6c32e23ea40b" title="indicate new data to higher layer">tcp_new_data</a>; |
---|
| 410 | <a name="l00605"></a>00605 |
---|
| 411 | <a name="l00606"></a><a class="code" href="classitpp_1_1TCP__Receiver.html#b7df00acd607d036b840461fb7a0ae05">00606</a> <a class="code" href="classitpp_1_1Slot.html">Slot<TCP_Receiver, std::string></a> <a class="code" href="classitpp_1_1TCP__Receiver.html#b7df00acd607d036b840461fb7a0ae05" title="ADD DOCUMENTATION HERE.">tcp_release</a>; |
---|
| 412 | <a name="l00607"></a>00607 |
---|
| 413 | <a name="l00608"></a>00608 <span class="keyword">private</span>: |
---|
| 414 | <a name="l00609"></a>00609 <span class="keywordtype">void</span> IndicateUserMessage(); |
---|
| 415 | <a name="l00610"></a>00610 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ReceiveMessageFromNet(<a class="code" href="classitpp_1_1Packet.html">itpp::Packet</a>* msg); |
---|
| 416 | <a name="l00612"></a>00612 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ReceiveDataPacket(<a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> & packet); |
---|
| 417 | <a name="l00613"></a>00613 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SendACK(<span class="keywordtype">bool</span>); |
---|
| 418 | <a name="l00614"></a>00614 <span class="keyword">virtual</span> <span class="keywordtype">void</span> ScheduleACKMessage(); |
---|
| 419 | <a name="l00615"></a>00615 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SendACKMessage(<a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a>); |
---|
| 420 | <a name="l00616"></a>00616 <span class="keyword">virtual</span> <span class="keywordtype">void</span> DelayedACKHandler(<a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a>); |
---|
| 421 | <a name="l00617"></a>00617 <span class="keyword">virtual</span> <span class="keywordtype">void</span> PeriodicACKHandler(<a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a>); |
---|
| 422 | <a name="l00618"></a>00618 <span class="keyword">virtual</span> <span class="keywordtype">void</span> HandleEndOfProcessing(<a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a>); |
---|
| 423 | <a name="l00619"></a>00619 <span class="keyword">virtual</span> <span class="keywordtype">void</span> TraceReceivedSeqNo(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn); |
---|
| 424 | <a name="l00620"></a>00620 <span class="keyword">virtual</span> std::string GenerateFilename(); |
---|
| 425 | <a name="l00621"></a>00621 |
---|
| 426 | <a name="l00622"></a>00622 <span class="comment">//basic variables</span> |
---|
| 427 | <a name="l00623"></a>00623 <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html">TCP_Receiver_Buffer</a> fReceiverBuffer; |
---|
| 428 | <a name="l00624"></a>00624 <span class="keywordtype">unsigned</span> fLabel; |
---|
| 429 | <a name="l00625"></a>00625 |
---|
| 430 | <a name="l00626"></a>00626 <span class="comment">//parameters read by the parser</span> |
---|
| 431 | <a name="l00627"></a>00627 <span class="keywordtype">unsigned</span> fTCPIPHeaderLength; |
---|
| 432 | <a name="l00628"></a>00628 <span class="keywordtype">unsigned</span> fMSS; |
---|
| 433 | <a name="l00629"></a>00629 <span class="keywordtype">unsigned</span> fBufferSize; |
---|
| 434 | <a name="l00630"></a>00630 <span class="keywordtype">bool</span> fDelayedACK; |
---|
| 435 | <a name="l00631"></a>00631 <a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a> fACKDelayTime; |
---|
| 436 | <a name="l00632"></a>00632 <span class="keywordtype">bool</span> fSendPeriodicACKs; |
---|
| 437 | <a name="l00633"></a>00633 <span class="keywordtype">bool</span> fStrictPeriodicACKs; |
---|
| 438 | <a name="l00634"></a>00634 <a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a> fPeriodicACKInterval;<span class="comment">// interval after which an ACK is repeated</span> |
---|
| 439 | <a name="l00635"></a>00635 <a class="code" href="group__protocol.html#g33cb6c41273f24dbf05adf6e7cdb1a04" title="64-bit floating point time">Ttype</a> fACKSchedulingDelay; |
---|
| 440 | <a name="l00636"></a>00636 <span class="keywordtype">bool</span> fACKOnBufferWrite; |
---|
| 441 | <a name="l00637"></a>00637 <span class="keywordtype">bool</span> fACKOnBufferRead; |
---|
| 442 | <a name="l00638"></a>00638 <span class="keywordtype">unsigned</span> fMaxUserBlockSize; |
---|
| 443 | <a name="l00639"></a>00639 <span class="keywordtype">unsigned</span> fMinUserBlockSize; |
---|
| 444 | <a name="l00640"></a>00640 <span class="keywordtype">double</span> fUserBlockProcDelay; |
---|
| 445 | <a name="l00641"></a>00641 <span class="keywordtype">bool</span> fTrace; |
---|
| 446 | <a name="l00642"></a>00642 <span class="keywordtype">bool</span> fDebug; |
---|
| 447 | <a name="l00644"></a>00644 <span class="comment">//specific TCP variables</span> |
---|
| 448 | <a name="l00645"></a>00645 <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> fAdvRcvNxt; |
---|
| 449 | <a name="l00646"></a>00646 <span class="keywordtype">unsigned</span> fAdvRcvWnd; |
---|
| 450 | <a name="l00648"></a>00648 <span class="comment">//session management</span> |
---|
| 451 | <a name="l00649"></a>00649 <span class="keywordtype">int</span> fSessionId; |
---|
| 452 | <a name="l00651"></a>00651 <span class="comment">//ACK timers</span> |
---|
| 453 | <a name="l00652"></a>00652 <a class="code" href="classitpp_1_1TTimer.html">TTimer<TCP_Receiver></a> fDelayedACKTimer; |
---|
| 454 | <a name="l00653"></a>00653 <a class="code" href="classitpp_1_1TTimer.html">TTimer<TCP_Receiver></a> fPeriodicACKTimer; |
---|
| 455 | <a name="l00654"></a>00654 <a class="code" href="classitpp_1_1TTimer.html">TTimer<TCP_Receiver></a> fACKSchedulingTimer; |
---|
| 456 | <a name="l00655"></a>00655 <a class="code" href="classitpp_1_1TCP__Packet.html">TCP_Packet</a> * fWaitingACKMsg; |
---|
| 457 | <a name="l00656"></a>00656 |
---|
| 458 | <a name="l00657"></a>00657 <span class="comment">//user data delivery</span> |
---|
| 459 | <a name="l00658"></a>00658 <a class="code" href="classitpp_1_1Packet.html">Packet</a> * fUserMessage; |
---|
| 460 | <a name="l00659"></a>00659 <a class="code" href="classitpp_1_1TTimer.html">TTimer<TCP_Receiver></a> fUserBlockProcTimer; |
---|
| 461 | <a name="l00660"></a>00660 |
---|
| 462 | <a name="l00661"></a>00661 |
---|
| 463 | <a name="l00662"></a>00662 <span class="comment">//statistic counters</span> |
---|
| 464 | <a name="l00663"></a>00663 ivec received_seq_num_val; |
---|
| 465 | <a name="l00664"></a>00664 vec received_seq_num_time; |
---|
| 466 | <a name="l00665"></a>00665 <span class="keywordtype">int</span> received_seq_num_index; |
---|
| 467 | <a name="l00666"></a>00666 |
---|
| 468 | <a name="l00667"></a>00667 }; |
---|
| 469 | <a name="l00668"></a>00668 |
---|
| 470 | <a name="l00669"></a>00669 |
---|
| 471 | <a name="l00670"></a>00670 |
---|
| 472 | <a name="l00671"></a>00671 <span class="comment">// ------------------------------- Inline definitions ---------------------------------------------</span> |
---|
| 473 | <a name="l00672"></a>00672 |
---|
| 474 | <a name="l00673"></a>00673 |
---|
| 475 | <a name="l00674"></a>00674 |
---|
| 476 | <a name="l00675"></a><a class="code" href="group__protocol.html#g9c64cbc6c944a611a7bc1946db93082e">00675</a> <span class="keyword">inline</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="group__protocol.html#g9c64cbc6c944a611a7bc1946db93082e" title="first byte stored or missing">TCP_Receiver_Buffer::first_byte</a>()<span class="keyword"> const</span> |
---|
| 477 | <a name="l00676"></a>00676 <span class="keyword"></span>{ |
---|
| 478 | <a name="l00677"></a>00677 <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#44bfe4a22a27117bf7af1384d9d63578" title="first byte stored or missing">fFirstByte</a>; |
---|
| 479 | <a name="l00678"></a>00678 } |
---|
| 480 | <a name="l00679"></a>00679 |
---|
| 481 | <a name="l00680"></a>00680 |
---|
| 482 | <a name="l00681"></a><a class="code" href="group__protocol.html#gcfed25ee9a35dcd9860eb817dac466b4">00681</a> <span class="keyword">inline</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="group__protocol.html#gcfed25ee9a35dcd9860eb817dac466b4" title="highest byte received (+1)">TCP_Receiver_Buffer::last_byte</a>()<span class="keyword"> const</span> |
---|
| 483 | <a name="l00682"></a>00682 <span class="keyword"></span>{ |
---|
| 484 | <a name="l00683"></a>00683 <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#ddd625dbb86178976ecb5010f1b0896b" title="ADD DOCUMENTATION HERE.">fBufList</a>.empty()) { |
---|
| 485 | <a name="l00684"></a>00684 <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#44bfe4a22a27117bf7af1384d9d63578" title="first byte stored or missing">fFirstByte</a>; |
---|
| 486 | <a name="l00685"></a>00685 } |
---|
| 487 | <a name="l00686"></a>00686 <span class="keywordflow">else</span> { |
---|
| 488 | <a name="l00687"></a>00687 <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#ddd625dbb86178976ecb5010f1b0896b" title="ADD DOCUMENTATION HERE.">fBufList</a>.back().end(); |
---|
| 489 | <a name="l00688"></a>00688 } |
---|
| 490 | <a name="l00689"></a>00689 } |
---|
| 491 | <a name="l00690"></a>00690 |
---|
| 492 | <a name="l00691"></a>00691 |
---|
| 493 | <a name="l00692"></a><a class="code" href="group__protocol.html#g516a93b62f601031d00a1bdfb982fd56">00692</a> <span class="keyword">inline</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> <a class="code" href="group__protocol.html#g516a93b62f601031d00a1bdfb982fd56" title="first byte missing">TCP_Receiver_Buffer::next_expected</a>()<span class="keyword"> const</span> |
---|
| 494 | <a name="l00693"></a>00693 <span class="keyword"></span>{ |
---|
| 495 | <a name="l00694"></a>00694 <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#44bfe4a22a27117bf7af1384d9d63578" title="first byte stored or missing">fFirstByte</a> + <a class="code" href="classitpp_1_1TCP__Receiver__Buffer.html#c1506205ce876c839d4c477cf29c0d28" title="size of first complete block">first_block_size</a>(); |
---|
| 496 | <a name="l00695"></a>00695 } |
---|
| 497 | <a name="l00696"></a>00696 |
---|
| 498 | <a name="l00697"></a>00697 |
---|
| 499 | <a name="l00698"></a><a class="code" href="group__protocol.html#gdf1e7e6fc51aab68c7c8fa571bf00edd">00698</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__protocol.html#gdf1e7e6fc51aab68c7c8fa571bf00edd" title="ADD DOCUMENTATION HERE.">TCP_Segment::set_begin</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn) |
---|
| 500 | <a name="l00699"></a>00699 { |
---|
| 501 | <a name="l00700"></a>00700 <a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> = sn; |
---|
| 502 | <a name="l00701"></a>00701 |
---|
| 503 | <a name="l00702"></a>00702 <a class="code" href="group__errorhandlingfunc.html#gd5c34b291e5018534fd2344486e2b5a1" title="Abort if t is not true.">it_assert</a>(<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> <= <a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>, <span class="stringliteral">"TCP_Segment::begin, end byte "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(<a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>.<a class="code" href="classitpp_1_1Sequence__Number.html#03a465e50cee4cb6b85193cc6a62ead1" title="Access to internal representation.">value</a>()) + <span class="stringliteral">" < begin byte "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>.<a class="code" href="classitpp_1_1Sequence__Number.html#03a465e50cee4cb6b85193cc6a62ead1" title="Access to internal representation.">value</a>())); |
---|
| 504 | <a name="l00703"></a>00703 } |
---|
| 505 | <a name="l00704"></a>00704 |
---|
| 506 | <a name="l00705"></a>00705 |
---|
| 507 | <a name="l00706"></a><a class="code" href="group__protocol.html#gcc81e83b9a513142363f6388b1abf9c6">00706</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__protocol.html#gcc81e83b9a513142363f6388b1abf9c6" title="ADD DOCUMENTATION HERE.">TCP_Segment::set_end</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Sequence__Number.html">Sequence_Number</a> &sn) |
---|
| 508 | <a name="l00707"></a>00707 { |
---|
| 509 | <a name="l00708"></a>00708 <a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a> = sn; |
---|
| 510 | <a name="l00709"></a>00709 |
---|
| 511 | <a name="l00710"></a>00710 <a class="code" href="group__errorhandlingfunc.html#gd5c34b291e5018534fd2344486e2b5a1" title="Abort if t is not true.">it_assert</a>(<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> <= <a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>, <span class="stringliteral">"TCP_Segment::set_begin, end byte "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(<a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>.<a class="code" href="classitpp_1_1Sequence__Number.html#03a465e50cee4cb6b85193cc6a62ead1" title="Access to internal representation.">value</a>()) + <span class="stringliteral">" < begin byte "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>.<a class="code" href="classitpp_1_1Sequence__Number.html#03a465e50cee4cb6b85193cc6a62ead1" title="Access to internal representation.">value</a>())); |
---|
| 512 | <a name="l00711"></a>00711 } |
---|
| 513 | <a name="l00712"></a>00712 |
---|
| 514 | <a name="l00713"></a>00713 |
---|
| 515 | <a name="l00714"></a><a class="code" href="group__protocol.html#g621cc3bc951211d85ea9d01dd0a242e1">00714</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#g621cc3bc951211d85ea9d01dd0a242e1" title="ADD DOCUMENTATION HERE.">TCP_Segment::operator==</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment)<span class="keyword"> const</span> |
---|
| 516 | <a name="l00715"></a>00715 <span class="keyword"></span>{ |
---|
| 517 | <a name="l00716"></a>00716 <span class="keywordflow">return</span> (this-><a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> == segment.<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>) && (this-><a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a> == segment.<a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>); |
---|
| 518 | <a name="l00717"></a>00717 } |
---|
| 519 | <a name="l00718"></a>00718 |
---|
| 520 | <a name="l00719"></a>00719 |
---|
| 521 | <a name="l00720"></a><a class="code" href="group__protocol.html#g250e7dff8c2620d37e0181f9145675f0">00720</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#g250e7dff8c2620d37e0181f9145675f0" title="ADD DOCUMENTATION HERE.">TCP_Segment::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment)<span class="keyword"> const</span> |
---|
| 522 | <a name="l00721"></a>00721 <span class="keyword"></span>{ |
---|
| 523 | <a name="l00722"></a>00722 <span class="keywordflow">return</span> (this-><a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> != segment.<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>) || (this-><a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a> != segment.<a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>); |
---|
| 524 | <a name="l00723"></a>00723 } |
---|
| 525 | <a name="l00724"></a>00724 |
---|
| 526 | <a name="l00725"></a>00725 |
---|
| 527 | <a name="l00726"></a><a class="code" href="group__protocol.html#g1dea82fb7b04634cff8e01afa45881f0">00726</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#g1dea82fb7b04634cff8e01afa45881f0" title="ADD DOCUMENTATION HERE.">TCP_Segment::can_be_combined</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment)<span class="keyword"> const</span> |
---|
| 528 | <a name="l00727"></a>00727 <span class="keyword"></span>{ |
---|
| 529 | <a name="l00728"></a>00728 <span class="keywordflow">return</span> (this-><a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> <= segment.<a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>) && (segment.<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> <= this-><a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>); |
---|
| 530 | <a name="l00729"></a>00729 } |
---|
| 531 | <a name="l00730"></a>00730 |
---|
| 532 | <a name="l00731"></a>00731 |
---|
| 533 | <a name="l00732"></a><a class="code" href="group__protocol.html#geffe232b6370e7d57ec9b28045f83168">00732</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__protocol.html#geffe232b6370e7d57ec9b28045f83168" title="ADD DOCUMENTATION HERE.">TCP_Segment::is_contained</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1TCP__Segment.html">TCP_Segment</a> &segment)<span class="keyword"> const</span> |
---|
| 534 | <a name="l00733"></a>00733 <span class="keyword"></span>{ |
---|
| 535 | <a name="l00734"></a>00734 <span class="keywordflow">return</span> (segment.<a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a> <= this->seq_begin) && (this-><a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a> <= segment.<a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a>); |
---|
| 536 | <a name="l00735"></a>00735 } |
---|
| 537 | <a name="l00736"></a>00736 |
---|
| 538 | <a name="l00737"></a>00737 |
---|
| 539 | <a name="l00738"></a><a class="code" href="group__protocol.html#ga582b8271e033fdead7e875e8872936c">00738</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <a class="code" href="group__protocol.html#ga582b8271e033fdead7e875e8872936c" title="ADD DOCUMENTATION HERE.">TCP_Segment::length</a>()<span class="keyword"> const</span> |
---|
| 540 | <a name="l00739"></a>00739 <span class="keyword"></span>{ |
---|
| 541 | <a name="l00740"></a>00740 <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1TCP__Segment.html#31aba03e7100bca14eb4b4f61aa58974" title="no. of last byte of segment + 1">seq_end</a> - <a class="code" href="classitpp_1_1TCP__Segment.html#682a833137dd7e66d7f6cc349b5a9778" title="no. of first byte of segment">seq_begin</a>; |
---|
| 542 | <a name="l00741"></a>00741 } |
---|
| 543 | <a name="l00742"></a>00742 |
---|
| 544 | <a name="l00744"></a>00744 |
---|
| 545 | <a name="l00745"></a>00745 |
---|
| 546 | <a name="l00746"></a>00746 } <span class="comment">// namespace itpp</span> |
---|
| 547 | <a name="l00747"></a>00747 |
---|
| 548 | <a name="l00748"></a>00748 <span class="preprocessor">#endif // #ifndef TCP_H</span> |
---|
| 549 | <a name="l00749"></a>00749 <span class="preprocessor"></span> |
---|
| 550 | </pre></div></div> |
---|
| 551 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:13 2009 for mixpp by |
---|
| 552 | <a href="http://www.doxygen.org/index.html"> |
---|
| 553 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
| 554 | </body> |
---|
| 555 | </html> |
---|