dtn::BundleActions Class Reference

#include <BundleActions.h>

Inheritance diagram for dtn::BundleActions:

oasys::Logger dtnsim::SimBundleActions List of all members.

Detailed Description

Intermediary class that provides the interface that is exposed to routers for the rest of the system.

All functions are virtual since the simulator overrides them to provide equivalent functionality (in the simulated environment).

Definition at line 41 of file BundleActions.h.

Public Member Functions

 BundleActions ()
virtual ~BundleActions ()
virtual void open_link (Link *link)
 Open a link for bundle transmission.
virtual void close_link (Link *link)
 Open a link for bundle transmission.
virtual bool send_bundle (Bundle *bundle, Link *link, ForwardingInfo::action_t action, const CustodyTimerSpec &custody_timer)
 Initiate transmission of a bundle out the given link.
virtual bool cancel_bundle (Bundle *bundle, Link *link)
 Attempt to cancel transmission of a bundle on the given link.
virtual void inject_bundle (Bundle *bundle)
 Inject a new bundle into the core system, which places it in the pending bundles list as well as in the persistent store.
virtual bool delete_bundle (Bundle *bundle, BundleProtocol::status_report_reason_t reason=BundleProtocol::REASON_NO_ADDTL_INFO, bool log_on_error=true)
 Attempt to delete a bundle from the system.

Protected Member Functions

virtual void store_add (Bundle *bundle)
 Add the given bundle to the data store.
virtual void store_update (Bundle *bundle)
 Update the on-disk version of the given bundle, after it's bookkeeping or header fields have been modified.
virtual void store_del (Bundle *bundle)
 Remove the given bundle from the data store.

Friends

class BundleDaemon


Constructor & Destructor Documentation

dtn::BundleActions::BundleActions (  )  [inline]

Definition at line 43 of file BundleActions.h.

virtual dtn::BundleActions::~BundleActions (  )  [inline, virtual]

Definition at line 44 of file BundleActions.h.


Member Function Documentation

void dtn::BundleActions::open_link ( Link link  )  [virtual]

Open a link for bundle transmission.

The link should be in state AVAILABLE for this to be called.

This may either immediately open the link in which case the link's state will be OPEN, or post a request for the convergence layer to complete the session initiation in which case the link state is OPENING.

Definition at line 30 of file BundleActions.cc.

References dtn::Link::contact(), dtn::Link::isavailable(), dtn::Link::isopen(), log_debug, log_err, dtn::Link::name(), and dtn::Link::open().

Referenced by dtn::TableBasedRouter::fwd_to_nexthop(), and dtn::BundleDaemon::handle_link_state_change_request().

void dtn::BundleActions::close_link ( Link link  )  [virtual]

Open a link for bundle transmission.

The link should be in an open state for this to be called.

Definition at line 49 of file BundleActions.cc.

References ASSERT, dtn::Link::close(), dtn::Link::contact(), dtn::Link::isopen(), dtn::Link::isopening(), log_debug, log_err, and dtn::Link::name().

Referenced by dtn::BundleDaemon::handle_link_state_change_request().

bool dtn::BundleActions::send_bundle ( Bundle bundle,
Link link,
ForwardingInfo::action_t  action,
const CustodyTimerSpec custody_timer 
) [virtual]

Initiate transmission of a bundle out the given link.

The link must already be open.

Parameters:
bundle the bundle
link the link on which to send the bundle
action the forwarding action that was taken
custody_timer custody timer specification
Returns:
true if the transmission was successfully initiated

Definition at line 64 of file BundleActions.cc.

References dtn::ForwardingLog::add_entry(), ASSERT, dtn::Link::clayer(), dtn::Link::contact(), dtn::LinkBlockSet::find_blocks(), dtn::Bundle::fwdlog_, dtn::BundleProtocol::generate_blocks(), dtn::ForwardingLog::get_latest_entry(), dtn::ForwardingInfo::IN_FLIGHT, log_debug, log_err, dtn::Link::name(), dtn::Link::nexthop(), dtn::Link::OPEN, dtn::Link::params(), dtn::BundleProtocol::prepare_blocks(), dtn::ConvergenceLayer::send_bundle(), dtn::Link::state(), dtn::Link::stats(), dtn::Link::type_str(), and dtn::Bundle::xmit_blocks_.

