<!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: TableBasedRouter.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>TableBasedRouter.h</h1><a href="TableBasedRouter_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright 2005-2006 Intel Corporation</span> <a name="l00003"></a>00003 <span class="comment"> * </span> <a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span> <a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span> <a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span> <a name="l00007"></a>00007 <span class="comment"> * </span> <a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> <a name="l00009"></a>00009 <span class="comment"> * </span> <a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> <a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> <a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> <a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span> <a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span> <a name="l00015"></a>00015 <span class="comment"> */</span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef _TABLE_BASED_ROUTER_H_</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _TABLE_BASED_ROUTER_H_</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <oasys/util/StringUtils.h></span> <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="BundleRouter_8h.html">BundleRouter.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="RouterInfo_8h.html">RouterInfo.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="BundleInfoCache_8h.html">bundling/BundleInfoCache.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="Registration_8h.html">reg/Registration.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="SessionTable_8h.html">session/SessionTable.h</a>"</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="keyword">namespace </span>dtn { <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="keyword">class </span>BundleList; <a name="l00031"></a>00031 <span class="keyword">class </span>RouteEntryVec; <a name="l00032"></a>00032 <span class="keyword">class </span>RouteTable; <a name="l00033"></a>00033 <a name="l00038"></a><a class="code" href="classdtn_1_1TableBasedRouter.html">00038</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1TableBasedRouter.html" title="This is an abstract class that is intended to be used for all routing algorithms...">TableBasedRouter</a> : <span class="keyword">public</span> <a class="code" href="classdtn_1_1BundleRouter.html" title="The BundleRouter is the main decision maker for all routing decisions related to...">BundleRouter</a> { <a name="l00039"></a>00039 <span class="keyword">protected</span>: <a name="l00044"></a>00044 <a class="code" href="classdtn_1_1TableBasedRouter.html#a1727dca6f2c6bc0cf3f8dc371e93568" title="Constructor -- protected since this class is never instantiated by itself.">TableBasedRouter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* classname, <span class="keyword">const</span> std::string& name); <a name="l00045"></a>00045 <a name="l00049"></a>00049 <span class="keyword">virtual</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#2b6549f8eac7612a408703026bd0f8d6" title="Destructor.">~TableBasedRouter</a>(); <a name="l00050"></a>00050 <a name="l00056"></a>00056 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#0a41a70c82d3a58ec0fc044dbe99dfe9" title="Event handler overridden from BundleRouter / BundleEventHandler that dispatches to...">handle_event</a>(<a class="code" href="classdtn_1_1BundleEvent.html" title="Event base class.">BundleEvent</a>* event); <a name="l00057"></a>00057 <a name="l00059"></a>00059 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#f85d95a59fe4ae2217ed2c9b0c6cb662" title="Event handlers.">handle_bundle_received</a>(<a class="code" href="classdtn_1_1BundleReceivedEvent.html" title="Event class for new bundle arrivals.">BundleReceivedEvent</a>* event); <a name="l00060"></a>00060 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#c021068d7b1e9802cc3507d6825ba245" title="Event handlers.">handle_bundle_transmitted</a>(<a class="code" href="classdtn_1_1BundleTransmittedEvent.html" title="Event class for bundle or fragment transmission.">BundleTransmittedEvent</a>* event); <a name="l00061"></a>00061 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#8cc4cee7d37567989384b3c70c33f938" title="Event handlers.">handle_bundle_cancelled</a>(<a class="code" href="classdtn_1_1BundleSendCancelledEvent.html" title="Event class for succesful cancellation of a bundle send.">BundleSendCancelledEvent</a>* event); <a name="l00062"></a>00062 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#7ffd58d58cac80337e17c53869d7f6dd" title="Event handlers.">handle_route_add</a>(<a class="code" href="classdtn_1_1RouteAddEvent.html" title="Event class for route add events.">RouteAddEvent</a>* event); <a name="l00063"></a>00063 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#aeaa4b9e5557810958ac0e48768a0a28" title="Event handlers.">handle_route_del</a>(<a class="code" href="classdtn_1_1RouteDelEvent.html" title="Event class for route delete events.">RouteDelEvent</a>* event); <a name="l00064"></a>00064 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#898f2c517d6c8b0635c2ac19a5c3425a" title="Event handlers.">handle_contact_up</a>(<a class="code" href="classdtn_1_1ContactUpEvent.html" title="Event class for contact up events.">ContactUpEvent</a>* event); <a name="l00065"></a>00065 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#5b9a452a306adc7f97c998f3e7c585e3" title="Event handlers.">handle_contact_down</a>(<a class="code" href="classdtn_1_1ContactDownEvent.html" title="Event class for contact down events.">ContactDownEvent</a>* event); <a name="l00066"></a>00066 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#32d765a2b27a3e41273884bf521a9122" title="Event handlers.">handle_link_available</a>(<a class="code" href="classdtn_1_1LinkAvailableEvent.html" title="Event class for link available events.">LinkAvailableEvent</a>* event); <a name="l00067"></a>00067 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#15d6e91c5362005ef5f5ee2cc9b667b8" title="Event handlers.">handle_link_created</a>(<a class="code" href="classdtn_1_1LinkCreatedEvent.html" title="Event class for link creation events.">LinkCreatedEvent</a>* event); <a name="l00068"></a>00068 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#f18906e5ecdbe1dc6ff76b3d74bc41b0" title="Event handlers.">handle_link_deleted</a>(<a class="code" href="classdtn_1_1LinkDeletedEvent.html" title="Event class for link deletion events.">LinkDeletedEvent</a>* event); <a name="l00069"></a>00069 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#4fec130df59945e730febe93bf5b9372" title="Event handlers.">handle_custody_timeout</a>(<a class="code" href="classdtn_1_1CustodyTimeoutEvent.html" title="Event class for custody transfer timeout events.">CustodyTimeoutEvent</a>* event); <a name="l00070"></a>00070 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#fab4ded007eddf5b49c3ff75eea74dd8" title="Event handlers.">handle_registration_added</a>(<a class="code" href="classdtn_1_1RegistrationAddedEvent.html" title="Event class for new registration arrivals.">RegistrationAddedEvent</a>* event); <a name="l00071"></a>00071 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#14f12535527828c3a8e76f97f00c584c" title="Event handlers.">handle_registration_removed</a>(<a class="code" href="classdtn_1_1RegistrationRemovedEvent.html" title="Event class for registration removals.">RegistrationRemovedEvent</a>* event); <a name="l00072"></a>00072 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#777585bc5c45196cd7426c08f47375d5" title="Event handlers.">handle_registration_expired</a>(<a class="code" href="classdtn_1_1RegistrationExpiredEvent.html" title="Event class for registration expiration.">RegistrationExpiredEvent</a>* event); <a name="l00074"></a>00074 <a name="l00075"></a>00075 <a name="l00077"></a>00077 <a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* <a class="code" href="classdtn_1_1TableBasedRouter.html#de9f9602a3734518769ac7a4bc324e79" title="Session management helper functions.">get_session_for_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00078"></a>00078 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#c917dc5ba2a3e8d2c73adb3cad6033d3" title="Session management helper functions.">add_bundle_to_session</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* session); <a name="l00079"></a>00079 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#8eefa1b03ae7e19a168205af67d4173b" title="Session management helper functions.">subscribe_to_session</a>(<span class="keywordtype">int</span> action, <a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* session); <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#6f94fb99000ba969300ffee06b8a2d84" title="Session management helper functions.">find_session_upstream</a>(<a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* session); <a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#5a20afd32a3841641b60c8dab2c55986" title="Session management helper functions.">reroute_all_sessions</a>(); <a name="l00083"></a>00083 <a name="l00084"></a>00084 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#14061ba8016fc61a7556d44b1323f36c" title="Session management helper functions.">handle_session_bundle</a>(<a class="code" href="classdtn_1_1BundleReceivedEvent.html" title="Event class for new bundle arrivals.">BundleReceivedEvent</a>* event); <a name="l00085"></a>00085 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#81dfb7a82261a5ee3baa1226c4bc2b1c" title="Session management helper functions.">add_subscriber</a>(<a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* session, <a name="l00086"></a>00086 <span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointID.html">EndpointID</a>& peer, <a name="l00087"></a>00087 <span class="keyword">const</span> <a class="code" href="classdtn_1_1SequenceID.html" title="A bundle SequenceID is a version vector of (EID, counter) and/or (EID, identifier)...">SequenceID</a>& known_seqid); <a name="l00089"></a>00089 <a name="l00093"></a>00093 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#c7e05bea7fada765cb85bc589e8fe9ab" title="Dump the routing state.">get_routing_state</a>(oasys::StringBuffer* <a class="code" href="num2sdnv_8c.html#a81cdcc7ff6987bc85c073253e32715f">buf</a>); <a name="l00094"></a>00094 <a name="l00098"></a>00098 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#b84236fc3f6862121bb83088b2e35d42" title="Get a tcl version of the routing state.">tcl_dump_state</a>(oasys::StringBuffer* buf); <a name="l00099"></a>00099 <a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#118c2a374824c8ba1fcf2e7388c0af74" title="Add a route entry to the routing table.">add_route</a>(<a class="code" href="classdtn_1_1RouteEntry.html" title="Class to represent route table entry.">RouteEntry</a> *entry); <a name="l00104"></a>00104 <a name="l00108"></a>00108 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#5cbd7ee9f918a8c833bb0d82f0df9155" title="Remove matrhing route entry(s) from the routing table.">del_route</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1EndpointIDPattern.html" title="A Distinct class for endpoint patterns (i.e.">EndpointIDPattern</a>& <span class="keywordtype">id</span>); <a name="l00109"></a>00109 <a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#d5d66b2ef80180677d4cf5093bcaf009" title="Update forwarding state due to changed routes.">handle_changed_routes</a>(); <a name="l00114"></a>00114 <a name="l00118"></a>00118 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#4bac86cb57a6b1b7350f8471d890bb2f" title="Try to forward a bundle to a next hop route.">fwd_to_nexthop</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a class="code" href="classdtn_1_1RouteEntry.html" title="Class to represent route table entry.">RouteEntry</a>* route); <a name="l00119"></a>00119 <a name="l00127"></a>00127 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#08961b48157a280be9cb160158903a82" title="Check if the bundle should be forwarded to the given next hop.">should_fwd</a>(<span class="keyword">const</span> <a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a class="code" href="classdtn_1_1RouteEntry.html" title="Class to represent route table entry.">RouteEntry</a>* route); <a name="l00128"></a>00128 <a name="l00139"></a>00139 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#2e313494d5804ecac9399a3685e32734" title="Check the route table entries that match the given bundle and have not already been...">route_bundle</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle); <a name="l00140"></a>00140 <a name="l00146"></a>00146 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#33e876c5a09869489c60f892a9fbb909" title="Once a vector of matching routes has been found, sort the vector.">sort_routes</a>(<a class="code" href="classdtn_1_1Bundle.html" title="The internal representation of a bundle.">Bundle</a>* bundle, <a class="code" href="classdtn_1_1RouteEntryVec.html" title="Class for a vector of route entries.">RouteEntryVec</a>* routes); <a name="l00147"></a>00147 <a name="l00156"></a>00156 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#c94ac84e21dbf45fd6ccd8fb37b0bd97" title="Called when the next hop link is available for transmission (i.e.">check_next_hop</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& next_hop); <a name="l00157"></a>00157 <a name="l00161"></a>00161 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#3e5d2926a1b0cf5cabbef44eafd21bb7" title="Go through all known bundles in the system and try to re-route them.">reroute_all_bundles</a>(); <a name="l00162"></a>00162 <a name="l00167"></a>00167 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#7339ab822d11b9cf8c83ae608e79058e" title="Generic hook in response to the command line indication that we should reroute all...">recompute_routes</a>(); <a name="l00168"></a>00168 <a name="l00173"></a>00173 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#822c4f8e15dab2c379dad968431c1f27" title="When new links are added or opened, and if we&#39;re configured to add nexthop routes...">add_nexthop_route</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00174"></a>00174 <a name="l00178"></a>00178 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#feb96189b85d0035ad08874204bdc86b" title="Hook to ask the router if the bundle can be deleted.">can_delete_bundle</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle); <a name="l00179"></a>00179 <a name="l00183"></a>00183 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#469390b9ba77d858ed51d5d80176407e" title="Hook to tell the router that the bundle should be deleted.">delete_bundle</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle); <a name="l00184"></a>00184 <a name="l00188"></a>00188 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#0999e77477c37efdf9709fd3f0928b05" title="Remove matching deferred transmission entries.">remove_from_deferred</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle, <span class="keywordtype">int</span> actions); <a name="l00189"></a>00189 <a name="l00191"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#794be5288550f7294907e058fc21a98f">00191</a> <a class="code" href="classdtn_1_1BundleInfoCache.html" title="Utility class for maintain a cache of recently received bundles, indexed by GbofId...">BundleInfoCache</a> <a class="code" href="classdtn_1_1TableBasedRouter.html#794be5288550f7294907e058fc21a98f" title="Cache to check for duplicates and to implement a simple RPF check.">reception_cache_</a>; <a name="l00192"></a>00192 <a name="l00194"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#83939b60c495ff450a1e95787c811297">00194</a> <a class="code" href="classdtn_1_1RouteTable.html" title="Class that implements the routing table, implemented with an stl vector.">RouteTable</a>* <a class="code" href="classdtn_1_1TableBasedRouter.html#83939b60c495ff450a1e95787c811297" title="The routing table.">route_table_</a>; <a name="l00195"></a>00195 <a name="l00197"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#15781c2af48938de09c75f010e40071a">00197</a> <a class="code" href="classdtn_1_1SessionTable.html" title="Table to manage the open sessions.">SessionTable</a> <a class="code" href="classdtn_1_1TableBasedRouter.html#15781c2af48938de09c75f010e40071a" title="Session state management table.">sessions_</a>; <a name="l00198"></a>00198 <a name="l00200"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#82bda89e14b56877e7b4dce41ebd5261">00200</a> <a class="code" href="classdtn_1_1RegistrationList.html" title="Typedef for a list of Registrations.">RegistrationList</a> <a class="code" href="classdtn_1_1TableBasedRouter.html#82bda89e14b56877e7b4dce41ebd5261" title="Vector of session custodian registrations.">session_custodians_</a>; <a name="l00201"></a>00201 <a name="l00204"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html">00204</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html" title="Timer class used to cancel transmission on down links after waiting for them to potentially...">RerouteTimer</a> : <span class="keyword">public</span> oasys::Timer { <a name="l00205"></a>00205 <span class="keyword">public</span>: <a name="l00206"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#0687a518af0585c6b9f22111749b582b">00206</a> <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#0687a518af0585c6b9f22111749b582b">RerouteTimer</a>(<a class="code" href="classdtn_1_1TableBasedRouter.html" title="This is an abstract class that is intended to be used for all routing algorithms...">TableBasedRouter</a>* router, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link) <a name="l00207"></a>00207 : <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#ec9285836030a97c1f4deeda5c6f0ec7">router_</a>(router), <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#99b1577ad6fad4e6dcd98f93c09efaa5">link_</a>(link) {} <a name="l00208"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#bfc79df48edf4659d22d8b878ce57091">00208</a> <span class="keyword">virtual</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#bfc79df48edf4659d22d8b878ce57091">~RerouteTimer</a>() {} <a name="l00209"></a>00209 <a name="l00210"></a>00210 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#9cb081861b3450eb7ebde4c72525cc52">timeout</a>(<span class="keyword">const</span> <span class="keyword">struct</span> timeval& now); <a name="l00211"></a>00211 <a name="l00212"></a>00212 <span class="keyword">protected</span>: <a name="l00213"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#ec9285836030a97c1f4deeda5c6f0ec7">00213</a> <a class="code" href="classdtn_1_1TableBasedRouter.html" title="This is an abstract class that is intended to be used for all routing algorithms...">TableBasedRouter</a>* <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#ec9285836030a97c1f4deeda5c6f0ec7">router_</a>; <a name="l00214"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#99b1577ad6fad4e6dcd98f93c09efaa5">00214</a> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a> <a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html#99b1577ad6fad4e6dcd98f93c09efaa5">link_</a>; <a name="l00215"></a>00215 }; <a name="l00216"></a>00216 <a name="l00217"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#e76c969f4f466488fef519f992eef9e6">00217</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdtn_1_1TableBasedRouter_1_1RerouteTimer.html" title="Timer class used to cancel transmission on down links after waiting for them to potentially...">RerouteTimer</a>; <a name="l00218"></a>00218 <a name="l00220"></a>00220 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter.html#7ea4067686f50b1656df26c896aea369" title="Helper function for rerouting.">reroute_bundles</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00221"></a>00221 <a name="l00223"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#0f3d17c2f282c283f277f5f5c7f49f95">00223</a> <span class="keyword">typedef</span> oasys::StringMap<RerouteTimer*> <a class="code" href="classdtn_1_1TableBasedRouter.html#0f3d17c2f282c283f277f5f5c7f49f95" title="Table of reroute timers, indexed by the link name.">RerouteTimerMap</a>; <a name="l00224"></a><a class="code" href="classdtn_1_1TableBasedRouter.html#601cf75bb9ad55256211e63b3d34b4d9">00224</a> <a class="code" href="classdtn_1_1TableBasedRouter.html#0f3d17c2f282c283f277f5f5c7f49f95" title="Table of reroute timers, indexed by the link name.">RerouteTimerMap</a> <a class="code" href="classdtn_1_1TableBasedRouter.html#601cf75bb9ad55256211e63b3d34b4d9">reroute_timers_</a>; <a name="l00225"></a>00225 <a name="l00228"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html">00228</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html" title="Per-link class used to store deferred transmission bundles that helps cache route...">DeferredList</a> : <span class="keyword">public</span> <a class="code" href="classdtn_1_1RouterInfo.html" title="Empty wrapper class to encapsulate router-specific data attached to Links.">RouterInfo</a>, <span class="keyword">public</span> oasys::<a class="code" href="classoasys_1_1Logger.html">Logger</a> { <a name="l00229"></a>00229 <span class="keyword">public</span>: <a name="l00230"></a>00230 <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#41c5806479ead8e174a8afce3c52de55">DeferredList</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* logpath, <span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00231"></a>00231 <a name="l00233"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#90707a646fce8e0af35b99509b14424b">00233</a> <a class="code" href="classdtn_1_1BundleList.html" title="List structure for handling bundles.">BundleList</a>* <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#90707a646fce8e0af35b99509b14424b" title="Accessor for the bundle list.">list</a>() { <span class="keywordflow">return</span> &<a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#ba631d00d7e4be0232b21e1c7c13ac35">list_</a>; } <a name="l00234"></a>00234 <a name="l00237"></a>00237 <span class="keyword">const</span> <a class="code" href="classdtn_1_1ForwardingInfo.html" title="Class to encapsulate bundle forwarding information.">ForwardingInfo</a>& <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#eff6ba41d141a9c16b0309e410a936ae" title="Accessor for the forwarding info associated with the bundle, which must be on the...">info</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle); <a name="l00238"></a>00238 <a name="l00241"></a>00241 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#8a87dfe205964e5eaee333c4b0c4f7c0" title="Check if the bundle is on the list.">find</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle, <a class="code" href="classdtn_1_1ForwardingInfo.html" title="Class to encapsulate bundle forwarding information.">ForwardingInfo</a>* <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#eff6ba41d141a9c16b0309e410a936ae" title="Accessor for the forwarding info associated with the bundle, which must be on the...">info</a>); <a name="l00242"></a>00242 <a name="l00244"></a>00244 <span class="keywordtype">bool</span> <span class="keyword">add</span>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle, <span class="keyword">const</span> <a class="code" href="classdtn_1_1ForwardingInfo.html" title="Class to encapsulate bundle forwarding information.">ForwardingInfo</a>& <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#eff6ba41d141a9c16b0309e410a936ae" title="Accessor for the forwarding info associated with the bundle, which must be on the...">info</a>); <a name="l00245"></a>00245 <a name="l00248"></a>00248 <span class="keywordtype">bool</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#06552754bfa787fb9ce0361c9007041b" title="Remove the bundle and its associated forwarding info from the list.">del</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#87094f3b26b9f1d469e616d311ae57b1" title="Class definition for a Bundle reference.">BundleRef</a>& bundle); <a name="l00249"></a>00249 <a name="l00251"></a>00251 <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#05eea0fee527d1c00796feb401638ffd" title="Print out the stats, called from Link::dump_stats.">dump_stats</a>(oasys::StringBuffer* buf); <a name="l00252"></a>00252 <a name="l00253"></a>00253 <span class="keyword">protected</span>: <a name="l00254"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#967502a76f6a5222366a7705893063aa">00254</a> <span class="keyword">typedef</span> std::map<u_int32_t, ForwardingInfo> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#967502a76f6a5222366a7705893063aa">InfoMap</a>; <a name="l00255"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#ba631d00d7e4be0232b21e1c7c13ac35">00255</a> <a class="code" href="classdtn_1_1BundleList.html" title="List structure for handling bundles.">BundleList</a> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#ba631d00d7e4be0232b21e1c7c13ac35">list_</a>; <a name="l00256"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#5074c943a1044ad9463b9ffdc8e8e7f1">00256</a> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#967502a76f6a5222366a7705893063aa">InfoMap</a> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#5074c943a1044ad9463b9ffdc8e8e7f1">info_</a>; <a name="l00257"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#03fe22b291b586e62d81e1fca52a3983">00257</a> <span class="keywordtype">size_t</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html#03fe22b291b586e62d81e1fca52a3983">count_</a>; <a name="l00258"></a>00258 }; <a name="l00259"></a>00259 <a name="l00261"></a>00261 <a class="code" href="classdtn_1_1TableBasedRouter_1_1DeferredList.html" title="Per-link class used to store deferred transmission bundles that helps cache route...">DeferredList</a>* <a class="code" href="classdtn_1_1TableBasedRouter.html#8b9aa9d3859cb6bbc3a8fc5fa30775c6" title="Helper accessor to return the deferred queue for a link.">deferred_list</a>(<span class="keyword">const</span> <a class="code" href="namespacedtn.html#6efb37e503f8062c537b022eb755b94e" title="Typedef for a reference on a link.">LinkRef</a>& link); <a name="l00262"></a>00262 <a name="l00264"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html">00264</a> <span class="keyword">class </span><a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html" title="Timer class used to periodically refresh subscriptions.">ResubscribeTimer</a> : <span class="keyword">public</span> oasys::Timer { <a name="l00265"></a>00265 <span class="keyword">public</span>: <a name="l00266"></a>00266 <a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html#70c775c353136414ef5ca2fe07f56211">ResubscribeTimer</a>(<a class="code" href="classdtn_1_1TableBasedRouter.html" title="This is an abstract class that is intended to be used for all routing algorithms...">TableBasedRouter</a>* router, <a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* session); <a name="l00267"></a>00267 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html#3feb0d534034706726b2716f93865265">timeout</a>(<span class="keyword">const</span> <span class="keyword">struct</span> timeval& now); <a name="l00268"></a>00268 <a name="l00269"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html#39d8381ef5d19954dbac055d408c1ba5">00269</a> <a class="code" href="classdtn_1_1TableBasedRouter.html" title="This is an abstract class that is intended to be used for all routing algorithms...">TableBasedRouter</a>* <a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html#39d8381ef5d19954dbac055d408c1ba5">router_</a>; <a name="l00270"></a><a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html#7700eb57fea72d161cef941a021a76c0">00270</a> <a class="code" href="classdtn_1_1Session.html" title="Class to manage a session.">Session</a>* <a class="code" href="classdtn_1_1TableBasedRouter_1_1ResubscribeTimer.html#7700eb57fea72d161cef941a021a76c0">session_</a>; <a name="l00271"></a>00271 }; <a name="l00272"></a>00272 }; <a name="l00273"></a>00273 <a name="l00274"></a>00274 } <span class="comment">// namespace dtn</span> <a name="l00275"></a>00275 <a name="l00276"></a>00276 <span class="preprocessor">#endif </span><span class="comment">/* _TABLE_BASED_ROUTER_H_ */</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Mon Jul 21 14:09:47 2008 for DTN Reference Implementation by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>