#include <TcaRouter.h>
A TCARouter is a specialized TableBasedRouter where the route table is manipulated in response to certain control bundles (for example, a "register" bundle, or a "change-of-address" bundle). Specialized routing logic is then applied in order to route late-bound bundles addressed to a mobile node, to the mobile's current location in the network.
The main interface point is the overridden handle_bundle_received function which tests for the special TCA bundles (control bundles and late-bound data bundles).
Definition at line 49 of file TcaRouter.h.
Definition at line 58 of file TcaRouter.h.
enum dtn::TcaRouter::Role |
dtn::TcaRouter::TcaRouter | ( | Role | role | ) |
Definition at line 113 of file TcaRouter.cc.
References admin_app_, dtn::EndpointID::c_str(), get_role_str(), role_, and dtn::TcaEndpointID::set_app().
LinkRef dtn::TcaRouter::create_link | ( | const std::string & | link_addr | ) | [protected] |
Definition at line 837 of file TcaRouter.cc.
References dtn::ContactManager::add_new_link(), dtn::ConvergenceLayer::find_clayer(), dtn::ContactManager::find_link(), dtn::Link::ONDEMAND, dtn::EndpointID::scheme_str(), and dtn::EndpointID::ssp().
Referenced by create_route().
bool dtn::TcaRouter::create_route | ( | const std::string & | pattern, | |
const std::string & | link_addr | |||
) | [protected] |
RouteEntry * dtn::TcaRouter::create_route | ( | const std::string & | pattern, | |
const LinkRef & | p_link | |||
) | [protected] |
Definition at line 882 of file TcaRouter.cc.
References dtn::RouteTable::add_entry(), dtn::ForwardingInfo::COPY_ACTION, and dtn::TableBasedRouter::route_table_.
Referenced by create_route(), and handle_add_route().
int dtn::TcaRouter::fwd_to_all | ( | Bundle * | bundle | ) | [protected, virtual] |
Definition at line 303 of file TcaRouter.cc.
References dtn::EndpointID::c_str(), count, dtn::Bundle::dest(), dtn::TableBasedRouter::fwd_to_nexthop(), dtn::RouteTable::get_matching(), pattern(), and dtn::TableBasedRouter::route_table_.
virtual int dtn::TcaRouter::fwd_to_matching | ( | Bundle * | bundle | ) | [inline, protected, virtual] |
int dtn::TcaRouter::fwd_to_matching | ( | Bundle * | bundle, | |
const LinkRef & | next_hop | |||
) | [protected, virtual] |
Definition at line 334 of file TcaRouter.cc.
References fwd_to_matching_r(), and get_forwarding_rule().
Referenced by fwd_to_matching(), and handle_bundle_received().
int dtn::TcaRouter::fwd_to_matching_r | ( | Bundle * | bundle, | |
const LinkRef & | next_hop, | |||
ForwardingRule | fwd_rule | |||
) | [protected, virtual] |
Definition at line 346 of file TcaRouter.cc.
References dtn::EndpointID::c_str(), count, dtn::Bundle::dest(), FWD_NEVER, dtn::TableBasedRouter::fwd_to_nexthop(), FWD_UDR_ALWAYS, FWD_UDR_EXCLUSIVELY, FWD_UDR_IFNECESSARY, dtn::RouteTable::get_matching(), dtn::Bundle::owner(), and dtn::TableBasedRouter::route_table_.
Referenced by fwd_to_matching(), handle_ask(), handle_coa(), handle_register(), and handle_tca_unbound_bundle().
TcaRouter::ForwardingRule dtn::TcaRouter::get_forwarding_rule | ( | Bundle * | b | ) | [protected] |
Definition at line 773 of file TcaRouter.cc.
References admin_app_, dtn::Bundle::dest(), FWD_NEVER, FWD_UDR_ALWAYS, FWD_UDR_EXCLUSIVELY, FWD_UDR_IFNECESSARY, FWD_UDR_NEVER, dtn::TcaEndpointID::host(), is_local_source(), dtn::EndpointID::scheme_str(), dtn::Bundle::source(), and dtn::EndpointID::str().
Referenced by fwd_to_matching().
std::string dtn::TcaRouter::get_role_str | ( | ) | const [protected] |
Definition at line 130 of file TcaRouter.cc.
References role_, TCA_GATEWAY, TCA_MOBILE, and TCA_ROUTER.
Referenced by TcaRouter().
bool dtn::TcaRouter::handle_add_route | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 684 of file TcaRouter.cc.
References dtn::TcaControlBundle::args_, dtn::check_nargs(), create_route(), and pattern().
Referenced by handle_bl_control_bundle().
Definition at line 559 of file TcaRouter.cc.
References dtn::Bundle::dest(), dtn::get_payload_str(), and handle_ask().
Referenced by handle_bundle_received().
bool dtn::TcaRouter::handle_ask | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 583 of file TcaRouter.cc.
References admin_app_, dtn::TcaControlBundle::args_, dtn::BL, dtn::check_nargs(), dtn::Bundle::dest(), fwd_to_matching_r(), FWD_UDR_NEVER, is_local_source(), post_bundle(), dtn::Bundle::source(), and dtn::EndpointID::str().
Referenced by handle_anonymous_bundle(), and handle_bl_control_bundle().
bool dtn::TcaRouter::handle_bl_ask | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 645 of file TcaRouter.cc.
References dtn::BL, post_bundle(), and dtn::Bundle::source().
Definition at line 616 of file TcaRouter.cc.
References dtn::TcaControlBundle::code_, dtn::get_payload_str(), handle_add_route(), handle_ask(), handle_del_route(), and handle_get_routes().
Referenced by handle_bundle_received().
void dtn::TcaRouter::handle_bundle_received | ( | BundleReceivedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 144 of file TcaRouter.cc.
References admin_app_, dtn::TcaEndpointID::app(), dtn::Bundle::dest(), fwd_to_matching(), handle_anonymous_bundle(), handle_bl_control_bundle(), handle_coa(), handle_register(), handle_tca_unbound_bundle(), dtn::TcaEndpointID::host(), dtn::log_bundle(), dtn::EndpointID::scheme_str(), and dtn::EndpointID::ssp().
void dtn::TcaRouter::handle_bundle_transmitted | ( | BundleTransmittedEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 201 of file TcaRouter.cc.
References dtn::TcaEndpointID::app(), dtn::TcaControlBundle::code_, dtn::Bundle::dest(), dtn::get_payload_str(), on_adv_transmitted(), on_ask_transmitted(), on_coa_transmitted(), and dtn::EndpointID::scheme_str().
Definition at line 544 of file TcaRouter.cc.
References fwd_to_matching_r(), and FWD_UDR_NEVER.
Referenced by handle_bundle_received().
void dtn::TcaRouter::handle_contact_down | ( | ContactDownEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 258 of file TcaRouter.cc.
References admin_app_, dtn::BL, and post_bundle().
void dtn::TcaRouter::handle_contact_up | ( | ContactUpEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 244 of file TcaRouter.cc.
References admin_app_, ASSERT, dtn::BL, dtn::ContactUpEvent::contact_, and post_bundle().
bool dtn::TcaRouter::handle_del_route | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 705 of file TcaRouter.cc.
References dtn::TcaControlBundle::args_, dtn::check_nargs(), dtn::RouteTable::del_entries(), and dtn::TableBasedRouter::route_table_.
Referenced by handle_bl_control_bundle().
bool dtn::TcaRouter::handle_get_routes | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 657 of file TcaRouter.cc.
References dtn::TcaControlBundle::args_, dtn::BL, dtn::check_nargs(), dtn::RouteTable::get_matching(), pattern(), post_bundle(), dtn::TableBasedRouter::route_table_, and dtn::Bundle::source().
Referenced by handle_bl_control_bundle().
void dtn::TcaRouter::handle_link_available | ( | LinkAvailableEvent * | event | ) | [protected, virtual] |
Event handlers.
Reimplemented from dtn::TableBasedRouter.
Definition at line 268 of file TcaRouter.cc.
References admin_app_, ASSERT, dtn::BL, dtn::LinkAvailableEvent::link_, and post_bundle().
void dtn::TcaRouter::handle_link_unavailable | ( | LinkUnavailableEvent * | event | ) | [protected, virtual] |
Default event handler when a link is unavailable.
Reimplemented from dtn::BundleEventHandler.
Definition at line 282 of file TcaRouter.cc.
References admin_app_, dtn::BL, and post_bundle().
Definition at line 494 of file TcaRouter.cc.
References admin_app_, dtn::TcaControlBundle::args_, dtn::BL, dtn::Bundle::dest(), fwd_to_matching_r(), FWD_UDR_EXCLUSIVELY, dtn::get_payload_str(), dtn::log_controlbundle(), post_bundle(), dtn::Bundle::source(), and dtn::EndpointID::str().
Referenced by handle_bundle_received().
void dtn::TcaRouter::handle_shutdown_request | ( | ShutdownRequest * | event | ) | [protected, virtual] |
Default event handler for shutdown requests.
Reimplemented from dtn::BundleEventHandler.
Definition at line 291 of file TcaRouter.cc.
References admin_app_, dtn::BL, and post_bundle().
Definition at line 731 of file TcaRouter.cc.
References admin_app_, dtn::BL, dtn::EndpointID::c_str(), dtn::Bundle::dest(), fwd_to_matching_r(), FWD_UDR_IFNECESSARY, post_bundle(), role_, dtn::EndpointID::str(), TCA_GATEWAY, and TCA_ROUTER.
Referenced by handle_bundle_received().
Definition at line 765 of file TcaRouter.cc.
References admin_app_, dtn::TcaEndpointID::get_hostid(), dtn::Bundle::source(), and src.
Referenced by get_forwarding_rule(), and handle_ask().
bool dtn::TcaRouter::on_adv_transmitted | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 470 of file TcaRouter.cc.
References admin_app_, dtn::TcaControlBundle::args_, dtn::BL, dtn::check_nargs(), dtn::Bundle::dest(), post_bundle(), dtn::Bundle::source(), and dtn::EndpointID::str().
Referenced by handle_bundle_transmitted().
bool dtn::TcaRouter::on_ask_transmitted | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 448 of file TcaRouter.cc.
References admin_app_, dtn::TcaControlBundle::args_, dtn::BL, dtn::check_nargs(), dtn::Bundle::dest(), post_bundle(), dtn::Bundle::source(), and dtn::EndpointID::str().
Referenced by handle_bundle_transmitted().
bool dtn::TcaRouter::on_coa_transmitted | ( | Bundle * | b, | |
const TcaControlBundle & | cb | |||
) | [protected] |
Definition at line 422 of file TcaRouter.cc.
References admin_app_, dtn::TcaControlBundle::args_, dtn::BL, dtn::EndpointID::c_str(), dtn::Bundle::dest(), post_bundle(), dtn::Bundle::source(), and dtn::EndpointID::str().
Referenced by handle_bundle_transmitted().
bool dtn::TcaRouter::post_bundle | ( | const EndpointID & | src, | |
const EndpointID & | dest, | |||
const std::string & | payload | |||
) | [protected] |
Definition at line 921 of file TcaRouter.cc.
References dtn::EndpointID::c_str(), dtn::EVENTSRC_ADMIN, and dtn::EndpointID::length().
Referenced by handle_ask(), handle_bl_ask(), handle_contact_down(), handle_contact_up(), handle_get_routes(), handle_link_available(), handle_link_unavailable(), handle_register(), handle_shutdown_request(), handle_tca_unbound_bundle(), on_adv_transmitted(), on_ask_transmitted(), on_coa_transmitted(), and push_wrapped_bundle().
bool dtn::TcaRouter::push_wrapped_bundle | ( | const std::string & | code, | |
const EndpointID & | src, | |||
const EndpointID & | dest, | |||
const std::string & | bsp | |||
) | [protected] |
Definition at line 959 of file TcaRouter.cc.
References admin_app_, dtn::BL, post_bundle(), and dtn::EndpointID::str().
TcaEndpointID dtn::TcaRouter::admin_app_ [protected] |
Definition at line 73 of file TcaRouter.h.
Referenced by get_forwarding_rule(), handle_ask(), handle_bundle_received(), handle_contact_down(), handle_contact_up(), handle_link_available(), handle_link_unavailable(), handle_register(), handle_shutdown_request(), handle_tca_unbound_bundle(), is_local_source(), on_adv_transmitted(), on_ask_transmitted(), on_coa_transmitted(), push_wrapped_bundle(), and TcaRouter().
Role dtn::TcaRouter::role_ [protected] |
Definition at line 71 of file TcaRouter.h.
Referenced by get_role_str(), handle_tca_unbound_bundle(), and TcaRouter().