dtn::TcaRouter Class Reference

#include <TcaRouter.h>

Inheritance diagram for dtn::TcaRouter:

dtn::TableBasedRouter dtn::BundleRouter dtn::BundleEventHandler

List of all members.


Detailed Description

This is the implementation of the TCA bundle routing algorithm.

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.


Public Types

enum  Role { TCA_MOBILE, TCA_ROUTER, TCA_GATEWAY }
enum  ForwardingRule {
  FWD_NEVER, FWD_UDR_EXCLUSIVELY, FWD_UDR_NEVER, FWD_UDR_IFNECESSARY,
  FWD_UDR_ALWAYS
}

Public Member Functions

 TcaRouter (Role role)

Protected Member Functions

std::string get_role_str () const
virtual void handle_bundle_received (BundleReceivedEvent *event)
 Event handlers.
virtual void handle_bundle_transmitted (BundleTransmittedEvent *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_unavailable (LinkUnavailableEvent *event)
 Default event handler when a link is unavailable.
virtual void handle_shutdown_request (ShutdownRequest *event)
 Default event handler for shutdown requests.
virtual int fwd_to_all (Bundle *bundle)
virtual int fwd_to_matching (Bundle *bundle, const LinkRef &next_hop)
virtual int fwd_to_matching (Bundle *bundle)
virtual int fwd_to_matching_r (Bundle *bundle, const LinkRef &next_hop, ForwardingRule fwd_rule)
bool on_coa_transmitted (Bundle *b, const TcaControlBundle &cb)
bool on_ask_transmitted (Bundle *b, const TcaControlBundle &cb)
bool on_adv_transmitted (Bundle *b, const TcaControlBundle &cb)
bool handle_register (Bundle *b)
bool handle_coa (Bundle *b)
bool handle_anonymous_bundle (Bundle *b)
bool handle_ask (Bundle *b, const TcaControlBundle &cb)
bool handle_bl_control_bundle (Bundle *b)
bool handle_bl_ask (Bundle *b, const TcaControlBundle &cb)
bool handle_get_routes (Bundle *b, const TcaControlBundle &cb)
bool handle_add_route (Bundle *b, const TcaControlBundle &cb)
bool handle_del_route (Bundle *b, const TcaControlBundle &cb)
bool handle_tca_unbound_bundle (Bundle *bundle)
bool on_route_unbound_bundle (Bundle *bundle)
bool on_gate_unbound_bundle (Bundle *bundle)
bool is_local_source (Bundle *b)
ForwardingRule get_forwarding_rule (Bundle *b)
LinkRef create_link (const std::string &link_addr)
RouteEntrycreate_route (const std::string &pattern, const LinkRef &p_link)
bool create_route (const std::string &pattern, const std::string &link_addr)
bool post_bundle (const EndpointID &src, const EndpointID &dest, const std::string &payload)
bool push_wrapped_bundle (const std::string &code, const EndpointID &src, const EndpointID &dest, const std::string &bsp)

Protected Attributes

Role role_
TcaEndpointID admin_app_

Member Enumeration Documentation

Enumerator:
TCA_MOBILE 
TCA_ROUTER 
TCA_GATEWAY 

Definition at line 53 of file TcaRouter.h.

Enumerator:
FWD_NEVER 
FWD_UDR_EXCLUSIVELY 
FWD_UDR_NEVER 
FWD_UDR_IFNECESSARY 
FWD_UDR_ALWAYS 

Definition at line 58 of file TcaRouter.h.


Constructor & Destructor Documentation

dtn::TcaRouter::TcaRouter ( Role  role  ) 


Member Function Documentation

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().

void dtn::TcaRouter::handle_bundle_received ( BundleReceivedEvent event  )  [protected, virtual]

void dtn::TcaRouter::handle_bundle_transmitted ( BundleTransmittedEvent event  )  [protected, virtual]

void dtn::TcaRouter::handle_contact_up ( ContactUpEvent event  )  [protected, virtual]

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_link_available ( LinkAvailableEvent event  )  [protected, virtual]

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().

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().

int dtn::TcaRouter::fwd_to_all ( Bundle bundle  )  [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().

virtual int dtn::TcaRouter::fwd_to_matching ( Bundle bundle  )  [inline, protected, virtual]

Definition at line 90 of file TcaRouter.h.

References fwd_to_matching().

int dtn::TcaRouter::fwd_to_matching_r ( Bundle bundle,
const LinkRef next_hop,
ForwardingRule  fwd_rule 
) [protected, virtual]

bool dtn::TcaRouter::on_coa_transmitted ( Bundle b,
const TcaControlBundle cb 
) [protected]

bool dtn::TcaRouter::on_ask_transmitted ( Bundle b,
const TcaControlBundle cb 
) [protected]

bool dtn::TcaRouter::on_adv_transmitted ( Bundle b,
const TcaControlBundle cb 
) [protected]

bool dtn::TcaRouter::handle_register ( Bundle b  )  [protected]

bool dtn::TcaRouter::handle_coa ( Bundle b  )  [protected]

Definition at line 544 of file TcaRouter.cc.

References fwd_to_matching_r(), and FWD_UDR_NEVER.

Referenced by handle_bundle_received().

bool dtn::TcaRouter::handle_anonymous_bundle ( Bundle b  )  [protected]

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]

bool dtn::TcaRouter::handle_bl_control_bundle ( Bundle b  )  [protected]

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().

bool dtn::TcaRouter::handle_get_routes ( Bundle b,
const TcaControlBundle cb 
) [protected]

bool dtn::TcaRouter::handle_add_route ( Bundle b,
const TcaControlBundle cb 
) [protected]

bool dtn::TcaRouter::handle_del_route ( Bundle b,
const TcaControlBundle cb 
) [protected]

bool dtn::TcaRouter::handle_tca_unbound_bundle ( Bundle bundle  )  [protected]

bool dtn::TcaRouter::on_route_unbound_bundle ( Bundle bundle  )  [protected]

bool dtn::TcaRouter::on_gate_unbound_bundle ( Bundle bundle  )  [protected]

bool dtn::TcaRouter::is_local_source ( Bundle b  )  [protected]

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().

TcaRouter::ForwardingRule dtn::TcaRouter::get_forwarding_rule ( Bundle b  )  [protected]

LinkRef dtn::TcaRouter::create_link ( const std::string &  link_addr  )  [protected]

RouteEntry * dtn::TcaRouter::create_route ( const std::string &  pattern,
const LinkRef p_link 
) [protected]

bool dtn::TcaRouter::create_route ( const std::string &  pattern,
const std::string &  link_addr 
) [protected]

Definition at line 898 of file TcaRouter.cc.

References create_link(), and create_route().

bool dtn::TcaRouter::post_bundle ( const EndpointID src,
const EndpointID dest,
const std::string &  payload 
) [protected]

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().


Member Data Documentation

Definition at line 71 of file TcaRouter.h.

Referenced by get_role_str(), handle_tca_unbound_bundle(), and TcaRouter().


The documentation for this class was generated from the following files:

Generated on Mon Jul 21 14:12:21 2008 for DTN Reference Implementation by  doxygen 1.5.6