dtn::BundleDaemon Class Reference

Class that handles the basic event / action mechanism. More...

#include <BundleDaemon.h>

Inheritance diagram for dtn::BundleDaemon:

dtn::BundleEventHandler dtnsim::Node

List of all members.

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.
BundleRouterrouter ()
 Returns the current bundle router.
BundleActionsactions ()
 Return the current actions handler.
ContactManagercontactmgr ()
 Accessor for the contact manager.
FragmentManagerfragmentmgr ()
 Accessor for the fragmentation manager.
const RegistrationTablereg_table ()
 Accessor for the registration table.
BundleListpending_bundles ()
 Accessor for the pending bundles list.
BundleListcustody_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 EndpointIDlocal_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.
Bundlefind_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

BundleRouterrouter_
 The active bundle router.
BundleActionsactions_
 The active bundle actions handler.
AdminRegistrationadmin_reg_
 The administrative registration.
PingRegistrationping_reg_
 The ping registration.
ContactManagercontactmgr_
 The contact manager.
FragmentManagerfragmentmgr_
 The fragmentation / reassembly manager.
RegistrationTablereg_table_
 The table of active registrations.
BundleListpending_bundles_
 The list of all bundles still pending delivery.
BundleListcustody_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.
DaemonIdleExitidle_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


Detailed Description

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.


Member Typedef Documentation

Definition at line 365 of file BundleDaemon.h.

typedef void(* dtn::BundleDaemon::ShutdownProc)(void *args)

Typedef for a shutdown procedure.

Definition at line 366 of file BundleDaemon.h.

Definition at line 367 of file BundleDaemon.h.


Constructor & Destructor Documentation

dtn::BundleDaemon::BundleDaemon (  ) 

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_.


Member Function Documentation

void dtn::BundleDaemon::accept_custody ( Bundle bundle  )  [protected]

BundleActions* dtn::BundleDaemon::actions (  )  [inline]

Return the current actions handler.

Definition at line 141 of file BundleDaemon.h.

References actions_.

bool dtn::BundleDaemon::add_to_pending ( Bundle bundle,
bool  add_to_store 
) [protected]

Add the bundle to the pending list and (optionally) the persistent store, and set up the expiration timer for it.

Returns:
true if the bundle is legal to be delivered and/or forwarded, false if it's already expired

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_.

bool dtn::BundleDaemon::check_local_delivery ( Bundle bundle,
bool  deliver 
) [protected]

Check the registration table and optionally deliver the bundle to any that match.

Returns:
whether or not any matching registrations were found or if the bundle is destined for the local node

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]

bool dtn::BundleDaemon::delete_from_pending ( const BundleRef bundle  )  [protected]

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]

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().

Bundle * dtn::BundleDaemon::find_duplicate ( Bundle bundle  )  [protected]

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]

void dtn::BundleDaemon::generate_status_report ( Bundle bundle,
BundleStatusReport::flag_t  flag,
status_report_reason_t  reason = BundleProtocol::REASON_NO_ADDTL_INFO 
) [protected]

void dtn::BundleDaemon::get_bundle_stats ( oasys::StringBuffer *  buf  ) 

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]

void dtn::BundleDaemon::handle_bundle_attributes_query ( BundleAttributesQueryRequest request  )  [protected, virtual]

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]

void dtn::BundleDaemon::handle_bundle_cancelled ( BundleSendCancelledEvent event  )  [protected, virtual]

void dtn::BundleDaemon::handle_bundle_delete ( BundleDeleteRequest request  )  [protected, virtual]

void dtn::BundleDaemon::handle_bundle_delivered ( BundleDeliveredEvent event  )  [protected, virtual]

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]

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]

void dtn::BundleDaemon::handle_bundle_transmitted ( BundleTransmittedEvent event  )  [protected, virtual]

void dtn::BundleDaemon::handle_cla_parameters_query ( CLAParametersQueryRequest request  )  [protected, virtual]

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]

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]

void dtn::BundleDaemon::handle_custody_timeout ( CustodyTimeoutEvent event  )  [protected, virtual]

void dtn::BundleDaemon::handle_eid_reachable_query ( EIDReachableQueryRequest request  )  [protected, virtual]

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]

void dtn::BundleDaemon::handle_iface_attributes_query ( IfaceAttributesQueryRequest request  )  [protected, virtual]

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]

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]

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]

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]

void dtn::BundleDaemon::handle_registration_added ( RegistrationAddedEvent event  )  [protected, virtual]

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]

void dtn::BundleDaemon::handle_registration_removed ( RegistrationRemovedEvent event  )  [protected, virtual]

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]

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]

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]

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]

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]

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.

References ASSERT, and router_.

void dtn::BundleDaemon::run (  )  [protected]

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().

bool dtn::BundleDaemon::try_to_delete ( const BundleRef bundle  )  [protected]

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().


Friends And Related Function Documentation

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]

Definition at line 523 of file BundleDaemon.h.

Referenced by init_idle_shutdown().


Member Data Documentation

The administrative registration.

Definition at line 460 of file BundleDaemon.h.

Referenced by load_registrations().

Application-specific shutdown data.

Definition at line 507 of file BundleDaemon.h.

Referenced by BundleDaemon(), handle_shutdown_request(), and set_app_shutdown().

Application-specific shutdown handler.

Definition at line 504 of file BundleDaemon.h.

Referenced by BundleDaemon(), handle_shutdown_request(), and set_app_shutdown().

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().

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().

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().

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().

The ping registration.

Definition at line 463 of file BundleDaemon.h.

Referenced by load_registrations().

Router-specific shutdown data.

Definition at line 513 of file BundleDaemon.h.

Referenced by BundleDaemon(), handle_shutdown_request(), and set_rtr_shutdown().

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().


The documentation for this class was generated from the following files:

Generated on Fri Jan 30 09:27:02 2009 for DTN Reference Implementation by  doxygen 1.5.8