#include <BundleActions.h>
Definition at line 38 of file BundleActions.h.
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 |
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.
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(), dtn::BundleDaemon::handle_link_state_change_request(), and dtn::ProphetBundleCore::send_bundle().
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.
Referenced by dtn::BundleDaemon::handle_link_state_change_request().
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.
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 |
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(), dtn::BundleDaemon::handle_bundle_send(), and dtn::ProphetBundleCore::send_bundle().
Attempt to cancel transmission of a bundle on the given link.
bundle | the bundle | |
link | the link on which the bundle was queued |
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::delete_bundle(), dtn::BundleDaemon::handle_bundle_cancel(), and dtn::TableBasedRouter::reroute_bundles().
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.
bundle | the new bundle |
Definition at line 222 of file BundleActions.cc.
References store_add().
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.
bundle | The bundle | |
reason | Bundle Status Report reason code | |
log_on_error | Set to false to suppress error logging |
Definition at line 233 of file BundleActions.cc.
Referenced by dtn::ProphetBundleCore::drop_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 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 261 of file BundleActions.cc.
References dtn::Bundle::bundleid().
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.
Definition at line 272 of file BundleActions.cc.
References dtn::Bundle::bundleid().
Referenced by dtn::BundleDaemon::handle_bundle_free(), and dtn::BundleDaemon::load_bundles().
friend class BundleDaemon [friend] |
Definition at line 113 of file BundleActions.h.