#include <BundleDaemon.h>
Classes | |
struct | DaemonIdleExit |
Class used for the idle timer. More... | |
struct | Params |
General daemon parameters. More... | |
struct | Stats |
Statistics structure definition. More... | |
Public Types | |
typedef void(* | ShutdownProc )(void *args) |
Typedef for a shutdown procedure. | |
Public Member Functions | |
BundleDaemon () | |
Constructor. | |
virtual | ~BundleDaemon () |
Destructor (called at shutdown time). | |
virtual void | do_init () |
Virtual initialization function, overridden in the simulator to install the modified event queue (with no notifier) and the SimBundleActions class. | |
virtual size_t | event_queue_size () |
Return the number of events currently waiting for processing. | |
virtual void | post_event (BundleEvent *event, bool at_back=true) |
Virtual post_event function, overridden by the Node class in the simulator to use a modified event queue. | |
BundleRouter * | router () |
Returns the current bundle router. | |
BundleActions * | actions () |
Return the current actions handler. | |
ContactManager * | contactmgr () |
Accessor for the contact manager. | |
FragmentManager * | fragmentmgr () |
Accessor for the fragmentation manager. | |
const RegistrationTable * | reg_table () |
Accessor for the registration table. | |
BundleList * | pending_bundles () |
Accessor for the pending bundles list. | |
BundleList * | custody_bundles () |
Accessor for the custody bundles list. | |
void | get_routing_state (oasys::StringBuffer *buf) |
Format the given StringBuffer with current routing info. | |
void | get_bundle_stats (oasys::StringBuffer *buf) |
Format the given StringBuffer with the current bundle statistics. | |
void | get_daemon_stats (oasys::StringBuffer *buf) |
Format the given StringBuffer with the current internal statistics value. | |
void | reset_stats () |
Reset all internal stats. | |
const EndpointID & | local_eid () |
Return the local endpoint identifier. | |
void | set_local_eid (const char *eid_str) |
Set the local endpoint id. | |
void | set_app_shutdown (ShutdownProc proc, void *data) |
Set an application-specific shutdown handler. | |
void | set_rtr_shutdown (ShutdownProc proc, void *data) |
Set a router-specific shutdown handler. | |
void | init_idle_shutdown (int interval) |
Initialize an idle shutdown handler that will cleanly exit the tcl event loop whenever no bundle events have been handled for the specified interval. | |
void | check_and_deliver_to_registrations (Bundle *bundle, const EndpointID &) |
This is used for delivering bundle to app by Late Binding. | |
Static Public Member Functions | |
static void | init () |
Boot time initializer. | |
static void | post (BundleEvent *event) |
Queues the event at the tail of the queue for processing by the daemon thread. | |
static void | post_at_head (BundleEvent *event) |
Queues the event at the head of the queue for processing by the daemon thread. | |
static bool | post_and_wait (BundleEvent *event, oasys::Notifier *notifier, int timeout=-1, bool at_back=true) |
Post the given event and wait for it to be processed by the daemon thread or for the given timeout to elapse. | |
static bool | shutting_down () |
Accessor for the BundleDaemon's shutdown status. | |
Static Public Attributes | |
static Params | params_ |
Protected Types | |
typedef BundleProtocol::custody_signal_reason_t | custody_signal_reason_t |
typedef BundleProtocol::status_report_flag_t | status_report_flag_t |
typedef BundleProtocol::status_report_reason_t | status_report_reason_t |
Protected Member Functions | |
void | load_registrations () |
Initialize and load in the registrations. | |
void | load_bundles () |
Initialize and load in stored bundles. | |
void | run () |
Main thread function that dispatches events. | |
void | handle_event (BundleEvent *event) |
Main event handling function. | |
void | generate_status_report (Bundle *bundle, BundleStatusReport::flag_t flag, status_report_reason_t reason=BundleProtocol::REASON_NO_ADDTL_INFO) |
Locally generate a status report for the given bundle. | |
void | generate_custody_signal (Bundle *bundle, bool succeeded, custody_signal_reason_t reason) |
Generate a custody signal to be sent to the current custodian. | |
void | cancel_custody_timers (Bundle *bundle) |
Cancel any pending custody timers for the bundle. | |
void | accept_custody (Bundle *bundle) |
Take custody for the given bundle, sending the appropriate signal to the current custodian. | |
void | release_custody (Bundle *bundle) |
Release custody of the given bundle, sending the appropriate signal to the current custodian. | |
bool | add_to_pending (Bundle *bundle, bool add_to_store) |
Add the bundle to the pending list and (optionally) the persistent store, and set up the expiration timer for it. | |
bool | delete_from_pending (const BundleRef &bundle) |
Remove the bundle from the pending list and data store, and cancel the expiration timer. | |
bool | try_to_delete (const BundleRef &bundle) |
Check if we should delete this bundle, called just after arrival, once it's been transmitted or delivered at least once, or when we release custody. | |
bool | delete_bundle (const BundleRef &bundle, status_report_reason_t reason=BundleProtocol::REASON_NO_ADDTL_INFO) |
Delete (rather than silently discard) a bundle, e.g., an expired bundle. | |
Bundle * | find_duplicate (Bundle *bundle) |
Check if there are any bundles in the pending queue that match the source id, timestamp, and fragmentation offset/length fields. | |
void | deliver_to_registration (Bundle *bundle, Registration *registration) |
Deliver the bundle to the given registration. | |
bool | check_local_delivery (Bundle *bundle, bool deliver) |
Check the registration table and optionally deliver the bundle to any that match. | |
void | handle_bundle_received (BundleReceivedEvent *event) |
Event type specific handlers. | |
void | handle_bundle_transmitted (BundleTransmittedEvent *event) |
Event type specific handlers. | |
void | handle_bundle_delivered (BundleDeliveredEvent *event) |
Event type specific handlers. | |
void | handle_bundle_expired (BundleExpiredEvent *event) |
Event type specific handlers. | |
void | handle_bundle_free (BundleFreeEvent *event) |
Event type specific handlers. | |
void | handle_bundle_send (BundleSendRequest *event) |
Event type specific handlers. | |
void | handle_bundle_cancel (BundleCancelRequest *event) |
Event type specific handlers. | |
void | handle_bundle_cancelled (BundleSendCancelledEvent *event) |
Event type specific handlers. | |
void | handle_bundle_inject (BundleInjectRequest *event) |
Event type specific handlers. | |
void | handle_bundle_delete (BundleDeleteRequest *request) |
Event type specific handlers. | |
void | handle_bundle_accept (BundleAcceptRequest *event) |
Event type specific handlers. | |
void | handle_bundle_query (BundleQueryRequest *event) |
Event type specific handlers. | |
void | handle_bundle_report (BundleReportEvent *event) |
Event type specific handlers. | |
void | handle_bundle_attributes_query (BundleAttributesQueryRequest *request) |
Event type specific handlers. | |
void | handle_bundle_attributes_report (BundleAttributesReportEvent *event) |
Event type specific handlers. | |
void | handle_registration_added (RegistrationAddedEvent *event) |
Event type specific handlers. | |
void | handle_registration_removed (RegistrationRemovedEvent *event) |
Event type specific handlers. | |
void | handle_registration_expired (RegistrationExpiredEvent *event) |
Event type specific handlers. | |
void | handle_registration_delete (RegistrationDeleteRequest *request) |
Event type specific handlers. | |
void | handle_contact_up (ContactUpEvent *event) |
Event type specific handlers. | |
void | handle_contact_down (ContactDownEvent *event) |
Event type specific handlers. | |
void | handle_contact_query (ContactQueryRequest *event) |
Event type specific handlers. | |
void | handle_contact_report (ContactReportEvent *event) |
Event type specific handlers. | |
void | handle_link_created (LinkCreatedEvent *event) |
Event type specific handlers. | |
void | handle_link_deleted (LinkDeletedEvent *event) |
Event type specific handlers. | |
void | handle_link_available (LinkAvailableEvent *event) |
Event type specific handlers. | |
void | handle_link_unavailable (LinkUnavailableEvent *event) |
Event type specific handlers. | |
void | handle_link_state_change_request (LinkStateChangeRequest *request) |
Event type specific handlers. | |
void | handle_link_create (LinkCreateRequest *event) |
Event type specific handlers. | |
void | handle_link_delete (LinkDeleteRequest *request) |
Event type specific handlers. | |
void | handle_link_reconfigure (LinkReconfigureRequest *request) |
Event type specific handlers. | |
void | handle_link_query (LinkQueryRequest *event) |
Event type specific handlers. | |
void | handle_link_report (LinkReportEvent *event) |
Event type specific handlers. | |
void | handle_reassembly_completed (ReassemblyCompletedEvent *event) |
Event type specific handlers. | |
void | handle_route_add (RouteAddEvent *event) |
Event type specific handlers. | |
void | handle_route_del (RouteDelEvent *event) |
Event type specific handlers. | |
void | handle_route_query (RouteQueryRequest *event) |
Event type specific handlers. | |
void | handle_route_report (RouteReportEvent *event) |
Event type specific handlers. | |
void | handle_custody_signal (CustodySignalEvent *event) |
Event type specific handlers. | |
void | handle_custody_timeout (CustodyTimeoutEvent *event) |
Event type specific handlers. | |
void | handle_shutdown_request (ShutdownRequest *event) |
Event type specific handlers. | |
void | handle_status_request (StatusRequest *event) |
Event type specific handlers. | |
void | handle_cla_set_params (CLASetParamsRequest *request) |
Event type specific handlers. | |
void | handle_bundle_queued_query (BundleQueuedQueryRequest *request) |
Event type specific handlers. | |
void | handle_bundle_queued_report (BundleQueuedReportEvent *event) |
Event type specific handlers. | |
void | handle_eid_reachable_query (EIDReachableQueryRequest *request) |
Event type specific handlers. | |
void | handle_eid_reachable_report (EIDReachableReportEvent *event) |
Event type specific handlers. | |
void | handle_link_attribute_changed (LinkAttributeChangedEvent *event) |
Event type specific handlers. | |
void | handle_link_attributes_query (LinkAttributesQueryRequest *request) |
Event type specific handlers. | |
void | handle_link_attributes_report (LinkAttributesReportEvent *event) |
Event type specific handlers. | |
void | handle_iface_attributes_query (IfaceAttributesQueryRequest *request) |
Event type specific handlers. | |
void | handle_iface_attributes_report (IfaceAttributesReportEvent *event) |
Event type specific handlers. | |
void | handle_cla_parameters_query (CLAParametersQueryRequest *request) |
Event type specific handlers. | |
void | handle_cla_parameters_report (CLAParametersReportEvent *event) |
Event type specific handlers. | |
void | event_handlers_completed (BundleEvent *event) |
Protected Attributes | |
BundleRouter * | router_ |
The active bundle router. | |
BundleActions * | actions_ |
The active bundle actions handler. | |
AdminRegistration * | admin_reg_ |
The administrative registration. | |
PingRegistration * | ping_reg_ |
The ping registration. | |
ContactManager * | contactmgr_ |
The contact manager. | |
FragmentManager * | fragmentmgr_ |
The fragmentation / reassembly manager. | |
RegistrationTable * | reg_table_ |
The table of active registrations. | |
BundleList * | pending_bundles_ |
The list of all bundles still pending delivery. | |
BundleList * | custody_bundles_ |
The list of all bundles that we have custody of. | |
oasys::MsgQueue< BundleEvent * > * | eventq_ |
The event queue. | |
EndpointID | local_eid_ |
The default endpoint id for reaching this daemon, used for bundle status reports, routing, etc. | |
Stats | stats_ |
Stats instance. | |
ShutdownProc | app_shutdown_proc_ |
Application-specific shutdown handler. | |
void * | app_shutdown_data_ |
Application-specific shutdown data. | |
ShutdownProc | rtr_shutdown_proc_ |
Router-specific shutdown handler. | |
void * | rtr_shutdown_data_ |
Router-specific shutdown data. | |
DaemonIdleExit * | idle_exit_ |
Pointer to the idle exit handler (if any). | |
oasys::Time | last_event_ |
Time value when the last event was handled. | |
Static Protected Attributes | |
static bool | shutting_down_ = false |
Friends | |
class | BundleActions |
class | DaemonIdleExit |
All events are queued and then forwarded to the active router module. The router then responds by calling various functions on the BundleActions class that it is given, which in turn effect all the operations.
Definition at line 57 of file BundleDaemon.h.
typedef BundleProtocol::custody_signal_reason_t dtn::BundleDaemon::custody_signal_reason_t [protected] |
Definition at line 365 of file BundleDaemon.h.
typedef void(* dtn::BundleDaemon::ShutdownProc)(void *args) |
Typedef for a shutdown procedure.
typedef BundleProtocol::status_report_flag_t dtn::BundleDaemon::status_report_flag_t [protected] |
Definition at line 366 of file BundleDaemon.h.
typedef BundleProtocol::status_report_reason_t dtn::BundleDaemon::status_report_reason_t [protected] |
Definition at line 367 of file BundleDaemon.h.
dtn::BundleDaemon::BundleDaemon | ( | ) |
Constructor.
Definition at line 74 of file BundleDaemon.cc.
References actions_, app_shutdown_data_, app_shutdown_proc_, dtn::EndpointID::assign(), contactmgr_, custody_bundles_, eventq_, fragmentmgr_, local_eid_, dtn::EndpointID::NULL_EID(), pending_bundles_, reg_table_, router_, rtr_shutdown_data_, rtr_shutdown_proc_, and stats_.
Referenced by init().
dtn::BundleDaemon::~BundleDaemon | ( | ) | [virtual] |
Destructor (called at shutdown time).
Definition at line 103 of file BundleDaemon.cc.
References actions_, contactmgr_, custody_bundles_, eventq_, fragmentmgr_, pending_bundles_, reg_table_, and router_.
void dtn::BundleDaemon::accept_custody | ( | Bundle * | bundle | ) | [protected] |
Take custody for the given bundle, sending the appropriate signal to the current custodian.
Definition at line 308 of file BundleDaemon.cc.
References actions_, dtn::EndpointID::assign(), dtn::Bundle::custodian(), custody_bundles_, dtn::BundleProtocol::CUSTODY_NO_ADDTL_INFO, dtn::Bundle::custody_rcpt(), dtn::EndpointID::equals(), generate_custody_signal(), generate_status_report(), dtn::Bundle::local_custody(), local_eid_, dtn::Bundle::mutable_custodian(), dtn::EndpointID::NULL_EID(), dtn::BundleList::push_back(), dtn::Bundle::set_local_custody(), dtn::BundleStatusReport::STATUS_CUSTODY_ACCEPTED, and dtn::BundleActions::store_update().
Referenced by handle_bundle_received().
BundleActions* dtn::BundleDaemon::actions | ( | ) | [inline] |
Return the current actions handler.
Definition at line 141 of file BundleDaemon.h.
References actions_.
Add the bundle to the pending list and (optionally) the persistent store, and set up the expiration timer for it.
Definition at line 2125 of file BundleDaemon.cc.
References actions_, dtn::Bundle::bundleid(), dtn::Bundle::creation_ts(), dtn::Bundle::expiration(), dtn::Bundle::expiration_timer(), dtnsim::gettimeofday(), pending_bundles_, dtn::BundleList::push_back(), dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::Bundle::set_expiration_timer(), dtn::Bundle::set_in_datastore(), dtn::BundleActions::store_add(), and dtn::BundleTimestamp::TIMEVAL_CONVERSION.
Referenced by handle_bundle_inject(), and handle_bundle_received().
void dtn::BundleDaemon::cancel_custody_timers | ( | Bundle * | bundle | ) | [protected] |
Cancel any pending custody timers for the bundle.
Definition at line 284 of file BundleDaemon.cc.
References dtn::Bundle::custody_timers(), and dtn::Bundle::lock().
Referenced by release_custody().
void dtn::BundleDaemon::check_and_deliver_to_registrations | ( | Bundle * | bundle, | |
const EndpointID & | reg_eid | |||
) |
This is used for delivering bundle to app by Late Binding.
Definition at line 442 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), deliver_to_registration(), dtn::RegistrationTable::get_matching(), and reg_table_.
Check the registration table and optionally deliver the bundle to any that match.
Definition at line 420 of file BundleDaemon.cc.
References ASSERT, deliver_to_registration(), dtn::Bundle::dest(), dtn::RegistrationTable::get_matching(), dtn::Bundle::is_fragment(), local_eid_, reg_table_, and dtn::EndpointID::subsume().
Referenced by handle_bundle_inject(), and handle_bundle_received().
ContactManager* dtn::BundleDaemon::contactmgr | ( | ) | [inline] |
Accessor for the contact manager.
Definition at line 146 of file BundleDaemon.h.
References contactmgr_.
Referenced by dtnsim::SimConvergenceLayer::update_connectivity().
BundleList* dtn::BundleDaemon::custody_bundles | ( | ) | [inline] |
Accessor for the custody bundles list.
Definition at line 166 of file BundleDaemon.h.
References custody_bundles_.
Referenced by get_bundle_stats().
bool dtn::BundleDaemon::delete_bundle | ( | const BundleRef & | bundle, | |
status_report_reason_t | reason = BundleProtocol::REASON_NO_ADDTL_INFO | |||
) | [protected] |
Delete (rather than silently discard) a bundle, e.g., an expired bundle.
Releases custody of the bundle, removes fragmentation state for the bundle if necessary, removes the bundle from the pending list, and sends a bundle deletion status report if necessary.
Definition at line 2265 of file BundleDaemon.cc.
References actions_, dtn::BundleActions::cancel_bundle(), contactmgr_, dtn::BundleRouter::delete_bundle(), dtn::FragmentManager::delete_fragment(), delete_from_pending(), dtn::BundleDaemon::BundleDaemon::Stats::deleted_bundles_, dtn::Bundle::deletion_rcpt(), fragmentmgr_, generate_status_report(), dtn::Bundle::is_fragment(), dtn::Bundle::is_queued_on(), dtn::ContactManager::links(), dtn::Bundle::local_custody(), dtn::ContactManager::lock(), pending_bundles_, dtn::BundleProtocol::REASON_NO_ADDTL_INFO, release_custody(), router_, dtn::BundleList::size(), stats_, and dtn::BundleStatusReport::STATUS_DELETED.
Referenced by handle_bundle_cancel(), handle_bundle_delete(), handle_bundle_expired(), handle_bundle_received(), handle_reassembly_completed(), and try_to_delete().
Remove the bundle from the pending list and data store, and cancel the expiration timer.
Definition at line 2180 of file BundleDaemon.cc.
References dtn::BundleList::erase(), pending_bundles_, and dtn::BundleList::size().
Referenced by delete_bundle().
void dtn::BundleDaemon::deliver_to_registration | ( | Bundle * | bundle, | |
Registration * | registration | |||
) | [protected] |
Deliver the bundle to the given registration.
Definition at line 370 of file BundleDaemon.cc.
References dtn::ForwardingLog::add_entry(), ASSERT, dtn::EndpointID::c_str(), dtn::Registration::deliver_if_not_duplicate(), dtn::ForwardingInfo::DELIVERED, dtn::Registration::endpoint(), dtn::ForwardingInfo::FORWARD_ACTION, dtn::Bundle::fwdlog(), dtn::ForwardingLog::get_latest_entry(), dtn::Bundle::is_fragment(), dtn::ForwardingInfo::NONE, dtn::Session::PUBLISH, dtn::Registration::regid(), and dtn::Registration::session_flags().
Referenced by check_and_deliver_to_registrations(), check_local_delivery(), and handle_registration_added().
void dtn::BundleDaemon::do_init | ( | ) | [virtual] |
Virtual initialization function, overridden in the simulator to install the modified event queue (with no notifier) and the SimBundleActions class.
Reimplemented in dtnsim::Node.
Definition at line 119 of file BundleDaemon.cc.
References actions_, BundleActions, eventq_, init(), and dtn::BundleProtocol::init_default_processors().
void dtn::BundleDaemon::event_handlers_completed | ( | BundleEvent * | event | ) | [protected] |
Once bundle reception, transmission or delivery has been processed by the router, check to see if it's still needed, otherwise we delete it.
Once the bundle expired event has been processed, the bundle shouldn't exist on any more lists.
Definition at line 2087 of file BundleDaemon.cc.
References dtn::BUNDLE_DELIVERED, dtn::BUNDLE_EXPIRED, dtn::BUNDLE_RECEIVED, dtn::BUNDLE_TRANSMITTED, try_to_delete(), dtn::BundleEvent::type_, and dtn::BundleEvent::type_str().
Referenced by handle_event().
virtual size_t dtn::BundleDaemon::event_queue_size | ( | ) | [inline, virtual] |
Return the number of events currently waiting for processing.
This is overridden in the simulator since it doesn't use a MsgQueue.
Reimplemented in dtnsim::Node.
Definition at line 98 of file BundleDaemon.h.
References eventq_.
Referenced by get_daemon_stats().
Check if there are any bundles in the pending queue that match the source id, timestamp, and fragmentation offset/length fields.
Definition at line 2334 of file BundleDaemon.cc.
References dtn::BundleList::begin(), dtn::Bundle::creation_ts(), dtn::BundleList::end(), dtn::EndpointID::equals(), dtn::Bundle::frag_offset(), dtn::Bundle::is_fragment(), dtn::BundlePayload::length(), dtn::Bundle::local_custody(), dtn::BundleList::lock(), params_, dtn::Bundle::payload(), pending_bundles_, dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::BundleList::size(), dtn::Bundle::source(), and dtn::BundleDaemon::BundleDaemon::Params::suppress_duplicates_.
Referenced by dtnsim::Node::handle_bundle_received(), and handle_bundle_received().
FragmentManager* dtn::BundleDaemon::fragmentmgr | ( | ) | [inline] |
Accessor for the fragmentation manager.
Definition at line 151 of file BundleDaemon.h.
References fragmentmgr_.
void dtn::BundleDaemon::generate_custody_signal | ( | Bundle * | bundle, | |
bool | succeeded, | |||
custody_signal_reason_t | reason | |||
) | [protected] |
Generate a custody signal to be sent to the current custodian.
Definition at line 259 of file BundleDaemon.cc.
References dtn::CustodySignal::create_custody_signal(), dtn::Bundle::custodian(), dtn::EndpointID::equals(), dtn::EVENTSRC_ADMIN, handle_event(), dtn::Bundle::local_custody(), local_eid_, and dtn::EndpointID::NULL_EID().
Referenced by accept_custody(), handle_bundle_delivered(), and handle_bundle_received().
void dtn::BundleDaemon::generate_status_report | ( | Bundle * | bundle, | |
BundleStatusReport::flag_t | flag, | |||
status_report_reason_t | reason = BundleProtocol::REASON_NO_ADDTL_INFO | |||
) | [protected] |
Locally generate a status report for the given bundle.
Definition at line 242 of file BundleDaemon.cc.
References dtn::BundleStatusReport::create_status_report(), dtn::EVENTSRC_ADMIN, handle_event(), and local_eid_.
Referenced by accept_custody(), delete_bundle(), handle_bundle_delivered(), handle_bundle_received(), and handle_bundle_transmitted().
void dtn::BundleDaemon::get_bundle_stats | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with the current bundle statistics.
Definition at line 188 of file BundleDaemon.cc.
References custody_bundles(), dtn::BundleDaemon::BundleDaemon::Stats::deleted_bundles_, dtn::BundleDaemon::BundleDaemon::Stats::delivered_bundles_, dtn::BundleDaemon::BundleDaemon::Stats::duplicate_bundles_, dtn::BundleDaemon::BundleDaemon::Stats::expired_bundles_, dtn::BundleDaemon::BundleDaemon::Stats::generated_bundles_, dtn::BundleDaemon::BundleDaemon::Stats::injected_bundles_, pending_bundles(), dtn::BundleDaemon::BundleDaemon::Stats::received_bundles_, stats_, and dtn::BundleDaemon::BundleDaemon::Stats::transmitted_bundles_.
void dtn::BundleDaemon::get_daemon_stats | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with the current internal statistics value.
Definition at line 214 of file BundleDaemon.cc.
References event_queue_size(), dtn::BundleDaemon::BundleDaemon::Stats::events_processed_, and stats_.
void dtn::BundleDaemon::get_routing_state | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with current routing info.
Definition at line 180 of file BundleDaemon.cc.
References contactmgr_, dtn::ContactManager::dump(), dtn::BundleRouter::get_routing_state(), and router_.
void dtn::BundleDaemon::handle_bundle_accept | ( | BundleAcceptRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 473 of file BundleDaemon.cc.
References dtn::BundleRouter::accept_bundle(), dtn::BundleAcceptRequest::bundle_, dtn::BundleAcceptRequest::reason_, dtn::BundleStatusReport::reason_to_str(), dtn::BundleAcceptRequest::result_, and router_.
void dtn::BundleDaemon::handle_bundle_attributes_query | ( | BundleAttributesQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1260 of file BundleDaemon.cc.
References dtn::BundleAttributesQueryRequest::attribute_names_, dtn::BundleAttributesQueryRequest::bundle_, dtn::BundleAttributesQueryRequest::metadata_blocks_, post(), and dtn::BundleAttributesQueryRequest::query_id_.
void dtn::BundleDaemon::handle_bundle_attributes_report | ( | BundleAttributesReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1280 of file BundleDaemon.cc.
References dtn::BundleAttributesReportEvent::query_id_.
void dtn::BundleDaemon::handle_bundle_cancel | ( | BundleCancelRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1050 of file BundleDaemon.cc.
References actions_, dtn::BundleActions::cancel_bundle(), contactmgr_, delete_bundle(), dtn::ContactManager::find_link(), and dtn::BundleCancelRequest::link_.
void dtn::BundleDaemon::handle_bundle_cancelled | ( | BundleSendCancelledEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1083 of file BundleDaemon.cc.
References dtn::Bundle::bundleid(), dtn::ForwardingInfo::CANCELLED, dtn::BundleProtocol::delete_blocks(), dtn::LinkBlockSet::find_blocks(), dtn::Bundle::fwdlog(), dtn::ForwardingLog::update(), and dtn::Bundle::xmit_blocks().
void dtn::BundleDaemon::handle_bundle_delete | ( | BundleDeleteRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 461 of file BundleDaemon.cc.
References dtn::BundleDeleteRequest::bundle_, delete_bundle(), dtn::BundleDeleteRequest::reason_, and dtn::BundleStatusReport::reason_to_str().
void dtn::BundleDaemon::handle_bundle_delivered | ( | BundleDeliveredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtnsim::Node.
Definition at line 959 of file BundleDaemon.cc.
References dtn::Bundle::bundleid(), dtn::Bundle::custodian(), dtn::BundleProtocol::CUSTODY_NO_ADDTL_INFO, dtn::Bundle::custody_requested(), dtn::BundleDaemon::BundleDaemon::Stats::delivered_bundles_, dtn::Bundle::delivery_rcpt(), dtn::EndpointID::equals(), generate_custody_signal(), generate_status_report(), dtn::BundlePayload::length(), dtn::Bundle::local_custody(), dtn::EndpointID::NULL_EID(), dtn::Bundle::payload(), release_custody(), stats_, and dtn::BundleStatusReport::STATUS_DELIVERED.
void dtn::BundleDaemon::handle_bundle_expired | ( | BundleExpiredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtnsim::Node.
Definition at line 1007 of file BundleDaemon.cc.
References delete_bundle(), dtn::BundleDaemon::BundleDaemon::Stats::expired_bundles_, dtn::BundleProtocol::REASON_LIFETIME_EXPIRED, and stats_.
void dtn::BundleDaemon::handle_bundle_free | ( | BundleFreeEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2375 of file BundleDaemon.cc.
References actions_, ASSERT, dtn::Bundle::in_datastore(), dtn::Bundle::lock(), dtn::Bundle::refcount(), and dtn::BundleActions::store_del().
void dtn::BundleDaemon::handle_bundle_inject | ( | BundleInjectRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1159 of file BundleDaemon.cc.
References add_to_pending(), dtn::EndpointID::assign(), check_local_delivery(), dtn::BundleInjectRequest::custodian_, dtn::BundleInjectRequest::dest_, dtn::BundlePayload::DISK, dtn::BundleInjectRequest::expiration_, fragmentmgr_, dtn::RegistrationTable::get(), dtn::BundleDaemon::BundleDaemon::Stats::injected_bundles_, dtn::BundleDaemon::BundleDaemon::Params::injected_bundles_in_memory_, dtn::Bundle::is_fragment(), dtn::BundlePayload::length(), dtn::BundlePayload::MEMORY, dtn::Bundle::mutable_custodian(), dtn::Bundle::mutable_dest(), dtn::Bundle::mutable_payload(), dtn::Bundle::mutable_replyto(), dtn::Bundle::mutable_source(), dtn::EndpointID::NULL_EID(), params_, dtn::Bundle::payload(), dtn::BundleInjectRequest::payload_file_, post(), dtn::BundleInjectRequest::priority_, dtn::FragmentManager::process_for_reassembly(), reg_table(), dtn::BundleInjectRequest::replyto_, dtn::BundleInjectRequest::request_id_, dtn::Bundle::set_expiration(), dtn::Bundle::set_priority(), src, dtn::BundleInjectRequest::src_, stats_, dtn::EndpointID::str(), dtn::EndpointID::uri(), and dtn::EndpointID::valid().
void dtn::BundleDaemon::handle_bundle_query | ( | BundleQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1247 of file BundleDaemon.cc.
References post_at_head().
void dtn::BundleDaemon::handle_bundle_queued_query | ( | BundleQueuedQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1642 of file BundleDaemon.cc.
References ASSERT, dtn::BundleQueuedQueryRequest::bundle_, dtn::BundleQueuedQueryRequest::link_, post(), and dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_bundle_queued_report | ( | BundleQueuedReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1660 of file BundleDaemon.cc.
References dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_bundle_received | ( | BundleReceivedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtnsim::Node.
Definition at line 486 of file BundleDaemon.cc.
References dtn::BundleRouter::accept_bundle(), accept_custody(), dtn::BundleDaemon::BundleDaemon::Params::accept_custody_, dtn::ForwardingLog::add_entry(), add_to_pending(), ASSERT, dtn::EndpointID::assign(), buf, dtn::Bundle::bundleid(), dtn::BundleReceivedEvent::bytes_received_, dtn::EndpointID::c_str(), check_local_delivery(), dtn::Bundle::creation_ts(), custody_bundles_, dtn::BundleProtocol::CUSTODY_REDUNDANT_RECEPTION, dtn::Bundle::custody_requested(), delete_bundle(), dtn::FragmentManager::delete_obsoleted_fragments(), dtn::Bundle::dest(), dtn::BundleDaemon::BundleDaemon::Stats::duplicate_bundles_, dtn::EVENTSRC_ADMIN, dtn::EVENTSRC_APP, dtn::EVENTSRC_FRAGMENTATION, dtn::EVENTSRC_PEER, dtn::EVENTSRC_ROUTER, dtn::EVENTSRC_STORE, dtn::Bundle::expiration(), find_duplicate(), dtn::Bundle::format_verbose(), dtn::ForwardingInfo::FORWARD_ACTION, fragmentmgr_, dtn::Bundle::fwdlog(), generate_custody_signal(), generate_status_report(), dtn::BundleDaemon::BundleDaemon::Stats::generated_bundles_, dtn::BundleTimestamp::get_current_time(), dtn::Bundle::is_fragment(), dtn::BundleReceivedEvent::link_, dtn::Bundle::local_custody(), dtn::Bundle::mutable_prevhop(), dtn::EndpointID::NULL_EID(), params_, dtn::Bundle::prevhop(), dtn::BundleReceivedEvent::prevhop_, dtn::FragmentManager::process_for_reassembly(), dtn::BundleList::push_back(), dtn::BundleProtocol::REASON_NO_ADDTL_INFO, dtn::Bundle::receive_rcpt(), dtn::ForwardingInfo::RECEIVED, dtn::BundleDaemon::BundleDaemon::Stats::received_bundles_, dtn::BundleReceivedEvent::registration_, router_, dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::Bundle::source(), dtn::BundleReceivedEvent::source_, stats_, dtn::BundleStatusReport::STATUS_RECEIVED, dtn::EndpointID::str(), dtn::BundleDaemon::BundleDaemon::Params::suppress_duplicates_, dtn::FragmentManager::try_to_convert_to_fragment(), and dtn::BundleProtocol::validate().
void dtn::BundleDaemon::handle_bundle_report | ( | BundleReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1254 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_bundle_send | ( | BundleSendRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1027 of file BundleDaemon.cc.
References dtn::BundleSendRequest::action_, actions_, contactmgr_, dtn::CustodyTimerSpec::defaults_, dtn::ContactManager::find_link(), dtn::BundleSendRequest::link_, and dtn::BundleActions::queue_bundle().
void dtn::BundleDaemon::handle_bundle_transmitted | ( | BundleTransmittedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Reimplemented in dtnsim::Node.
Definition at line 785 of file BundleDaemon.cc.
References ASSERT, buf, dtn::Bundle::bundleid(), dtn::BundleTransmittedEvent::bundleref_, dtn::BundleTransmittedEvent::bytes_sent_, dtn::ForwardingInfo::custody_spec(), dtn::Bundle::custody_timers(), dtn::BundleProtocol::delete_blocks(), dtn::ForwardingLog::dump(), dtn::LinkBlockSet::find_blocks(), dtn::Bundle::forward_rcpt(), fragmentmgr_, dtn::Bundle::fwdlog(), generate_status_report(), dtn::ForwardingLog::get_latest_entry(), dtn::Bundle::local_custody(), params_, dtn::ForwardingInfo::QUEUED, dtn::BundleTransmittedEvent::reliably_sent_, dtn::BundleDaemon::BundleDaemon::Params::retry_reliable_unacked_, dtn::ForwardingInfo::state(), dtn::ForwardingInfo::state_to_str(), stats_, dtn::BundleStatusReport::STATUS_FORWARDED, dtn::ForwardingInfo::timestamp(), dtn::BundleProtocol::total_length(), dtn::ForwardingInfo::TRANSMIT_FAILED, dtn::ForwardingInfo::TRANSMITTED, dtn::BundleDaemon::BundleDaemon::Stats::transmitted_bundles_, dtn::FragmentManager::try_to_reactively_fragment(), dtn::ForwardingLog::update(), and dtn::Bundle::xmit_blocks().
void dtn::BundleDaemon::handle_cla_parameters_query | ( | CLAParametersQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1780 of file BundleDaemon.cc.
References ASSERT, dtn::CLAParametersQueryRequest::cla_, dtn::ConvergenceLayer::name(), dtn::CLAParametersQueryRequest::parameter_names_, dtn::ConvergenceLayer::query_cla_parameters(), and dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_cla_parameters_report | ( | CLAParametersReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1794 of file BundleDaemon.cc.
References dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_cla_set_params | ( | CLASetParamsRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2071 of file BundleDaemon.cc.
References ASSERT, dtn::CLASetParamsRequest::cla_, dtn::CLASetParamsRequest::parameters_, and dtn::ConvergenceLayer::set_cla_parameters().
void dtn::BundleDaemon::handle_contact_down | ( | ContactDownEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1832 of file BundleDaemon.cc.
References ASSERT, and dtn::ContactEvent::reason_to_str().
void dtn::BundleDaemon::handle_contact_query | ( | ContactQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1849 of file BundleDaemon.cc.
References post_at_head().
void dtn::BundleDaemon::handle_contact_report | ( | ContactReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1856 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_contact_up | ( | ContactUpEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1803 of file BundleDaemon.cc.
References ASSERT, contactmgr_, dtn::ContactManager::lock(), and dtn::Link::OPEN.
void dtn::BundleDaemon::handle_custody_signal | ( | CustodySignalEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1908 of file BundleDaemon.cc.
References dtn::BundleProtocol::ADMIN_IS_FRAGMENT, dtn::EndpointID::c_str(), custody_bundles_, dtn::BundleProtocol::CUSTODY_REDUNDANT_RECEPTION, dtn::CustodySignalEvent::data_, dtn::BundleList::find(), dtn::CustodySignal::CustodySignal::data_t::orig_source_eid_, dtn::CustodySignal::CustodySignal::data_t::reason_, dtn::CustodySignal::reason_to_str(), release_custody(), dtn::CustodySignal::CustodySignal::data_t::succeeded_, and try_to_delete().
void dtn::BundleDaemon::handle_custody_timeout | ( | CustodyTimeoutEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1962 of file BundleDaemon.cc.
References ASSERT, dtn::BundleList::contains(), dtn::ForwardingInfo::CUSTODY_TIMEOUT, dtn::Bundle::custody_timers(), dtn::Bundle::fwdlog(), dtn::CustodyTimer::link_, dtn::Bundle::lock(), pending_bundles_, and dtn::ForwardingLog::update().
void dtn::BundleDaemon::handle_eid_reachable_query | ( | EIDReachableQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1670 of file BundleDaemon.cc.
References ASSERT, dtn::Interface::clayer(), dtn::EIDReachableQueryRequest::endpoint_, dtn::EIDReachableQueryRequest::iface_, dtn::ConvergenceLayer::is_eid_reachable(), and dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_eid_reachable_report | ( | EIDReachableReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1687 of file BundleDaemon.cc.
References dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_event | ( | BundleEvent * | event | ) | [protected, virtual] |
Main event handling function.
Implements dtn::BundleEventHandler.
Definition at line 2393 of file BundleDaemon.cc.
References contactmgr_, dtn::BundleEvent::daemon_only_, dtn::BundleEventHandler::dispatch_event(), event_handlers_completed(), dtn::BundleDaemon::BundleDaemon::Stats::events_processed_, dtn::ContactManager::handle_event(), dtn::BundleRouter::handle_event(), dtn::BundleEvent::processed_notifier_, router_, and stats_.
Referenced by generate_custody_signal(), generate_status_report(), load_bundles(), load_registrations(), dtnsim::Node::process_one_bundle_event(), run(), and dtnsim::Node::run_one_event_now().
void dtn::BundleDaemon::handle_iface_attributes_query | ( | IfaceAttributesQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1754 of file BundleDaemon.cc.
References ASSERT, dtn::IfaceAttributesQueryRequest::attribute_names_, dtn::Interface::clayer(), dtn::IfaceAttributesQueryRequest::iface_, dtn::CLAQueryReport::query_id_, and dtn::ConvergenceLayer::query_iface_attributes().
void dtn::BundleDaemon::handle_iface_attributes_report | ( | IfaceAttributesReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1771 of file BundleDaemon.cc.
References dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_link_attribute_changed | ( | LinkAttributeChangedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1697 of file BundleDaemon.cc.
References dtn::LinkAttributeChangedEvent::attributes_.
void dtn::BundleDaemon::handle_link_attributes_query | ( | LinkAttributesQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1729 of file BundleDaemon.cc.
References ASSERT, dtn::LinkAttributesQueryRequest::attribute_names_, dtn::LinkAttributesQueryRequest::link_, and dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_link_attributes_report | ( | LinkAttributesReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1745 of file BundleDaemon.cc.
References dtn::CLAQueryReport::query_id_.
void dtn::BundleDaemon::handle_link_available | ( | LinkAvailableEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1400 of file BundleDaemon.cc.
References ASSERT.
void dtn::BundleDaemon::handle_link_create | ( | LinkCreateRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1546 of file BundleDaemon.cc.
References dtn::ContactManager::add_new_link(), dtn::LinkCreateRequest::cla_, contactmgr_, dtn::Link::create_link(), dtn::BundleEvent::daemon_only_, dtn::ContactManager::find_link(), dtn::LinkCreateRequest::link_type_, dtn::ContactManager::lock(), dtn::LinkCreateRequest::name_, and dtn::LinkCreateRequest::parameters_.
void dtn::BundleDaemon::handle_link_created | ( | LinkCreatedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1373 of file BundleDaemon.cc.
References ASSERT.
void dtn::BundleDaemon::handle_link_delete | ( | LinkDeleteRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1605 of file BundleDaemon.cc.
References ASSERT, contactmgr_, dtn::ContactManager::del_link(), and dtn::LinkDeleteRequest::link_.
void dtn::BundleDaemon::handle_link_deleted | ( | LinkDeletedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1390 of file BundleDaemon.cc.
References ASSERT.
void dtn::BundleDaemon::handle_link_query | ( | LinkQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1629 of file BundleDaemon.cc.
References post_at_head().
void dtn::BundleDaemon::handle_link_reconfigure | ( | LinkReconfigureRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1618 of file BundleDaemon.cc.
References ASSERT, dtn::LinkReconfigureRequest::link_, and dtn::LinkReconfigureRequest::parameters_.
void dtn::BundleDaemon::handle_link_report | ( | LinkReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1636 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_state_change_request | ( | LinkStateChangeRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1429 of file BundleDaemon.cc.
References actions_, ASSERT, dtn::Link::AVAILABLE, dtn::BundleActions::close_link(), dtn::Link::CLOSED, dtn::LinkStateChangeRequest::contact_, contactmgr_, dtn::ContactEvent::IDLE, dtn::LinkStateChangeRequest::link_, dtn::ContactManager::lock(), dtn::LinkStateChangeRequest::old_state_, dtn::Link::OPEN, dtn::BundleActions::open_link(), dtn::Link::OPENING, post_at_head(), dtn::ContactEvent::reason_, dtn::ContactEvent::reason_to_str(), dtn::LinkStateChangeRequest::state_, dtn::Link::state_to_str(), and dtn::Link::UNAVAILABLE.
void dtn::BundleDaemon::handle_link_unavailable | ( | LinkUnavailableEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1418 of file BundleDaemon.cc.
References ASSERT.
void dtn::BundleDaemon::handle_reassembly_completed | ( | ReassemblyCompletedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1862 of file BundleDaemon.cc.
References dtn::ReassemblyCompletedEvent::bundle_, delete_bundle(), dtn::EVENTSRC_FRAGMENTATION, dtn::ReassemblyCompletedEvent::fragments_, dtn::BundleList::pop_front(), and post_at_head().
void dtn::BundleDaemon::handle_registration_added | ( | RegistrationAddedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1289 of file BundleDaemon.cc.
References dtn::RegistrationTable::add(), dtn::BundleList::begin(), dtn::EndpointID::c_str(), deliver_to_registration(), dtn::Bundle::dest(), dtn::BundleList::end(), dtn::Registration::endpoint(), dtn::EVENTSRC_APP, dtn::Bundle::is_fragment(), dtn::BundleList::lock(), dtn::EndpointIDPattern::match(), pending_bundles_, reg_table_, dtn::Registration::regid(), and dtn::RegistrationAddedEvent::source_.
void dtn::BundleDaemon::handle_registration_delete | ( | RegistrationDeleteRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1365 of file BundleDaemon.cc.
References dtn::Registration::regid(), and dtn::RegistrationDeleteRequest::registration_.
void dtn::BundleDaemon::handle_registration_expired | ( | RegistrationExpiredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1337 of file BundleDaemon.cc.
References dtn::Registration::active(), dtn::RegistrationTable::del(), dtn::RegistrationTable::get(), post_at_head(), reg_table_, dtn::Registration::regid(), and dtn::Registration::set_expired().
void dtn::BundleDaemon::handle_registration_removed | ( | RegistrationRemovedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1320 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), dtn::RegistrationTable::del(), dtn::Registration::endpoint(), post(), reg_table_, and dtn::Registration::regid().
void dtn::BundleDaemon::handle_route_add | ( | RouteAddEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1881 of file BundleDaemon.cc.
References dtn::RouteAddEvent::entry_.
void dtn::BundleDaemon::handle_route_del | ( | RouteDelEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1888 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), and dtn::RouteDelEvent::dest_.
void dtn::BundleDaemon::handle_route_query | ( | RouteQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1895 of file BundleDaemon.cc.
References post_at_head().
void dtn::BundleDaemon::handle_route_report | ( | RouteReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1902 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_shutdown_request | ( | ShutdownRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2026 of file BundleDaemon.cc.
References app_shutdown_data_, app_shutdown_proc_, contactmgr_, dtn::ContactManager::links(), dtn::ContactManager::lock(), rtr_shutdown_data_, rtr_shutdown_proc_, dtn::ConvergenceLayer::shutdown_clayers(), and shutting_down_.
void dtn::BundleDaemon::handle_status_request | ( | StatusRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2079 of file BundleDaemon.cc.
static void dtn::BundleDaemon::init | ( | ) | [inline, static] |
Boot time initializer.
Definition at line 82 of file BundleDaemon.h.
References BundleDaemon().
Referenced by do_init().
void dtn::BundleDaemon::init_idle_shutdown | ( | int | interval | ) |
Initialize an idle shutdown handler that will cleanly exit the tcl event loop whenever no bundle events have been handled for the specified interval.
Definition at line 2539 of file BundleDaemon.cc.
References DaemonIdleExit, and idle_exit_.
void dtn::BundleDaemon::load_bundles | ( | ) | [protected] |
Initialize and load in stored bundles.
Definition at line 2457 of file BundleDaemon.cc.
References actions_, dtn::BundlePayload::DISK, dtn::Bundle::durable_size(), dtn::EVENTSRC_STORE, dtn::BundleStore::get(), handle_event(), dtn::BundlePayload::location(), dtn::BundleStore::new_iterator(), dtn::Bundle::payload(), dtn::BundleProtocol::reload_post_process(), dtn::BundleStore::set_total_size(), and dtn::BundleActions::store_del().
Referenced by run().
void dtn::BundleDaemon::load_registrations | ( | ) | [protected] |
Initialize and load in the registrations.
Definition at line 2414 of file BundleDaemon.cc.
References admin_reg_, dtn::EndpointID::append_service_tag(), dtn::EVENTSRC_ADMIN, dtn::EVENTSRC_STORE, handle_event(), local_eid(), and ping_reg_.
Referenced by run().
const EndpointID& dtn::BundleDaemon::local_eid | ( | ) | [inline] |
Return the local endpoint identifier.
Definition at line 193 of file BundleDaemon.h.
References local_eid_.
Referenced by dtnsim::NodeCommand::exec(), dtnsim::SimLink::handle_arrival_events(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::initiate_contact(), and load_registrations().
BundleList* dtn::BundleDaemon::pending_bundles | ( | ) | [inline] |
Accessor for the pending bundles list.
Definition at line 161 of file BundleDaemon.h.
References pending_bundles_.
Referenced by get_bundle_stats(), and dtnsim::Simulator::log_inqueue_stats().
void dtn::BundleDaemon::post | ( | BundleEvent * | event | ) | [static] |
Queues the event at the tail of the queue for processing by the daemon thread.
Definition at line 134 of file BundleDaemon.cc.
Referenced by dtn::ContactManager::add_new_link(), dtn::CLConnection::break_contact(), dtn::UDPConvergenceLayer::bundle_queued(), dtn::NullConvergenceLayer::bundle_queued(), dtn::NullConvergenceLayer::cancel_bundle(), dtn::ConnectionConvergenceLayer::cancel_bundle(), dtn::BundleActions::cancel_bundle(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::check_completed(), dtn::APIClient::close_client(), dtn::ConnectionConvergenceLayer::close_contact(), dtn::CLConnection::contact_up(), dtn::ContactManager::del_link(), dtn::FragmentManager::delete_obsoleted_fragments(), dtn::PingRegistration::deliver_bundle(), dtn::LoggingRegistration::deliver_bundle(), dtn::APIRegistration::deliver_bundle(), dtn::AdminRegistration::deliver_bundle(), dtn::RouteCommand::exec(), dtn::LinkCommand::exec(), dtn::BundleCommand::exec(), dtn::TclRegistration::get_bundle_data(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_ack_segment(), handle_bundle_attributes_query(), handle_bundle_inject(), handle_bundle_queued_query(), dtn::APIClient::handle_cancel(), dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_cancel_bundle(), dtn::Discovery::handle_neighbor_discovered(), dtn::APIClient::handle_recv(), handle_registration_removed(), dtn::APIClient::handle_session_update(), dtn::APIClient::handle_unbind(), dtn::ConvergenceLayer::is_eid_reachable(), dtn::UDPConvergenceLayer::open_contact(), dtn::NullConvergenceLayer::open_contact(), post_and_wait(), dtn::UDPConvergenceLayer::UDPConvergenceLayer::Receiver::process_data(), dtn::ConvergenceLayer::query_cla_parameters(), dtn::ConvergenceLayer::query_iface_attributes(), dtn::ConvergenceLayer::query_link_attributes(), dtn::DTLSRRouter::DTLSRRouter::Reg::Reg(), dtn::ContactManager::reopen_link(), dtn::FileConvergenceLayer::send_bundle(), dtn::ConvergenceLayer::set_cla_parameters(), dtn::OndemandLink::set_initial_state(), dtn::Registration::Registration::ExpirationTimer::timeout(), and dtn::CustodyTimer::timeout().
bool dtn::BundleDaemon::post_and_wait | ( | BundleEvent * | event, | |
oasys::Notifier * | notifier, | |||
int | timeout = -1 , |
|||
bool | at_back = true | |||
) | [static] |
Post the given event and wait for it to be processed by the daemon thread or for the given timeout to elapse.
Definition at line 148 of file BundleDaemon.cc.
References ASSERT, post(), post_at_head(), and dtn::BundleEvent::processed_notifier_.
Referenced by dtn::ContactManager::del_link(), dtn::RouteCommand::exec(), dtn::RegistrationCommand::exec(), dtn::BundleCommand::exec(), dtn::APIClient::handle_register(), dtn::APIClient::handle_send(), and dtn::APIClient::handle_unregister().
void dtn::BundleDaemon::post_at_head | ( | BundleEvent * | event | ) | [static] |
Queues the event at the head of the queue for processing by the daemon thread.
Definition at line 141 of file BundleDaemon.cc.
Referenced by dtn::TableBasedRouter::add_bundle_to_session(), dtn::DTLSRRouter::DTLSRRouter::Reg::deliver_bundle(), handle_bundle_query(), dtn::TableBasedRouter::handle_bundle_received(), handle_contact_query(), handle_link_query(), handle_link_state_change_request(), handle_reassembly_completed(), handle_registration_expired(), handle_route_query(), post_and_wait(), dtn::FragmentManager::process_for_reassembly(), dtn::DTLSRRouter::send_lsa(), dtn::AlwaysOnLink::set_initial_state(), dtn::TableBasedRouter::subscribe_to_session(), dtn::ExpirationTimer::timeout(), dtn::FragmentManager::try_to_reactively_fragment(), and dtn::DTLSRRouter::update_current_lsa().
void dtn::BundleDaemon::post_event | ( | BundleEvent * | event, | |
bool | at_back = true | |||
) | [virtual] |
Virtual post_event function, overridden by the Node class in the simulator to use a modified event queue.
Reimplemented in dtnsim::Node.
Definition at line 170 of file BundleDaemon.cc.
References eventq_, and dtn::BundleEvent::type_str().
const RegistrationTable* dtn::BundleDaemon::reg_table | ( | ) | [inline] |
Accessor for the registration table.
Definition at line 156 of file BundleDaemon.h.
References reg_table_.
Referenced by dtnsim::NodeCommand::exec(), and handle_bundle_inject().
void dtn::BundleDaemon::release_custody | ( | Bundle * | bundle | ) | [protected] |
Release custody of the given bundle, sending the appropriate signal to the current custodian.
Definition at line 349 of file BundleDaemon.cc.
References actions_, dtn::EndpointID::assign(), cancel_custody_timers(), custody_bundles_, dtn::BundleList::erase(), dtn::Bundle::local_custody(), dtn::Bundle::mutable_custodian(), dtn::EndpointID::NULL_EID(), dtn::Bundle::set_local_custody(), and dtn::BundleActions::store_update().
Referenced by delete_bundle(), handle_bundle_delivered(), and handle_custody_signal().
void dtn::BundleDaemon::reset_stats | ( | ) |
Reset all internal stats.
Definition at line 227 of file BundleDaemon.cc.
References contactmgr_, dtn::ContactManager::links(), dtn::ContactManager::lock(), and stats_.
BundleRouter* dtn::BundleDaemon::router | ( | ) | [inline] |
Returns the current bundle router.
Reimplemented in dtnsim::Node.
Definition at line 132 of file BundleDaemon.h.
void dtn::BundleDaemon::run | ( | ) | [protected] |
Main thread function that dispatches events.
Definition at line 2546 of file BundleDaemon.cc.
References ASSERT, dtn::BundleTimestamp::check_local_clock(), dtn::BundleRouter::config_, dtn::BundleRouter::create_router(), eventq_, handle_event(), dtn::BundleRouter::initialize(), last_event_, load_bundles(), load_registrations(), log_err_p, dtn::BundleEvent::posted_time_, router_, and dtn::BundleEvent::type_str().
void dtn::BundleDaemon::set_app_shutdown | ( | ShutdownProc | proc, | |
void * | data | |||
) | [inline] |
Set an application-specific shutdown handler.
Definition at line 243 of file BundleDaemon.h.
References app_shutdown_data_, and app_shutdown_proc_.
void dtn::BundleDaemon::set_local_eid | ( | const char * | eid_str | ) | [inline] |
Set the local endpoint id.
Definition at line 198 of file BundleDaemon.h.
References dtn::EndpointID::assign(), and local_eid_.
void dtn::BundleDaemon::set_rtr_shutdown | ( | ShutdownProc | proc, | |
void * | data | |||
) | [inline] |
Set a router-specific shutdown handler.
Definition at line 252 of file BundleDaemon.h.
References rtr_shutdown_data_, and rtr_shutdown_proc_.
static bool dtn::BundleDaemon::shutting_down | ( | ) | [inline, static] |
Accessor for the BundleDaemon's shutdown status.
Definition at line 261 of file BundleDaemon.h.
References shutting_down_.
Referenced by dtn::StreamConvergenceLayer::StreamConvergenceLayer::Connection::handle_poll_timeout().
Check if we should delete this bundle, called just after arrival, once it's been transmitted or delivered at least once, or when we release custody.
Definition at line 2222 of file BundleDaemon.cc.
References dtn::BundleRouter::can_delete_bundle(), delete_bundle(), dtn::BundleDaemon::BundleDaemon::Params::early_deletion_, params_, pending_bundles_, dtn::BundleProtocol::REASON_NO_ADDTL_INFO, router_, and dtn::BundleList::size().
Referenced by event_handlers_completed(), and handle_custody_signal().
friend class BundleActions [friend] |
Definition at line 279 of file BundleDaemon.h.
Referenced by dtnsim::Node::do_init(), and do_init().
friend class DaemonIdleExit [friend] |
BundleActions* dtn::BundleDaemon::actions_ [protected] |
The active bundle actions handler.
Definition at line 457 of file BundleDaemon.h.
Referenced by accept_custody(), actions(), add_to_pending(), BundleDaemon(), delete_bundle(), dtnsim::Node::do_init(), do_init(), handle_bundle_cancel(), handle_bundle_free(), handle_bundle_send(), handle_link_state_change_request(), load_bundles(), release_custody(), and ~BundleDaemon().
AdminRegistration* dtn::BundleDaemon::admin_reg_ [protected] |
The administrative registration.
Definition at line 460 of file BundleDaemon.h.
Referenced by load_registrations().
void* dtn::BundleDaemon::app_shutdown_data_ [protected] |
Application-specific shutdown data.
Definition at line 507 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_app_shutdown().
ShutdownProc dtn::BundleDaemon::app_shutdown_proc_ [protected] |
Application-specific shutdown handler.
Definition at line 504 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_app_shutdown().
ContactManager* dtn::BundleDaemon::contactmgr_ [protected] |
The contact manager.
Definition at line 466 of file BundleDaemon.h.
Referenced by BundleDaemon(), contactmgr(), delete_bundle(), get_routing_state(), handle_bundle_cancel(), handle_bundle_send(), handle_contact_up(), handle_event(), handle_link_create(), handle_link_delete(), handle_link_state_change_request(), handle_shutdown_request(), reset_stats(), and ~BundleDaemon().
BundleList* dtn::BundleDaemon::custody_bundles_ [protected] |
The list of all bundles that we have custody of.
Definition at line 478 of file BundleDaemon.h.
Referenced by accept_custody(), BundleDaemon(), custody_bundles(), handle_bundle_received(), handle_custody_signal(), release_custody(), and ~BundleDaemon().
oasys::MsgQueue<BundleEvent*>* dtn::BundleDaemon::eventq_ [protected] |
The event queue.
Reimplemented in dtnsim::Node.
Definition at line 481 of file BundleDaemon.h.
Referenced by BundleDaemon(), do_init(), event_queue_size(), post_event(), run(), and ~BundleDaemon().
FragmentManager* dtn::BundleDaemon::fragmentmgr_ [protected] |
The fragmentation / reassembly manager.
Definition at line 469 of file BundleDaemon.h.
Referenced by BundleDaemon(), delete_bundle(), fragmentmgr(), handle_bundle_inject(), handle_bundle_received(), handle_bundle_transmitted(), and ~BundleDaemon().
DaemonIdleExit* dtn::BundleDaemon::idle_exit_ [protected] |
Pointer to the idle exit handler (if any).
Definition at line 526 of file BundleDaemon.h.
Referenced by init_idle_shutdown().
oasys::Time dtn::BundleDaemon::last_event_ [protected] |
Time value when the last event was handled.
Definition at line 529 of file BundleDaemon.h.
Referenced by run().
EndpointID dtn::BundleDaemon::local_eid_ [protected] |
The default endpoint id for reaching this daemon, used for bundle status reports, routing, etc.
Definition at line 485 of file BundleDaemon.h.
Referenced by accept_custody(), BundleDaemon(), check_local_delivery(), generate_custody_signal(), generate_status_report(), local_eid(), and set_local_eid().
Definition at line 233 of file BundleDaemon.h.
Referenced by dtn::ProphetBundleCore::custody_accepted(), find_duplicate(), handle_bundle_inject(), handle_bundle_received(), handle_bundle_transmitted(), dtn::ParamCommand::ParamCommand(), and try_to_delete().
BundleList* dtn::BundleDaemon::pending_bundles_ [protected] |
The list of all bundles still pending delivery.
Definition at line 475 of file BundleDaemon.h.
Referenced by add_to_pending(), BundleDaemon(), delete_bundle(), delete_from_pending(), find_duplicate(), handle_custody_timeout(), handle_registration_added(), pending_bundles(), try_to_delete(), and ~BundleDaemon().
PingRegistration* dtn::BundleDaemon::ping_reg_ [protected] |
The ping registration.
Definition at line 463 of file BundleDaemon.h.
Referenced by load_registrations().
RegistrationTable* dtn::BundleDaemon::reg_table_ [protected] |
The table of active registrations.
Definition at line 472 of file BundleDaemon.h.
Referenced by BundleDaemon(), check_and_deliver_to_registrations(), check_local_delivery(), handle_registration_added(), handle_registration_expired(), handle_registration_removed(), reg_table(), and ~BundleDaemon().
BundleRouter* dtn::BundleDaemon::router_ [protected] |
The active bundle router.
Definition at line 454 of file BundleDaemon.h.
Referenced by BundleDaemon(), dtnsim::Node::configure(), delete_bundle(), get_routing_state(), handle_bundle_accept(), handle_bundle_received(), handle_event(), dtnsim::Node::router(), router(), run(), try_to_delete(), and ~BundleDaemon().
void* dtn::BundleDaemon::rtr_shutdown_data_ [protected] |
Router-specific shutdown data.
Definition at line 513 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_rtr_shutdown().
ShutdownProc dtn::BundleDaemon::rtr_shutdown_proc_ [protected] |
Router-specific shutdown handler.
Definition at line 510 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_rtr_shutdown().
bool dtn::BundleDaemon::shutting_down_ = false [static, protected] |
Definition at line 516 of file BundleDaemon.h.
Referenced by handle_shutdown_request(), and shutting_down().
Stats dtn::BundleDaemon::stats_ [protected] |
Stats instance.
Definition at line 501 of file BundleDaemon.h.
Referenced by BundleDaemon(), delete_bundle(), get_bundle_stats(), get_daemon_stats(), handle_bundle_delivered(), handle_bundle_expired(), handle_bundle_inject(), handle_bundle_received(), handle_bundle_transmitted(), handle_event(), and reset_stats().