#include <TableBasedRouter.h>
Classes | |
class | DeferredList |
Per-link class used to store deferred transmission bundles that helps cache route computations. More... | |
class | RerouteTimer |
Timer class used to cancel transmission on down links after waiting for them to potentially reopen. More... | |
class | ResubscribeTimer |
Timer class used to periodically refresh subscriptions. More... | |
Protected Types | |
typedef oasys::StringMap < RerouteTimer * > | RerouteTimerMap |
Table of reroute timers, indexed by the link name. | |
Protected Member Functions | |
TableBasedRouter (const char *classname, const std::string &name) | |
Constructor -- protected since this class is never instantiated by itself. | |
virtual | ~TableBasedRouter () |
Destructor. | |
virtual void | handle_event (BundleEvent *event) |
Event handler overridden from BundleRouter / BundleEventHandler that dispatches to the type specific handlers where appropriate. | |
void | get_routing_state (oasys::StringBuffer *buf) |
Dump the routing state. | |
void | tcl_dump_state (oasys::StringBuffer *buf) |
Get a tcl version of the routing state. | |
void | add_route (RouteEntry *entry) |
Add a route entry to the routing table. | |
void | del_route (const EndpointIDPattern &id) |
Remove matrhing route entry(s) from the routing table. | |
void | handle_changed_routes () |
Update forwarding state due to changed routes. | |
virtual bool | fwd_to_nexthop (Bundle *bundle, RouteEntry *route) |
Try to forward a bundle to a next hop route. | |
virtual bool | should_fwd (const Bundle *bundle, RouteEntry *route) |
Check if the bundle should be forwarded to the given next hop. | |
virtual int | route_bundle (Bundle *bundle) |
Check the route table entries that match the given bundle and have not already been found in the bundle history. | |
virtual void | sort_routes (Bundle *bundle, RouteEntryVec *routes) |
Once a vector of matching routes has been found, sort the vector. | |
virtual void | check_next_hop (const LinkRef &next_hop) |
Called when the next hop link is available for transmission (i.e. | |
virtual void | reroute_all_bundles () |
Go through all known bundles in the system and try to re-route them. | |
virtual void | recompute_routes () |
Generic hook in response to the command line indication that we should reroute all bundles. | |
void | add_nexthop_route (const LinkRef &link) |
When new links are added or opened, and if we're configured to add nexthop routes, try to add a new route for the given link. | |
bool | can_delete_bundle (const BundleRef &bundle) |
Hook to ask the router if the bundle can be deleted. | |
void | delete_bundle (const BundleRef &bundle) |
Hook to tell the router that the bundle should be deleted. | |
void | remove_from_deferred (const BundleRef &bundle, int actions) |
Remove matching deferred transmission entries. | |
void | reroute_bundles (const LinkRef &link) |
Helper function for rerouting. | |
DeferredList * | deferred_list (const LinkRef &link) |
Helper accessor to return the deferred queue for a link. | |
virtual void | handle_bundle_received (BundleReceivedEvent *event) |
Event handlers. | |
virtual void | handle_bundle_transmitted (BundleTransmittedEvent *event) |
Event handlers. | |
virtual void | handle_bundle_cancelled (BundleSendCancelledEvent *event) |
Event handlers. | |
virtual void | handle_route_add (RouteAddEvent *event) |
Event handlers. | |
virtual void | handle_route_del (RouteDelEvent *event) |
Event handlers. | |
virtual void | handle_contact_up (ContactUpEvent *event) |
Event handlers. | |
virtual void | handle_contact_down (ContactDownEvent *event) |
Event handlers. | |
virtual void | handle_link_available (LinkAvailableEvent *event) |
Event handlers. | |
virtual void | handle_link_created (LinkCreatedEvent *event) |
Event handlers. | |
virtual void | handle_link_deleted (LinkDeletedEvent *event) |
Event handlers. | |
virtual void | handle_custody_timeout (CustodyTimeoutEvent *event) |
Event handlers. | |
virtual void | handle_registration_added (RegistrationAddedEvent *event) |
Event handlers. | |
virtual void | handle_registration_removed (RegistrationRemovedEvent *event) |
Event handlers. | |
virtual void | handle_registration_expired (RegistrationExpiredEvent *event) |
Event handlers. | |
Session * | get_session_for_bundle (Bundle *bundle) |
Session management helper functions. | |
bool | add_bundle_to_session (Bundle *bundle, Session *session) |
Session management helper functions. | |
bool | subscribe_to_session (int action, Session *session) |
Session management helper functions. | |
bool | find_session_upstream (Session *session) |
Session management helper functions. | |
void | reroute_all_sessions () |
Session management helper functions. | |
bool | handle_session_bundle (BundleReceivedEvent *event) |
Session management helper functions. | |
void | add_subscriber (Session *session, const EndpointID &peer, const SequenceID &known_seqid) |
Session management helper functions. | |
Protected Attributes | |
BundleInfoCache | reception_cache_ |
Cache to check for duplicates and to implement a simple RPF check. | |
RouteTable * | route_table_ |
The routing table. | |
SessionTable | sessions_ |
Session state management table. | |
RegistrationList | session_custodians_ |
Vector of session custodian registrations. | |
RerouteTimerMap | reroute_timers_ |
Friends | |
class | RerouteTimer |
Definition at line 38 of file TableBasedRouter.h.
typedef oasys::StringMap<RerouteTimer*> dtn::TableBasedRouter::RerouteTimerMap [protected] |
Table of reroute timers, indexed by the link name.
Definition at line 223 of file TableBasedRouter.h.
dtn::TableBasedRouter::TableBasedRouter | ( | const char * | classname, | |
const std::string & | name | |||
) | [protected] |
Constructor -- protected since this class is never instantiated by itself.
Definition at line 35 of file TableBasedRouter.cc.
References route_table_.
dtn::TableBasedRouter::~TableBasedRouter | ( | ) | [protected, virtual] |
bool dtn::TableBasedRouter::add_bundle_to_session | ( | Bundle * | bundle, | |
Session * | session | |||
) | [protected] |
Session management helper functions.
Definition at line 126 of file TableBasedRouter.cc.
References ASSERT, dtn::BundleList::begin(), dtn::Session::bundles(), dtn::SequenceID::empty(), dtn::BundleList::end(), dtn::BundleList::erase(), dtn::BundleList::lock(), dtn::Bundle::obsoletes_id(), dtn::BundleDaemon::post_at_head(), dtn::BundleList::push_back(), dtn::BundleProtocol::REASON_DEPLETED_STORAGE, dtn::Session::sequence_id(), dtn::Bundle::sequence_id(), and dtn::SequenceID::update().
Referenced by handle_bundle_received().
void dtn::TableBasedRouter::add_nexthop_route | ( | const LinkRef & | link | ) | [protected] |
When new links are added or opened, and if we're configured to add nexthop routes, try to add a new route for the given link.
Definition at line 394 of file TableBasedRouter.cc.
References dtn::BundleRouter::BundleRouter::Config::add_nexthop_routes_, add_route(), dtn::BundleRouter::config_, dtn::ForwardingInfo::FORWARD_ACTION, dtn::RouteTable::get_matching(), dtn::EndpointID::NULL_EID(), route_table_, and dtn::RouteEntry::set_action().
Referenced by handle_contact_up(), and handle_link_created().
void dtn::TableBasedRouter::add_route | ( | RouteEntry * | entry | ) | [protected] |
Add a route entry to the routing table.
Definition at line 52 of file TableBasedRouter.cc.
References dtn::RouteTable::add_entry(), handle_changed_routes(), and route_table_.
Referenced by add_nexthop_route(), dtn::FloodBundleRouter::handle_link_created(), and handle_route_add().
void dtn::TableBasedRouter::add_subscriber | ( | Session * | session, | |
const EndpointID & | peer, | |||
const SequenceID & | known_seqid | |||
) | [protected] |
Session management helper functions.
Definition at line 1295 of file TableBasedRouter.cc.
References dtn::ForwardingLog::add_entry(), dtn::RouteTable::add_entry(), dtn::Session::add_subscriber(), dtn::BundleList::begin(), dtn::Bundle::bundleid(), dtn::Session::bundles(), dtn::EndpointID::c_str(), dtn::ForwardingInfo::COPY_ACTION, dtn::Session::eid(), dtn::SequenceID::empty(), dtn::BundleList::end(), dtn::Bundle::fwdlog(), dtn::BundleList::lock(), route_bundle(), route_table_, dtn::Bundle::sequence_id(), dtn::RouteEntry::set_action(), dtn::BundleList::size(), and dtn::ForwardingInfo::SUPPRESSED.
Referenced by find_session_upstream(), and handle_session_bundle().
Hook to ask the router if the bundle can be deleted.
Reimplemented from dtn::BundleRouter.
Reimplemented in dtn::DTLSRRouter.
Definition at line 304 of file TableBasedRouter.cc.
References dtn::ForwardingInfo::DELIVERED, get_session_for_bundle(), dtn::Session::subscribers(), and dtn::ForwardingInfo::TRANSMITTED.
Referenced by dtn::DTLSRRouter::can_delete_bundle().
void dtn::TableBasedRouter::check_next_hop | ( | const LinkRef & | next_hop | ) | [protected, virtual] |
Called when the next hop link is available for transmission (i.e.
either when it first arrives and the contact is brought up or when a bundle is completed and it's no longer busy).
Loops through the bundle list and calls fwd_to_matching on all bundles.
Definition at line 802 of file TableBasedRouter.cc.
References dtn::ForwardingInfo::action(), dtn::BundleRouter::actions_, dtn::ForwardingInfo::custody_spec(), deferred_list(), info, dtn::BundleActions::open_link(), dtn::BundleActions::queue_bundle(), and dtn::BundleRouter::should_fwd().
Referenced by handle_bundle_transmitted(), handle_contact_up(), handle_link_available(), and route_bundle().
TableBasedRouter::DeferredList * dtn::TableBasedRouter::deferred_list | ( | const LinkRef & | link | ) | [protected] |
Helper accessor to return the deferred queue for a link.
Definition at line 990 of file TableBasedRouter.cc.
References ASSERT.
Referenced by check_next_hop(), fwd_to_nexthop(), remove_from_deferred(), and route_bundle().
void dtn::TableBasedRouter::del_route | ( | const EndpointIDPattern & | id | ) | [protected] |
Remove matrhing route entry(s) from the routing table.
Definition at line 60 of file TableBasedRouter.cc.
References dtn::RouteTable::del_entries(), dtn::BundleInfoCache::evict_all(), reception_cache_, and route_table_.
Referenced by handle_route_del().
void dtn::TableBasedRouter::delete_bundle | ( | const BundleRef & | bundle | ) | [protected, virtual] |
Hook to tell the router that the bundle should be deleted.
Reimplemented from dtn::BundleRouter.
Reimplemented in dtn::DTLSRRouter.
Definition at line 342 of file TableBasedRouter.cc.
References dtn::ForwardingInfo::ANY_ACTION, dtn::Session::bundles(), dtn::BundleList::erase(), get_session_for_bundle(), and remove_from_deferred().
Session management helper functions.
Definition at line 1227 of file TableBasedRouter.cc.
References add_subscriber(), dtn::EndpointID::c_str(), dtn::Session::eid(), dtn::Registration::endpoint(), dtn::RouteTable::get_matching(), dtn::EndpointIDPattern::match(), dtn::EndpointID::NULL_EID(), dtn::Registration::regid(), route_table_, session_custodians_, dtn::Session::set_upstream(), dtn::EndpointID::str(), and dtn::Session::upstream().
Referenced by handle_registration_added(), handle_session_bundle(), and reroute_all_sessions().
bool dtn::TableBasedRouter::fwd_to_nexthop | ( | Bundle * | bundle, | |
RouteEntry * | route | |||
) | [protected, virtual] |
Try to forward a bundle to a next hop route.
Definition at line 670 of file TableBasedRouter.cc.
References dtn::RouteEntry::action(), dtn::BundleRouter::actions_, dtn::TableBasedRouter::TableBasedRouter::DeferredList::add(), dtn::RouteEntry::custody_spec(), deferred_list(), info, dtn::Bundle::is_queued_on(), dtn::RouteEntry::link(), dtn::TableBasedRouter::TableBasedRouter::DeferredList::list(), dtn::ForwardingInfo::NONE, dtn::BundleActions::open_link(), and dtn::BundleActions::queue_bundle().
Referenced by dtn::TcaRouter::fwd_to_all(), dtn::TcaRouter::fwd_to_matching_r(), and route_bundle().
void dtn::TableBasedRouter::get_routing_state | ( | oasys::StringBuffer * | buf | ) | [protected, virtual] |
Dump the routing state.
Implements dtn::BundleRouter.
Reimplemented in dtn::DTLSRRouter.
Definition at line 622 of file TableBasedRouter.cc.
References dtn::SessionTable::dump(), dtn::RouteTable::dump(), dtn::SessionTable::empty(), dtn::BundleRouter::name_, route_table_, session_custodians_, sessions_, and dtn::SessionTable::size().
Session management helper functions.
Definition at line 91 of file TableBasedRouter.cc.
References ASSERT, dtn::EndpointID::assign(), dtn::Bundle::bundleid(), dtn::Bundle::dest(), dtn::SequenceID::empty(), dtn::SessionTable::get_session(), dtn::EndpointID::length(), dtn::Bundle::obsoletes_id(), dtn::Bundle::sequence_id(), dtn::Bundle::session_eid(), dtn::Bundle::session_flags(), sessions_, dtn::Bundle::source(), dtn::EndpointID::str(), and dtn::EndpointID::valid().
Referenced by can_delete_bundle(), delete_bundle(), and handle_bundle_received().
void dtn::TableBasedRouter::handle_bundle_cancelled | ( | BundleSendCancelledEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 366 of file TableBasedRouter.cc.
References dtn::Bundle::expired(), and route_bundle().
void dtn::TableBasedRouter::handle_bundle_received | ( | BundleReceivedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::DTLSRRouter, dtn::FloodBundleRouter, and dtn::TcaRouter.
Definition at line 199 of file TableBasedRouter.cc.
References add_bundle_to_session(), dtn::BundleInfoCache::add_entry(), dtn::Bundle::bundleid(), get_session_for_bundle(), handle_session_bundle(), dtn::BundleReceivedEvent::link_, dtn::EndpointID::NULL_EID(), dtn::BundleDaemon::post_at_head(), dtn::BundleProtocol::REASON_NO_ADDTL_INFO, reception_cache_, route_bundle(), and dtn::Bundle::session_flags().
void dtn::TableBasedRouter::handle_bundle_transmitted | ( | BundleTransmittedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::TcaRouter.
Definition at line 287 of file TableBasedRouter.cc.
References check_next_hop(), dtn::ForwardingInfo::FORWARD_ACTION, and remove_from_deferred().
void dtn::TableBasedRouter::handle_changed_routes | ( | ) | [protected] |
Update forwarding state due to changed routes.
Definition at line 73 of file TableBasedRouter.cc.
References dtn::BundleInfoCache::evict_all(), reception_cache_, reroute_all_bundles(), and reroute_all_sessions().
Referenced by add_route(), and dtn::DTLSRRouter::recompute_routes().
void dtn::TableBasedRouter::handle_contact_down | ( | ContactDownEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::DTLSRRouter, and dtn::TcaRouter.
Definition at line 484 of file TableBasedRouter.cc.
References ASSERT, reroute_timers_, and RerouteTimer.
void dtn::TableBasedRouter::handle_contact_up | ( | ContactUpEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::DTLSRRouter, and dtn::TcaRouter.
Definition at line 450 of file TableBasedRouter.cc.
References add_nexthop_route(), ASSERT, check_next_hop(), and reroute_timers_.
void dtn::TableBasedRouter::handle_custody_timeout | ( | CustodyTimeoutEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 608 of file TableBasedRouter.cc.
References dtn::CustodyTimeoutEvent::bundle_, and route_bundle().
void dtn::TableBasedRouter::handle_event | ( | BundleEvent * | event | ) | [protected, virtual] |
Event handler overridden from BundleRouter / BundleEventHandler that dispatches to the type specific handlers where appropriate.
Implements dtn::BundleRouter.
Definition at line 84 of file TableBasedRouter.cc.
References dtn::BundleEventHandler::dispatch_event().
void dtn::TableBasedRouter::handle_link_available | ( | LinkAvailableEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::TcaRouter.
Definition at line 556 of file TableBasedRouter.cc.
References dtn::BundleRouter::actions_, ASSERT, check_next_hop(), dtn::BundleRouter::config_, dtn::ContactEvent::DISCOVERY, dtn::BundleRouter::BundleRouter::Config::open_discovered_links_, dtn::BundleActions::open_link(), and dtn::Link::OPPORTUNISTIC.
void dtn::TableBasedRouter::handle_link_created | ( | LinkCreatedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::DTLSRRouter, and dtn::FloodBundleRouter.
Definition at line 577 of file TableBasedRouter.cc.
References add_nexthop_route(), and ASSERT.
void dtn::TableBasedRouter::handle_link_deleted | ( | LinkDeletedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::DTLSRRouter.
Definition at line 590 of file TableBasedRouter.cc.
References ASSERT, dtn::RouteTable::del_entries_for_nexthop(), reroute_timers_, and route_table_.
void dtn::TableBasedRouter::handle_registration_added | ( | RegistrationAddedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtn::DTLSRRouter.
Definition at line 1000 of file TableBasedRouter.cc.
References dtn::Session::add_subscriber(), dtn::Session::CUSTODY, dtn::Registration::endpoint(), find_session_upstream(), dtn::SessionTable::get_session(), dtn::Session::PUBLISH, dtn::Registration::regid(), session_custodians_, dtn::Registration::session_flags(), sessions_, dtn::Session::SUBSCRIBE, and subscribe_to_session().
void dtn::TableBasedRouter::handle_registration_expired | ( | RegistrationExpiredEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1342 of file TableBasedRouter.cc.
void dtn::TableBasedRouter::handle_registration_removed | ( | RegistrationRemovedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1335 of file TableBasedRouter.cc.
void dtn::TableBasedRouter::handle_route_add | ( | RouteAddEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 380 of file TableBasedRouter.cc.
References add_route(), and dtn::RouteAddEvent::entry_.
void dtn::TableBasedRouter::handle_route_del | ( | RouteDelEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 387 of file TableBasedRouter.cc.
References del_route(), and dtn::RouteDelEvent::dest_.
bool dtn::TableBasedRouter::handle_session_bundle | ( | BundleReceivedEvent * | event | ) | [protected] |
Session management helper functions.
Definition at line 1103 of file TableBasedRouter.cc.
References dtn::ForwardingLog::add_entry(), add_subscriber(), ASSERT, dtn::Bundle::bundleid(), dtn::EndpointID::c_str(), dtn::EVENTSRC_PEER, dtn::EVENTSRC_STORE, find_session_upstream(), dtn::Session::flag_str(), dtn::ForwardingInfo::FORWARD_ACTION, dtn::Bundle::fwdlog(), dtn::SessionTable::get_session(), dtn::EndpointID::NULL_EID(), dtn::Bundle::prevhop(), dtn::Session::RESUBSCRIBE, dtn::Bundle::sequence_id(), dtn::Bundle::session_eid(), dtn::Bundle::session_flags(), sessions_, dtn::BundleReceivedEvent::source_, dtn::EndpointID::str(), dtn::Session::SUBSCRIBE, dtn::ForwardingInfo::SUPPRESSED, and dtn::EndpointIDPattern::WILDCARD_EID().
Referenced by handle_bundle_received().
void dtn::TableBasedRouter::recompute_routes | ( | ) | [protected, virtual] |
Generic hook in response to the command line indication that we should reroute all bundles.
Reimplemented from dtn::BundleRouter.
Reimplemented in dtn::DTLSRRouter.
Definition at line 902 of file TableBasedRouter.cc.
References reroute_all_bundles().
void dtn::TableBasedRouter::remove_from_deferred | ( | const BundleRef & | bundle, | |
int | actions | |||
) | [protected] |
Remove matching deferred transmission entries.
Definition at line 253 of file TableBasedRouter.cc.
References dtn::ForwardingInfo::action(), deferred_list(), dtn::TableBasedRouter::TableBasedRouter::DeferredList::del(), dtn::TableBasedRouter::TableBasedRouter::DeferredList::find(), info, dtn::ContactManager::links(), and dtn::ContactManager::lock().
Referenced by delete_bundle(), and handle_bundle_transmitted().
void dtn::TableBasedRouter::reroute_all_bundles | ( | ) | [protected, virtual] |
Go through all known bundles in the system and try to re-route them.
Definition at line 880 of file TableBasedRouter.cc.
References dtn::BundleList::begin(), dtn::BundleList::end(), dtn::BundleList::lock(), dtn::BundleRouter::pending_bundles_, route_bundle(), and dtn::BundleList::size().
Referenced by handle_changed_routes(), and recompute_routes().
void dtn::TableBasedRouter::reroute_all_sessions | ( | ) | [protected] |
Session management helper functions.
Definition at line 1213 of file TableBasedRouter.cc.
References dtn::SessionTable::begin(), dtn::SessionTable::end(), find_session_upstream(), sessions_, and dtn::SessionTable::size().
Referenced by handle_changed_routes().
void dtn::TableBasedRouter::reroute_bundles | ( | const LinkRef & | link | ) | [protected] |
Helper function for rerouting.
Definition at line 520 of file TableBasedRouter.cc.
References dtn::BundleRouter::actions_, ASSERT, dtn::BundleActions::cancel_bundle(), dtn::Link::state_to_str(), and dtn::Link::UNAVAILABLE.
Referenced by dtn::TableBasedRouter::TableBasedRouter::RerouteTimer::timeout().
int dtn::TableBasedRouter::route_bundle | ( | Bundle * | bundle | ) | [protected, virtual] |
Check the route table entries that match the given bundle and have not already been found in the bundle history.
If a match is found, call fwd_to_nexthop on it.
bundle | the bundle to forward |
Definition at line 728 of file TableBasedRouter.cc.
References dtn::Bundle::bundleid(), check_next_hop(), count, deferred_list(), dtn::Bundle::dest(), fwd_to_nexthop(), dtn::Bundle::fwdlog(), dtn::ForwardingLog::get_count(), dtn::RouteTable::get_matching(), dtn::RouteEntry::link(), route_table_, should_fwd(), sort_routes(), dtn::ForwardingInfo::SUPPRESSED, and dtn::EndpointIDPattern::WILDCARD_EID().
Referenced by add_subscriber(), handle_bundle_cancelled(), handle_bundle_received(), handle_custody_timeout(), and reroute_all_bundles().
bool dtn::TableBasedRouter::should_fwd | ( | const Bundle * | bundle, | |
RouteEntry * | route | |||
) | [protected, virtual] |
Check if the bundle should be forwarded to the given next hop.
Reasons why it would not be forwarded include that it was already transmitted or is currently in flight on the link, or that the route indicates ForwardingInfo::FORWARD_ACTION and it is already in flight on another route.
Definition at line 424 of file TableBasedRouter.cc.
References dtn::RouteEntry::action(), dtn::Bundle::bundleid(), dtn::RouteEntry::link(), dtn::BundleInfoCache::lookup(), dtn::EndpointID::NULL_EID(), and reception_cache_.
Referenced by route_bundle().
void dtn::TableBasedRouter::sort_routes | ( | Bundle * | bundle, | |
RouteEntryVec * | routes | |||
) | [protected, virtual] |
Once a vector of matching routes has been found, sort the vector.
The default uses the route priority, breaking ties by using the number of bytes queued.
Definition at line 794 of file TableBasedRouter.cc.
Referenced by route_bundle().
Session management helper functions.
Definition at line 1038 of file TableBasedRouter.cc.
References dtn::SequenceID::assign(), dtn::EndpointID::assign(), dtn::EndpointID::c_str(), dtn::BundleRouter::config_, dtn::Session::eid(), dtn::EVENTSRC_ROUTER, dtn::Subscriber::is_local(), dtn::Bundle::mutable_custodian(), dtn::Bundle::mutable_dest(), dtn::Bundle::mutable_replyto(), dtn::Bundle::mutable_sequence_id(), dtn::Bundle::mutable_session_eid(), dtn::Bundle::mutable_source(), dtn::EndpointID::NULL_EID(), dtn::BundleDaemon::post_at_head(), dtn::Session::resubscribe_timer(), dtn::Session::sequence_id(), dtn::Bundle::set_do_not_fragment(), dtn::Bundle::set_expiration(), dtn::Session::set_resubscribe_timer(), dtn::Bundle::set_session_flags(), dtn::Bundle::set_singleton_dest(), dtn::EndpointID::str(), dtn::BundleRouter::BundleRouter::Config::subscription_timeout_, and dtn::Session::upstream().
Referenced by handle_registration_added(), and dtn::TableBasedRouter::TableBasedRouter::ResubscribeTimer::timeout().
void dtn::TableBasedRouter::tcl_dump_state | ( | oasys::StringBuffer * | buf | ) | [protected, virtual] |
Get a tcl version of the routing state.
Reimplemented from dtn::BundleRouter.
Definition at line 650 of file TableBasedRouter.cc.
References dtn::EndpointID::c_str(), dtn::RouteEntry::dest_pattern(), dtn::RouteTable::lock(), dtn::RouteEntry::next_hop_str(), dtn::RouteEntry::priority(), dtn::RouteTable::route_table(), route_table_, and dtn::RouteEntry::source_pattern().
friend class RerouteTimer [friend] |
Cache to check for duplicates and to implement a simple RPF check.
Definition at line 191 of file TableBasedRouter.h.
Referenced by del_route(), handle_bundle_received(), handle_changed_routes(), and should_fwd().
Definition at line 224 of file TableBasedRouter.h.
Referenced by handle_contact_down(), handle_contact_up(), and handle_link_deleted().
RouteTable* dtn::TableBasedRouter::route_table_ [protected] |
The routing table.
Definition at line 194 of file TableBasedRouter.h.
Referenced by add_nexthop_route(), add_route(), add_subscriber(), dtn::TcaRouter::create_route(), del_route(), find_session_upstream(), dtn::TcaRouter::fwd_to_all(), dtn::TcaRouter::fwd_to_matching_r(), get_routing_state(), dtn::TcaRouter::handle_del_route(), dtn::TcaRouter::handle_get_routes(), handle_link_deleted(), dtn::DTLSRRouter::recompute_routes(), route_bundle(), TableBasedRouter(), tcl_dump_state(), and ~TableBasedRouter().
Vector of session custodian registrations.
Definition at line 200 of file TableBasedRouter.h.
Referenced by find_session_upstream(), get_routing_state(), and handle_registration_added().
SessionTable dtn::TableBasedRouter::sessions_ [protected] |
Session state management table.
Definition at line 197 of file TableBasedRouter.h.
Referenced by get_routing_state(), get_session_for_bundle(), handle_registration_added(), handle_session_bundle(), and reroute_all_sessions().