Class that handles the basic event / action mechanism. More...
#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 |
Class that handles the basic event / action mechanism.
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.
Definition at line 238 of file BundleDaemon.h.
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 53 of file BundleDaemon.cc.
References dtn::EndpointID::NULL_EID(), dtn::BundleDaemon::Params::Params(), params_, and shutting_down_.
Referenced by init().
dtn::BundleDaemon::~BundleDaemon | ( | ) | [virtual] |
Destructor (called at shutdown time).
Definition at line 82 of file BundleDaemon.cc.
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 287 of file BundleDaemon.cc.
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 2104 of file BundleDaemon.cc.
References try_to_delete().
void dtn::BundleDaemon::cancel_custody_timers | ( | Bundle * | bundle | ) | [protected] |
Cancel any pending custody timers for the bundle.
Definition at line 263 of file BundleDaemon.cc.
Referenced by deliver_to_registration().
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 421 of file BundleDaemon.cc.
References ASSERT, deliver_to_registration(), dtn::RegistrationTable::get_matching(), local_eid_, and reg_table_.
Check the registration table and optionally deliver the bundle to any that match.
Definition at line 399 of file BundleDaemon.cc.
References dtn::ForwardingLog::add_entry(), dtn::ForwardingInfo::DELIVERED, dtn::ForwardingInfo::FORWARD_ACTION, and dtn::Bundle::fwdlog().
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_.
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 2244 of file BundleDaemon.cc.
Referenced by handle_bundle_send().
Remove the bundle from the pending list and data store, and cancel the expiration timer.
Definition at line 2159 of file BundleDaemon.cc.
void dtn::BundleDaemon::deliver_to_registration | ( | Bundle * | bundle, | |
Registration * | registration | |||
) | [protected] |
Deliver the bundle to the given registration.
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 check_and_deliver_to_registrations(), and handle_bundle_accept().
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 98 of file BundleDaemon.cc.
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 2066 of file BundleDaemon.cc.
Referenced by load_registrations().
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_.
Check if there are any bundles in the pending queue that match the source id, timestamp, and fragmentation offset/length fields.
Definition at line 2313 of file BundleDaemon.cc.
References actions_, and dtn::BundleActions::cancel_bundle().
Referenced by dtnsim::Node::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 238 of file BundleDaemon.cc.
Referenced by handle_bundle_expired().
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 221 of file BundleDaemon.cc.
void dtn::BundleDaemon::get_bundle_stats | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with the current bundle statistics.
Definition at line 167 of file BundleDaemon.cc.
References eventq_, and dtn::BundleEvent::type_str().
void dtn::BundleDaemon::get_daemon_stats | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with the current internal statistics value.
Definition at line 193 of file BundleDaemon.cc.
void dtn::BundleDaemon::get_routing_state | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with current routing info.
Definition at line 159 of file BundleDaemon.cc.
References post().
void dtn::BundleDaemon::handle_bundle_accept | ( | BundleAcceptRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 452 of file BundleDaemon.cc.
References deliver_to_registration().
void dtn::BundleDaemon::handle_bundle_attributes_query | ( | BundleAttributesQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1239 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_bundle_attributes_report | ( | BundleAttributesReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1259 of file BundleDaemon.cc.
References dtn::BundleAttributesQueryRequest::bundle_, and dtn::BundleAttributesQueryRequest::query_id_.
void dtn::BundleDaemon::handle_bundle_cancel | ( | BundleCancelRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1029 of file BundleDaemon.cc.
References dtn::BundleSendRequest::link_.
void dtn::BundleDaemon::handle_bundle_cancelled | ( | BundleSendCancelledEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1062 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_bundle_delete | ( | BundleDeleteRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 440 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), dtn::RegistrationTable::get_matching(), and reg_table_.
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 938 of file BundleDaemon.cc.
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 986 of file BundleDaemon.cc.
References dtn::BundleProtocol::CUSTODY_NO_ADDTL_INFO, generate_custody_signal(), dtn::EndpointID::NULL_EID(), and release_custody().
void dtn::BundleDaemon::handle_bundle_free | ( | BundleFreeEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2354 of file BundleDaemon.cc.
References params_, and dtn::BundleDaemon::Params::suppress_duplicates_.
void dtn::BundleDaemon::handle_bundle_inject | ( | BundleInjectRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1138 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_bundle_query | ( | BundleQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1226 of file BundleDaemon.cc.
References fragmentmgr_, and dtn::FragmentManager::process_for_reassembly().
void dtn::BundleDaemon::handle_bundle_queued_query | ( | BundleQueuedQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1621 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_bundle_queued_report | ( | BundleQueuedReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1639 of file BundleDaemon.cc.
References ASSERT, and dtn::BundleQueuedQueryRequest::link_.
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 465 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_bundle_report | ( | BundleReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1233 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 1006 of file BundleDaemon.cc.
References delete_bundle(), dtn::BundleDaemon::Stats::expired_bundles_, dtn::BundleProtocol::REASON_LIFETIME_EXPIRED, and stats_.
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 764 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_cla_parameters_query | ( | CLAParametersQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1759 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_cla_parameters_report | ( | CLAParametersReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1773 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_cla_set_params | ( | CLASetParamsRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2050 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_contact_down | ( | ContactDownEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1811 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_contact_query | ( | ContactQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1828 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_contact_report | ( | ContactReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1835 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 1782 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_custody_signal | ( | CustodySignalEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1887 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), and dtn::RouteDelEvent::dest_.
void dtn::BundleDaemon::handle_custody_timeout | ( | CustodyTimeoutEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1941 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_eid_reachable_query | ( | EIDReachableQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1649 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_eid_reachable_report | ( | EIDReachableReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1666 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_event | ( | BundleEvent * | event | ) | [protected, virtual] |
Main event handling function.
Implements dtn::BundleEventHandler.
Definition at line 2372 of file BundleDaemon.cc.
References actions_, ASSERT, dtn::Bundle::in_datastore(), dtn::Bundle::lock(), dtn::Bundle::refcount(), and dtn::BundleActions::store_del().
Referenced by dtnsim::Node::process_one_bundle_event(), 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 1733 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_iface_attributes_report | ( | IfaceAttributesReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1750 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_attribute_changed | ( | LinkAttributeChangedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1676 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_attributes_query | ( | LinkAttributesQueryRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1708 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_attributes_report | ( | LinkAttributesReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1724 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_available | ( | LinkAvailableEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1379 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_create | ( | LinkCreateRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1525 of file BundleDaemon.cc.
References dtn::Link::AVAILABLE.
void dtn::BundleDaemon::handle_link_created | ( | LinkCreatedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1352 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_delete | ( | LinkDeleteRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1584 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_deleted | ( | LinkDeletedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1369 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_query | ( | LinkQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1608 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_reconfigure | ( | LinkReconfigureRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1597 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_report | ( | LinkReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1615 of file BundleDaemon.cc.
References dtn::LinkReconfigureRequest::link_.
void dtn::BundleDaemon::handle_link_state_change_request | ( | LinkStateChangeRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1408 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_link_unavailable | ( | LinkUnavailableEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1397 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 1841 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_registration_added | ( | RegistrationAddedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1268 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_registration_delete | ( | RegistrationDeleteRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1344 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_registration_expired | ( | RegistrationExpiredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1316 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_registration_removed | ( | RegistrationRemovedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1299 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_route_add | ( | RouteAddEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1860 of file BundleDaemon.cc.
References dtn::ReassemblyCompletedEvent::bundle_.
void dtn::BundleDaemon::handle_route_del | ( | RouteDelEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1867 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_route_query | ( | RouteQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1874 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_route_report | ( | RouteReportEvent * | 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_shutdown_request | ( | ShutdownRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2005 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_status_request | ( | StatusRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 2058 of file BundleDaemon.cc.
References app_shutdown_data_.
static void dtn::BundleDaemon::init | ( | ) | [inline, static] |
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 2518 of file BundleDaemon.cc.
void dtn::BundleDaemon::load_bundles | ( | ) | [protected] |
Initialize and load in stored bundles.
Definition at line 2436 of file BundleDaemon.cc.
void dtn::BundleDaemon::load_registrations | ( | ) | [protected] |
Initialize and load in the registrations.
Definition at line 2393 of file BundleDaemon.cc.
References contactmgr_, dtn::BundleEvent::daemon_only_, dtn::BundleEventHandler::dispatch_event(), event_handlers_completed(), dtn::BundleDaemon::Stats::events_processed_, dtn::ContactManager::handle_event(), dtn::BundleRouter::handle_event(), dtn::BundleEvent::processed_notifier_, router_, and stats_.
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(), and dtn::StreamConvergenceLayer::Connection::initiate_contact().
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 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 113 of file BundleDaemon.cc.
Referenced by dtn::UDPConvergenceLayer::bundle_queued(), dtn::NullConvergenceLayer::bundle_queued(), dtn::NullConvergenceLayer::cancel_bundle(), dtn::ConnectionConvergenceLayer::cancel_bundle(), dtn::BundleActions::cancel_bundle(), dtn::StreamConvergenceLayer::Connection::check_completed(), dtn::APIClient::close_client(), dtn::ConnectionConvergenceLayer::close_contact(), dtn::FragmentManager::delete_obsoleted_fragments(), dtn::APIRegistration::deliver_bundle(), dtn::AdminRegistration::deliver_bundle(), get_routing_state(), dtn::StreamConvergenceLayer::Connection::handle_ack_segment(), dtn::APIClient::handle_cancel(), dtn::StreamConvergenceLayer::Connection::handle_cancel_bundle(), dtn::APIClient::handle_recv(), dtn::APIClient::handle_session_update(), dtn::APIClient::handle_unbind(), dtn::ConvergenceLayer::is_eid_reachable(), dtn::UDPConvergenceLayer::open_contact(), dtn::NullConvergenceLayer::open_contact(), dtn::UDPConvergenceLayer::Receiver::process_data(), dtn::ConvergenceLayer::query_cla_parameters(), dtn::ConvergenceLayer::query_iface_attributes(), dtn::ConvergenceLayer::query_link_attributes(), dtn::DTLSRRouter::Reg::Reg(), dtn::FileConvergenceLayer::send_bundle(), dtn::ConvergenceLayer::set_cla_parameters(), dtn::OndemandLink::set_initial_state(), dtn::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 127 of file BundleDaemon.cc.
Referenced by 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 120 of file BundleDaemon.cc.
References actions_, BundleActions, eventq_, and dtn::BundleProtocol::init_default_processors().
Referenced by dtn::TableBasedRouter::add_bundle_to_session(), dtn::DTLSRRouter::Reg::deliver_bundle(), dtn::TableBasedRouter::handle_bundle_received(), 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 149 of file BundleDaemon.cc.
References ASSERT.
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().
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 328 of file BundleDaemon.cc.
Referenced by handle_bundle_expired().
void dtn::BundleDaemon::reset_stats | ( | ) |
Reset all internal stats.
Definition at line 206 of file BundleDaemon.cc.
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 2525 of file BundleDaemon.cc.
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::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 2201 of file BundleDaemon.cc.
Referenced by add_to_pending().
friend class BundleActions [friend] |
Definition at line 279 of file BundleDaemon.h.
Referenced by dtnsim::Node::do_init(), and post_at_head().
friend class DaemonIdleExit [friend] |
Definition at line 523 of file BundleDaemon.h.
BundleActions* dtn::BundleDaemon::actions_ [protected] |
The active bundle actions handler.
Definition at line 457 of file BundleDaemon.h.
Referenced by actions(), deliver_to_registration(), dtnsim::Node::do_init(), find_duplicate(), handle_event(), and post_at_head().
AdminRegistration* dtn::BundleDaemon::admin_reg_ [protected] |
The administrative registration.
Definition at line 460 of file BundleDaemon.h.
void* dtn::BundleDaemon::app_shutdown_data_ [protected] |
Application-specific shutdown data.
Definition at line 507 of file BundleDaemon.h.
Referenced by handle_status_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 set_app_shutdown().
ContactManager* dtn::BundleDaemon::contactmgr_ [protected] |
The contact manager.
Definition at line 466 of file BundleDaemon.h.
Referenced by contactmgr(), and load_registrations().
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 custody_bundles(), and deliver_to_registration().
oasys::MsgQueue<BundleEvent*>* dtn::BundleDaemon::eventq_ [protected] |
The event queue.
Reimplemented in dtnsim::Node.
Definition at line 481 of file BundleDaemon.h.
Referenced by event_queue_size(), get_bundle_stats(), and post_at_head().
FragmentManager* dtn::BundleDaemon::fragmentmgr_ [protected] |
The fragmentation / reassembly manager.
Definition at line 469 of file BundleDaemon.h.
Referenced by fragmentmgr(), and handle_bundle_query().
DaemonIdleExit* dtn::BundleDaemon::idle_exit_ [protected] |
Pointer to the idle exit handler (if any).
Definition at line 526 of file BundleDaemon.h.
oasys::Time dtn::BundleDaemon::last_event_ [protected] |
Time value when the last event was handled.
Definition at line 529 of file BundleDaemon.h.
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 check_and_deliver_to_registrations(), local_eid(), and set_local_eid().
Definition at line 233 of file BundleDaemon.h.
Referenced by BundleDaemon(), dtn::ProphetBundleCore::custody_accepted(), handle_bundle_free(), and dtn::ParamCommand::ParamCommand().
BundleList* dtn::BundleDaemon::pending_bundles_ [protected] |
The list of all bundles still pending delivery.
Definition at line 475 of file BundleDaemon.h.
Referenced by pending_bundles().
PingRegistration* dtn::BundleDaemon::ping_reg_ [protected] |
The ping registration.
Definition at line 463 of file BundleDaemon.h.
RegistrationTable* dtn::BundleDaemon::reg_table_ [protected] |
The table of active registrations.
Definition at line 472 of file BundleDaemon.h.
Referenced by check_and_deliver_to_registrations(), handle_bundle_delete(), and reg_table().
BundleRouter* dtn::BundleDaemon::router_ [protected] |
The active bundle router.
Definition at line 454 of file BundleDaemon.h.
Referenced by dtnsim::Node::configure(), load_registrations(), dtnsim::Node::router(), and router().
void* dtn::BundleDaemon::rtr_shutdown_data_ [protected] |
Router-specific shutdown data.
Definition at line 513 of file BundleDaemon.h.
Referenced by set_rtr_shutdown().
ShutdownProc dtn::BundleDaemon::rtr_shutdown_proc_ [protected] |
Router-specific shutdown handler.
Definition at line 510 of file BundleDaemon.h.
Referenced by set_rtr_shutdown().
bool dtn::BundleDaemon::shutting_down_ = false [static, protected] |
Definition at line 516 of file BundleDaemon.h.
Referenced by BundleDaemon(), and shutting_down().
Stats dtn::BundleDaemon::stats_ [protected] |
Stats instance.
Definition at line 501 of file BundleDaemon.h.
Referenced by handle_bundle_send(), and load_registrations().