Sophie

Sophie

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

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: dtn::FloodBundleRouter Class Reference</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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespacedtn.html">dtn</a>::<a class="el" href="classdtn_1_1FloodBundleRouter.html">FloodBundleRouter</a>
  </div>
</div>
<div class="contents">
<h1>dtn::FloodBundleRouter Class Reference</h1><!-- doxytag: class="dtn::FloodBundleRouter" --><!-- doxytag: inherits="dtn::TableBasedRouter" -->This is the implementation of a flooding based bundle router.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="FloodBundleRouter_8h-source.html">FloodBundleRouter.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for dtn::FloodBundleRouter:</div>
<div class="dynsection">

<p><center><img src="classdtn_1_1FloodBundleRouter.png" usemap="#dtn::FloodBundleRouter_map" border="0" alt=""></center>
<map name="dtn::FloodBundleRouter_map">
<area href="classdtn_1_1TableBasedRouter.html" alt="dtn::TableBasedRouter" shape="rect" coords="0,112,151,136">
<area href="classdtn_1_1BundleRouter.html" alt="dtn::BundleRouter" shape="rect" coords="0,56,151,80">
<area href="classdtn_1_1BundleEventHandler.html" alt="dtn::BundleEventHandler" shape="rect" coords="0,0,151,24">
</map>
</div>

<p>
<a href="classdtn_1_1FloodBundleRouter-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#660a62aff9ec2ac9229830513d425fd7">FloodBundleRouter</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#660a62aff9ec2ac9229830513d425fd7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#c64fdfc35227035b64312f6271317381">initialize</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializer.  <a href="#c64fdfc35227035b64312f6271317381"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#d0c23759201e076aec5b7a4d070ef3a0">handle_bundle_received</a> (<a class="el" href="classdtn_1_1BundleReceivedEvent.html">BundleReceivedEvent</a> *event)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Event handler for new bundle arrivals.  <a href="#d0c23759201e076aec5b7a4d070ef3a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#211fac9393649fc76ecfd366da0e2a21">handle_link_created</a> (<a class="el" href="classdtn_1_1LinkCreatedEvent.html">LinkCreatedEvent</a> *event)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">When a link is created, add a new route for it.  <a href="#211fac9393649fc76ecfd366da0e2a21"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#6e544673088731fde3512406d2266942">handle_bundle_expired</a> (<a class="el" href="classdtn_1_1BundleExpiredEvent.html">BundleExpiredEvent</a> *event)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default event handler when bundles expire.  <a href="#6e544673088731fde3512406d2266942"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classdtn_1_1BundleList.html">BundleList</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#d812770c10ca652fbaf21779920e6f91">all_bundles_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">To ensure bundles aren't deleted by the system just after they are forwarded, we hold them all in this separate list.  <a href="#d812770c10ca652fbaf21779920e6f91"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classdtn_1_1EndpointIDPattern.html">EndpointIDPattern</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FloodBundleRouter.html#0825d406aa6c89dae23648642a3102f9">all_eids_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wildcard pattern to match all bundles.  <a href="#0825d406aa6c89dae23648642a3102f9"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This is the implementation of a flooding based bundle router. 
<p>
The implementation is very simple: The class maintains an internal <a class="el" href="classdtn_1_1BundleList.html" title="List structure for handling bundles.">BundleList</a> in which all bundles are kept until their expiration time. This prevents the main daemon logic from opportunistically deleting bundles when they've been transmitted.<p>
Whenever a new link arrives, we add a wildcard route to the table. Then when a bundle arrives, we can stick it on the all_bundles list and just call the base class route_bundle function. The core base class logic then makes sure that a copy of the bundle is forwarded exactly once to each neighbor.<p>
XXX/demmer This should be extended to avoid forwarding a bundle back to the node from which it arrived. With the upcoming bidirectional link changes, this should be able to be done easily. 
<p>Definition at line <a class="el" href="FloodBundleRouter_8h-source.html#l00042">42</a> of file <a class="el" href="FloodBundleRouter_8h-source.html">FloodBundleRouter.h</a>.</p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="660a62aff9ec2ac9229830513d425fd7"></a><!-- doxytag: member="dtn::FloodBundleRouter::FloodBundleRouter" ref="660a62aff9ec2ac9229830513d425fd7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dtn::FloodBundleRouter::FloodBundleRouter           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
<p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8cc-source.html#l00036">36</a> of file <a class="el" href="FloodBundleRouter_8cc-source.html">FloodBundleRouter.cc</a>.</p>

<p>References <a class="el" href="FloodBundleRouter_8h-source.html#l00079">all_eids_</a>, <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, and <a class="el" href="EndpointID_8h-source.html#l00262">dtn::EndpointID::valid()</a>.</p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="6e544673088731fde3512406d2266942"></a><!-- doxytag: member="dtn::FloodBundleRouter::handle_bundle_expired" ref="6e544673088731fde3512406d2266942" args="(BundleExpiredEvent *event)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtn::FloodBundleRouter::handle_bundle_expired           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classdtn_1_1BundleExpiredEvent.html">BundleExpiredEvent</a> *&nbsp;</td>
          <td class="paramname"> <em>event</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default event handler when bundles expire. 
<p>

<p>Reimplemented from <a class="el" href="classdtn_1_1BundleEventHandler.html#2f61bf0d5f85f029b3bd67adacb03ea1">dtn::BundleEventHandler</a>.</p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8cc-source.html#l00087">87</a> of file <a class="el" href="FloodBundleRouter_8cc-source.html">FloodBundleRouter.cc</a>.</p>

<p>References <a class="el" href="FloodBundleRouter_8h-source.html#l00076">all_bundles_</a>, and <a class="el" href="BundleList_8cc-source.html#l00275">dtn::BundleList::erase()</a>.</p>