Referenced by dtn::TableBasedRouter::fwd_to_nexthop(), dtn::ProphetEncounter::fwd_to_nexthop(), dtn::BundleDaemon::handle_bundle_inject(), dtn::LinkStateRouter::handle_bundle_received(), dtn::BundleDaemon::handle_bundle_send(), and dtn::LinkStateRouter::send_announcement().

bool dtn::BundleActions::cancel_bundle ( Bundle bundle,
Link link 
) [virtual]

Attempt to cancel transmission of a bundle on the given link.

Parameters:
bundle the bundle
link the link on which the bundle was queued
Returns:
true if successful

Definition at line 118 of file BundleActions.cc.

References ASSERT, dtn::ConvergenceLayer::cancel_bundle(), dtn::ForwardingInfo::CANCELLED, dtn::Link::clayer(), dtn::Link::contact(), dtn::Bundle::fwdlog_, log_debug, dtn::Link::name(), dtn::Link::nexthop(), dtn::Link::OPEN, dtn::Link::state(), dtn::Link::type_str(), and dtn::ForwardingLog::update().

Referenced by dtn::BundleDaemon::handle_bundle_cancel().

void dtn::BundleActions::inject_bundle ( Bundle bundle  )  [virtual]

Inject a new bundle into the core system, which places it in the pending bundles list as well as in the persistent store.

This is typically used by routing algorithms that need to generate their own bundles for distribuing route announcements. It does not, therefore, generate a BundleReceivedEvent.

Parameters:
bundle the new bundle

Definition at line 135 of file BundleActions.cc.

References log_debug, and store_add().

Referenced by dtn::LinkStateRouter::send_announcement().

bool dtn::BundleActions::delete_bundle ( Bundle bundle,
BundleProtocol::status_report_reason_t  reason = BundleProtocol::REASON_NO_ADDTL_INFO,
bool  log_on_error = true 
) [virtual]

Attempt to delete a bundle from the system.

Parameters:
bundle The bundle
reason Bundle Status Report reason code
log_on_error Set to false to suppress error logging
Returns:
true if successful

Definition at line 146 of file BundleActions.cc.

References log_debug, and log_err.

Referenced by dtn::ProphetController::handle_bundle_received().

void dtn::BundleActions::store_add ( Bundle bundle  )  [protected, virtual]

Add the given bundle to the data store.

Reimplemented in dtnsim::SimBundleActions.

Definition at line 161 of file BundleActions.cc.

References dtn::Bundle::bundleid_, log_crit, and log_debug.

Referenced by dtn::BundleDaemon::add_to_pending(), and inject_bundle().

void dtn::BundleActions::store_update ( Bundle bundle  )  [protected, virtual]

Update the on-disk version of the given bundle, after it's bookkeeping or header fields have been modified.

Definition at line 172 of file BundleActions.cc.

References dtn::Bundle::bundleid_, log_crit, and log_debug.

Referenced by dtn::BundleDaemon::accept_custody(), and dtn::BundleDaemon::release_custody().

void dtn::BundleActions::store_del ( Bundle bundle  )  [protected, virtual]

Remove the given bundle from the data store.

Reimplemented in dtnsim::SimBundleActions.

Definition at line 183 of file BundleActions.cc.

References dtn::Bundle::bundleid_, log_crit, and log_debug.

Referenced by dtn::BundleDaemon::handle_bundle_free().


Friends And Related Function Documentation

friend class BundleDaemon [friend]

Definition at line 116 of file BundleActions.h.


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:32 2007 for DTN Reference Implementation by  doxygen 1.5.1