<!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::FragmentManager 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 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 List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespacedtn.html">dtn</a>::<a class="el" href="classdtn_1_1FragmentManager.html">FragmentManager</a> </div> </div> <div class="contents"> <h1>dtn::FragmentManager Class Reference</h1><!-- doxytag: class="dtn::FragmentManager" -->The Fragment Manager maintains state for all of the fragmentary bundles, reconstructing whole bundles from partial bundles. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="FragmentManager_8h-source.html">FragmentManager.h</a>></code> <p> <p> <a href="classdtn_1_1FragmentManager-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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#694dece64b76aaddff128b23e3c5a06f">FragmentManager</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#694dece64b76aaddff128b23e3c5a06f"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#f6f29fb926b821b27d8d6cda64ffa96a">create_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle, <a class="el" href="classdtn_1_1BlockInfoVec.html">BlockInfoVec</a> *blocks, size_t offset, size_t length)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a bundle fragment from another bundle. <a href="#f6f29fb926b821b27d8d6cda64ffa96a"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#240ed97b1cdf027902042e9571b9beec">create_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle, const <a class="el" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e">LinkRef</a> &link, const <a class="el" href="classdtn_1_1BlockInfoPointerList.html">BlockInfoPointerList</a> &blocks_to_copy, size_t offset, size_t length)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a fragment to be sent out on a particular link. <a href="#240ed97b1cdf027902042e9571b9beec"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#78e055f146c81f00cb1a0a82324cd585">convert_to_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle, size_t length)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Turn a bundle into a fragment. <a href="#78e055f146c81f00cb1a0a82324cd585"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#fbc6aa92f31a9e8a72cadb302e9c8a54">proactively_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle, const <a class="el" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e">LinkRef</a> &link, size_t max_length)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Given the given fragmentation threshold, determine whether the given bundle should be split into several smaller bundles. <a href="#fbc6aa92f31a9e8a72cadb302e9c8a54"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#6d648fcee877721cf9e6448b24641246">get_fragment_state</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#1e7b45257f6281030c8fe71fa2f809db">erase_fragment_state</a> (<a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> *fragment)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="serialsource_8c.html#1062901a7428fdd9c7f180f5e01ea056">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#2f9394ef9f40337b95fed1f6cca381ac">try_to_reactively_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle, <a class="el" href="classdtn_1_1BlockInfoVec.html">BlockInfoVec</a> *blocks, size_t bytes_sent)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">If only part of the given bundle was sent successfully, split it into two. <a href="#2f9394ef9f40337b95fed1f6cca381ac"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="serialsource_8c.html#1062901a7428fdd9c7f180f5e01ea056">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#d3a2b8e4ecd2838da9caee845f47dccb">try_to_convert_to_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *bundle)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a partially received bundle into a fragment. <a href="#d3a2b8e4ecd2838da9caee845f47dccb"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#06ba9686e9d9a7fca8cdc31c3ffca187">process_for_reassembly</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *fragment)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Given a newly arrived bundle fragment, append it to the table of fragments and see if it allows us to reassemble the bundle. <a href="#06ba9686e9d9a7fca8cdc31c3ffca187"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#900e9f477dc6ff5aac6cd6621daf04d9">delete_obsoleted_fragments</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *fragment)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Delete any fragments that are no longer needed given the incoming (non-fragment) bundle. <a href="#900e9f477dc6ff5aac6cd6621daf04d9"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#3cf63b648553dda12d36e0f05d17380e">delete_fragment</a> (<a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *fragment)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Delete reassembly state for a bundle. <a href="#3cf63b648553dda12d36e0f05d17380e"></a><br></td></tr> <tr><td colspan="2"><br><h2>Protected Types</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef oasys::StringHashMap<br class="typebreak"> < <a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#a89f7eb445d19fa240f69b36b4ee89e4">FragmentTable</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Check if the bundle has been completely reassembled. <a href="#a89f7eb445d19fa240f69b36b4ee89e4"></a><br></td></tr> <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#14e6759dca799277da24a3425274d9f9">get_hash_key</a> (const <a class="el" href="classdtn_1_1Bundle.html">Bundle</a> *, std::string *key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Calculate a hash table key from a bundle. <a href="#14e6759dca799277da24a3425274d9f9"></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_1FragmentManager.html#a89f7eb445d19fa240f69b36b4ee89e4">FragmentTable</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtn_1_1FragmentManager.html#c16a79e94b6eb8ac6aeed3f52752022b">fragment_table_</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> The Fragment Manager maintains state for all of the fragmentary bundles, reconstructing whole bundles from partial bundles. <p> It also implements the routine for creating bundle fragments from larger bundles. <p>Definition at line <a class="el" href="FragmentManager_8h-source.html#l00049">49</a> of file <a class="el" href="FragmentManager_8h-source.html">FragmentManager.h</a>.</p> <hr><h2>Member Typedef Documentation</h2> <a class="anchor" name="a89f7eb445d19fa240f69b36b4ee89e4"></a><!-- doxytag: member="dtn::FragmentManager::FragmentTable" ref="a89f7eb445d19fa240f69b36b4ee89e4" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef oasys::StringHashMap<<a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a>*> <a class="el" href="classdtn_1_1FragmentManager.html#a89f7eb445d19fa240f69b36b4ee89e4">dtn::FragmentManager::FragmentTable</a><code> [protected]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> Check if the bundle has been completely reassembled. <p> Table of partial bundles <p>Definition at line <a class="el" href="FragmentManager_8h-source.html#l00160">160</a> of file <a class="el" href="FragmentManager_8h-source.html">FragmentManager.h</a>.</p> </div> </div><p> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="694dece64b76aaddff128b23e3c5a06f"></a><!-- doxytag: member="dtn::FragmentManager::FragmentManager" ref="694dece64b76aaddff128b23e3c5a06f" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">dtn::FragmentManager::FragmentManager </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Constructor. <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00038">38</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="78e055f146c81f00cb1a0a82324cd585"></a><!-- doxytag: member="dtn::FragmentManager::convert_to_fragment" ref="78e055f146c81f00cb1a0a82324cd585" args="(Bundle *bundle, size_t length)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::FragmentManager::convert_to_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>length</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Turn a bundle into a fragment. <p> Note this is used just for reactive fragmentation on a newly received partial bundle and therefore the offset is implicitly zero (unless the bundle was already a fragment). </div> </div><p> <a class="anchor" name="240ed97b1cdf027902042e9571b9beec"></a><!-- doxytag: member="dtn::FragmentManager::create_fragment" ref="240ed97b1cdf027902042e9571b9beec" args="(Bundle *bundle, const LinkRef &link, const BlockInfoPointerList &blocks_to_copy, size_t offset, size_t length)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * dtn::FragmentManager::create_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e">LinkRef</a> & </td> <td class="paramname"> <em>link</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classdtn_1_1BlockInfoPointerList.html">BlockInfoPointerList</a> & </td> <td class="paramname"> <em>blocks_to_copy</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>offset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>length</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Create a fragment to be sent out on a particular link. <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00105">105</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="Bundle_8cc-source.html#l00261">dtn::Bundle::copy_metadata()</a>, <a class="el" href="BlockInfo_8cc-source.html#l00235">dtn::LinkBlockSet::create_blocks()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00222">dtn::Bundle::frag_offset()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00209">dtn::Bundle::is_fragment()</a>, <a class="el" href="BundlePayload_8h-source.html#l00077">dtn::BundlePayload::length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00272">dtn::Bundle::mutable_payload()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00223">dtn::Bundle::orig_length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00232">dtn::Bundle::payload()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00249">dtn::Bundle::set_do_not_fragment()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00260">dtn::Bundle::set_frag_offset()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00247">dtn::Bundle::set_is_fragment()</a>, <a class="el" href="BundlePayload_8cc-source.html#l00161">dtn::BundlePayload::set_length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00261">dtn::Bundle::set_orig_length()</a>, <a class="el" href="BundlePayload_8cc-source.html#l00378">dtn::BundlePayload::write_data()</a>, and <a class="el" href="bundling_2Bundle_8h-source.html#l00277">dtn::Bundle::xmit_blocks()</a>.</p> </div> </div><p> <a class="anchor" name="f6f29fb926b821b27d8d6cda64ffa96a"></a><!-- doxytag: member="dtn::FragmentManager::create_fragment" ref="f6f29fb926b821b27d8d6cda64ffa96a" args="(Bundle *bundle, BlockInfoVec *blocks, size_t offset, size_t length)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * dtn::FragmentManager::create_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classdtn_1_1BlockInfoVec.html">BlockInfoVec</a> * </td> <td class="paramname"> <em>blocks</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>offset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>length</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Create a bundle fragment from another bundle. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>bundle</em> </td><td>the source bundle from which we create the fragment. Note: the bundle may itself be a fragment</td></tr> <tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>the offset relative to this bundle (not the original) for the for the new fragment. note that if this bundle is already a fragment, the offset into the original bundle will be this bundle's frag_offset + offset</td></tr> <tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>the length of the fragment we want</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to the newly created bundle </dd></dl> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00045">45</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="BundleProtocol_8h-source.html#l00196">dtn::BundleProtocol::BLOCK_FLAG_REPLICATE</a>, <a class="el" href="Bundle_8cc-source.html#l00261">dtn::Bundle::copy_metadata()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00222">dtn::Bundle::frag_offset()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00209">dtn::Bundle::is_fragment()</a>, <a class="el" href="BundlePayload_8h-source.html#l00077">dtn::BundlePayload::length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00272">dtn::Bundle::mutable_payload()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00278">dtn::Bundle::mutable_recv_blocks()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00223">dtn::Bundle::orig_length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00232">dtn::Bundle::payload()</a>, <a class="el" href="BundleProtocol_8h-source.html#l00178">dtn::BundleProtocol::PAYLOAD_BLOCK</a>, <a class="el" href="BundleProtocol_8h-source.html#l00177">dtn::BundleProtocol::PRIMARY_BLOCK</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00249">dtn::Bundle::set_do_not_fragment()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00260">dtn::Bundle::set_frag_offset()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00247">dtn::Bundle::set_is_fragment()</a>, <a class="el" href="BundlePayload_8cc-source.html#l00161">dtn::BundlePayload::set_length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00261">dtn::Bundle::set_orig_length()</a>, and <a class="el" href="BundlePayload_8cc-source.html#l00378">dtn::BundlePayload::write_data()</a>.</p> <p>Referenced by <a class="el" href="FragmentManager_8cc-source.html#l00244">proactively_fragment()</a>, and <a class="el" href="FragmentManager_8cc-source.html#l00327">try_to_reactively_fragment()</a>.</p> </div> </div><p> <a class="anchor" name="3cf63b648553dda12d36e0f05d17380e"></a><!-- doxytag: member="dtn::FragmentManager::delete_fragment" ref="3cf63b648553dda12d36e0f05d17380e" args="(Bundle *fragment)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::FragmentManager::delete_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>fragment</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Delete reassembly state for a bundle. <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00505">505</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, <a class="el" href="FragmentState_8cc-source.html#l00035">dtn::FragmentState::erase_fragment()</a>, <a class="el" href="FragmentManager_8h-source.html#l00161">fragment_table_</a>, <a class="el" href="FragmentManager_8cc-source.html#l00230">get_hash_key()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00209">dtn::Bundle::is_fragment()</a>, and <a class="el" href="FragmentState_8h-source.html#l00045">dtn::FragmentState::num_fragments()</a>.</p> <p>Referenced by <a class="el" href="BundleDaemon_8cc-source.html#l02265">dtn::BundleDaemon::delete_bundle()</a>.</p> </div> </div><p> <a class="anchor" name="900e9f477dc6ff5aac6cd6621daf04d9"></a><!-- doxytag: member="dtn::FragmentManager::delete_obsoleted_fragments" ref="900e9f477dc6ff5aac6cd6621daf04d9" args="(Bundle *fragment)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::FragmentManager::delete_obsoleted_fragments </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>fragment</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Delete any fragments that are no longer needed given the incoming (non-fragment) bundle. <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00465">465</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00201">dtn::Bundle::bundleid()</a>, <a class="el" href="BundleList_8cc-source.html#l00467">dtn::BundleList::empty()</a>, <a class="el" href="FragmentState_8h-source.html#l00047">dtn::FragmentState::fragment_list()</a>, <a class="el" href="FragmentManager_8h-source.html#l00161">fragment_table_</a>, <a class="el" href="FragmentManager_8cc-source.html#l00230">get_hash_key()</a>, <a class="el" href="bundling_2BundleList_8h-source.html#l00285">dtn::BundleList::lock()</a>, <a class="el" href="FragmentState_8h-source.html#l00045">dtn::FragmentState::num_fragments()</a>, <a class="el" href="BundleList_8cc-source.html#l00256">dtn::BundleList::pop_back()</a>, <a class="el" href="BundleDaemon_8cc-source.html#l00134">dtn::BundleDaemon::post()</a>, <a class="el" href="BundleProtocol_8h-source.html#l00124">dtn::BundleProtocol::REASON_NO_ADDTL_INFO</a>, and <a class="el" href="BundleList_8cc-source.html#l00459">dtn::BundleList::size()</a>.</p> <p>Referenced by <a class="el" href="BundleDaemon_8cc-source.html#l00486">dtn::BundleDaemon::handle_bundle_received()</a>.</p> </div> </div><p> <a class="anchor" name="1e7b45257f6281030c8fe71fa2f809db"></a><!-- doxytag: member="dtn::FragmentManager::erase_fragment_state" ref="1e7b45257f6281030c8fe71fa2f809db" args="(FragmentState *fragment)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::FragmentManager::erase_fragment_state </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> * </td> <td class="paramname"> <em>fragment</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00318">318</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="FragmentState_8h-source.html#l00046">dtn::FragmentState::bundle()</a>, <a class="el" href="FragmentManager_8h-source.html#l00161">fragment_table_</a>, and <a class="el" href="FragmentManager_8cc-source.html#l00230">get_hash_key()</a>.</p> </div> </div><p> <a class="anchor" name="6d648fcee877721cf9e6448b24641246"></a><!-- doxytag: member="dtn::FragmentManager::get_fragment_state" ref="6d648fcee877721cf9e6448b24641246" args="(Bundle *bundle)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> * dtn::FragmentManager::get_fragment_state </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00303">303</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="FragmentManager_8h-source.html#l00161">fragment_table_</a>, and <a class="el" href="FragmentManager_8cc-source.html#l00230">get_hash_key()</a>.</p> </div> </div><p> <a class="anchor" name="14e6759dca799277da24a3425274d9f9"></a><!-- doxytag: member="dtn::FragmentManager::get_hash_key" ref="14e6759dca799277da24a3425274d9f9" args="(const Bundle *, std::string *key)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::FragmentManager::get_hash_key </td> <td>(</td> <td class="paramtype">const <a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::string * </td> <td class="paramname"> <em>key</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Calculate a hash table key from a bundle. <p> <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00230">230</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="num2sdnv_8c-source.html#l00035">buf</a>, <a class="el" href="EndpointID_8h-source.html#l00264">dtn::EndpointID::c_str()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00234">dtn::Bundle::creation_ts()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00205">dtn::Bundle::dest()</a>, <a class="el" href="BundleTimestamp_8h-source.html#l00031">dtn::BundleTimestamp::seconds_</a>, <a class="el" href="BundleTimestamp_8h-source.html#l00032">dtn::BundleTimestamp::seqno_</a>, and <a class="el" href="bundling_2Bundle_8h-source.html#l00204">dtn::Bundle::source()</a>.</p> <p>Referenced by <a class="el" href="FragmentManager_8cc-source.html#l00505">delete_fragment()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00465">delete_obsoleted_fragments()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00318">erase_fragment_state()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00303">get_fragment_state()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00244">proactively_fragment()</a>, and <a class="el" href="FragmentManager_8cc-source.html#l00387">process_for_reassembly()</a>.</p> </div> </div><p> <a class="anchor" name="fbc6aa92f31a9e8a72cadb302e9c8a54"></a><!-- doxytag: member="dtn::FragmentManager::proactively_fragment" ref="fbc6aa92f31a9e8a72cadb302e9c8a54" args="(Bundle *bundle, const LinkRef &link, size_t max_length)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classdtn_1_1FragmentState.html">FragmentState</a> * dtn::FragmentManager::proactively_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e">LinkRef</a> & </td> <td class="paramname"> <em>link</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>max_length</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Given the given fragmentation threshold, determine whether the given bundle should be split into several smaller bundles. <p> If so, this returns true and generates a bunch of bundle received events for the individual fragments.<p> Return the number of fragments created or zero if none were created. <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00244">244</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="FragmentState_8cc-source.html#l00028">dtn::FragmentState::add_fragment()</a>, <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, <a class="el" href="BundleProtocol_8h-source.html#l00196">dtn::BundleProtocol::BLOCK_FLAG_REPLICATE</a>, <a class="el" href="dtnping_8c-source.html#l00045">count</a>, <a class="el" href="FragmentManager_8cc-source.html#l00045">create_fragment()</a>, <a class="el" href="BlockInfo_8cc-source.html#l00247">dtn::LinkBlockSet::find_blocks()</a>, <a class="el" href="BlockInfo_8cc-source.html#l00118">dtn::BlockInfo::flags()</a>, <a class="el" href="FragmentManager_8h-source.html#l00161">fragment_table_</a>, <a class="el" href="FragmentManager_8cc-source.html#l00230">get_hash_key()</a>, <a class="el" href="BundlePayload_8h-source.html#l00077">dtn::BundlePayload::length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00232">dtn::Bundle::payload()</a>, <a class="el" href="BundleProtocol_8h-source.html#l00178">dtn::BundleProtocol::PAYLOAD_BLOCK</a>, <a class="el" href="BundleProtocol_8h-source.html#l00177">dtn::BundleProtocol::PRIMARY_BLOCK</a>, <a class="el" href="BlockInfo_8cc-source.html#l00094">dtn::BlockInfo::type()</a>, and <a class="el" href="bundling_2Bundle_8h-source.html#l00277">dtn::Bundle::xmit_blocks()</a>.</p> </div> </div><p> <a class="anchor" name="06ba9686e9d9a7fca8cdc31c3ffca187"></a><!-- doxytag: member="dtn::FragmentManager::process_for_reassembly" ref="06ba9686e9d9a7fca8cdc31c3ffca187" args="(Bundle *fragment)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void dtn::FragmentManager::process_for_reassembly </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>fragment</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Given a newly arrived bundle fragment, append it to the table of fragments and see if it allows us to reassemble the bundle. <p> If it does, a <a class="el" href="classdtn_1_1ReassemblyCompletedEvent.html" title="Event class for reassembly completion.">ReassemblyCompletedEvent</a> will be posted. <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00387">387</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="FragmentState_8cc-source.html#l00028">dtn::FragmentState::add_fragment()</a>, <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, <a class="el" href="FragmentState_8h-source.html#l00046">dtn::FragmentState::bundle()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00201">dtn::Bundle::bundleid()</a>, <a class="el" href="FragmentState_8cc-source.html#l00042">dtn::FragmentState::check_completed()</a>, <a class="el" href="Bundle_8cc-source.html#l00261">dtn::Bundle::copy_metadata()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00222">dtn::Bundle::frag_offset()</a>, <a class="el" href="FragmentState_8h-source.html#l00047">dtn::FragmentState::fragment_list()</a>, <a class="el" href="FragmentManager_8h-source.html#l00161">fragment_table_</a>, <a class="el" href="FragmentManager_8cc-source.html#l00230">get_hash_key()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00209">dtn::Bundle::is_fragment()</a>, <a class="el" href="BundlePayload_8h-source.html#l00077">dtn::BundlePayload::length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00223">dtn::Bundle::orig_length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00232">dtn::Bundle::payload()</a>, <a class="el" href="BundleDaemon_8cc-source.html#l00141">dtn::BundleDaemon::post_at_head()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00236">dtn::Bundle::recv_blocks()</a>, and <a class="el" href="BundleList_8cc-source.html#l00459">dtn::BundleList::size()</a>.</p> <p>Referenced by <a class="el" href="BundleDaemon_8cc-source.html#l01159">dtn::BundleDaemon::handle_bundle_inject()</a>, and <a class="el" href="BundleDaemon_8cc-source.html#l00486">dtn::BundleDaemon::handle_bundle_received()</a>.</p> </div> </div><p> <a class="anchor" name="d3a2b8e4ecd2838da9caee845f47dccb"></a><!-- doxytag: member="dtn::FragmentManager::try_to_convert_to_fragment" ref="d3a2b8e4ecd2838da9caee845f47dccb" args="(Bundle *bundle)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="serialsource_8c.html#1062901a7428fdd9c7f180f5e01ea056">bool</a> dtn::FragmentManager::try_to_convert_to_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Convert a partially received bundle into a fragment. <p> Return true if a fragment was created <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00164">164</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, <a class="el" href="BlockInfo_8h-source.html#l00083">dtn::BlockInfo::complete()</a>, <a class="el" href="BlockInfo_8h-source.html#l00077">dtn::BlockInfo::data_length()</a>, <a class="el" href="BlockInfo_8h-source.html#l00078">dtn::BlockInfo::data_offset()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00211">dtn::Bundle::do_not_fragment()</a>, <a class="el" href="BlockInfo_8cc-source.html#l00203">dtn::BlockInfoVec::find_block()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00209">dtn::Bundle::is_fragment()</a>, <a class="el" href="BlockInfo_8cc-source.html#l00142">dtn::BlockInfo::last_block()</a>, <a class="el" href="BundlePayload_8h-source.html#l00077">dtn::BundlePayload::length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00272">dtn::Bundle::mutable_payload()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00232">dtn::Bundle::payload()</a>, <a class="el" href="BundleProtocol_8h-source.html#l00178">dtn::BundleProtocol::PAYLOAD_BLOCK</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00236">dtn::Bundle::recv_blocks()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00260">dtn::Bundle::set_frag_offset()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00265">dtn::Bundle::set_fragmented_incoming()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00247">dtn::Bundle::set_is_fragment()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00261">dtn::Bundle::set_orig_length()</a>, and <a class="el" href="BundlePayload_8cc-source.html#l00215">dtn::BundlePayload::truncate()</a>.</p> <p>Referenced by <a class="el" href="BundleDaemon_8cc-source.html#l00486">dtn::BundleDaemon::handle_bundle_received()</a>.</p> </div> </div><p> <a class="anchor" name="2f9394ef9f40337b95fed1f6cca381ac"></a><!-- doxytag: member="dtn::FragmentManager::try_to_reactively_fragment" ref="2f9394ef9f40337b95fed1f6cca381ac" args="(Bundle *bundle, BlockInfoVec *blocks, size_t bytes_sent)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="serialsource_8c.html#1062901a7428fdd9c7f180f5e01ea056">bool</a> dtn::FragmentManager::try_to_reactively_fragment </td> <td>(</td> <td class="paramtype"><a class="el" href="classdtn_1_1Bundle.html">Bundle</a> * </td> <td class="paramname"> <em>bundle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classdtn_1_1BlockInfoVec.html">BlockInfoVec</a> * </td> <td class="paramname"> <em>blocks</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"> <em>bytes_sent</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> If only part of the given bundle was sent successfully, split it into two. <p> The original bundle<p> Return true if a fragment was created <p>Definition at line <a class="el" href="FragmentManager_8cc-source.html#l00327">327</a> of file <a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a>.</p> <p>References <a class="el" href="SDNV_8cc-source.html#l00044">ASSERT</a>, <a class="el" href="FragmentManager_8cc-source.html#l00045">create_fragment()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00211">dtn::Bundle::do_not_fragment()</a>, <a class="el" href="BundleEvent_8h-source.html#l00218">dtn::EVENTSRC_FRAGMENTATION</a>, <a class="el" href="BlockInfo_8cc-source.html#l00203">dtn::BlockInfoVec::find_block()</a>, <a class="el" href="BlockInfo_8cc-source.html#l00142">dtn::BlockInfo::last_block()</a>, <a class="el" href="BundlePayload_8h-source.html#l00077">dtn::BundlePayload::length()</a>, <a class="el" href="bundling_2Bundle_8h-source.html#l00232">dtn::Bundle::payload()</a>, <a class="el" href="BundleProtocol_8h-source.html#l00178">dtn::BundleProtocol::PAYLOAD_BLOCK</a>, <a class="el" href="BundleProtocol_8cc-source.html#l00279">dtn::BundleProtocol::payload_offset()</a>, <a class="el" href="BundleDaemon_8cc-source.html#l00141">dtn::BundleDaemon::post_at_head()</a>, and <a class="el" href="BundleProtocol_8cc-source.html#l00264">dtn::BundleProtocol::total_length()</a>.</p> <p>Referenced by <a class="el" href="BundleDaemon_8cc-source.html#l00785">dtn::BundleDaemon::handle_bundle_transmitted()</a>.</p> </div> </div><p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="c16a79e94b6eb8ac6aeed3f52752022b"></a><!-- doxytag: member="dtn::FragmentManager::fragment_table_" ref="c16a79e94b6eb8ac6aeed3f52752022b" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classdtn_1_1FragmentManager.html#a89f7eb445d19fa240f69b36b4ee89e4">FragmentTable</a> <a class="el" href="classdtn_1_1FragmentManager.html#c16a79e94b6eb8ac6aeed3f52752022b">dtn::FragmentManager::fragment_table_</a><code> [protected]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="FragmentManager_8h-source.html#l00161">161</a> of file <a class="el" href="FragmentManager_8h-source.html">FragmentManager.h</a>.</p> <p>Referenced by <a class="el" href="FragmentManager_8cc-source.html#l00505">delete_fragment()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00465">delete_obsoleted_fragments()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00318">erase_fragment_state()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00303">get_fragment_state()</a>, <a class="el" href="FragmentManager_8cc-source.html#l00244">proactively_fragment()</a>, and <a class="el" href="FragmentManager_8cc-source.html#l00387">process_for_reassembly()</a>.</p> </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="FragmentManager_8h-source.html">FragmentManager.h</a><li><a class="el" href="FragmentManager_8cc-source.html">FragmentManager.cc</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 30 09:27:03 2009 for DTN Reference Implementation by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>