<!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: TcaRouter.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <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> <h1>TcaRouter.h</h1><a href="TcaRouter_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 2005-2006 University of Waterloo</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 <a name="l00018"></a>00018 <span class="preprocessor">#ifndef _TCA_ROUTER_H_</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define _TCA_ROUTER_H_</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="EndpointID_8h.html">naming/EndpointID.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="TableBasedRouter_8h.html">TableBasedRouter.h</a>"</span> <a name="l00023"></a>00023 <a name="l00024"></a><a class="code" href="TcaRouter_8h.html#dd53741e5f8e6909e8a139e4acaf3ff7">00024</a> <span class="preprocessor">#define SERVLIB 1</span> <a name="l00025"></a>00025 <span class="preprocessor"></span><span class="comment">//#include "TcaTypes.h"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="servlib_2routing_2TcaEndpointID_8h.html">TcaEndpointID.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="TcaControlBundle_8h.html">TcaControlBundle.h</a>"</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="keyword">namespace </span>dtn { <a name="l00031"></a>00031 <a name="l00032"></a>00032 <a name="l00049"></a><a class="code" href="classdtn_1_1TcaRouter.html">00049</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1TcaRouter.html" title="This is the implementation of the TCA bundle routing algorithm.">TcaRouter</a> : <span class="keyword">public</span> <a class="code" href="classdtn_1_1TableBasedRouter.html" title="This is an abstract class that is intended to be used for all routing algorithms...">TableBasedRouter</a> { <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="keyword">public</span>: <a name="l00052"></a>00052 <a name="l00053"></a><a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b24b40fd54ee6b0189d5984e209b4082dc1">00053</a> <span class="keyword">enum</span> <a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b24">Role</a> { <a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b241af3143a7a9f53ce46551848a9d23e1a">TCA_MOBILE</a>, <a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b24b40fd54ee6b0189d5984e209b4082dc1">TCA_ROUTER</a>, <a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b24aa6e45693173fd8231cbdcd4a6d3c6b9">TCA_GATEWAY</a> }; <a name="l00054"></a>00054 <a name="l00055"></a>00055 <span class="comment">// Internal bundle-forwarding rule.</span> <a name="l00056"></a>00056 <span class="comment">// This mostly has to do with how to treat the default route</span> <a name="l00057"></a>00057 <span class="comment">// (UDR = "Use Default Route").</span> <a name="l00058"></a><a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82">00058</a> <span class="keyword">enum</span> <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82">ForwardingRule</a> { <a name="l00059"></a><a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82a7ff8cbd1e8adcc7d83834c9b22c5ce9">00059</a> <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82a7ff8cbd1e8adcc7d83834c9b22c5ce9">FWD_NEVER</a>, <span class="comment">// do not forward, ever</span> <a name="l00060"></a><a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf8245a9e3815c6eaa77c5ce35ae1b1cede1">00060</a> <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf8245a9e3815c6eaa77c5ce35ae1b1cede1">FWD_UDR_EXCLUSIVELY</a>, <span class="comment">// forward (only) to the default route</span> <a name="l00061"></a><a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82c09b112c6e73eddf14d211043905dcab">00061</a> <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82c09b112c6e73eddf14d211043905dcab">FWD_UDR_NEVER</a>, <span class="comment">// fwd to matching, except default route</span> <a name="l00062"></a><a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf829083ad4aa536bc2c6d7f0a5be4fd3604">00062</a> <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf829083ad4aa536bc2c6d7f0a5be4fd3604">FWD_UDR_IFNECESSARY</a>, <span class="comment">// fwd to matching, using default route iff</span> <a name="l00063"></a>00063 <span class="comment">// no other matches</span> <a name="l00064"></a><a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf8299689a5b013eef9e17cdc411004797d3">00064</a> <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf8299689a5b013eef9e17cdc411004797d3">FWD_UDR_ALWAYS</a> <span class="comment">// forward to matching, including default route</span> <a name="l00065"></a>00065 }; <a name="l00066"></a>00066 <a name="l00067"></a>00067 <a class="code" href="classdtn_1_1TcaRouter.html#05195a84a9e4d7bb169e449d2dd2edba">TcaRouter</a>(<a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b24">Role</a> <a class="code" href="tca__admin_8cc.html#61a55e29b77f88331554bca442ce7cd8">role</a>); <a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="keyword">protected</span>: <a name="l00070"></a>00070 <a name="l00071"></a><a class="code" href="classdtn_1_1TcaRouter.html#95d98e32fedc60c6e192fdf083c21341">00071</a> <a class="code" href="classdtn_1_1TcaRouter.html#7937c9ef257ad4c0d45e44947ed48b24">Role</a> <a class="code" href="classdtn_1_1TcaRouter.html#95d98e32fedc60c6e192fdf083c21341">role_</a>; <a name="l00072"></a>00072 <a name="l00073"></a><a class="code" href="classdtn_1_1TcaRouter.html#10687890eaf780ed184c4ec5da372666">00073</a> <a class="code" href="classdtn_1_1TcaEndpointID.html">TcaEndpointID</a> <a class="code" href="classdtn_1_1TcaRouter.html#10687890eaf780ed184c4ec5da372666">admin_app_</a>; <span class="comment">// eid of local admin application</span> <a name="l00074"></a>00074 <a name="l00075"></a>00075 std::string <a class="code" href="classdtn_1_1TcaRouter.html#3a1969acd0d8c88b00a3e83907b1846e">get_role_str</a>() <span class="keyword">const</span>; <a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="comment">// BundleEventHandler functions to handle events important to TCA.</span> <a name="l00078"></a>00078 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#20fc6b94067656bf6d3d32cba7d836c8" title="Event handlers.">handle_bundle_received</a>(<a class="code" href="classdtn_1_1BundleReceivedEvent.html" title="Event class for new bundle arrivals.">BundleReceivedEvent</a>* event); <a name="l00079"></a>00079 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#5ac83a679cce9bf7b5025e46a3c88d65" title="Event handlers.">handle_bundle_transmitted</a>(<a class="code" href="classdtn_1_1BundleTransmittedEvent.html" title="Event class for bundle or fragment transmission.">BundleTransmittedEvent</a>* event); <a name="l00080"></a>00080 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#9cac11025de364655eb960b8b549a92c" title="Event handlers.">handle_contact_up</a>(<a class="code" href="classdtn_1_1ContactUpEvent.html" title="Event class for contact up events.">ContactUpEvent</a>* event); <a name="l00081"></a>00081 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#87986c1aa06a4894ecf4b14f932a8442" title="Event handlers.">handle_contact_down</a>(<a class="code" href="classdtn_1_1ContactDownEvent.html" title="Event class for contact down events.">ContactDownEvent</a>* event); <a name="l00082"></a>00082 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#b02a4586e8162b8aec0a550113d6c6ee" title="Event handlers.">handle_link_available</a>(<a class="code" href="classdtn_1_1LinkAvailableEvent.html" title="Event class for link available events.">LinkAvailableEvent</a>* event); <a name="l00083"></a>00083 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#562dd2754090394f77e36afdf499277f" title="Default event handler when a link is unavailable.">handle_link_unavailable</a>(<a class="code" href="classdtn_1_1LinkUnavailableEvent.html" title="Event class for link unavailable events.">LinkUnavailableEvent</a>* event); <a name="l00084"></a>00084 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TcaRouter.html#c95d8b17913afe853007097bc00b89cd" title="Default event handler for shutdown requests.">handle_shutdown_request</a>(<a class="code" href="classdtn_1_1ShutdownRequest.html" title="Event class for shutting down a daemon.">ShutdownRequest</a>* event); <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="comment">// fwd function to broadcast a bundle to everybody in the route table</span> <a name="l00087"></a>00087 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1TcaRouter.html#df87be853cdf09fd7d86ae7c5f8ebde9">fwd_to_all</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00088"></a>00088 <a name="l00089"></a>00089 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1TcaRouter.html#4080d20ce9043bc8f1d21be0c619b99d">fwd_to_matching</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& next_hop); <a name="l00090"></a><a class="code" href="classdtn_1_1TcaRouter.html#bc244d6ffe3def07c458c0222cc4609d">00090</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1TcaRouter.html#4080d20ce9043bc8f1d21be0c619b99d">fwd_to_matching</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle) { <a name="l00091"></a>00091 <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> link(<span class="stringliteral">"TcaRouter::fwd_to_matching: null"</span>); <a name="l00092"></a>00092 <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1TcaRouter.html#4080d20ce9043bc8f1d21be0c619b99d">fwd_to_matching</a>(bundle, link); <a name="l00093"></a>00093 } <a name="l00094"></a>00094 <a name="l00095"></a>00095 <span class="comment">// fwd function with special forwarding rules for default route</span> <a name="l00096"></a>00096 <span class="comment">// used for forwarding unbound tca bundles and some tca control bundles</span> <a name="l00097"></a>00097 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1TcaRouter.html#4dcc5aebccb8bc0693bcea7d78acc266">fwd_to_matching_r</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& next_hop, <a name="l00098"></a>00098 <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82">ForwardingRule</a> fwd_rule); <a name="l00099"></a>00099 <a name="l00100"></a>00100 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#fab3841fcc54865c4cfd34b83c45662d">on_coa_transmitted</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00101"></a>00101 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#9af48c77978fae70fc76c23e4d34992f">on_ask_transmitted</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00102"></a>00102 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#b6813fbb3c85d4999435f5ac06009d2e">on_adv_transmitted</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="comment">// special control bundle handlers</span> <a name="l00105"></a>00105 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#a7c14a283ad6f6241529dbcbc02255cd">handle_register</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b); <a name="l00106"></a>00106 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#d97182b3e5c3f04a0f630653d77def65">handle_coa</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b); <a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="comment">// handle bundle sent to anonymous address</span> <a name="l00109"></a>00109 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#baee51212bd5482452dc79c9d73d6004">handle_anonymous_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b); <a name="l00110"></a>00110 <a name="l00111"></a>00111 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#c3404881d57c999de16b413319835752">handle_ask</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00112"></a>00112 <a name="l00113"></a>00113 <span class="comment">// handle control bundles addressed to bundlelayer</span> <a name="l00114"></a>00114 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#f4894d57a18a6ee67d602b8fdb047286">handle_bl_control_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b); <a name="l00115"></a>00115 <a name="l00116"></a>00116 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#eed6598bb8d42f6e6a31043e4d244ba2">handle_bl_ask</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00117"></a>00117 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#44b8ea0c59a125efb522f4dc59f064b4">handle_get_routes</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00118"></a>00118 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#ffcedb6ebf00cc9bb32c961cae93ceb3">handle_add_route</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00119"></a>00119 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#670c32c1769f2381e678d3b8e3889fba">handle_del_route</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b, <span class="keyword">const</span> <a class="code" href="classdtn_1_1TcaControlBundle.html">TcaControlBundle</a>& cb); <a name="l00120"></a>00120 <a name="l00121"></a>00121 <span class="comment">// handle regular late-bound tca data bundle</span> <a name="l00122"></a>00122 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#e72174b3667dd66ecc6201c2f6cfba24">handle_tca_unbound_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00123"></a>00123 <a name="l00124"></a>00124 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#0312f1b487ac07d2d03e1792da022765">on_route_unbound_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00125"></a>00125 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#7580d5b040d9a60b649e541a6c64232c">on_gate_unbound_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00126"></a>00126 <a name="l00127"></a>00127 <span class="comment">// did the bundle originate at this node?</span> <a name="l00128"></a>00128 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#f4924ec881e6f55024714928560fc53c">is_local_source</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b); <a name="l00129"></a>00129 <a name="l00130"></a>00130 <a class="code" href="classdtn_1_1TcaRouter.html#9c0f7c470ee32d86df8ccdd6145eaf82">ForwardingRule</a> <a class="code" href="classdtn_1_1TcaRouter.html#a6617e273b45487a85ec11cbdb997ac0">get_forwarding_rule</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b); <a name="l00131"></a>00131 <a name="l00132"></a>00132 <span class="comment">// create a link entry for the given address</span> <a name="l00133"></a>00133 <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> <a class="code" href="classdtn_1_1TcaRouter.html#429cb314c948f703f5ed21a8c8820bdb">create_link</a>(<span class="keyword">const</span> std::string& link_addr); <a name="l00134"></a>00134 <a name="l00135"></a>00135 <span class="comment">// create a route entry for the given endpoint pattern, specified link</span> <a name="l00136"></a>00136 <a class="code" href="classdtn_1_1RouteEntry.html" title="Class to represent route table entry.">RouteEntry</a>* <a class="code" href="classdtn_1_1TcaRouter.html#365edc775bc1481550f313c1366040e0">create_route</a>(<span class="keyword">const</span> std::string& <a class="code" href="dtnperf-client_8c.html#71808395b2460b32d8b1048e44faef6e">pattern</a>, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& p_link); <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="comment">// create a route *and link* if necessary, for the given endpoint pattern,</span> <a name="l00139"></a>00139 <span class="comment">// given link address</span> <a name="l00140"></a>00140 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#365edc775bc1481550f313c1366040e0">create_route</a>(<span class="keyword">const</span> std::string& <a class="code" href="dtnperf-client_8c.html#71808395b2460b32d8b1048e44faef6e">pattern</a>, <a name="l00141"></a>00141 <span class="keyword">const</span> std::string& link_addr); <a name="l00142"></a>00142 <a name="l00143"></a>00143 <span class="comment">// Ultra-simplified helper function to inject a new bundle into</span> <a name="l00144"></a>00144 <span class="comment">// the works, using defaults for most fields.</span> <a name="l00145"></a>00145 <span class="comment">// Specify empty src for bundlelayer</span> <a name="l00146"></a>00146 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#5619ce73ca0f8b6e94c0bee312d6a18f">post_bundle</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& <a class="code" href="dtnmoteproxy_8c.html#e1ade0f5a1b32f6c8be72f31a99e2a18">src</a>, <span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& dest, <a name="l00147"></a>00147 <span class="keyword">const</span> std::string& payload); <a name="l00148"></a>00148 <a name="l00149"></a>00149 <span class="comment">// Ultra-simplified helper function to post a wrapped bundle to the</span> <a name="l00150"></a>00150 <span class="comment">// admin app. This is in lieu of a WrappedBundle class.</span> <a name="l00151"></a>00151 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TcaRouter.html#b26c21545be05b3acb0853135646e85f">push_wrapped_bundle</a>(<span class="keyword">const</span> std::string& code, <a name="l00152"></a>00152 <span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& <a class="code" href="dtnmoteproxy_8c.html#e1ade0f5a1b32f6c8be72f31a99e2a18">src</a>, <a name="l00153"></a>00153 <span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& dest, <a name="l00154"></a>00154 <span class="keyword">const</span> std::string& bsp); <a name="l00155"></a>00155 <a name="l00156"></a>00156 }; <a name="l00157"></a>00157 <a name="l00158"></a>00158 } <span class="comment">// namespace dtn</span> <a name="l00159"></a>00159 <a name="l00160"></a>00160 <span class="preprocessor">#endif </span><span class="comment">/* _TCA_ROUTER_H_ */</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Mon Jul 21 14:09:47 2008 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.6 </small></address> </body> </html>