</div>
</div><p>
<a class="anchor" name="d0c23759201e076aec5b7a4d070ef3a0"></a><!-- doxytag: member="dtn::FloodBundleRouter::handle_bundle_received" ref="d0c23759201e076aec5b7a4d070ef3a0" args="(BundleReceivedEvent *event)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtn::FloodBundleRouter::handle_bundle_received           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classdtn_1_1BundleReceivedEvent.html">BundleReceivedEvent</a> *&nbsp;</td>
          <td class="paramname"> <em>event</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Event handler for new bundle arrivals. 
<p>
Queue the bundle on the pending delivery list, and then searches through the route table to find any matching next contacts, filling in the action list with forwarding decisions. 
<p>Reimplemented from <a class="el" href="classdtn_1_1TableBasedRouter.html#f85d95a59fe4ae2217ed2c9b0c6cb662">dtn::TableBasedRouter</a>.</p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8cc-source.html#l00055">55</a> of file <a class="el" href="FloodBundleRouter_8cc-source.html">FloodBundleRouter.cc</a>.</p>

<p>References <a class="el" href="FloodBundleRouter_8h-source.html#l00076">all_bundles_</a>, and <a class="el" href="BundleList_8cc-source.html#l00130">dtn::BundleList::push_back()</a>.</p>

</div>
</div><p>
<a class="anchor" name="211fac9393649fc76ecfd366da0e2a21"></a><!-- doxytag: member="dtn::FloodBundleRouter::handle_link_created" ref="211fac9393649fc76ecfd366da0e2a21" args="(LinkCreatedEvent *event)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtn::FloodBundleRouter::handle_link_created           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classdtn_1_1LinkCreatedEvent.html">LinkCreatedEvent</a> *&nbsp;</td>
          <td class="paramname"> <em>event</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
When a link is created, add a new route for it. 
<p>

<p>Reimplemented from <a class="el" href="classdtn_1_1TableBasedRouter.html#15d6e91c5362005ef5f5ee2cc9b667b8">dtn::TableBasedRouter</a>.</p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8cc-source.html#l00066">66</a> of file <a class="el" href="FloodBundleRouter_8cc-source.html">FloodBundleRouter.cc</a>.</p>

<p>References <a class="el" href="TableBasedRouter_8cc-source.html#l00052">dtn::TableBasedRouter::add_route()</a>, <a class="el" href="FloodBundleRouter_8h-source.html#l00079">all_eids_</a>, <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, and <a class="el" href="ForwardingInfo_8h-source.html#l00046">dtn::ForwardingInfo::COPY_ACTION</a>.</p>

</div>
</div><p>
<a class="anchor" name="c64fdfc35227035b64312f6271317381"></a><!-- doxytag: member="dtn::FloodBundleRouter::initialize" ref="c64fdfc35227035b64312f6271317381" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dtn::FloodBundleRouter::initialize           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initializer. 
<p>

<p>Reimplemented from <a class="el" href="classdtn_1_1BundleRouter.html#58bdadd6a5f618d44cd4c2084acc707c">dtn::BundleRouter</a>.</p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8cc-source.html#l00047">47</a> of file <a class="el" href="FloodBundleRouter_8cc-source.html">FloodBundleRouter.cc</a>.</p>

<p>References <a class="el" href="BundleRouter_8h-source.html#l00080">dtn::BundleRouter::BundleRouter::Config::add_nexthop_routes_</a>, and <a class="el" href="BundleRouter_8cc-source.html#l00049">dtn::BundleRouter::config_</a>.</p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="d812770c10ca652fbaf21779920e6f91"></a><!-- doxytag: member="dtn::FloodBundleRouter::all_bundles_" ref="d812770c10ca652fbaf21779920e6f91" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classdtn_1_1BundleList.html">BundleList</a> <a class="el" href="classdtn_1_1FloodBundleRouter.html#d812770c10ca652fbaf21779920e6f91">dtn::FloodBundleRouter::all_bundles_</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
To ensure bundles aren't deleted by the system just after they are forwarded, we hold them all in this separate list. 
<p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8h-source.html#l00076">76</a> of file <a class="el" href="FloodBundleRouter_8h-source.html">FloodBundleRouter.h</a>.</p>

<p>Referenced by <a class="el" href="FloodBundleRouter_8cc-source.html#l00087">handle_bundle_expired()</a>, and <a class="el" href="FloodBundleRouter_8cc-source.html#l00055">handle_bundle_received()</a>.</p>

</div>
</div><p>
<a class="anchor" name="0825d406aa6c89dae23648642a3102f9"></a><!-- doxytag: member="dtn::FloodBundleRouter::all_eids_" ref="0825d406aa6c89dae23648642a3102f9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classdtn_1_1EndpointIDPattern.html">EndpointIDPattern</a> <a class="el" href="classdtn_1_1FloodBundleRouter.html#0825d406aa6c89dae23648642a3102f9">dtn::FloodBundleRouter::all_eids_</a><code> [protected]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Wildcard pattern to match all bundles. 
<p>

<p>Definition at line <a class="el" href="FloodBundleRouter_8h-source.html#l00079">79</a> of file <a class="el" href="FloodBundleRouter_8h-source.html">FloodBundleRouter.h</a>.</p>

<p>Referenced by <a class="el" href="FloodBundleRouter_8cc-source.html#l00036">FloodBundleRouter()</a>, and <a class="el" href="FloodBundleRouter_8cc-source.html#l00066">handle_link_created()</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="FloodBundleRouter_8h-source.html">FloodBundleRouter.h</a><li><a class="el" href="FloodBundleRouter_8cc-source.html">FloodBundleRouter.cc</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:27:04 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>