<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>DTN Reference Implementation: StreamConvergenceLayer.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>StreamConvergenceLayer.h</h1><a href="StreamConvergenceLayer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright 2006 Intel Corporation</span> <a name="l00003"></a>00003 <span class="comment"> * </span> <a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span> <a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span> <a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span> <a name="l00007"></a>00007 <span class="comment"> * </span> <a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> <a name="l00009"></a>00009 <span class="comment"> * </span> <a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> <a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> <a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> <a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span> <a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span> <a name="l00015"></a>00015 <span class="comment"> */</span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef _STREAM_CONVERGENCE_LAYER_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _STREAM_CONVERGENCE_LAYER_H_</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="ConnectionConvergenceLayer_8h.html">ConnectionConvergenceLayer.h</a>"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="CLConnection_8h.html">CLConnection.h</a>"</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="keyword">namespace </span>dtn { <a name="l00024"></a>00024 <a name="l00079"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html">00079</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1StreamConvergenceLayer.html" title="Another shared-implementation convergence layer class for use with reliable, in-order...">StreamConvergenceLayer</a> : <span class="keyword">public</span> <a class="code" href="classdtn_1_1ConnectionConvergenceLayer.html" title="All convergence layers that maintain a connection (i.e.">ConnectionConvergenceLayer</a> { <a name="l00080"></a>00080 <span class="keyword">public</span>: <a name="l00084"></a>00084 <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#096660d9de60059df676728759749ac7" title="Constructor.">StreamConvergenceLayer</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* logpath, <span class="keyword">const</span> <span class="keywordtype">char</span>* cl_name, <a name="l00085"></a>00085 u_int8_t cl_version); <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="keyword">protected</span>: <a name="l00091"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca861536">00091</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00092"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca86153680b34f4cf0349121806fbddf754ead76">00092</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca86153680b34f4cf0349121806fbddf754ead76" title="segment acks requested">SEGMENT_ACK_ENABLED</a> = 1 << 0, <a name="l00093"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca8615367037a814236c37362d50f76e5d9508d6">00093</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca8615367037a814236c37362d50f76e5d9508d6" title="reactive fragmentation enabled">REACTIVE_FRAG_ENABLED</a> = 1 << 1, <a name="l00094"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca861536b71e6c1a74eeee3534bd4a35c6621f68">00094</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca861536b71e6c1a74eeee3534bd4a35c6621f68" title="refuse bundle enabled">NEGATIVE_ACK_ENABLED</a> = 1 << 2, <a name="l00095"></a>00095 } <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#22063658b9cd2c7a894688ecca861536" title="Values for ContactHeader flags.">contact_header_flags_t</a>; <a name="l00096"></a>00096 <a name="l00100"></a><a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html">00100</a> <span class="keyword">struct </span><a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html" title="Contact initiation header.">ContactHeader</a> { <a name="l00101"></a><a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#100178e791d70d34681bec8f940eb60d">00101</a> u_int32_t <a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#100178e791d70d34681bec8f940eb60d" title="magic word (MAGIC: &quot;dtn!&quot;)">magic</a>; <a name="l00102"></a><a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#f92367a32a108c3c2eb8b61ffa6bc99a">00102</a> u_int8_t <a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#f92367a32a108c3c2eb8b61ffa6bc99a" title="cl protocol version">version</a>; <a name="l00103"></a><a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#ed32bf95f52fd9137ffaddb74b7cf55a">00103</a> u_int8_t <a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#ed32bf95f52fd9137ffaddb74b7cf55a" title="connection flags (see above)">flags</a>; <a name="l00104"></a><a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#41a243b98016a50c0f586403030e4e2c">00104</a> u_int16_t <a class="code" href="structdtn_1_1StreamConvergenceLayer_1_1ContactHeader.html#41a243b98016a50c0f586403030e4e2c" title="seconds between keepalive packets">keepalive_interval</a>; <a name="l00105"></a>00105 <span class="comment">// SDNV local_eid_length local eid length</span> <a name="l00106"></a>00106 <span class="comment">// byte[] local_eid local eid data</span> <a name="l00107"></a>00107 } __attribute__((<a class="code" href="classdtn_1_1StreamConvergenceLayer.html#21394b7f57d72c668f71944d143ffd60" title="Contact initiation header.">packed</a>)); <a name="l00108"></a>00108 <a name="l00114"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53ac">00114</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00115"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53ac1c7865f9e31769ff99ffd0f395fb4dd6">00115</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53ac1c7865f9e31769ff99ffd0f395fb4dd6" title="a segment of bundle data (followed by a SDNV segment length)">DATA_SEGMENT</a> = 0x1 << 4, <a name="l00116"></a>00116 <a name="l00117"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53ac288e2ceefe0dd8461d944e0b88531d05">00117</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53ac288e2ceefe0dd8461d944e0b88531d05" title="acknowledgement of a segment (followed by a SDNV ack length)">ACK_SEGMENT</a> = 0x2 << 4, <a name="l00118"></a>00118 <a name="l00119"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53accec1bcb080fccd4ed408e519539cda92">00119</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53accec1bcb080fccd4ed408e519539cda92" title="reject reception of current bundle">REFUSE_BUNDLE</a> = 0x3 << 4, <a name="l00120"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53accfc2440c0ffff7d31b53c4ee810fcecf">00120</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53accfc2440c0ffff7d31b53c4ee810fcecf" title="keepalive packet">KEEPALIVE</a> = 0x4 << 4, <a name="l00121"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53acfdbe69c942f3d92b9f503c9ba5c87a37">00121</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53acfdbe69c942f3d92b9f503c9ba5c87a37" title="about to shutdown">SHUTDOWN</a> = 0x5 << 4, <a name="l00122"></a>00122 } <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#183d0df09b1791083a921382569f53ac" title="Valid type codes for the protocol messages, shifted into the high-order four bits...">msg_type_t</a>; <a name="l00123"></a>00123 <a name="l00127"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#d0516828cb1330f808cf3c7df91a6a9b">00127</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00128"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#d0516828cb1330f808cf3c7df91a6a9b1ce5167d70b177595c4e42c826c3e225">00128</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#d0516828cb1330f808cf3c7df91a6a9b1ce5167d70b177595c4e42c826c3e225" title="First segment of a bundle.">BUNDLE_START</a> = 0x1 << 1, <a name="l00129"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#d0516828cb1330f808cf3c7df91a6a9b0ca0531933393d66d0e47170956ea5d9">00129</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#d0516828cb1330f808cf3c7df91a6a9b0ca0531933393d66d0e47170956ea5d9" title="Last segment of a bundle.">BUNDLE_END</a> = 0x1 << 0, <a name="l00130"></a>00130 } <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#d0516828cb1330f808cf3c7df91a6a9b" title="Valid flags for the DATA_SEGMENT message.">data_segment_flags_t</a>; <a name="l00131"></a>00131 <a name="l00135"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7a4e7b19ccf485147cd8ab341f7f642c">00135</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00136"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7a4e7b19ccf485147cd8ab341f7f642c4053159703ea6ea3c8de5045f73e12f7">00136</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7a4e7b19ccf485147cd8ab341f7f642c4053159703ea6ea3c8de5045f73e12f7" title="Has reason code.">SHUTDOWN_HAS_REASON</a> = 0x1 << 1, <a name="l00137"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7a4e7b19ccf485147cd8ab341f7f642c478975a37cc3b9079370e8581b595070">00137</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7a4e7b19ccf485147cd8ab341f7f642c478975a37cc3b9079370e8581b595070" title="Has reconnect delay.">SHUTDOWN_HAS_DELAY</a> = 0x1 << 0, <a name="l00138"></a>00138 } <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7a4e7b19ccf485147cd8ab341f7f642c" title="Valid flags for the SHUTDOWN message.">shutdown_flags_t</a>; <a name="l00139"></a>00139 <a name="l00143"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b38">00143</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00144"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b3869622c46041eb62e40fea1813a48971c">00144</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b3869622c46041eb62e40fea1813a48971c" title="no reason code (never sent)">SHUTDOWN_NO_REASON</a> = 0xff, <a name="l00145"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b381fca6e7cc76836e4ae89e179fb4cff90">00145</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b381fca6e7cc76836e4ae89e179fb4cff90" title="idle connection">SHUTDOWN_IDLE_TIMEOUT</a> = 0x0, <a name="l00146"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b38a623d9b20734c83802ea80dc8df1489e">00146</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b38a623d9b20734c83802ea80dc8df1489e" title="version mismatch">SHUTDOWN_VERSION_MISMATCH</a> = 0x1, <a name="l00147"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b389bcc936ab6b796dbc92b92b9c5327e6b">00147</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b389bcc936ab6b796dbc92b92b9c5327e6b" title="node is busy">SHUTDOWN_BUSY</a> = 0x2, <a name="l00148"></a>00148 } <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b38" title="Values for the SHUTDOWN reason codes.">shutdown_reason_t</a>; <a name="l00149"></a>00149 <a name="l00153"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#196057db7dfae4139d9f7913eb610db1">00153</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#196057db7dfae4139d9f7913eb610db1" title="Convert a reason code to a string.">shutdown_reason_to_str</a>(<a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b38" title="Values for the SHUTDOWN reason codes.">shutdown_reason_t</a> reason) <a name="l00154"></a>00154 { <a name="l00155"></a>00155 <span class="keywordflow">switch</span> (reason) { <a name="l00156"></a>00156 <span class="keywordflow">case</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b3869622c46041eb62e40fea1813a48971c" title="no reason code (never sent)">SHUTDOWN_NO_REASON</a>: <span class="keywordflow">return</span> <span class="stringliteral">"no reason"</span>; <a name="l00157"></a>00157 <span class="keywordflow">case</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b381fca6e7cc76836e4ae89e179fb4cff90" title="idle connection">SHUTDOWN_IDLE_TIMEOUT</a>: <span class="keywordflow">return</span> <span class="stringliteral">"idle connection"</span>; <a name="l00158"></a>00158 <span class="keywordflow">case</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b38a623d9b20734c83802ea80dc8df1489e" title="version mismatch">SHUTDOWN_VERSION_MISMATCH</a>: <span class="keywordflow">return</span> <span class="stringliteral">"version mismatch"</span>; <a name="l00159"></a>00159 <span class="keywordflow">case</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7b1454224520c3344536c8d5fcc07b389bcc936ab6b796dbc92b92b9c5327e6b" title="node is busy">SHUTDOWN_BUSY</a>: <span class="keywordflow">return</span> <span class="stringliteral">"node is busy"</span>; <a name="l00160"></a>00160 } <a name="l00161"></a>00161 NOTREACHED; <a name="l00162"></a>00162 } <a name="l00163"></a>00163 <a name="l00167"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html">00167</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html" title="Link parameters shared among all stream based convergence layers.">StreamLinkParams</a> : <span class="keyword">public</span> <a class="code" href="classdtn_1_1ConnectionConvergenceLayer.html" title="All convergence layers that maintain a connection (i.e.">ConnectionConvergenceLayer</a>::<a class="code" href="classdtn_1_1ConnectionConvergenceLayer_1_1LinkParams.html" title="Tunable parameter structure stored in each Link&#39;s CLInfo slot.">LinkParams</a> { <a name="l00168"></a>00168 <span class="keyword">public</span>: <a name="l00169"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#4a217be895b5445882f426d690268ce0">00169</a> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#4a217be895b5445882f426d690268ce0" title="Use per-segment acks.">segment_ack_enabled_</a>; <a name="l00170"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#909f9c1ec500b8bcbe27753150a96435">00170</a> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#909f9c1ec500b8bcbe27753150a96435" title="Enable negative acks.">negative_ack_enabled_</a>; <a name="l00171"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#5513a46ac82f99427efb3f1f46e9cb7e">00171</a> u_int <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#5513a46ac82f99427efb3f1f46e9cb7e" title="Seconds between keepalive packets.">keepalive_interval_</a>; <a name="l00172"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#f84af5832d28b56241e1ca6f23b757b6">00172</a> u_int <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#f84af5832d28b56241e1ca6f23b757b6" title="Maximum size of transmitted segments.">segment_length_</a>; <a name="l00173"></a>00173 <a name="l00174"></a>00174 <span class="keyword">protected</span>: <a name="l00175"></a>00175 <span class="comment">// See comment in LinkParams for why this should be protected</span> <a name="l00176"></a>00176 <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html#2f8152afdfad87f6b57856fe55f770d7">StreamLinkParams</a>(<span class="keywordtype">bool</span> init_defaults); <a name="l00177"></a>00177 }; <a name="l00178"></a>00178 <a name="l00182"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#431ccce6bc6e45cec1203705791716f3">00182</a> u_int8_t <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#431ccce6bc6e45cec1203705791716f3" title="Version of the actual CL protocol.">cl_version_</a>; <a name="l00183"></a>00183 <a name="l00187"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html">00187</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html" title="Stream connection class.">Connection</a> : <span class="keyword">public</span> <a class="code" href="classdtn_1_1CLConnection.html" title="Helper class (and thread) that manages an established connection with a peer daemon...">CLConnection</a> { <a name="l00188"></a>00188 <span class="keyword">public</span>: <a name="l00192"></a>00192 <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#589a28b08f149fc893b90a6c25a66b4b" title="Constructor.">Connection</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* classname, <a name="l00193"></a>00193 <span class="keyword">const</span> <span class="keywordtype">char</span>* logpath, <a name="l00194"></a>00194 <a class="code" href="classdtn_1_1StreamConvergenceLayer.html" title="Another shared-implementation convergence layer class for use with reliable, in-order...">StreamConvergenceLayer</a>* cl, <a name="l00195"></a>00195 <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html" title="Link parameters shared among all stream based convergence layers.">StreamLinkParams</a>* params, <a name="l00196"></a>00196 <span class="keywordtype">bool</span> active_connector); <a name="l00197"></a>00197 <a name="l00199"></a>00199 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#e7bfa4ed0a7c2a98d06e6e5273ff5a1e" title="virtual from CLConnection">send_pending_data</a>(); <a name="l00200"></a>00200 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#4efc34a816975a771ef5e9fd48dd1d50" title="virtual from CLConnection">handle_bundles_queued</a>(); <a name="l00201"></a>00201 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#2c11a5f0a2b7d0641db35223c3f1ee19" title="virtual from CLConnection">handle_cancel_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00202"></a>00202 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#39c37dca585724b5c41a8759d9cc5741" title="virtual from CLConnection">handle_poll_timeout</a>(); <a name="l00203"></a>00203 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#b06d1276d10f66d40f04da6bd824e54b" title="virtual from CLConnection">break_contact</a>(<a class="code" href="classdtn_1_1ContactEvent.html#e20f7357509a2bcca3d8e6c8daf552f7" title="Reason codes for contact state operations.">ContactEvent::reason_t</a> reason); <a name="l00205"></a>00205 <a name="l00206"></a>00206 <span class="keyword">protected</span>: <a name="l00211"></a>00211 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#bbdabd686c5d5e5a9bf30706a7ab849c" title="Hook used to tell the derived CL class to drain data out of the send buffer.">send_data</a>() = 0; <a name="l00212"></a>00212 <a name="l00214"></a>00214 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#db6e45fa1f3fdf6e3e753df0cfb792c8" title="utility functions used by derived classes">initiate_contact</a>(); <a name="l00215"></a>00215 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#5e611627d2caa87dbce0e3affc5b5c68" title="utility functions used by derived classes">process_data</a>(); <a name="l00216"></a>00216 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#a7f82a1ad41a82f47cebf230ac0b5036" title="utility functions used by derived classes">check_keepalive</a>(); <a name="l00218"></a>00218 <a name="l00219"></a>00219 <span class="keyword">private</span>: <a name="l00221"></a>00221 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#3467dd32c5c8da24266290d9b2e95377" title="utility functions used internally in this class">note_data_rcvd</a>(); <a name="l00222"></a>00222 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#9ef41c9f94581292808d7e50472ab07b" title="utility functions used internally in this class">note_data_sent</a>(); <a name="l00223"></a>00223 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#07b8a28fbb18258b3727aed3c8e98815" title="utility functions used internally in this class">send_pending_acks</a>(); <a name="l00224"></a>00224 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#4c167905aa71be2b4d4aac383344c240" title="utility functions used internally in this class">start_next_bundle</a>(); <a name="l00225"></a>00225 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#10e5a054fe260ebd06e5daf3095c1d52" title="utility functions used internally in this class">send_next_segment</a>(<a class="code" href="classdtn_1_1CLConnection_1_1InFlightBundle.html" title="Struct used to record bundles that are in-flight along with their transmission state...">InFlightBundle</a>* inflight); <a name="l00226"></a>00226 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#69b0db2a6c9456baac7c14a04c6b8c46" title="utility functions used internally in this class">send_data_todo</a>(<a class="code" href="classdtn_1_1CLConnection_1_1InFlightBundle.html" title="Struct used to record bundles that are in-flight along with their transmission state...">InFlightBundle</a>* inflight); <a name="l00227"></a>00227 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#361c9432800358728e78a0289775429a" title="utility functions used internally in this class">finish_bundle</a>(<a class="code" href="classdtn_1_1CLConnection_1_1InFlightBundle.html" title="Struct used to record bundles that are in-flight along with their transmission state...">InFlightBundle</a>* inflight); <a name="l00228"></a>00228 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#bd92299ff0aa3ba935cfdc180a29855d" title="utility functions used internally in this class">check_completed</a>(<a class="code" href="classdtn_1_1CLConnection_1_1InFlightBundle.html" title="Struct used to record bundles that are in-flight along with their transmission state...">InFlightBundle</a>* inflight); <a name="l00229"></a>00229 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#0c93d13277062f931c16baeb819197a7" title="utility functions used internally in this class">send_keepalive</a>(); <a name="l00230"></a>00230 <a name="l00231"></a>00231 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#fe8bc46331b10ed587f6c11e2a5be757" title="utility functions used internally in this class">handle_contact_initiation</a>(); <a name="l00232"></a>00232 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#2820112f480a485501737eb2962c12e9" title="utility functions used internally in this class">handle_data_segment</a>(u_int8_t flags); <a name="l00233"></a>00233 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#11cd8cb07dd92f8577b109a60b680cc5" title="utility functions used internally in this class">handle_data_todo</a>(); <a name="l00234"></a>00234 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#4e953071e0c7ee2e9157c11b7f998bd6" title="utility functions used internally in this class">handle_ack_segment</a>(u_int8_t flags); <a name="l00235"></a>00235 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#c6509bf3539fc74f5bcb128379acf8dd" title="utility functions used internally in this class">handle_refuse_bundle</a>(u_int8_t flags); <a name="l00236"></a>00236 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#71fc76a4d77152e025c1e5246894a656" title="utility functions used internally in this class">handle_keepalive</a>(u_int8_t flags); <a name="l00237"></a>00237 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#62654499c48ef4b7815333db6813689f" title="utility functions used internally in this class">handle_shutdown</a>(u_int8_t flags); <a name="l00238"></a>00238 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#bd92299ff0aa3ba935cfdc180a29855d" title="utility functions used internally in this class">check_completed</a>(<a class="code" href="classdtn_1_1CLConnection_1_1IncomingBundle.html" title="Struct used to record bundles that are in the process of being received along with...">IncomingBundle</a>* incoming); <a name="l00240"></a>00240 <a name="l00245"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#f143ebd2efeaa6adc4b5fcc0e01e367d">00245</a> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html" title="Link parameters shared among all stream based convergence layers.">StreamLinkParams</a>* <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#f143ebd2efeaa6adc4b5fcc0e01e367d" title="Utility function to downcast the params_ pointer that&#39;s stored in the CLConnection...">stream_lparams</a>() <a name="l00246"></a>00246 { <a name="l00247"></a>00247 <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html" title="Link parameters shared among all stream based convergence layers.">StreamLinkParams</a>* ret = <span class="keyword">dynamic_cast<</span><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1StreamLinkParams.html" title="Link parameters shared among all stream based convergence layers.">StreamLinkParams</a>*<span class="keyword">></span>(<a class="code" href="classdtn_1_1CLConnection.html#e3408a135a49d68ab36fd8de5805b1fe" title="Pointer to Link parameters, or to defaults until Link is bound.">params_</a>); <a name="l00248"></a>00248 <a class="code" href="SDNV_8cc.html#ca68c0d4ac8df0838e209fb5300f7be3">ASSERT</a>(ret != NULL); <a name="l00249"></a>00249 <span class="keywordflow">return</span> ret; <a name="l00250"></a>00250 } <a name="l00251"></a>00251 <a name="l00252"></a>00252 <span class="keyword">protected</span>: <a name="l00253"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#3305960e367d4413a8529cc3266c2922">00253</a> <a class="code" href="classdtn_1_1CLConnection_1_1InFlightBundle.html" title="Struct used to record bundles that are in-flight along with their transmission state...">InFlightBundle</a>* <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#3305960e367d4413a8529cc3266c2922" title="Current bundle that&#39;s in flight.">current_inflight_</a>; <a name="l00254"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#5fb1d3c5c5069a8142d4ac8c6303212c">00254</a> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#5fb1d3c5c5069a8142d4ac8c6303212c" title="Bytes left to send of current segment.">send_segment_todo_</a>; <a name="l00255"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#ba8fdf9ef5426b99c0215d6e210c2e13">00255</a> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#ba8fdf9ef5426b99c0215d6e210c2e13" title="Bytes left to recv of current segment.">recv_segment_todo_</a>; <a name="l00256"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#906480a8d18388e12f207611a7bdecad">00256</a> <span class="keyword">struct </span>timeval <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#906480a8d18388e12f207611a7bdecad" title="Timestamp for idle/keepalive timer.">data_rcvd_</a>; <a name="l00257"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#40cc6956b2b157b5f4ef4ef9734cead0">00257</a> <span class="keyword">struct </span>timeval <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#40cc6956b2b157b5f4ef4ef9734cead0" title="Timestamp for idle timer.">data_sent_</a>; <a name="l00258"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#d7be9e6fb91ba7620f8e5172c4643e1b">00258</a> <span class="keyword">struct </span>timeval <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#d7be9e6fb91ba7620f8e5172c4643e1b" title="Timestamp for keepalive timer.">keepalive_sent_</a>; <a name="l00259"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#592661b95051f90a7b390cafee133a9f">00259</a> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#592661b95051f90a7b390cafee133a9f" title="Bit to catch multiple calls to break_contact.">breaking_contact_</a>; <a name="l00260"></a>00260 <a name="l00261"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#334e73df91eb3303aae9c96c8b7c7301">00261</a> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer_1_1Connection.html#334e73df91eb3303aae9c96c8b7c7301">contact_initiated_</a>; <span class="comment">//< bit to prevent certain actions before</span> <a name="l00262"></a>00262 <span class="comment">//< contact is initiated</span> <a name="l00263"></a>00263 }; <a name="l00264"></a>00264 <a name="l00266"></a><a class="code" href="classdtn_1_1StreamConvergenceLayer.html#c24f55b2eee7fcd1aa5225f8098051f4">00266</a> <span class="keyword">typedef</span> <a class="code" href="classdtn_1_1ConnectionConvergenceLayer_1_1LinkParams.html" title="Tunable parameter structure stored in each Link&#39;s CLInfo slot.">ConnectionConvergenceLayer::LinkParams</a> <a class="code" href="classdtn_1_1ConnectionConvergenceLayer_1_1LinkParams.html" title="Tunable parameter structure stored in each Link&#39;s CLInfo slot.">LinkParams</a>; <a name="l00267"></a>00267 <a name="l00269"></a>00269 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#a6c4edd67ccbef20b2da705474048fed" title="Virtual from ConvergenceLayer.">dump_link</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link, oasys::StringBuffer* <a class="code" href="num2sdnv_8c.html#a81cdcc7ff6987bc85c073253e32715f">buf</a>); <a name="l00271"></a>00271 <a name="l00273"></a>00273 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#7ff0e15422faa7ab806b1945bf598e56" title="Virtual from ConnectionConvergenceLayer.">parse_link_params</a>(<a class="code" href="classdtn_1_1ConnectionConvergenceLayer_1_1LinkParams.html" title="Tunable parameter structure stored in each Link&#39;s CLInfo slot.">LinkParams</a>* params, <a name="l00274"></a>00274 <span class="keywordtype">int</span> argc, <span class="keyword">const</span> <span class="keywordtype">char</span>** argv, <a name="l00275"></a>00275 <span class="keyword">const</span> <span class="keywordtype">char</span>** invalidp); <a name="l00276"></a>00276 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1StreamConvergenceLayer.html#6164b894bc7b0f10951c57484a4c3c43" title="Virtual from ConnectionConvergenceLayer.">finish_init_link</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link, <a class="code" href="classdtn_1_1ConnectionConvergenceLayer_1_1LinkParams.html" title="Tunable parameter structure stored in each Link&#39;s CLInfo slot.">LinkParams</a>* params); <a name="l00278"></a>00278 <a name="l00279"></a>00279 }; <a name="l00280"></a>00280 <a name="l00281"></a>00281 } <span class="comment">// namespace dtn</span> <a name="l00282"></a>00282 <a name="l00283"></a>00283 <span class="preprocessor">#endif </span><span class="comment">/* _STREAM_CONVERGENCE_LAYER_H_ */</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:58 2009 for DTN Reference Implementation by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>