dtn::BundleActions Class Reference

Intermediary class that provides a utility interface to help routers more easily deal with the rest of the system. More...

#include <BundleActions.h>

List of all members.

Public Member Functions

 BundleActions ()
virtual ~BundleActions ()
virtual void open_link (const LinkRef &link)
 Open a link for bundle transmission.
virtual void close_link (const LinkRef &link)
 Open a link for bundle transmission.
virtual bool queue_bundle (Bundle *bundle, const LinkRef &link, ForwardingInfo::action_t action, const CustodyTimerSpec &custody_timer)
 Queue the bundle for transmission on the given link.
virtual void cancel_bundle (Bundle *bundle, const LinkRef &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

Detailed Description

Intermediary class that provides a utility interface to help routers more easily deal with the rest of the system.

Definition at line 38 of file BundleActions.h.


Constructor & Destructor Documentation

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

Definition at line 40 of file BundleActions.h.

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

Definition at line 41 of file BundleActions.h.


Member Function Documentation

void dtn::BundleActions::cancel_bundle ( Bundle bundle,
const LinkRef 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 174 of file BundleActions.cc.

References ASSERT, dtn::LinkBlockSet::find_blocks(), dtn::BundleDaemon::post(), dtn::BundleProtocol::total_length(), and dtn::Bundle::xmit_blocks().

Referenced by dtn::BundleDaemon::find_duplicate(), and dtn::TableBasedRouter::reroute_bundles().

void dtn::BundleActions::close_link ( const LinkRef link  )  [virtual]

Open a link for bundle transmission.

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

Definition at line 61 of file BundleActions.cc.

References ASSERT.

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 233 of file BundleActions.cc.

Referenced by dtn::ProphetBundleCore::drop_bundle().

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 222 of file BundleActions.cc.

References store_add().

void dtn::BundleActions::open_link ( const LinkRef 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 33 of file BundleActions.cc.

References ASSERT.

Referenced by dtn::TableBasedRouter::check_next_hop(), dtn::TableBasedRouter::fwd_to_nexthop(), dtn::TableBasedRouter::handle_link_available(), dtn::ProphetRouter::handle_link_available(), and dtn::ProphetBundleCore::send_bundle().

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

Queue the bundle for transmission on the given link.

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

Definition at line 78 of file BundleActions.cc.

References dtn::ForwardingLog::add_entry(), ASSERT, dtn::Bundle::bundleid(), dtn::LinkBlockSet::find_blocks(), dtn::Bundle::fwdlog(), dtn::BundleProtocol::generate_blocks(), dtn::ForwardingLog::get_latest_entry(), dtn::BundleProtocol::prepare_blocks(), dtn::ForwardingInfo::QUEUED, and dtn::Bundle::xmit_blocks().

Referenced by dtn::TableBasedRouter::check_next_hop(), dtn::TableBasedRouter::fwd_to_nexthop(), and dtn::ProphetBundleCore::send_bundle().

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

Add the given bundle to the data store.

Definition at line 250 of file BundleActions.cc.

References dtn::Bundle::bundleid().

Referenced by inject_bundle().

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

Remove the given bundle from the data store.

Definition at line 272 of file BundleActions.cc.

References dtn::Bundle::bundleid().

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

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 261 of file BundleActions.cc.

References dtn::Bundle::bundleid().

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


Friends And Related Function Documentation

friend class BundleDaemon [friend]

Definition at line 113 of file BundleActions.h.


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:40:56 2010 for DTN Reference Implementation by  doxygen 1.6.3