Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 29c369053a983cc5d8c880dc6e0a2237 > files > 700

libdtn-devel-2.6.0-2mdv2009.1.i586.rpm

<!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: TCPTunnel.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&nbsp;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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>TCPTunnel.h</h1><a href="TCPTunnel_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 _TCPTUNNEL_H_</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _TCPTUNNEL_H_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;<a class="code" href="dtn__api_8h.html">dtn_api.h</a>&gt;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;oasys/debug/Log.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;oasys/io/TCPClient.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;oasys/io/TCPServer.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;oasys/thread/MsgQueue.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;oasys/thread/Thread.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;oasys/util/ExpandableBuffer.h&gt;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="IPTunnel_8h.html">IPTunnel.h</a>"</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="keyword">namespace </span>dtntunnel {
<a name="l00033"></a>00033 
<a name="l00037"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html">00037</a> <span class="keyword">class </span><a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a> : <span class="keyword">public</span> <a class="code" href="classdtntunnel_1_1IPTunnel.html" title="Pure virtual base class for tunneling of IP protocols.">IPTunnel</a> {
<a name="l00038"></a>00038 <span class="keyword">public</span>:
<a name="l00040"></a>00040     <a class="code" href="classdtntunnel_1_1TCPTunnel.html#8f4e4626553a95f87b10ff8dc087dd0f" title="Constructor.">TCPTunnel</a>();
<a name="l00041"></a>00041     
<a name="l00044"></a>00044     <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel.html#17e855174e6624b2426e2b175dc72b13" title="Add a new listening to from the given listening address/port to the given remote...">add_listener</a>(in_addr_t listen_addr, u_int16_t listen_port,
<a name="l00045"></a>00045                       in_addr_t remote_addr, u_int16_t remote_port);
<a name="l00046"></a>00046     
<a name="l00048"></a>00048     <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel.html#9edfdd42b7d3de85e4cebd37af4793ed" title="Handle a newly arriving bundle.">handle_bundle</a>(<a class="code" href="structdtn_1_1APIBundle.html" title="Small encapsulating structure for API bundles.">dtn::APIBundle</a>* bundle);
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 <span class="keyword">protected</span>:
<a name="l00052"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html">00052</a>     <span class="keyword">class </span><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html" title="Helper class to accept incoming TCP connections.">Listener</a> : <span class="keyword">public</span> oasys::TCPServerThread {
<a name="l00053"></a>00053     <span class="keyword">public</span>:
<a name="l00054"></a>00054         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#e78e18c208c6cae652377932a712d964">Listener</a>(<a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a>* t,
<a name="l00055"></a>00055                  in_addr_t listen_addr, u_int16_t listen_port,
<a name="l00056"></a>00056                  in_addr_t remote_addr, u_int16_t remote_port);
<a name="l00057"></a>00057         
<a name="l00058"></a>00058         <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#aaf932ec1c7119949ed07d6b42ee9f91">accepted</a>(<span class="keywordtype">int</span> <a class="code" href="dtnperf-client_8c.html#6f8059414f0228f0256115e024eeed4b">fd</a>, in_addr_t addr, u_int16_t port);
<a name="l00059"></a>00059 
<a name="l00060"></a>00060     <span class="keyword">protected</span>:
<a name="l00061"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#12131d6f4dcff9b8ab92eef23ea21a88">00061</a>         <a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a>* <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#12131d6f4dcff9b8ab92eef23ea21a88">tcptun_</a>;
<a name="l00062"></a>00062 
<a name="l00065"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#a743ec3bcc3834acdd140cf2889bb4b0">00065</a>         in_addr_t <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#a743ec3bcc3834acdd140cf2889bb4b0">listen_addr_</a>;
<a name="l00066"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#ae15faf1e576b108ea6e3f0299e0816f">00066</a>         u_int16_t <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#ae15faf1e576b108ea6e3f0299e0816f">listen_port_</a>;
<a name="l00067"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#f1a362475585e3eeba00142833e333db">00067</a>         in_addr_t <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#f1a362475585e3eeba00142833e333db">remote_addr_</a>;
<a name="l00068"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#ab743801a910f99cf0e0ec87c8e5ec3a">00068</a>         u_int16_t <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Listener.html#ab743801a910f99cf0e0ec87c8e5ec3a">remote_port_</a>;
<a name="l00070"></a>00070     };
<a name="l00071"></a>00071 
<a name="l00073"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html">00073</a>     <span class="keyword">class </span><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html" title="Helper class to handle an actively proxied connection.">Connection</a> : <span class="keyword">public</span> oasys::<a class="code" href="classoasys_1_1Formatter.html">Formatter</a>,
<a name="l00074"></a>00074                        <span class="keyword">public</span> oasys::Thread,
<a name="l00075"></a>00075                        <span class="keyword">public</span> oasys::<a class="code" href="classoasys_1_1Logger.html">Logger</a>
<a name="l00076"></a>00076     {
<a name="l00077"></a>00077     <span class="keyword">public</span>:
<a name="l00080"></a>00080         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#5b965f7ab8f478c0c38bbfc769407aed" title="Constructor called to initiate a connection due to an arriving bundle request.">Connection</a>(<a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a>* t, <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* dest_eid,
<a name="l00081"></a>00081                    in_addr_t client_addr, u_int16_t client_port,
<a name="l00082"></a>00082                    in_addr_t remote_addr, u_int16_t remote_port,
<a name="l00083"></a>00083                    u_int32_t connection_id);
<a name="l00084"></a>00084 
<a name="l00086"></a>00086         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#5b965f7ab8f478c0c38bbfc769407aed" title="Constructor called to initiate a connection due to an arriving bundle request.">Connection</a>(<a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a>* t, <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>* dest_eid, <span class="keywordtype">int</span> <a class="code" href="dtnperf-client_8c.html#6f8059414f0228f0256115e024eeed4b">fd</a>,
<a name="l00087"></a>00087                    in_addr_t client_addr, u_int16_t client_port,
<a name="l00088"></a>00088                    in_addr_t remote_addr, u_int16_t remote_port,
<a name="l00089"></a>00089                    u_int32_t connection_id);
<a name="l00090"></a>00090 
<a name="l00092"></a>00092         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#9e793b4964b82803175567900d953abb" title="Destructor.">~Connection</a>();
<a name="l00093"></a>00093 
<a name="l00095"></a>00095         <span class="keywordtype">int</span> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#990dbc71ac6ca7c53cb1db9afcc55347" title="Virtual from Formatter.">format</a>(<span class="keywordtype">char</span>* <a class="code" href="num2sdnv_8c.html#a81cdcc7ff6987bc85c073253e32715f">buf</a>, <span class="keywordtype">size_t</span> sz) <span class="keyword">const</span>;
<a name="l00096"></a>00096 
<a name="l00098"></a>00098         <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#36405fa5fa3feb354cd9d4a90ae65b79" title="Handle a newly arriving bundle.">handle_bundle</a>(<a class="code" href="structdtn_1_1APIBundle.html" title="Small encapsulating structure for API bundles.">dtn::APIBundle</a>* bundle);
<a name="l00099"></a>00099         
<a name="l00100"></a>00100     <span class="keyword">protected</span>:
<a name="l00101"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#5399c674e34e35d8c833cd307cf83d75">00101</a>         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a>;
<a name="l00102"></a>00102         
<a name="l00104"></a>00104         <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#a6fb5a5ecd36cceb56e26f0317c43419" title="virtual run method">run</a>();
<a name="l00105"></a>00105 
<a name="l00107"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#1936abcb2eea9444a625819c6a7008fb">00107</a>         <a class="code" href="classdtntunnel_1_1TCPTunnel.html" title="Class to manage TCP &amp;lt;-&amp;gt; DTN tunnels.">TCPTunnel</a>* <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#1936abcb2eea9444a625819c6a7008fb" title="The tcp tunnel object.">tcptun_</a>;
<a name="l00108"></a>00108         
<a name="l00110"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#24c9f36b41f11830b16da3f1941d550f">00110</a>         oasys::TCPClient <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#24c9f36b41f11830b16da3f1941d550f" title="The tcp socket.">sock_</a>;
<a name="l00111"></a>00111 
<a name="l00113"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#4f515c0da27217296e41d16644140b72">00113</a>         <a class="code" href="namespacedtn.html#3b449eea73ff25be3bf284318ee5230d" title="Type definition of an oasys blocking message queue that stores APIBundle structures...">dtn::APIBundleQueue</a> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#4f515c0da27217296e41d16644140b72" title="Queue for bundles on this connection.">queue_</a>;
<a name="l00114"></a>00114 
<a name="l00116"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#3a7c8c92c4f2359acf984ca398136a99">00116</a>         <span class="keyword">typedef</span> std::map&lt;u_int32_t, dtn::APIBundle*&gt; <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#3a7c8c92c4f2359acf984ca398136a99" title="Table for out-of-order bundles.">ReorderTable</a>;
<a name="l00117"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#75e657583b10e40f92572862dc650968">00117</a>         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#3a7c8c92c4f2359acf984ca398136a99" title="Table for out-of-order bundles.">ReorderTable</a> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#75e657583b10e40f92572862dc650968">reorder_table_</a>;
<a name="l00118"></a>00118 
<a name="l00120"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#f8ed44c1c4dec18cf6d672fe0e7a1e75">00120</a>         u_int32_t <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#f8ed44c1c4dec18cf6d672fe0e7a1e75" title="Running sequence number counter.">next_seqno_</a>;
<a name="l00121"></a>00121 
<a name="l00123"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#5773bc0689267176a8770c0922c9a6ed">00123</a>         <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a> <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#5773bc0689267176a8770c0922c9a6ed" title="Parameters for the connection.">dest_eid_</a>;
<a name="l00124"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#54970c38de9d3f2917d943b3c43b39ba">00124</a>         in_addr_t         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#54970c38de9d3f2917d943b3c43b39ba">client_addr_</a>;
<a name="l00125"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#6e7f34ac31940c6e5029ab9e972734d9">00125</a>         u_int16_t         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#6e7f34ac31940c6e5029ab9e972734d9">client_port_</a>;
<a name="l00126"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#a594859a720a91b711fed687f56ace6a">00126</a>         in_addr_t         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#a594859a720a91b711fed687f56ace6a">remote_addr_</a>;
<a name="l00127"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#d234bde5bed2d1b59b96aa0ef54f6162">00127</a>         u_int16_t         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#d234bde5bed2d1b59b96aa0ef54f6162">remote_port_</a>;
<a name="l00128"></a><a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#04c3bb39d6fbb6de547c3960f46db885">00128</a>         u_int32_t         <a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html#04c3bb39d6fbb6de547c3960f46db885">connection_id_</a>;
<a name="l00129"></a>00129     };
<a name="l00130"></a>00130 
<a name="l00132"></a>00132     u_int32_t <a class="code" href="classdtntunnel_1_1TCPTunnel.html#a400a9b8c4fda2a4b72352220ab58900" title="Return the next connection id.">next_connection_id</a>();
<a name="l00133"></a>00133 
<a name="l00135"></a>00135     <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel.html#82b6c2ff15a1cc137ec0d8df781e8c0a" title="Hook called by the listener when a new connection comes in.">new_connection</a>(<a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html" title="Helper class to handle an actively proxied connection.">Connection</a>* c);
<a name="l00136"></a>00136 
<a name="l00138"></a>00138     <span class="keywordtype">void</span> <a class="code" href="classdtntunnel_1_1TCPTunnel.html#722f77fa0b3727e267010a619ad17734" title="Hook called when a new connection dies.">kill_connection</a>(<a class="code" href="classdtntunnel_1_1TCPTunnel_1_1Connection.html" title="Helper class to handle an actively proxied connection.">Connection</a>* c);
<a name="l00139"></a>00139 
<a name="l00141"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html">00141</a>     <span class="keyword">struct </span><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html" title="Helper struct used as the index key into the connection table.">ConnKey</a> {
<a name="l00142"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9c85685a9a5dcc2365059f4bbb480776">00142</a>         <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9c85685a9a5dcc2365059f4bbb480776">ConnKey</a>()
<a name="l00143"></a>00143             : <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#5f80abeb41e79e3be99c552aca84bdc1">endpoint_id_</a>(<span class="stringliteral">""</span>),
<a name="l00144"></a>00144               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#3c81cd066c9346f1531ce88cf7ff2926">client_addr_</a>(INADDR_NONE), <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9e2615dada288b5ceeed0203b88fa6e3">client_port_</a>(0),
<a name="l00145"></a>00145               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#2864f2d3252da1da4ef8acc664baa7ed">remote_addr_</a>(INADDR_NONE), <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#acfc4c509ec267a0c602ceb080f4f66d">remote_port_</a>(0),
<a name="l00146"></a>00146               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#830b7db242046d6b63452a8823f202d1">connection_id_</a>(0) {}
<a name="l00147"></a>00147 
<a name="l00148"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#2360b051e739e16f68a9d1ec240293fe">00148</a>         <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9c85685a9a5dcc2365059f4bbb480776">ConnKey</a>(<span class="keyword">const</span> <a class="code" href="structdtn__endpoint__id__t.html" title="Specification of a dtn endpoint id, i.e.">dtn_endpoint_id_t</a>&amp; eid,
<a name="l00149"></a>00149                 in_addr_t client_addr, u_int16_t client_port,
<a name="l00150"></a>00150                 in_addr_t remote_addr, u_int16_t remote_port,
<a name="l00151"></a>00151                 u_int32_t connection_id)
<a name="l00152"></a>00152             : <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#5f80abeb41e79e3be99c552aca84bdc1">endpoint_id_</a>(eid.uri),
<a name="l00153"></a>00153               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#3c81cd066c9346f1531ce88cf7ff2926">client_addr_</a>(client_addr),
<a name="l00154"></a>00154               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9e2615dada288b5ceeed0203b88fa6e3">client_port_</a>(client_port),
<a name="l00155"></a>00155               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#2864f2d3252da1da4ef8acc664baa7ed">remote_addr_</a>(remote_addr),
<a name="l00156"></a>00156               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#acfc4c509ec267a0c602ceb080f4f66d">remote_port_</a>(remote_port),
<a name="l00157"></a>00157               <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#830b7db242046d6b63452a8823f202d1">connection_id_</a>(connection_id) {}
<a name="l00158"></a>00158 
<a name="l00159"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#e3af6f765f3408e8d7bfa8f4bd0a2b42">00159</a>         <span class="keywordtype">bool</span> <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#e3af6f765f3408e8d7bfa8f4bd0a2b42">operator&lt;</a>(<span class="keyword">const</span> <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html" title="Helper struct used as the index key into the connection table.">ConnKey</a>&amp; other)<span class="keyword"> const</span>
<a name="l00160"></a>00160 <span class="keyword">        </span>{
<a name="l00161"></a>00161 <span class="preprocessor">            #define COMPARE(_x) if (_x != other._x) return _x &lt; other._x;</span>
<a name="l00162"></a>00162 <span class="preprocessor"></span>            <a class="code" href="TCPTunnel_8h.html#de82d452f9013ada423defd040203af6">COMPARE</a>(<a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#830b7db242046d6b63452a8823f202d1">connection_id_</a>);
<a name="l00163"></a>00163             <a class="code" href="TCPTunnel_8h.html#de82d452f9013ada423defd040203af6">COMPARE</a>(<a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#3c81cd066c9346f1531ce88cf7ff2926">client_addr_</a>);
<a name="l00164"></a>00164             <a class="code" href="TCPTunnel_8h.html#de82d452f9013ada423defd040203af6">COMPARE</a>(<a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9e2615dada288b5ceeed0203b88fa6e3">client_port_</a>);
<a name="l00165"></a>00165             <a class="code" href="TCPTunnel_8h.html#de82d452f9013ada423defd040203af6">COMPARE</a>(<a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#2864f2d3252da1da4ef8acc664baa7ed">remote_addr_</a>);
<a name="l00166"></a>00166             <a class="code" href="TCPTunnel_8h.html#de82d452f9013ada423defd040203af6">COMPARE</a>(<a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#acfc4c509ec267a0c602ceb080f4f66d">remote_port_</a>);
<a name="l00167"></a>00167 <span class="preprocessor">            #undef COMPARE</span>
<a name="l00168"></a>00168 <span class="preprocessor"></span>
<a name="l00169"></a>00169             <span class="keywordflow">return</span> <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#5f80abeb41e79e3be99c552aca84bdc1">endpoint_id_</a> &lt; other.<a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#5f80abeb41e79e3be99c552aca84bdc1">endpoint_id_</a>;
<a name="l00170"></a>00170         }
<a name="l00171"></a>00171 
<a name="l00172"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#5f80abeb41e79e3be99c552aca84bdc1">00172</a>         std::string <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#5f80abeb41e79e3be99c552aca84bdc1">endpoint_id_</a>;
<a name="l00173"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#3c81cd066c9346f1531ce88cf7ff2926">00173</a>         in_addr_t   <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#3c81cd066c9346f1531ce88cf7ff2926">client_addr_</a>;
<a name="l00174"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9e2615dada288b5ceeed0203b88fa6e3">00174</a>         u_int16_t   <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#9e2615dada288b5ceeed0203b88fa6e3">client_port_</a>;
<a name="l00175"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#2864f2d3252da1da4ef8acc664baa7ed">00175</a>         in_addr_t   <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#2864f2d3252da1da4ef8acc664baa7ed">remote_addr_</a>;
<a name="l00176"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#acfc4c509ec267a0c602ceb080f4f66d">00176</a>         u_int16_t   <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#acfc4c509ec267a0c602ceb080f4f66d">remote_port_</a>;
<a name="l00177"></a><a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#830b7db242046d6b63452a8823f202d1">00177</a>         u_int32_t   <a class="code" href="structdtntunnel_1_1TCPTunnel_1_1ConnKey.html#830b7db242046d6b63452a8823f202d1">connection_id_</a>;
<a name="l00178"></a>00178     };
<a name="l00179"></a>00179 
<a name="l00181"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html#68aab7171556c6a29bdb5f369804f51f">00181</a>     <span class="keyword">typedef</span> std::map&lt;ConnKey, Connection*&gt; <a class="code" href="classdtntunnel_1_1TCPTunnel.html#68aab7171556c6a29bdb5f369804f51f" title="Table of connection classes indexed by the remote address/port.">ConnTable</a>;
<a name="l00182"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html#94b9f9bc1e134be44f6dd942d4398b60">00182</a>     <a class="code" href="classdtntunnel_1_1TCPTunnel.html#68aab7171556c6a29bdb5f369804f51f" title="Table of connection classes indexed by the remote address/port.">ConnTable</a> <a class="code" href="classdtntunnel_1_1TCPTunnel.html#94b9f9bc1e134be44f6dd942d4398b60">connections_</a>;
<a name="l00183"></a>00183 
<a name="l00186"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html#84a4aadbaa3d0e61d03ee453c6639588">00186</a>     <span class="keyword">typedef</span> std::map&lt;ConnKey, dtn::APIBundleVector*&gt; <a class="code" href="classdtntunnel_1_1TCPTunnel.html#84a4aadbaa3d0e61d03ee453c6639588" title="Table of bundles that arrive out of order before the connection is set up.">NoConnBundleTable</a>;
<a name="l00187"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html#9d330834f0141da1002e3e005f217854">00187</a>     <a class="code" href="classdtntunnel_1_1TCPTunnel.html#84a4aadbaa3d0e61d03ee453c6639588" title="Table of bundles that arrive out of order before the connection is set up.">NoConnBundleTable</a> <a class="code" href="classdtntunnel_1_1TCPTunnel.html#9d330834f0141da1002e3e005f217854">no_conn_bundles_</a>;
<a name="l00188"></a>00188 
<a name="l00190"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html#72bf262d24541e93bd5bbf24612b9a44">00190</a>     oasys::SpinLock <a class="code" href="classdtntunnel_1_1TCPTunnel.html#72bf262d24541e93bd5bbf24612b9a44" title="Lock to protect the connections table.">lock_</a>;
<a name="l00191"></a>00191 
<a name="l00193"></a><a class="code" href="classdtntunnel_1_1TCPTunnel.html#a57571781241fb2284c83e093cc557d5">00193</a>     u_int32_t <a class="code" href="classdtntunnel_1_1TCPTunnel.html#a57571781241fb2284c83e093cc557d5" title="Increasing counter for connection identifiers.">next_connection_id_</a>;
<a name="l00194"></a>00194 };
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 } <span class="comment">// namespace dtntunnel</span>
<a name="l00197"></a>00197 
<a name="l00198"></a>00198 <span class="preprocessor">#endif </span><span class="comment">/* _TCPTUNNEL_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&nbsp;
<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>