Sophie

Sophie

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

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: ProphetBundleCore.cc 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>ProphetBundleCore.cc</h1><a href="ProphetBundleCore_8cc.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 2007 Baylor University</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">#ifdef HAVE_CONFIG_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;<a class="code" href="dtn-config_8h.html">dtn-config.h</a>&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#endif</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="BundleStore_8h.html">storage/BundleStore.h</a>"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="BundleTimestamp_8h.html">bundling/BundleTimestamp.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="BundleDaemon_8h.html">bundling/BundleDaemon.h</a>"</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="ProphetTimer_8h.html">ProphetTimer.h</a>"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;oasys/util/Random.h&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="BundleRouter_8h.html">BundleRouter.h</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="ProphetBundleCore_8h.html">ProphetBundleCore.h</a>"</span>
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="ProphetBundleCore_8cc.html#259e390b81bb640af4691776b15a9116">00031</a> <span class="preprocessor">#define LOG(_args...) print_log("core",LOG_DEBUG,_args);</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a><a class="code" href="ProphetBundleCore_8cc.html#a48474920cf8a04d161a450fc31bd0e6">00033</a> <span class="preprocessor">#define TEST_MODE_QUOTA 0xffffffff</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="keyword">namespace </span>dtn
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 
<a name="l00038"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#51d7ce77085e8a409489b7c7fe301ae6">00038</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#51d7ce77085e8a409489b7c7fe301ae6" title="Constructor.">ProphetBundleCore::ProphetBundleCore</a>(<span class="keyword">const</span> std::string&amp; local_eid,
<a name="l00039"></a>00039                                      <a class="code" href="classdtn_1_1BundleActions.html" title="Intermediary class that provides a utility interface to help routers more easily...">BundleActions</a>* actions,
<a name="l00040"></a>00040                                      oasys::SpinLock* lock)
<a name="l00041"></a>00041     : oasys::<a class="code" href="classoasys_1_1Logger.html">Logger</a>(<span class="stringliteral">"ProphetBundleCore"</span>,<span class="stringliteral">"/dtn/route/prophet"</span>),
<a name="l00042"></a>00042       actions_(actions),
<a name="l00043"></a>00043       bundles_(this),
<a name="l00044"></a>00044       local_eid_(local_eid),
<a name="l00045"></a>00045       lock_(lock),
<a name="l00046"></a>00046       test_mode_(false)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048     <a class="code" href="SDNV_8cc.html#ca68c0d4ac8df0838e209fb5300f7be3">ASSERT</a>(<a class="code" href="classdtn_1_1ProphetBundleCore.html#28247942ac5a5db76cdd32353370169d" title="actions interface for send, delete, etc">actions_</a> != NULL);
<a name="l00049"></a>00049     oasys::Random::seed(time(0));
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#d8159ade4eb431273e9d3350e6ba6d88">00052</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#51d7ce77085e8a409489b7c7fe301ae6" title="Constructor.">ProphetBundleCore::ProphetBundleCore</a>(oasys::Builder)
<a name="l00053"></a>00053     : oasys::<a class="code" href="classoasys_1_1Logger.html">Logger</a>(<span class="stringliteral">"ProphetBundleCore"</span>,<span class="stringliteral">"/dtn/route/prophet/test"</span>),
<a name="l00054"></a>00054       actions_(NULL),
<a name="l00055"></a>00055       bundles_(this),
<a name="l00056"></a>00056       lock_(NULL)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058     <a class="code" href="classdtn_1_1ProphetBundleCore.html#af452604d6bdefe329fe72626276df95" title="test constructor used, meaning that BundleDaemon is unavailable">test_mode_</a> = <span class="keyword">true</span>;
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 <span class="keywordtype">void</span>
<a name="l00062"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#8a5f42d5706c67c8874f8507a16c97e2">00062</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#8a5f42d5706c67c8874f8507a16c97e2" title="Initialization routine for loading Bundle metadata into Prophet&amp;#39;s facade.">ProphetBundleCore::load_dtn_bundles</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1BundleList.html" title="List structure for handling bundles.">BundleList</a>* bundles)
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064     <a class="code" href="SDNV_8cc.html#ca68c0d4ac8df0838e209fb5300f7be3">ASSERT</a>(bundles != NULL);
<a name="l00065"></a>00065     oasys::ScopeLock l(bundles-&gt;<a class="code" href="classdtn_1_1BundleList.html#0d0c9f789f0f7f7d1cda3b4ecf32d2bc" title="Return the internal lock on this list.">lock</a>(),<span class="stringliteral">"ProphetBundleCore::constructor"</span>);
<a name="l00066"></a>00066     <span class="keywordflow">for</span> (<a class="code" href="classdtn_1_1BundleList.html#1d52b8d6bb7d8a07e5d4f5fc4b5b61d2" title="Type for an iterator, which just wraps an stl iterator.">BundleList::iterator</a> i = bundles-&gt;<a class="code" href="classdtn_1_1BundleList.html#24cd371acd62f2f9725ff3f92b55badf" title="Iterator used to iterate through the list.">begin</a>();
<a name="l00067"></a>00067             i != bundles-&gt;<a class="code" href="classdtn_1_1BundleList.html#19f95941fe436d25ba49ae0b2d8bf2c1" title="Iterator used to mark the end of the list.">end</a>(); i++)
<a name="l00068"></a>00068     {
<a name="l00069"></a>00069         <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a> ref(<span class="stringliteral">"ProphetBundleCore"</span>);
<a name="l00070"></a>00070         ref = *i;
<a name="l00071"></a>00071         <span class="keyword">add</span>(ref);
<a name="l00072"></a>00072     }
<a name="l00073"></a>00073     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"added %zu bundles to core"</span>,bundles-&gt;<a class="code" href="classdtn_1_1BundleList.html#3c50c6f421631a4dd72b7b77b0660bc3" title="Return the size of the list.">size</a>());
<a name="l00074"></a>00074 }
<a name="l00075"></a>00075 
<a name="l00076"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#d1c03d7f36b85902bf04851ccedecb41">00076</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#d1c03d7f36b85902bf04851ccedecb41" title="Destructor.">ProphetBundleCore::~ProphetBundleCore</a>()
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 <span class="keywordtype">bool</span>
<a name="l00081"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#41b8f2fddbfebd06f18e9ba8fce619b5">00081</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#41b8f2fddbfebd06f18e9ba8fce619b5" title="Virtual from prophet::BundleCore.">ProphetBundleCore::should_fwd</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>* b,
<a name="l00082"></a>00082                               <span class="keyword">const</span> <a class="code" href="classprophet_1_1Link.html">prophet::Link</a>* link)<span class="keyword"> const</span>
<a name="l00083"></a>00083 <span class="keyword"></span>{
<a name="l00084"></a>00084     <span class="comment">// convert Facade objects into DTN objects</span>
<a name="l00085"></a>00085     <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a> bundle(<span class="stringliteral">"should_fwd"</span>);
<a name="l00086"></a>00086     bundle = <a class="code" href="classdtn_1_1ProphetBundleCore.html#523fafcbef972e062ebe3c411dd7dc2f" title="objects that link DTN to Prophet bundles">bundles_</a>.<a class="code" href="classdtn_1_1ProphetBundleList.html#07853b9e4a046a0503ad68d28d44f330" title="Given a prophet object, return dtn::BundleRef&amp;amp;.">find_ref</a>(b).object();
<a name="l00087"></a>00087     <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> nexthop(<span class="stringliteral">"should_fwd"</span>);
<a name="l00088"></a>00088     nexthop = <a class="code" href="classdtn_1_1ProphetBundleCore.html#262a351626af35ced9e7604c9ef0134e" title="objects that link DTN to Prophet links">links_</a>.<a class="code" href="classdtn_1_1ProphetLinkList.html#74ea0dad9af6d840266e3ef9be6b9faa" title="Given prophet object, return dtn::LinkRef&amp;amp;.">find_ref</a>(link).object();
<a name="l00089"></a>00089     <a class="code" href="classdtn_1_1ProphetBundleCore.html" title="Implements the prophet::BundleCore API by integrating DTN&amp;#39;s system services.">ProphetBundleCore</a>* me = <span class="keyword">const_cast&lt;</span><a class="code" href="classdtn_1_1ProphetBundleCore.html" title="Implements the prophet::BundleCore API by integrating DTN&amp;#39;s system services.">ProphetBundleCore</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>);
<a name="l00090"></a>00090     <span class="comment">// if DTN objects are non-NULL ...</span>
<a name="l00091"></a>00091     <span class="keywordflow">if</span> (bundle.object() != NULL &amp;&amp; nexthop.object() != NULL)
<a name="l00092"></a>00092     {
<a name="l00093"></a>00093         <span class="keywordflow">if</span> (<a class="code" href="classdtn_1_1ProphetBundleCore.html#af452604d6bdefe329fe72626276df95" title="test constructor used, meaning that BundleDaemon is unavailable">test_mode_</a>) <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00094"></a>00094         <a class="code" href="classdtn_1_1BundleRouter.html" title="The BundleRouter is the main decision maker for all routing decisions related to...">BundleRouter</a>* router = BundleDaemon::instance()-&gt;router();
<a name="l00095"></a>00095         <span class="keywordtype">bool</span> ok = <span class="keyword">false</span>;
<a name="l00096"></a>00096         <span class="keywordflow">if</span> (router != NULL)
<a name="l00097"></a>00097         {
<a name="l00098"></a>00098             ok = router-&gt;<a class="code" href="classdtn_1_1BundleRouter.html#b30e99f427cc0526fce08b77e0ae95c7" title="Check if the bundle should be forwarded to the given next hop.">should_fwd</a>(bundle.object(),nexthop);
<a name="l00099"></a>00099             <span class="keywordflow">if</span> (me != NULL) 
<a name="l00100"></a>00100                 me-&gt;<a class="code" href="classdtn_1_1ProphetBundleCore.html#ff15d52706f454338dc3b85b5e27af28" title="Virtual from prophet::BundleCore.">print_log</a>(<span class="stringliteral">"core"</span>,<a class="code" href="classprophet_1_1BundleCore.html#494b3a7c2b761b5b79873ea016ab8cc8" title="Log level.">LOG_DEBUG</a>,
<a name="l00101"></a>00101                           <span class="stringliteral">"BundleRouter says%sok to fwd *%p"</span>,
<a name="l00102"></a>00102                           ok ? <span class="stringliteral">" "</span> : <span class="stringliteral">" not "</span>, bundle.object());
<a name="l00103"></a>00103         }
<a name="l00104"></a>00104         <span class="keywordflow">return</span> ok;
<a name="l00105"></a>00105     } 
<a name="l00106"></a>00106     <span class="keywordflow">else</span>
<a name="l00107"></a>00107     {
<a name="l00108"></a>00108         <span class="keywordflow">if</span> (me != NULL) 
<a name="l00109"></a>00109             me-&gt;<a class="code" href="classdtn_1_1ProphetBundleCore.html#ff15d52706f454338dc3b85b5e27af28" title="Virtual from prophet::BundleCore.">print_log</a>(<span class="stringliteral">"core"</span>,<a class="code" href="classprophet_1_1BundleCore.html#494b3a7c2b761b5b79873ea016ab8cc8" title="Log level.">LOG_DEBUG</a>,
<a name="l00110"></a>00110                     <span class="stringliteral">"failed to convert prophet handle to DTN object"</span>);
<a name="l00111"></a>00111     }
<a name="l00112"></a>00112     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="keywordtype">bool</span>
<a name="l00116"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#90e8d30f6e84420cb0dedf94e7f0584b">00116</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#90e8d30f6e84420cb0dedf94e7f0584b" title="Virtual from prophet::BundleCore.">ProphetBundleCore::is_route</a>(<span class="keyword">const</span> std::string&amp; dest_id,
<a name="l00117"></a>00117                             <span class="keyword">const</span> std::string&amp; route)<span class="keyword"> const</span>
<a name="l00118"></a>00118 <span class="keyword"></span>{
<a name="l00119"></a>00119     <a class="code" href="classdtn_1_1EndpointIDPattern.html" title="A Distinct class for endpoint patterns (i.e.">EndpointIDPattern</a> routeid(<a class="code" href="classdtn_1_1ProphetBundleCore.html#9fa1cc138d96df53f2984dedab3495b7" title="Virtual from prophet::BundleCore.">get_route_pattern</a>(route));
<a name="l00120"></a>00120     <span class="keywordflow">return</span> routeid.<a class="code" href="classdtn_1_1EndpointIDPattern.html#551ee984666d2079f9ccdc5514dcbdc6" title="Shortcut to the matching functionality implemented by the scheme.">match</a>(<a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>(dest_id));
<a name="l00121"></a>00121 }
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 std::string
<a name="l00124"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#9fa1cc138d96df53f2984dedab3495b7">00124</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#9fa1cc138d96df53f2984dedab3495b7" title="Virtual from prophet::BundleCore.">ProphetBundleCore::get_route_pattern</a>(<span class="keyword">const</span> std::string&amp; dest_id)<span class="keyword"> const</span>
<a name="l00125"></a>00125 <span class="keyword"></span>{
<a name="l00126"></a>00126     std::string routeid = <a class="code" href="classdtn_1_1ProphetBundleCore.html#3af8d47db2a95a24cae949a7ae182c88" title="Virtual from prophet::BundleCore.">get_route</a>(dest_id);
<a name="l00127"></a>00127     <a class="code" href="classdtn_1_1EndpointIDPattern.html" title="A Distinct class for endpoint patterns (i.e.">EndpointIDPattern</a> route(routeid);
<a name="l00128"></a>00128     <span class="keywordflow">if</span> (!route.<a class="code" href="classdtn_1_1EndpointID.html#783433d2a8111f33c8a166921bd43b44" title="Append a wildcard (in a scheme-specific manner) to form a route pattern.">append_service_wildcard</a>())
<a name="l00129"></a>00129         <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
<a name="l00130"></a>00130     <span class="keywordflow">return</span> route.<a class="code" href="classdtn_1_1EndpointID.html#e214dda88bf43a3576cfcdf76c77c5a9">str</a>();
<a name="l00131"></a>00131 }
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 std::string
<a name="l00134"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#3af8d47db2a95a24cae949a7ae182c88">00134</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#3af8d47db2a95a24cae949a7ae182c88" title="Virtual from prophet::BundleCore.">ProphetBundleCore::get_route</a>(<span class="keyword">const</span> std::string&amp; dest_id)<span class="keyword"> const</span>
<a name="l00135"></a>00135 <span class="keyword"></span>{
<a name="l00136"></a>00136     <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a> eid(dest_id);
<a name="l00137"></a>00137     <span class="comment">// reduce all but the hostname part of the original dest_id</span>
<a name="l00138"></a>00138     <span class="keywordflow">if</span> (!eid.<a class="code" href="classdtn_1_1EndpointID.html#3e797bc638cb833b6450bfad0441579f" title="Reduce EndpointID to routing endpoint.">remove_service_tag</a>())
<a name="l00139"></a>00139         <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
<a name="l00140"></a>00140     <span class="keywordflow">return</span> eid.<a class="code" href="classdtn_1_1EndpointID.html#e214dda88bf43a3576cfcdf76c77c5a9">str</a>();
<a name="l00141"></a>00141 }
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 u_int64_t
<a name="l00144"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#ce3e0bbd59d7c7af4ea8d985f5e982bc">00144</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#ce3e0bbd59d7c7af4ea8d985f5e982bc" title="Virtual from prophet::BundleCore.">ProphetBundleCore::max_bundle_quota</a>()<span class="keyword"> const</span>
<a name="l00145"></a>00145 <span class="keyword"></span>{
<a name="l00146"></a>00146     <span class="keywordflow">if</span> (<a class="code" href="classdtn_1_1ProphetBundleCore.html#af452604d6bdefe329fe72626276df95" title="test constructor used, meaning that BundleDaemon is unavailable">test_mode_</a>) <span class="keywordflow">return</span> <a class="code" href="ProphetBundleCore_8cc.html#a48474920cf8a04d161a450fc31bd0e6">TEST_MODE_QUOTA</a>;
<a name="l00147"></a>00147     <span class="keywordflow">return</span> BundleStore::instance()-&gt;payload_quota();
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 <span class="keywordtype">bool</span>
<a name="l00151"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#67a65fc972b64f8cba3dd73e2edbe0a5">00151</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#67a65fc972b64f8cba3dd73e2edbe0a5" title="Virtual from prophet::BundleCore.">ProphetBundleCore::custody_accepted</a>()<span class="keyword"> const</span>
<a name="l00152"></a>00152 <span class="keyword"></span>{
<a name="l00153"></a>00153     <span class="keywordflow">if</span> (<a class="code" href="classdtn_1_1ProphetBundleCore.html#af452604d6bdefe329fe72626276df95" title="test constructor used, meaning that BundleDaemon is unavailable">test_mode_</a>) <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00154"></a>00154     <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1BundleDaemon.html#a18fd65ff3e11b985f3e04a4591d4a33">BundleDaemon::params_</a>.accept_custody_;
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 <span class="keywordtype">void</span>
<a name="l00158"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#02bf8a64669d954187436f6d129a8715">00158</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#02bf8a64669d954187436f6d129a8715" title="Virtual from prophet::BundleCore.">ProphetBundleCore::drop_bundle</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>* bundle)
<a name="l00159"></a>00159 {
<a name="l00160"></a>00160     <span class="keywordflow">if</span> (bundle == NULL) 
<a name="l00161"></a>00161     {
<a name="l00162"></a>00162         <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"drop_bundle(NULL)"</span>);
<a name="l00163"></a>00163         <span class="keywordflow">return</span>;
<a name="l00164"></a>00164     }
<a name="l00165"></a>00165     <span class="keywordflow">else</span>
<a name="l00166"></a>00166         <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"drop_bundle(%d)"</span>,bundle-&gt;<a class="code" href="classprophet_1_1Bundle.html#8f4fad2c83696237207ba7a19acb9ca4" title="Accessors.">sequence_num</a>());
<a name="l00167"></a>00167 
<a name="l00168"></a>00168     <span class="comment">// translate Facade wrapper into DTN::Bundle</span>
<a name="l00169"></a>00169     <span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* dtn_b = <a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">get_bundle</a>(bundle); 
<a name="l00170"></a>00170     <span class="keywordflow">if</span> (dtn_b == NULL)
<a name="l00171"></a>00171     {
<a name="l00172"></a>00172         log_err(<span class="stringliteral">"drop_bundle: failed to convert prophet handle %p to "</span>
<a name="l00173"></a>00173                 <span class="stringliteral">"dtn bundle"</span>, bundle);
<a name="l00174"></a>00174         <span class="keywordflow">return</span>;
<a name="l00175"></a>00175     }
<a name="l00176"></a>00176 
<a name="l00177"></a>00177     <span class="comment">// un-const the pointer</span>
<a name="l00178"></a>00178     <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b = <span class="keyword">const_cast&lt;</span><a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>*<span class="keyword">&gt;</span>(dtn_b);
<a name="l00179"></a>00179 
<a name="l00180"></a>00180     <span class="keywordflow">if</span> (b == NULL)
<a name="l00181"></a>00181     {
<a name="l00182"></a>00182         log_err(<span class="stringliteral">"drop_bundle: const cast failed"</span>);
<a name="l00183"></a>00183         <span class="keywordflow">return</span>;
<a name="l00184"></a>00184     }
<a name="l00185"></a>00185 
<a name="l00186"></a>00186     log_debug(<span class="stringliteral">"drop bundle *%p"</span>,b);
<a name="l00187"></a>00187     <span class="comment">// remove from Prophet repository</span>
<a name="l00188"></a>00188     <a class="code" href="classdtn_1_1ProphetBundleCore.html#523fafcbef972e062ebe3c411dd7dc2f" title="objects that link DTN to Prophet bundles">bundles_</a>.<a class="code" href="classdtn_1_1ProphetBundleList.html#b705f40015a645a80f402cca6299f455" title="Remove mapping for dtn::BundleRef from list.">del</a>(bundle);
<a name="l00189"></a>00189     <span class="comment">// request deletion from other ref holders</span>
<a name="l00190"></a>00190     <a class="code" href="classdtn_1_1ProphetBundleCore.html#28247942ac5a5db76cdd32353370169d" title="actions interface for send, delete, etc">actions_</a>-&gt;<a class="code" href="classdtn_1_1BundleActions.html#afdfbef5763f8f8ec84616977d3ca68d" title="Attempt to delete a bundle from the system.">delete_bundle</a>(b, <a class="code" href="classdtn_1_1BundleProtocol.html#37b000d94172c06970bb8af32889f917eac137290a0338e66ed4a0c1cc09c2f2">BundleProtocol::REASON_NO_ADDTL_INFO</a>);
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192 
<a name="l00193"></a>00193 <span class="keywordtype">bool</span>
<a name="l00194"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#533cbc680bb1c333fdac808b0de80476">00194</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#533cbc680bb1c333fdac808b0de80476" title="Virtual from prophet::BundleCore.">ProphetBundleCore::send_bundle</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>* bundle,
<a name="l00195"></a>00195                                <span class="keyword">const</span> <a class="code" href="classprophet_1_1Link.html">prophet::Link</a>* link)
<a name="l00196"></a>00196 {
<a name="l00197"></a>00197     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"send_bundle(%u)"</span>,bundle == NULL ? 0 : bundle-&gt;<a class="code" href="classprophet_1_1Bundle.html#8f4fad2c83696237207ba7a19acb9ca4" title="Accessors.">sequence_num</a>());
<a name="l00198"></a>00198     <a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>* l = <span class="keyword">const_cast&lt;</span><a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>*<span class="keyword">&gt;</span>(<a class="code" href="classdtn_1_1ProphetBundleCore.html#d66e16db42a6bbe21ec71964ec73223e" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">get_link</a>(link));
<a name="l00199"></a>00199     <span class="keywordflow">if</span> (l == NULL)
<a name="l00200"></a>00200     {
<a name="l00201"></a>00201         log_err(<span class="stringliteral">"failed to convert prophet handle for link (%s)"</span>,
<a name="l00202"></a>00202                 link-&gt;<a class="code" href="classprophet_1_1Link.html#4c7e5be6a49b400be9e07db823b7f301" title="Accessors.">remote_eid</a>());
<a name="l00203"></a>00203         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00204"></a>00204     }
<a name="l00205"></a>00205     <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b = <span class="keyword">const_cast&lt;</span><a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>*<span class="keyword">&gt;</span>(<a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">get_bundle</a>(bundle));
<a name="l00206"></a>00206     <span class="keywordflow">if</span> (b == NULL)
<a name="l00207"></a>00207     {
<a name="l00208"></a>00208         log_err(<span class="stringliteral">"failed to convert prophet handle for bundle (%s, %u)"</span>,
<a name="l00209"></a>00209                 bundle-&gt;<a class="code" href="classprophet_1_1Bundle.html#81f0a95589809a157829bacb4d3c5989" title="Accessors.">destination_id</a>().c_str(),bundle-&gt;<a class="code" href="classprophet_1_1Bundle.html#8f4fad2c83696237207ba7a19acb9ca4" title="Accessors.">sequence_num</a>());
<a name="l00210"></a>00210         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00211"></a>00211     }
<a name="l00212"></a>00212     <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> nexthop(<span class="stringliteral">"send_bundle"</span>);
<a name="l00213"></a>00213     nexthop = l;
<a name="l00214"></a>00214 
<a name="l00215"></a>00215     <span class="comment">// if link is available but not open, open it</span>
<a name="l00216"></a>00216     <span class="keywordflow">if</span> (nexthop-&gt;isavailable() &amp;&amp;
<a name="l00217"></a>00217         (!nexthop-&gt;isopen()) &amp;&amp; (!nexthop-&gt;isopening()))
<a name="l00218"></a>00218     {
<a name="l00219"></a>00219         log_debug(<span class="stringliteral">"opening *%p because a message is intended for it"</span>,
<a name="l00220"></a>00220                   nexthop.object());
<a name="l00221"></a>00221         <a class="code" href="classdtn_1_1ProphetBundleCore.html#28247942ac5a5db76cdd32353370169d" title="actions interface for send, delete, etc">actions_</a>-&gt;<a class="code" href="classdtn_1_1BundleActions.html#0cb4ef96c172a1943d32d19747a00438" title="Open a link for bundle transmission.">open_link</a>(nexthop);
<a name="l00222"></a>00222     }
<a name="l00223"></a>00223 
<a name="l00224"></a>00224     <span class="comment">// we can only send if link is open and not full</span>
<a name="l00225"></a>00225     <span class="keywordflow">if</span> (nexthop-&gt;isopen() &amp;&amp; !nexthop-&gt;queue_is_full())
<a name="l00226"></a>00226     {
<a name="l00227"></a>00227         log_debug(<span class="stringliteral">"send bundle *%p over link *%p"</span>, b, l);
<a name="l00228"></a>00228         <a class="code" href="classdtn_1_1ProphetBundleCore.html#28247942ac5a5db76cdd32353370169d" title="actions interface for send, delete, etc">actions_</a>-&gt;<a class="code" href="classdtn_1_1BundleActions.html#7a75826fd1b4515b9d9aa2b98acbde68" title="Queue the bundle for transmission on the given link.">queue_bundle</a>(b, nexthop,
<a name="l00229"></a>00229                                <a class="code" href="classdtn_1_1ForwardingInfo.html#18ec95dc1b1b8a7e9df9873a0d9b594777ba7ba2355d6b87536afc9ef78efeb8" title="Forward a copy of the bundle.">ForwardingInfo::COPY_ACTION</a>,
<a name="l00230"></a>00230                                <a class="code" href="classdtn_1_1CustodyTimerSpec.html" title="Utility class to abstract out various parameters that can be used to calculate custody...">CustodyTimerSpec</a>());
<a name="l00231"></a>00231         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00232"></a>00232     }
<a name="l00233"></a>00233 
<a name="l00234"></a>00234     <span class="comment">// since we can't send the bundle right now, log why</span>
<a name="l00235"></a>00235     <span class="keywordflow">if</span> (!nexthop-&gt;isavailable())
<a name="l00236"></a>00236         log_debug(<span class="stringliteral">"can't forward *%p to *%p because link not available"</span>,
<a name="l00237"></a>00237                   b,nexthop.object());
<a name="l00238"></a>00238     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!nexthop-&gt;isopen())
<a name="l00239"></a>00239         log_debug(<span class="stringliteral">"can't forward *%p to *%p because link not open"</span>,
<a name="l00240"></a>00240                   b,nexthop.object());
<a name="l00241"></a>00241     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (nexthop-&gt;queue_is_full())
<a name="l00242"></a>00242         log_debug(<span class="stringliteral">"can't forward *%p to *%p because link queue is full"</span>,
<a name="l00243"></a>00243                   b, nexthop.object());
<a name="l00244"></a>00244     <span class="keywordflow">else</span>
<a name="l00245"></a>00245         log_debug(<span class="stringliteral">"can't forward *%p to *%p"</span>, b,nexthop.object());
<a name="l00246"></a>00246 
<a name="l00247"></a>00247     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 
<a name="l00250"></a>00250 <span class="keywordtype">bool</span>
<a name="l00251"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#1a8696244a7ce2d07a065b04787b6d8b">00251</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#1a8696244a7ce2d07a065b04787b6d8b" title="Virtual from prophet::BundleCore.">ProphetBundleCore::write_bundle</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>* bundle,
<a name="l00252"></a>00252         <span class="keyword">const</span> u_char* buffer, <span class="keywordtype">size_t</span> <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>)
<a name="l00253"></a>00253 {
<a name="l00254"></a>00254     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"write_bundle(%u)"</span>,bundle == NULL ? 0 : bundle-&gt;<a class="code" href="classprophet_1_1Bundle.html#8f4fad2c83696237207ba7a19acb9ca4" title="Accessors.">sequence_num</a>());
<a name="l00255"></a>00255     <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b = <span class="keyword">const_cast&lt;</span><a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>*<span class="keyword">&gt;</span>(<a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">get_bundle</a>(bundle));
<a name="l00256"></a>00256     <span class="keywordflow">if</span> (b != NULL)
<a name="l00257"></a>00257     {
<a name="l00258"></a>00258         b-&gt;mutable_payload()-&gt;append_data(buffer,len);
<a name="l00259"></a>00259         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00260"></a>00260     }
<a name="l00261"></a>00261     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263 
<a name="l00264"></a>00264 <span class="keywordtype">bool</span>
<a name="l00265"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#9be1ba58006e1acdcaf8916ee700c833">00265</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#db5e1bc9d1959fb5a2bfce5fef463fc5" title="Virtual from prophet::BundleCore.">ProphetBundleCore::read_bundle</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>* bundle,
<a name="l00266"></a>00266         u_char* buffer, <span class="keywordtype">size_t</span>&amp; <a class="code" href="num2sdnv_8c.html#fed088663f8704004425cdae2120b9b3">len</a>)
<a name="l00267"></a>00267 {
<a name="l00268"></a>00268     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"read_bundle(%u)"</span>,bundle == NULL ? 0 : bundle-&gt;<a class="code" href="classprophet_1_1Bundle.html#8f4fad2c83696237207ba7a19acb9ca4" title="Accessors.">sequence_num</a>());
<a name="l00269"></a>00269     <span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b = <a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">get_bundle</a>(bundle);
<a name="l00270"></a>00270     <span class="keywordflow">if</span> (b != NULL)
<a name="l00271"></a>00271     {
<a name="l00272"></a>00272         <span class="keywordtype">size_t</span> blen = b-&gt;payload().length();
<a name="l00273"></a>00273         <span class="keywordflow">if</span> (blen &lt; len)
<a name="l00274"></a>00274             <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00275"></a>00275         b-&gt;payload().read_data(0,blen,buffer);
<a name="l00276"></a>00276         len = blen;
<a name="l00277"></a>00277         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00278"></a>00278     }
<a name="l00279"></a>00279     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281 
<a name="l00282"></a>00282 <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>*
<a name="l00283"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#f4d2996b411b94787d8df7654c1e4ecf">00283</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#f4d2996b411b94787d8df7654c1e4ecf" title="Virtual from prophet::BundleCore.">ProphetBundleCore::create_bundle</a>(<span class="keyword">const</span> std::string&amp; <a class="code" href="dtnmoteproxy_8c.html#e1ade0f5a1b32f6c8be72f31a99e2a18">src</a>,
<a name="l00284"></a>00284         <span class="keyword">const</span> std::string&amp; dst, u_int <a class="code" href="dtncat_8c.html#d6057e40387509de502bdc91007d3238">expiration</a>)
<a name="l00285"></a>00285 {
<a name="l00286"></a>00286     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"create_bundle"</span>);
<a name="l00287"></a>00287     <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b = <span class="keyword">new</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>();
<a name="l00288"></a>00288     b-&gt;<a class="code" href="classdtn_1_1Bundle.html#69c35928ca050eb4bb2ec67641f1b6bb" title="Setters and mutable accessors.">mutable_source</a>()-&gt;<a class="code" href="classdtn_1_1EndpointID.html#ec39752e4da3107b16ff5da58d2aa5ab" title="Assign this endpoint ID as a copy of the other.">assign</a>(src);
<a name="l00289"></a>00289     b-&gt;<a class="code" href="classdtn_1_1Bundle.html#fedf6ad0537f7e3a3f958162d1fc935e" title="Setters and mutable accessors.">mutable_dest</a>()-&gt;<a class="code" href="classdtn_1_1EndpointID.html#ec39752e4da3107b16ff5da58d2aa5ab" title="Assign this endpoint ID as a copy of the other.">assign</a>(dst);
<a name="l00290"></a>00290     b-&gt;<a class="code" href="classdtn_1_1Bundle.html#7c2091e44637889b9ad6f94a82ae7f83" title="Setters and mutable accessors.">mutable_replyto</a>()-&gt;<a class="code" href="classdtn_1_1EndpointID.html#ec39752e4da3107b16ff5da58d2aa5ab" title="Assign this endpoint ID as a copy of the other.">assign</a>(<a class="code" href="classdtn_1_1EndpointID.html#31bd1844cae5e71cc2393a139c9bec4c" title="Return the special endpoint id used for the null endpoint, namely &amp;quot;dtn:none&amp;quot;...">EndpointID::NULL_EID</a>());
<a name="l00291"></a>00291     b-&gt;<a class="code" href="classdtn_1_1Bundle.html#96698085719d88c0b5c86d4cb388324c" title="Setters and mutable accessors.">mutable_custodian</a>()-&gt;<a class="code" href="classdtn_1_1EndpointID.html#ec39752e4da3107b16ff5da58d2aa5ab" title="Assign this endpoint ID as a copy of the other.">assign</a>(<a class="code" href="classdtn_1_1EndpointID.html#31bd1844cae5e71cc2393a139c9bec4c" title="Return the special endpoint id used for the null endpoint, namely &amp;quot;dtn:none&amp;quot;...">EndpointID::NULL_EID</a>());
<a name="l00292"></a>00292     b-&gt;<a class="code" href="classdtn_1_1Bundle.html#7623ecfe9e47e5dc075ebd872fb9a237" title="Setters and mutable accessors.">set_expiration</a>(expiration);
<a name="l00293"></a>00293     <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a> tmp(<span class="stringliteral">"create_bundle"</span>);
<a name="l00294"></a>00294     tmp = b;
<a name="l00295"></a>00295     <span class="keyword">add</span>(tmp);
<a name="l00296"></a>00296     <span class="keywordflow">return</span> <span class="keyword">const_cast&lt;</span><a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>*<span class="keyword">&gt;</span>(<a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">get_bundle</a>(b));
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 <span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>*
<a name="l00300"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#75d40cd7e91c7b5d8ca026f5a4943cf3">00300</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#75d40cd7e91c7b5d8ca026f5a4943cf3" title="Virtual from prophet::BundleCore.">ProphetBundleCore::find</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1BundleList.html" title="List of Prophet&amp;#39;s Bundle facade objects.">prophet::BundleList</a>&amp; list,
<a name="l00301"></a>00301         <span class="keyword">const</span> std::string&amp; eid, u_int32_t creation_ts, u_int32_t seqno)<span class="keyword"> const</span>
<a name="l00302"></a>00302 <span class="keyword"></span>{
<a name="l00303"></a>00303     <span class="keywordflow">for</span> (prophet::BundleList::const_iterator i = list.begin();
<a name="l00304"></a>00304             i != list.end(); i++)
<a name="l00305"></a>00305     {
<a name="l00306"></a>00306         <span class="keywordflow">if</span> ((*i)-&gt;creation_ts() == creation_ts &amp;&amp;
<a name="l00307"></a>00307             (*i)-&gt;sequence_num() == seqno &amp;&amp;
<a name="l00308"></a>00308             <a class="code" href="classdtn_1_1ProphetBundleCore.html#90e8d30f6e84420cb0dedf94e7f0584b" title="Virtual from prophet::BundleCore.">is_route</a>((*i)-&gt;destination_id(), eid))  <span class="keywordflow">return</span> *i;
<a name="l00309"></a>00309     }
<a name="l00310"></a>00310     <span class="keywordflow">return</span> NULL;
<a name="l00311"></a>00311 }
<a name="l00312"></a>00312 
<a name="l00313"></a>00313 <span class="keywordtype">void</span>
<a name="l00314"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#2f380429a5d36969d4522d02e4aa6e51">00314</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#2f380429a5d36969d4522d02e4aa6e51" title="Initialization routine for deserializing routes from permanent storage.">ProphetBundleCore::load_prophet_nodes</a>(<a class="code" href="classprophet_1_1Table.html" title="Container for Prophet nodes (routes and predictability values).">prophet::Table</a>* nodes,
<a name="l00315"></a>00315                                       <a class="code" href="classprophet_1_1ProphetParams.html" title="Tunable parameter struct for setting global default values for various Prophet algorithms...">prophet::ProphetParams</a>* params)
<a name="l00316"></a>00316 {
<a name="l00317"></a>00317     ASSERTF(<a class="code" href="classdtn_1_1ProphetBundleCore.html#0d26612612b5c0d039316c72895bc4ec" title="interface into persistent storage">nodes_</a>.<a class="code" href="classdtn_1_1ProphetNodeList.html#430cf348c0cb833f4455eee5e63e5d71" title="Accessors.">empty</a>(), <span class="stringliteral">"load_prophet_nodes called more than once"</span>);
<a name="l00318"></a>00318 
<a name="l00319"></a>00319     <a class="code" href="classprophet_1_1Node.html" title="Node represents a route to another Prophet node, and as such, tracks destination...">prophet::Node</a>* node = NULL;
<a name="l00320"></a>00320     <a class="code" href="classdtn_1_1ProphetStore.html">ProphetStore</a>* prophet_store = ProphetStore::instance();
<a name="l00321"></a>00321     <a class="code" href="classdtn_1_1ProphetStore.html#55d38ab64d7a4ab03eb78dd8f21f4eac">ProphetStore::iterator</a>* iter = prophet_store-&gt;<a class="code" href="classdtn_1_1ProphetStore.html#0b855e0d581312dcdeac06d14e6c35c1" title="Return a new iterator.">new_iterator</a>();
<a name="l00322"></a>00322 
<a name="l00323"></a>00323     log_notice(<span class="stringliteral">"loading prophet nodes from data store"</span>);
<a name="l00324"></a>00324 
<a name="l00325"></a>00325     <span class="keywordflow">for</span> (iter-&gt;begin(); iter-&gt;more(); iter-&gt;next())
<a name="l00326"></a>00326     {
<a name="l00327"></a>00327         node = prophet_store-&gt;<a class="code" href="classdtn_1_1ProphetStore.html#b69963faf845cf598a991d5885294002" title="Retrieve a ProphetNode.">get</a>(iter-&gt;cur_val());
<a name="l00328"></a>00328         <span class="keywordflow">if</span> (node == NULL)
<a name="l00329"></a>00329         {
<a name="l00330"></a>00330             log_err(<span class="stringliteral">"failed to deserialize Prophet route for %s"</span>,
<a name="l00331"></a>00331                 iter-&gt;cur_val().c_str());
<a name="l00332"></a>00332             <span class="keywordflow">continue</span>;
<a name="l00333"></a>00333         }
<a name="l00334"></a>00334         <a class="code" href="classdtn_1_1ProphetBundleCore.html#0d26612612b5c0d039316c72895bc4ec" title="interface into persistent storage">nodes_</a>.<a class="code" href="classdtn_1_1ProphetNodeList.html#afbd8e532b00c349d5a1027573f5e67b" title="Deserialize from storage.">load</a>(node);
<a name="l00335"></a>00335     }
<a name="l00336"></a>00336     <span class="keyword">delete</span> iter;
<a name="l00337"></a>00337 
<a name="l00338"></a>00338     <span class="comment">// push local list into Table</span>
<a name="l00339"></a>00339     <a class="code" href="classdtn_1_1ProphetBundleCore.html#0d26612612b5c0d039316c72895bc4ec" title="interface into persistent storage">nodes_</a>.<a class="code" href="classdtn_1_1ProphetNodeList.html#641fd92c8528bad7a7d36a17d9dd875b" title="Copy list of nodes from permanent store into prophet::Table.">clone</a>(nodes,params);
<a name="l00340"></a>00340 
<a name="l00341"></a>00341     <span class="comment">// calculate age, now that they're off disk, into memory</span>
<a name="l00342"></a>00342     nodes-&gt;<a class="code" href="classprophet_1_1Table.html#0fb8c279c02261f9b600777b6cadd591" title="For maintenance routines, visit each Node in table and invoke its aging algorithm;...">age_nodes</a>();
<a name="l00343"></a>00343 
<a name="l00344"></a>00344     <span class="comment">// trim whatever's below minimum</span>
<a name="l00345"></a>00345     nodes-&gt;<a class="code" href="classprophet_1_1Table.html#4bde73fe9f4a477a42619e805e9a4508" title="The predictability of Nodes should diminish with time; to allow for maintenance of...">truncate</a>(params-&gt;<a class="code" href="classprophet_1_1ProphetParams.html#cf23b3c63661086bef05205a4fdec21f" title="Accessors.">epsilon</a>());
<a name="l00346"></a>00346     log_notice(<span class="stringliteral">"prophet nodes loaded"</span>);
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 
<a name="l00349"></a>00349 <span class="keywordtype">void</span>
<a name="l00350"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#fbf59008d115bb77da64e173028e918c">00350</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#fbf59008d115bb77da64e173028e918c" title="Virtual from prophet::BundleCore.">ProphetBundleCore::update_node</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Node.html" title="Node represents a route to another Prophet node, and as such, tracks destination...">prophet::Node</a>* node)
<a name="l00351"></a>00351 {
<a name="l00352"></a>00352     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"update_node"</span>);
<a name="l00353"></a>00353     <a class="code" href="classdtn_1_1ProphetBundleCore.html#0d26612612b5c0d039316c72895bc4ec" title="interface into persistent storage">nodes_</a>.<a class="code" href="classdtn_1_1ProphetNodeList.html#4e137701492aabe741b4fcab1e0762ba" title="Update (or add new) node in permanent store.">update</a>(node);
<a name="l00354"></a>00354 }
<a name="l00355"></a>00355 
<a name="l00356"></a>00356 <span class="keywordtype">void</span>
<a name="l00357"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#73191dd5279e1298a7fbde2a54a61c13">00357</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#73191dd5279e1298a7fbde2a54a61c13" title="Virtual from prophet::BundleCore.">ProphetBundleCore::delete_node</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Node.html" title="Node represents a route to another Prophet node, and as such, tracks destination...">prophet::Node</a>* node)
<a name="l00358"></a>00358 {
<a name="l00359"></a>00359     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"delete_node"</span>);
<a name="l00360"></a>00360     <a class="code" href="classdtn_1_1ProphetBundleCore.html#0d26612612b5c0d039316c72895bc4ec" title="interface into persistent storage">nodes_</a>.<a class="code" href="classdtn_1_1ProphetNodeList.html#bc02c29e504d40da397a066842a5d63b" title="Remove node from permanent store.">del</a>(node);
<a name="l00361"></a>00361 }
<a name="l00362"></a>00362 
<a name="l00363"></a>00363 std::string
<a name="l00364"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#c64d3b6f19bdb469bf00e93b5feee89c">00364</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#4de78b6c6e8e99f23b0958c499c99378" title="Virtual from prophet::BundleCore.">ProphetBundleCore::prophet_id</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Link.html">prophet::Link</a>* link)<span class="keyword"> const</span>
<a name="l00365"></a>00365 <span class="keyword"></span>{
<a name="l00366"></a>00366     <span class="keywordflow">if</span> (link == NULL) <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
<a name="l00367"></a>00367     std::string remote_eid(link-&gt;<a class="code" href="classprophet_1_1Link.html#4c7e5be6a49b400be9e07db823b7f301" title="Accessors.">remote_eid</a>());
<a name="l00368"></a>00368     <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a> eid(remote_eid.c_str());
<a name="l00369"></a>00369     eid.append_service_tag(<span class="stringliteral">"prophet"</span>);
<a name="l00370"></a>00370     <a class="code" href="SDNV_8cc.html#ca68c0d4ac8df0838e209fb5300f7be3">ASSERT</a>( eid.str().find(<span class="stringliteral">"prophet"</span>) != std::string::npos );
<a name="l00371"></a>00371     <span class="keywordflow">return</span> eid.str();
<a name="l00372"></a>00372 }
<a name="l00373"></a>00373 
<a name="l00374"></a>00374 <a class="code" href="classprophet_1_1Alarm.html" title="Alarm registration.">prophet::Alarm</a>*
<a name="l00375"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#49ab45f3e7d06f040f727edb815de465">00375</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#49ab45f3e7d06f040f727edb815de465" title="Virtual from prophet::BundleCore.">ProphetBundleCore::create_alarm</a>(<a class="code" href="classprophet_1_1ExpirationHandler.html" title="Alarm expiration handler.">prophet::ExpirationHandler</a>* handler,
<a name="l00376"></a>00376         u_int timeout, <span class="keywordtype">bool</span> jitter)
<a name="l00377"></a>00377 {
<a name="l00378"></a>00378     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"create_alarm (%u)"</span>,timeout);
<a name="l00379"></a>00379     <span class="keywordflow">if</span> (handler == NULL) <span class="keywordflow">return</span> NULL;
<a name="l00380"></a>00380     <a class="code" href="classdtn_1_1ProphetTimer.html">ProphetTimer</a>* alarm = <span class="keyword">new</span> <a class="code" href="classdtn_1_1ProphetTimer.html">ProphetTimer</a>(handler,<a class="code" href="classdtn_1_1ProphetBundleCore.html#951ac6cc1edc0202298a9b242593d949" title="shared lock with ProphetRouter">lock_</a>);
<a name="l00381"></a>00381     <span class="keywordflow">if</span> (jitter)
<a name="l00382"></a>00382     {
<a name="l00383"></a>00383         <span class="comment">// mix up jitter on timeout to roughly +/- 5%</span>
<a name="l00384"></a>00384         <span class="comment">// by subtracting 6.25% and adding rand (0 .. 12.5)%</span>
<a name="l00385"></a>00385         u_int twelve_pct = timeout &gt;&gt; 3; <span class="comment">// div 8</span>
<a name="l00386"></a>00386         u_int six_pct = timeout &gt;&gt; 4; <span class="comment">// div 16</span>
<a name="l00387"></a>00387         u_int zero_to_twelve = oasys::Random::rand(twelve_pct);
<a name="l00388"></a>00388         timeout = timeout - six_pct + zero_to_twelve;
<a name="l00389"></a>00389     }
<a name="l00390"></a>00390     alarm-&gt;<a class="code" href="classdtn_1_1ProphetTimer.html#06a6447f317c304f1a341dad43484b0e" title="Virtual from prophet::Alarm.">schedule</a>(timeout);
<a name="l00391"></a>00391     log_debug(<span class="stringliteral">"scheduling alarm %s for %u ms"</span>,handler-&gt;<a class="code" href="classprophet_1_1ExpirationHandler.html#a1d4ba4922d44190ba483eaf0da31607" title="Accessor.">name</a>(),timeout);
<a name="l00392"></a>00392     <span class="keywordflow">return</span> alarm;
<a name="l00393"></a>00393 }
<a name="l00394"></a>00394 
<a name="l00395"></a>00395 <span class="keywordtype">void</span>
<a name="l00396"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#ff15d52706f454338dc3b85b5e27af28">00396</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#ff15d52706f454338dc3b85b5e27af28" title="Virtual from prophet::BundleCore.">ProphetBundleCore::print_log</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name,
<a name="l00397"></a>00397         <span class="keywordtype">int</span> level, <span class="keyword">const</span> <span class="keywordtype">char</span>* fmt, ...)
<a name="l00398"></a>00398 {
<a name="l00399"></a>00399     <span class="comment">// force arbitrary int into enumerated type</span>
<a name="l00400"></a>00400     oasys::log_level_t l_int = (oasys::log_level_t)level;
<a name="l00401"></a>00401     oasys::log_level_t log_level =
<a name="l00402"></a>00402     (l_int &gt;= oasys::LOG_DEBUG &amp;&amp; l_int &lt;= oasys::LOG_ALWAYS) ?
<a name="l00403"></a>00403         l_int : oasys::LOG_DEBUG;
<a name="l00404"></a>00404 
<a name="l00405"></a>00405     <span class="comment">// hack the logpath</span>
<a name="l00406"></a>00406     std::string prev(logpath_);
<a name="l00407"></a>00407     <span class="keywordflow">if</span> (name[0] != <span class="charliteral">'/'</span>)
<a name="l00408"></a>00408         logpathf(<span class="stringliteral">"%s/%s"</span>,logpath_,name);
<a name="l00409"></a>00409     <span class="keywordflow">else</span>
<a name="l00410"></a>00410         logpathf(<span class="stringliteral">"%s%s"</span>,logpath_,name);
<a name="l00411"></a>00411 
<a name="l00412"></a>00412     <span class="comment">// submit log to Logger</span>
<a name="l00413"></a>00413     va_list ap;
<a name="l00414"></a>00414     va_start(ap, fmt);
<a name="l00415"></a>00415     vlogf(log_level,fmt,ap);
<a name="l00416"></a>00416     va_end(ap);
<a name="l00417"></a>00417 
<a name="l00418"></a>00418     <span class="comment">// unhack the logpath</span>
<a name="l00419"></a>00419     set_logpath(prev.c_str());
<a name="l00420"></a>00420 }
<a name="l00421"></a>00421 
<a name="l00422"></a>00422 <span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>*
<a name="l00423"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25">00423</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">ProphetBundleCore::get_bundle</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>* bundle)
<a name="l00424"></a>00424 {
<a name="l00425"></a>00425     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"get_bundle prophet -&gt; DTN"</span>);
<a name="l00426"></a>00426     <span class="keywordflow">if</span> (bundle == NULL) <span class="keywordflow">return</span> NULL;
<a name="l00427"></a>00427     <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a> tmp(<span class="stringliteral">"get_bundle"</span>);
<a name="l00428"></a>00428     tmp = <a class="code" href="classdtn_1_1ProphetBundleCore.html#523fafcbef972e062ebe3c411dd7dc2f" title="objects that link DTN to Prophet bundles">bundles_</a>.<a class="code" href="classdtn_1_1ProphetBundleList.html#07853b9e4a046a0503ad68d28d44f330" title="Given a prophet object, return dtn::BundleRef&amp;amp;.">find_ref</a>(bundle);
<a name="l00429"></a>00429     <span class="keywordflow">return</span> tmp.object();
<a name="l00430"></a>00430 }
<a name="l00431"></a>00431 
<a name="l00432"></a>00432 <span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>*
<a name="l00433"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#21cbaff14be0f583a702a211e1065df9">00433</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#996e6a15afca44ed35cb91bf1cab3c25" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">ProphetBundleCore::get_bundle</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* b)
<a name="l00434"></a>00434 {
<a name="l00435"></a>00435     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"get_bundle DTN -&gt; prophet"</span>);
<a name="l00436"></a>00436     <span class="keywordflow">if</span> (b == NULL) <span class="keywordflow">return</span> NULL;
<a name="l00437"></a>00437     <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1ProphetBundleCore.html#523fafcbef972e062ebe3c411dd7dc2f" title="objects that link DTN to Prophet bundles">bundles_</a>.<a class="code" href="classdtn_1_1ProphetBundleList.html#196550ca5bcb79b25eee907682c66dff" title="Given destination ID and creation ts, return prophet::Bundle*.">find</a>(b);
<a name="l00438"></a>00438 }
<a name="l00439"></a>00439 
<a name="l00440"></a>00440 <span class="keyword">const</span> <a class="code" href="classprophet_1_1Bundle.html" title="Facade interface between Prophet router and host implmentation&amp;#39;s Bundle representation...">prophet::Bundle</a>*
<a name="l00441"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#df384080fdfc9cc99c8ed066f503fb5d">00441</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#df384080fdfc9cc99c8ed066f503fb5d" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">ProphetBundleCore::get_temp_bundle</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>&amp; b)
<a name="l00442"></a>00442 {
<a name="l00443"></a>00443     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"get_temp_bundle DTN -&gt; prophet"</span>);
<a name="l00444"></a>00444     <span class="keywordflow">if</span> (b.object() == NULL) <span class="keywordflow">return</span> NULL;
<a name="l00445"></a>00445     <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classdtn_1_1ProphetBundle.html" title="Unification class that ties together Prophet&amp;#39;s metadata view with DTN&amp;#39;s complete...">ProphetBundle</a>(b);
<a name="l00446"></a>00446 }
<a name="l00447"></a>00447 
<a name="l00448"></a>00448 <span class="keyword">const</span> <a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>*
<a name="l00449"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#d66e16db42a6bbe21ec71964ec73223e">00449</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#d66e16db42a6bbe21ec71964ec73223e" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">ProphetBundleCore::get_link</a>(<span class="keyword">const</span> <a class="code" href="classprophet_1_1Link.html">prophet::Link</a>* link)
<a name="l00450"></a>00450 {
<a name="l00451"></a>00451     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"get_link prophet -&gt; DTN"</span>);
<a name="l00452"></a>00452     <span class="keywordflow">if</span> (link == NULL) <span class="keywordflow">return</span> NULL;
<a name="l00453"></a>00453     <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> tmp(<span class="stringliteral">"get_link"</span>);
<a name="l00454"></a>00454     tmp = <a class="code" href="classdtn_1_1ProphetBundleCore.html#262a351626af35ced9e7604c9ef0134e" title="objects that link DTN to Prophet links">links_</a>.<a class="code" href="classdtn_1_1ProphetLinkList.html#74ea0dad9af6d840266e3ef9be6b9faa" title="Given prophet object, return dtn::LinkRef&amp;amp;.">find_ref</a>(link-&gt;<a class="code" href="classprophet_1_1Link.html#4c7e5be6a49b400be9e07db823b7f301" title="Accessors.">remote_eid</a>());
<a name="l00455"></a>00455     <span class="keywordflow">return</span> tmp.object();
<a name="l00456"></a>00456 }
<a name="l00457"></a>00457 
<a name="l00458"></a>00458 <span class="keyword">const</span> <a class="code" href="classprophet_1_1Link.html">prophet::Link</a>*
<a name="l00459"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#c9531e9818a80f50d02feafaaf6b386c">00459</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#d66e16db42a6bbe21ec71964ec73223e" title="Conversion between Prophet&amp;#39;s Facade type and DTN native type.">ProphetBundleCore::get_link</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>* link)
<a name="l00460"></a>00460 {
<a name="l00461"></a>00461     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"get_link DTN -&gt; prophet"</span>);
<a name="l00462"></a>00462     <a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>* l = <span class="keyword">const_cast&lt;</span><a class="code" href="classdtn_1_1Link.html" title="Abstraction for a DTN link, i.e.">Link</a>*<span class="keyword">&gt;</span>(link);
<a name="l00463"></a>00463     <span class="keywordflow">if</span> (l == NULL) <span class="keywordflow">return</span> NULL;
<a name="l00464"></a>00464     <span class="keywordflow">return</span> <a class="code" href="classdtn_1_1ProphetBundleCore.html#262a351626af35ced9e7604c9ef0134e" title="objects that link DTN to Prophet links">links_</a>.<a class="code" href="classdtn_1_1ProphetLinkList.html#3df1234c992eed150dcefc9334683afb" title="Given remote_eid, return pointer to prophet object.">find</a>(l-&gt;<a class="code" href="classdtn_1_1Link.html#febda74522edf794750548f1067fa334" title="Accessor to the remote endpoint id.">remote_eid</a>().<a class="code" href="classdtn_1_1EndpointID.html#c9d8a72806359621f4d2850c1e78269c">c_str</a>());
<a name="l00465"></a>00465 }
<a name="l00466"></a>00466 
<a name="l00467"></a>00467 <span class="keywordtype">void</span>
<a name="l00468"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#0dcc65afc988880e4b15557aa771a9c1">00468</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#0dcc65afc988880e4b15557aa771a9c1">ProphetBundleCore::add</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>&amp; b)
<a name="l00469"></a>00469 {
<a name="l00470"></a>00470     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"add(bundle)"</span>);
<a name="l00471"></a>00471     <a class="code" href="classdtn_1_1ProphetBundleCore.html#523fafcbef972e062ebe3c411dd7dc2f" title="objects that link DTN to Prophet bundles">bundles_</a>.<a class="code" href="classdtn_1_1ProphetBundleList.html#726b948b41a5e24b7f2f18689dd1b107" title="Add mapping for dtn::BundleRef to list.">add</a>(b);
<a name="l00472"></a>00472 }
<a name="l00473"></a>00473 
<a name="l00474"></a>00474 <span class="keywordtype">void</span>
<a name="l00475"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#12409f4d4d0b3d4be1c756129f133379">00475</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#12409f4d4d0b3d4be1c756129f133379">ProphetBundleCore::del</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>&amp; b)
<a name="l00476"></a>00476 {
<a name="l00477"></a>00477     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"del(bundle)"</span>);
<a name="l00478"></a>00478     <a class="code" href="classdtn_1_1ProphetBundleCore.html#523fafcbef972e062ebe3c411dd7dc2f" title="objects that link DTN to Prophet bundles">bundles_</a>.<a class="code" href="classdtn_1_1ProphetBundleList.html#b705f40015a645a80f402cca6299f455" title="Remove mapping for dtn::BundleRef from list.">del</a>(b);
<a name="l00479"></a>00479 }
<a name="l00480"></a>00480 
<a name="l00481"></a>00481 <span class="keywordtype">void</span>
<a name="l00482"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#a3b16957f133902f57d8b3da00d57495">00482</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#0dcc65afc988880e4b15557aa771a9c1">ProphetBundleCore::add</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>&amp; link)
<a name="l00483"></a>00483 {
<a name="l00484"></a>00484     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"add(link)"</span>);
<a name="l00485"></a>00485     <a class="code" href="classdtn_1_1ProphetBundleCore.html#262a351626af35ced9e7604c9ef0134e" title="objects that link DTN to Prophet links">links_</a>.<a class="code" href="classdtn_1_1ProphetLinkList.html#cc8c8d46912d84f436c753ca11f045df" title="Add a mapping between DTN LinkRef and prophet::Link*.">add</a>(link);
<a name="l00486"></a>00486 }
<a name="l00487"></a>00487 
<a name="l00488"></a>00488 <span class="keywordtype">void</span>
<a name="l00489"></a><a class="code" href="classdtn_1_1ProphetBundleCore.html#f024732cd7142966214796de402677ce">00489</a> <a class="code" href="classdtn_1_1ProphetBundleCore.html#12409f4d4d0b3d4be1c756129f133379">ProphetBundleCore::del</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>&amp; link)
<a name="l00490"></a>00490 {
<a name="l00491"></a>00491     <a class="code" href="namespacedtn.html#a316af661cbfed69c13e77d524d1012e">LOG</a>(<span class="stringliteral">"del(link)"</span>);
<a name="l00492"></a>00492     <a class="code" href="classdtn_1_1ProphetBundleCore.html#262a351626af35ced9e7604c9ef0134e" title="objects that link DTN to Prophet links">links_</a>.<a class="code" href="classdtn_1_1ProphetLinkList.html#57085ff2476cdc08edbc764465858319" title="Remove mapping between DTN LinkRef and prophet::Link*.">del</a>(link);
<a name="l00493"></a>00493 }
<a name="l00494"></a>00494 
<a name="l00495"></a>00495 }; <span class="comment">// namespace dtn</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:26:57 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>