#include <BundleDaemon.h>
Inheritance diagram for dtn::BundleDaemon:
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 53 of file BundleDaemon.h.
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 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. | |
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 bool | is_simulator () |
Accessor for the simulator bit. | |
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, status_report_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 (Bundle *bundle) |
Remove the bundle from the pending list and data store, and cancel the expiration timer. | |
bool | try_delete_from_pending (Bundle *bundle) |
Check if we should delete this bundle, called once it's been transmitted or delivered at least once. | |
bool | delete_bundle (Bundle *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. | |
void | check_registrations (Bundle *bundle) |
Check the registration table and 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_transmit_failed (BundleTransmitFailedEvent *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_inject (BundleInjectRequest *event) |
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_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_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_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_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. | |
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. | |
Static Protected Attributes | |
static bool | shutting_down_ |
static bool | is_simulator_ |
Friends | |
class | BundleActions |
Classes | |
struct | Params |
General daemon parameters. More... | |
struct | Stats |
Statistics structure definition. More... |
typedef void(*) dtn::BundleDaemon::ShutdownProc(void *args) |
typedef BundleProtocol::custody_signal_reason_t dtn::BundleDaemon::custody_signal_reason_t [protected] |
Definition at line 316 of file BundleDaemon.h.
typedef BundleProtocol::status_report_flag_t dtn::BundleDaemon::status_report_flag_t [protected] |
Definition at line 317 of file BundleDaemon.h.
typedef BundleProtocol::status_report_reason_t dtn::BundleDaemon::status_report_reason_t [protected] |
Definition at line 318 of file BundleDaemon.h.
dtn::BundleDaemon::BundleDaemon | ( | ) |
Constructor.
Definition at line 61 of file BundleDaemon.cc.
References app_shutdown_data_, app_shutdown_proc_, dtn::EndpointID::assign(), contactmgr_, custody_bundles_, fragmentmgr_, local_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 88 of file BundleDaemon.cc.
References actions_, contactmgr_, custody_bundles_, eventq_, fragmentmgr_, pending_bundles_, reg_table_, and router_.
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 104 of file BundleDaemon.cc.
References actions_, BundleActions, eventq_, dtn::BundleProtocol::init_default_processors(), and oasys::Logger::logpath_.
static void dtn::BundleDaemon::init | ( | ) | [inline, static] |
Boot time initializer.
Definition at line 78 of file BundleDaemon.h.
References BundleDaemon().
Referenced by dtn::DTNServer::init_components().
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 114 of file BundleDaemon.cc.
Referenced by dtn::ContactManager::add_link(), dtn::CLConnection::break_contact(), dtn::StreamConvergenceLayer::Connection::check_completed(), dtn::CLConnection::close_contact(), dtn::APIClient::close_session(), dtn::CLConnection::contact_up(), dtn::ContactManager::del_link(), dtn::PingRegistration::deliver_bundle(), dtn::LoggingRegistration::deliver_bundle(), dtn::LinkStateRouter::LSRegistration::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::Connection::handle_ack_segment(), dtn::TableBasedRouter::handle_link_created(), dtn::APIClient::handle_recv(), dtn::LinkStateRouter::LSRegistration::LSRegistration(), dtn::UDPConvergenceLayer::open_contact(), dtn::NullConvergenceLayer::open_contact(), post_and_wait(), dtn::FragmentManager::proactively_fragment(), dtn::UDPConvergenceLayer::Receiver::process_data(), dtn::ContactManager::reopen_link(), dtn::UDPConvergenceLayer::send_bundle(), dtn::NullConvergenceLayer::send_bundle(), dtn::FileConvergenceLayer::send_bundle(), dtn::OndemandLink::set_initial_state(), dtn::AlwaysOnLink::set_initial_state(), dtn::Registration::ExpirationTimer::timeout(), and dtn::CustodyTimer::timeout().
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 121 of file BundleDaemon.cc.
Referenced by dtn::StreamConvergenceLayer::Connection::check_keepalive(), dtn::CLConnection::check_unblock_link(), handle_bundle_query(), handle_contact_query(), handle_link_query(), handle_link_state_change_request(), handle_reassembly_completed(), handle_route_query(), post_and_wait(), dtn::FragmentManager::process_for_reassembly(), dtn::ExpirationTimer::timeout(), and dtn::FragmentManager::try_to_reactively_fragment().
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 128 of file BundleDaemon.cc.
References ASSERT, post(), post_at_head(), dtn::BundleEvent::processed_notifier_, oasys::Thread::start_barrier_enabled(), and oasys::Notifier::wait().
Referenced by 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_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 150 of file BundleDaemon.cc.
References eventq_, log_debug, and dtn::BundleEvent::type_str().
BundleRouter* dtn::BundleDaemon::router | ( | ) | [inline] |
Returns the current bundle router.
Reimplemented in dtnsim::Node.
Definition at line 118 of file BundleDaemon.h.
BundleActions* dtn::BundleDaemon::actions | ( | ) | [inline] |
Return the current actions handler.
Definition at line 127 of file BundleDaemon.h.
References actions_.
Referenced by dtnsim::GlueNode::forward_event().
ContactManager* dtn::BundleDaemon::contactmgr | ( | ) | [inline] |
Accessor for the contact manager.
Definition at line 132 of file BundleDaemon.h.
References contactmgr_.
Referenced by dtnsim::Node::process(), dtn::LinkStateChangeRequest::serialize(), dtn::LinkReportEvent::serialize(), and dtn::ContactReportEvent::serialize().
FragmentManager* dtn::BundleDaemon::fragmentmgr | ( | ) | [inline] |
Accessor for the fragmentation manager.
Definition at line 137 of file BundleDaemon.h.
References fragmentmgr_.
const RegistrationTable* dtn::BundleDaemon::reg_table | ( | ) | [inline] |
Accessor for the registration table.
Definition at line 142 of file BundleDaemon.h.
References reg_table_.
BundleList* dtn::BundleDaemon::pending_bundles | ( | ) | [inline] |
Accessor for the pending bundles list.
Definition at line 147 of file BundleDaemon.h.
References pending_bundles_.
Referenced by get_bundle_stats(), and dtn::BundleReportEvent::serialize().
BundleList* dtn::BundleDaemon::custody_bundles | ( | ) | [inline] |
Accessor for the custody bundles list.
Definition at line 152 of file BundleDaemon.h.
References custody_bundles_.
Referenced by get_bundle_stats(), and dtn::BundleReportEvent::serialize().
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 contactmgr_, dtn::ContactManager::dump(), dtn::BundleRouter::get_routing_state(), and router_.
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 oasys::StringBuffer::appendf(), dtn::BundleDaemon::Stats::bundles_delivered_, dtn::BundleDaemon::Stats::bundles_expired_, dtn::BundleDaemon::Stats::bundles_generated_, dtn::BundleDaemon::Stats::bundles_received_, dtn::BundleDaemon::Stats::bundles_transmitted_, custody_bundles(), dtn::BundleDaemon::Stats::duplicate_bundles_, pending_bundles(), and stats_.
void dtn::BundleDaemon::get_daemon_stats | ( | oasys::StringBuffer * | buf | ) |
Format the given StringBuffer with the current internal statistics value.
Definition at line 189 of file BundleDaemon.cc.
References oasys::StringBuffer::appendf(), eventq_, dtn::BundleDaemon::Stats::events_processed_, and stats_.
void dtn::BundleDaemon::reset_stats | ( | ) |
Reset all internal stats.
Definition at line 199 of file BundleDaemon.cc.
References contactmgr_, ExamineDump::l, dtn::ContactManager::links(), dtn::ContactManager::lock(), and stats_.
const EndpointID& dtn::BundleDaemon::local_eid | ( | ) | [inline] |
Return the local endpoint identifier.
Definition at line 179 of file BundleDaemon.h.
References local_eid_.
Referenced by dtnsim::NodeCommand::exec(), dtn::StreamConvergenceLayer::Connection::initiate_contact(), and load_registrations().
void dtn::BundleDaemon::set_local_eid | ( | const char * | eid_str | ) | [inline] |
Set the local endpoint id.
Definition at line 184 of file BundleDaemon.h.
References dtn::EndpointID::assign(), and local_eid_.
Referenced by dtnsim::NodeCommand::exec().
void dtn::BundleDaemon::set_app_shutdown | ( | ShutdownProc | proc, | |
void * | data | |||
) | [inline] |
Set an application-specific shutdown handler.
Definition at line 222 of file BundleDaemon.h.
References app_shutdown_data_, and app_shutdown_proc_.
void dtn::BundleDaemon::set_rtr_shutdown | ( | ShutdownProc | proc, | |
void * | data | |||
) | [inline] |
Set a router-specific shutdown handler.
Definition at line 231 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 240 of file BundleDaemon.h.
References shutting_down_.
Referenced by dtn::StreamConvergenceLayer::Connection::handle_poll_timeout().
static bool dtn::BundleDaemon::is_simulator | ( | ) | [inline, static] |
Accessor for the simulator bit.
Definition at line 248 of file BundleDaemon.h.
References is_simulator_.
void dtn::BundleDaemon::load_registrations | ( | ) | [protected] |
Initialize and load in the registrations.
Definition at line 1683 of file BundleDaemon.cc.
References admin_reg_, dtn::EndpointID::append_service_tag(), dtn::EVENTSRC_ADMIN, dtn::EVENTSRC_STORE, oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::get(), handle_event(), dtn::RegistrationStore::instance(), local_eid(), log_crit, log_err, oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::new_iterator(), and ping_reg_.
Referenced by run().
void dtn::BundleDaemon::load_bundles | ( | ) | [protected] |
Initialize and load in stored bundles.
Definition at line 1726 of file BundleDaemon.cc.
References oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::iterator::begin(), oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::iterator::cur_val(), dtn::Bundle::durable_size(), dtn::EVENTSRC_STORE, dtn::BundleStore::get(), handle_event(), log_err, log_notice, oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::iterator::more(), dtn::BundleStore::new_iterator(), oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::iterator::next(), and dtn::BundleStore::set_total_size().
Referenced by run().
void dtn::BundleDaemon::run | ( | ) | [protected, virtual] |
Main thread function that dispatches events.
Implements oasys::Thread.
Definition at line 1763 of file BundleDaemon.cc.
References ASSERT, dtn::BundleTimestamp::check_local_clock(), dtn::BundleRouter::config_, dtn::BundleRouter::create_router(), oasys::Time::elapsed_ms(), eventq_, oasys::Time::get_time(), handle_event(), dtn::BundleRouter::initialize(), oasys::IOTIMEOUT, load_bundles(), load_registrations(), log_debug, log_err, log_warn, oasys::TimerSystem::notifier(), oasys::IO::poll_multiple(), router_, oasys::TimerSystem::run_expired_timers(), oasys::Thread::should_stop(), and dtn::BundleEvent::type_str().
void dtn::BundleDaemon::handle_event | ( | BundleEvent * | event | ) | [protected, virtual] |
Main event handling function.
Implements dtn::BundleEventHandler.
Definition at line 1664 of file BundleDaemon.cc.
References contactmgr_, dtn::BundleEvent::daemon_only_, dtn::BundleEventHandler::dispatch_event(), dtn::BundleDaemon::Stats::events_processed_, dtn::ContactManager::handle_event(), dtn::BundleRouter::handle_event(), oasys::Notifier::notify(), dtn::BundleEvent::processed_notifier_, router_, and stats_.
Referenced by generate_custody_signal(), generate_status_report(), load_bundles(), load_registrations(), dtnsim::Node::process_bundle_events(), and run().
void dtn::BundleDaemon::handle_bundle_received | ( | BundleReceivedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 399 of file BundleDaemon.cc.
References accept_custody(), dtn::BundleDaemon::Params::accept_custody_, add_to_pending(), oasys::StringBuffer::appendf(), ASSERT, dtn::Bundle::bundleid_, dtn::BundleReceivedEvent::bundleref_, dtn::BundleDaemon::Stats::bundles_generated_, dtn::BundleDaemon::Stats::bundles_received_, dtn::BundleReceivedEvent::bytes_received_, dtn::EndpointID::c_str(), oasys::StringBuffer::c_str(), check_registrations(), dtn::Bundle::creation_ts_, custody_bundles_, dtn::BundleProtocol::CUSTODY_REDUNDANT_RECEPTION, dtn::Bundle::custody_requested_, dtn::BundleEvent::daemon_only_, delete_bundle(), dtn::Bundle::dest_, dtn::BundleDaemon::Stats::duplicate_bundles_, dtn::EVENTSRC_ADMIN, dtn::EVENTSRC_APP, dtn::EVENTSRC_FRAGMENTATION, dtn::EVENTSRC_PEER, dtn::EVENTSRC_STORE, dtn::Bundle::expiration_, find_duplicate(), dtn::Bundle::format_verbose(), fragmentmgr_, generate_custody_signal(), generate_status_report(), dtn::BundleTimestamp::get_current_time(), is_simulator_, dtn::Bundle::local_custody_, oasys::LOG_DEBUG, oasys::Logger::log_enabled(), log_info, oasys::Logger::log_multiline(), log_notice, log_warn, NOTREACHED, oasys::Ref< _Type >::object(), params_, dtn::BundleProtocol::payload_offset(), dtn::BundleList::push_back(), dtn::BundleProtocol::REASON_NO_ADDTL_INFO, dtn::Bundle::receive_rcpt_, dtn::Bundle::recv_blocks_, dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::Bundle::source_, dtn::BundleReceivedEvent::source_, stats_, dtn::BundleProtocol::STATUS_RECEIVED, dtn::FragmentManager::try_to_convert_to_fragment(), and dtn::BundleProtocol::validate().
void dtn::BundleDaemon::handle_bundle_transmitted | ( | BundleTransmittedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 584 of file BundleDaemon.cc.
References ASSERT, dtn::Bundle::bundleid_, dtn::BundleTransmittedEvent::bundleref_, dtn::BundleDaemon::Stats::bundles_transmitted_, dtn::BundleTransmittedEvent::bytes_sent_, dtn::ForwardingInfo::custody_timer_, dtn::Bundle::custody_timers_, dtn::LinkBlockSet::delete_blocks(), dtn::LinkBlockSet::find_blocks(), dtn::Bundle::forward_rcpt_, fragmentmgr_, dtn::Bundle::fwdlog_, generate_status_report(), dtn::ForwardingLog::get_latest_entry(), dtn::Link::is_reliable(), dtn::BundleTransmittedEvent::link_, dtn::Bundle::local_custody_, log_info, dtn::Link::name(), dtn::Link::nexthop(), oasys::Ref< _Type >::object(), params_, dtn::BundleProtocol::payload_offset(), dtn::Link::reliable_, dtn::BundleTransmittedEvent::reliably_sent_, dtn::BundleDaemon::Params::retry_reliable_unacked_, dtn::ForwardingInfo::state_, dtn::Link::stats(), stats_, dtn::BundleProtocol::STATUS_FORWARDED, dtn::ForwardingInfo::timestamp_, dtn::BundleProtocol::total_length(), dtn::ForwardingInfo::TRANSMIT_FAILED, dtn::ForwardingInfo::TRANSMITTED, try_delete_from_pending(), dtn::FragmentManager::try_to_reactively_fragment(), dtn::ForwardingLog::update(), and dtn::Bundle::xmit_blocks_.
void dtn::BundleDaemon::handle_bundle_transmit_failed | ( | BundleTransmitFailedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 711 of file BundleDaemon.cc.
References dtn::Bundle::bundleid_, dtn::BundleTransmitFailedEvent::bundleref_, dtn::BundleTransmitFailedEvent::contact_, dtn::LinkBlockSet::delete_blocks(), dtn::Bundle::fwdlog_, dtn::BundleTransmitFailedEvent::link_, log_info, oasys::Ref< _Type >::object(), dtn::ForwardingInfo::TRANSMIT_FAILED, dtn::ForwardingLog::update(), and dtn::Bundle::xmit_blocks_.
void dtn::BundleDaemon::handle_bundle_delivered | ( | BundleDeliveredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 740 of file BundleDaemon.cc.
References dtn::Bundle::bundleid_, dtn::BundleDeliveredEvent::bundleref_, dtn::BundleDaemon::Stats::bundles_delivered_, dtn::EndpointID::c_str(), dtn::Bundle::custodian_, dtn::BundleProtocol::CUSTODY_NO_ADDTL_INFO, dtn::Bundle::custody_requested_, dtn::Bundle::delivery_rcpt_, dtn::Registration::endpoint(), dtn::EndpointID::equals(), generate_custody_signal(), generate_status_report(), dtn::BundlePayload::length(), dtn::Bundle::local_custody_, log_info, dtn::EndpointID::NULL_EID(), oasys::Ref< _Type >::object(), dtn::Bundle::payload_, dtn::Registration::regid(), dtn::BundleDeliveredEvent::registration_, release_custody(), stats_, dtn::BundleProtocol::STATUS_DELIVERED, and try_delete_from_pending().
void dtn::BundleDaemon::handle_bundle_expired | ( | BundleExpiredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 795 of file BundleDaemon.cc.
References dtn::BundleExpiredEvent::bundleref_, dtn::BundleDaemon::Stats::bundles_expired_, delete_bundle(), log_info, oasys::Ref< _Type >::object(), 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 1647 of file BundleDaemon.cc.
References actions_, ASSERT, dtn::BundleFreeEvent::bundle_, dtn::Bundle::in_datastore_, oasys::SpinLock::lock(), dtn::Bundle::lock_, dtn::Bundle::refcount(), and dtn::BundleActions::store_del().
void dtn::BundleDaemon::handle_bundle_send | ( | BundleSendRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 816 of file BundleDaemon.cc.
References dtn::BundleSendRequest::action_, actions_, dtn::BundleSendRequest::bundleid_, contactmgr_, custody_bundles_, dtn::CustodyTimerSpec::defaults_, dtn::BundleList::find(), dtn::ContactManager::find_link(), dtn::ForwardingInfo::INVALID_ACTION, dtn::BundleSendRequest::link_, oasys::Ref< _Type >::object(), pending_bundles_, and dtn::BundleActions::send_bundle().
void dtn::BundleDaemon::handle_bundle_cancel | ( | BundleCancelRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 850 of file BundleDaemon.cc.
References actions_, dtn::BundleCancelRequest::bundleid_, dtn::BundleActions::cancel_bundle(), contactmgr_, custody_bundles_, dtn::BundleList::find(), dtn::ContactManager::find_link(), dtn::BundleCancelRequest::link_, oasys::Ref< _Type >::object(), and pending_bundles_.
void dtn::BundleDaemon::handle_bundle_inject | ( | BundleInjectRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 878 of file BundleDaemon.cc.
References dtn::BundleInjectRequest::action_, actions_, dtn::EndpointID::assign(), contactmgr_, dtn::BundleInjectRequest::custodian_, dtn::Bundle::custodian_, dtn::CustodyTimerSpec::defaults_, dtn::BundleInjectRequest::dest_, dtn::Bundle::dest_, dtn::Bundle::expiration_, dtn::BundleInjectRequest::expiration_, dtn::ContactManager::find_link(), dtn::BundleInjectRequest::link_, dtn::EndpointID::NULL_EID(), dtn::Bundle::payload_, dtn::BundleInjectRequest::payload_, dtn::BundleInjectRequest::priority_, dtn::Bundle::priority_, dtn::BundleInjectRequest::replyto_, dtn::Bundle::replyto_, dtn::BundleActions::send_bundle(), dtn::BundlePayload::set_data(), dtn::Bundle::source_, and dtn::BundleInjectRequest::src_.
void dtn::BundleDaemon::handle_bundle_accept | ( | BundleAcceptRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 386 of file BundleDaemon.cc.
References dtn::BundleRouter::accept_bundle(), dtn::BundleAcceptRequest::bundle_, log_info, oasys::Ref< _Type >::object(), dtn::BundleAcceptRequest::reason_, dtn::BundleStatusReport::reason_to_str(), dtn::BundleAcceptRequest::result_, and router_.
void dtn::BundleDaemon::handle_bundle_query | ( | BundleQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 928 of file BundleDaemon.cc.
References post_at_head().
void dtn::BundleDaemon::handle_bundle_report | ( | BundleReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 935 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 941 of file BundleDaemon.cc.
References dtn::RegistrationTable::add(), dtn::BundleList::begin(), dtn::EndpointID::c_str(), deliver_to_registration(), dtn::BundleList::end(), dtn::Registration::endpoint(), dtn::EVENTSRC_APP, ExamineDump::l, dtn::BundleList::lock(), log_err, log_info, dtn::EndpointIDPattern::match(), pending_bundles_, reg_table_, dtn::Registration::regid(), dtn::RegistrationAddedEvent::registration_, and dtn::RegistrationAddedEvent::source_.
void dtn::BundleDaemon::handle_registration_removed | ( | RegistrationRemovedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 972 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), dtn::RegistrationTable::del(), dtn::Registration::endpoint(), log_err, log_info, reg_table_, dtn::Registration::regid(), and dtn::RegistrationRemovedEvent::registration_.
void dtn::BundleDaemon::handle_registration_expired | ( | RegistrationExpiredEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 989 of file BundleDaemon.cc.
References dtn::Registration::active(), dtn::RegistrationTable::del(), dtn::RegistrationTable::get(), log_err, log_info, reg_table_, dtn::Registration::regid(), dtn::RegistrationExpiredEvent::regid_, and dtn::Registration::set_expired().
void dtn::BundleDaemon::handle_contact_up | ( | ContactUpEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1181 of file BundleDaemon.cc.
References dtn::Link::contact(), dtn::ContactUpEvent::contact_, contactmgr_, ExamineDump::l, dtn::ContactManager::lock(), log_info, oasys::Ref< _Type >::object(), dtn::Link::OPEN, dtn::Link::set_state(), and dtn::Link::stats_.
void dtn::BundleDaemon::handle_contact_down | ( | ContactDownEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1203 of file BundleDaemon.cc.
References dtn::ContactDownEvent::contact_, log_info, oasys::Ref< _Type >::object(), dtn::ContactEvent::reason_, 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 1218 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 1225 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 1016 of file BundleDaemon.cc.
References ASSERT, dtn::Link::isavailable(), dtn::LinkAvailableEvent::link_, and log_info.
void dtn::BundleDaemon::handle_link_unavailable | ( | LinkUnavailableEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1026 of file BundleDaemon.cc.
References ASSERT, dtn::Link::isavailable(), dtn::LinkUnavailableEvent::link_, and log_info.
void dtn::BundleDaemon::handle_link_state_change_request | ( | LinkStateChangeRequest * | request | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1036 of file BundleDaemon.cc.
References actions_, ASSERT, dtn::Link::AVAILABLE, dtn::Link::BUSY, dtn::BundleActions::close_link(), dtn::Link::CLOSED, dtn::Link::contact(), dtn::LinkStateChangeRequest::contact_, contactmgr_, dtn::ContactEvent::IDLE, ExamineDump::l, dtn::LinkStateChangeRequest::link_, dtn::ContactManager::lock(), log_err, log_info, log_warn, oasys::Ref< _Type >::object(), 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::Link::set_state(), dtn::Link::state(), dtn::LinkStateChangeRequest::state_, dtn::Link::state_to_str(), dtn::Link::UNAVAILABLE, and dtn::ContactEvent::UNBLOCKED.
void dtn::BundleDaemon::handle_link_create | ( | LinkCreateRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1161 of file BundleDaemon.cc.
References NOTIMPLEMENTED.
void dtn::BundleDaemon::handle_link_query | ( | LinkQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1168 of file BundleDaemon.cc.
References post_at_head().
void dtn::BundleDaemon::handle_link_report | ( | LinkReportEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1175 of file BundleDaemon.cc.
void dtn::BundleDaemon::handle_reassembly_completed | ( | ReassemblyCompletedEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1231 of file BundleDaemon.cc.
References dtn::ReassemblyCompletedEvent::bundle_, dtn::EVENTSRC_FRAGMENTATION, dtn::ReassemblyCompletedEvent::fragments_, log_info, oasys::Ref< _Type >::object(), dtn::BundleList::pop_front(), post_at_head(), and try_delete_from_pending().
void dtn::BundleDaemon::handle_route_add | ( | RouteAddEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1250 of file BundleDaemon.cc.
References dtn::RouteAddEvent::entry_, and log_info.
void dtn::BundleDaemon::handle_route_del | ( | RouteDelEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1257 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), dtn::RouteDelEvent::dest_, and log_info.
void dtn::BundleDaemon::handle_route_query | ( | RouteQueryRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1264 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 1271 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 1277 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), custody_bundles_, dtn::BundleProtocol::CUSTODY_REDUNDANT_RECEPTION, dtn::CustodySignalEvent::data_, dtn::BundleList::find(), log_info, log_notice, log_warn, dtn::CustodySignal::data_t::orig_creation_tv_, dtn::CustodySignal::data_t::orig_source_eid_, dtn::CustodySignal::data_t::reason_, dtn::CustodySignal::reason_to_str(), release_custody(), dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::CustodySignal::data_t::succeeded_, and try_delete_from_pending().
void dtn::BundleDaemon::handle_custody_timeout | ( | CustodyTimeoutEvent * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1322 of file BundleDaemon.cc.
References ASSERT, dtn::CustodyTimeoutEvent::bundle_, oasys::Timer::cancelled(), dtn::BundleList::contains(), dtn::ForwardingInfo::CUSTODY_TIMEOUT, dtn::Bundle::custody_timers_, dtn::Bundle::fwdlog_, ExamineDump::l, dtn::CustodyTimer::link_, dtn::CustodyTimeoutEvent::link_, dtn::Bundle::lock_, log_err, log_info, dtn::Link::nexthop(), oasys::Ref< _Type >::object(), oasys::Timer::pending(), pending_bundles_, and dtn::ForwardingLog::update().
void dtn::BundleDaemon::handle_shutdown_request | ( | ShutdownRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1385 of file BundleDaemon.cc.
References app_shutdown_data_, app_shutdown_proc_, dtn::Link::close(), contactmgr_, dtn::Link::isopen(), ExamineDump::l, dtn::ContactManager::links(), dtn::ContactManager::lock(), log_debug, log_notice, rtr_shutdown_data_, rtr_shutdown_proc_, oasys::Thread::set_should_stop(), and shutting_down_.
void dtn::BundleDaemon::handle_status_request | ( | StatusRequest * | event | ) | [protected, virtual] |
Event type specific handlers.
Reimplemented from dtn::BundleEventHandler.
Definition at line 1428 of file BundleDaemon.cc.
References log_info.
void dtn::BundleDaemon::generate_status_report | ( | Bundle * | bundle, | |
status_report_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 214 of file BundleDaemon.cc.
References dtn::BundleStatusReport::create_status_report(), dtn::EVENTSRC_ADMIN, handle_event(), local_eid_, and log_debug.
Referenced by accept_custody(), delete_bundle(), handle_bundle_delivered(), handle_bundle_received(), and handle_bundle_transmitted().
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 231 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_, log_err, and dtn::EndpointID::NULL_EID().
Referenced by accept_custody(), handle_bundle_delivered(), and handle_bundle_received().
void dtn::BundleDaemon::cancel_custody_timers | ( | Bundle * | bundle | ) | [protected] |
Cancel any pending custody timers for the bundle.
Definition at line 256 of file BundleDaemon.cc.
References dtn::Bundle::custody_timers_, ExamineDump::l, dtn::Bundle::lock_, and log_crit.
Referenced by release_custody().
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 280 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_, log_err, log_info, dtn::EndpointID::NULL_EID(), dtn::BundleList::push_back(), dtn::BundleProtocol::STATUS_CUSTODY_ACCEPTED, and dtn::BundleActions::store_update().
Referenced by handle_bundle_received().
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 320 of file BundleDaemon.cc.
References actions_, dtn::EndpointID::assign(), cancel_custody_timers(), dtn::Bundle::custodian_, custody_bundles_, dtn::BundleList::erase(), dtn::Bundle::local_custody_, log_err, log_info, dtn::EndpointID::NULL_EID(), and dtn::BundleActions::store_update().
Referenced by delete_bundle(), handle_bundle_delivered(), and handle_custody_signal().
Add the bundle to the pending list and (optionally) the persistent store, and set up the expiration timer for it.
Definition at line 1436 of file BundleDaemon.cc.
References actions_, dtn::Bundle::bundleid_, dtn::Bundle::creation_ts_, dtn::Bundle::expiration_, dtn::Bundle::expiration_timer_, dtnsim::gettimeofday(), dtn::Bundle::in_datastore_, log_debug, log_warn, pending_bundles_, dtn::BundleList::push_back(), oasys::Timer::schedule_at(), dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, dtn::BundleActions::store_add(), and dtn::BundleTimestamp::TIMEVAL_CONVERSION.
Referenced by handle_bundle_received().
Remove the bundle from the pending list and data store, and cancel the expiration timer.
Definition at line 1489 of file BundleDaemon.cc.
References dtn::Bundle::bundleid_, dtn::ExpirationTimer::bundleref_, oasys::Timer::cancel(), dtn::BundleList::erase(), dtn::Bundle::expiration_timer_, log_crit, log_debug, log_err, pending_bundles_, and oasys::Ref< _Type >::release().
Referenced by delete_bundle(), and try_delete_from_pending().
Check if we should delete this bundle, called once it's been transmitted or delivered at least once.
If so, call delete_from_pending.
Definition at line 1520 of file BundleDaemon.cc.
References delete_from_pending(), dtn::BundleDaemon::Params::early_deletion_, dtn::Bundle::expiration_timer_, dtn::Bundle::fwdlog_, dtn::ForwardingLog::get_count(), dtn::ForwardingInfo::IN_FLIGHT, dtn::Bundle::is_queued_on(), log_debug, log_err, dtn::Bundle::num_mappings(), params_, and pending_bundles_.
Referenced by handle_bundle_delivered(), handle_bundle_transmitted(), handle_custody_signal(), and handle_reassembly_completed().
bool dtn::BundleDaemon::delete_bundle | ( | Bundle * | 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 1582 of file BundleDaemon.cc.
References dtn::FragmentManager::delete_fragment(), delete_from_pending(), dtn::Bundle::deletion_rcpt_, fragmentmgr_, generate_status_report(), dtn::Bundle::is_fragment_, dtn::Bundle::is_queued_on(), dtn::Bundle::local_custody_, pending_bundles_, dtn::BundleProtocol::REASON_NO_ADDTL_INFO, release_custody(), and dtn::BundleProtocol::STATUS_DELETED.
Referenced by handle_bundle_expired(), and handle_bundle_received().
Check if there are any bundles in the pending queue that match the source id, timestamp, and fragmentation offset/length fields.
Definition at line 1619 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_, ExamineDump::l, dtn::BundlePayload::length(), dtn::BundleList::lock(), dtn::Bundle::orig_length_, dtn::Bundle::payload_, pending_bundles_, dtn::BundleTimestamp::seconds_, dtn::BundleTimestamp::seqno_, and dtn::Bundle::source_.
Referenced by handle_bundle_received().
void dtn::BundleDaemon::deliver_to_registration | ( | Bundle * | bundle, | |
Registration * | registration | |||
) | [protected] |
Deliver the bundle to the given registration.
Definition at line 341 of file BundleDaemon.cc.
References dtn::EndpointID::c_str(), dtn::Registration::deliver_bundle(), dtn::Registration::endpoint(), fragmentmgr_, dtn::Bundle::is_fragment_, log_debug, dtn::Bundle::owner_, dtn::FragmentManager::process_for_reassembly(), and dtn::Registration::regid().
Referenced by check_registrations(), and handle_registration_added().
void dtn::BundleDaemon::check_registrations | ( | Bundle * | bundle | ) | [protected] |
Check the registration table and deliver the bundle to any that match.
Definition at line 367 of file BundleDaemon.cc.
References deliver_to_registration(), dtn::Bundle::dest_, dtn::RegistrationTable::get_matching(), log_debug, and reg_table_.
Referenced by handle_bundle_received().
friend class BundleActions [friend] |
Definition at line 212 of file BundleDaemon.h.
Referenced by handle_bundle_received(), handle_bundle_transmitted(), dtn::ParamCommand::ParamCommand(), and try_delete_from_pending().
BundleRouter* dtn::BundleDaemon::router_ [protected] |
The active bundle router.
Reimplemented in dtnsim::GlueNode.
Definition at line 402 of file BundleDaemon.h.
Referenced by BundleDaemon(), dtnsim::Node::do_init(), get_routing_state(), handle_bundle_accept(), handle_event(), dtnsim::Node::router(), router(), run(), and ~BundleDaemon().
BundleActions* dtn::BundleDaemon::actions_ [protected] |
The active bundle actions handler.
Definition at line 405 of file BundleDaemon.h.
Referenced by accept_custody(), actions(), add_to_pending(), dtnsim::Node::do_init(), do_init(), handle_bundle_cancel(), handle_bundle_free(), handle_bundle_inject(), handle_bundle_send(), handle_link_state_change_request(), release_custody(), and ~BundleDaemon().
AdminRegistration* dtn::BundleDaemon::admin_reg_ [protected] |
The administrative registration.
Definition at line 408 of file BundleDaemon.h.
Referenced by load_registrations().
PingRegistration* dtn::BundleDaemon::ping_reg_ [protected] |
The ping registration.
Definition at line 411 of file BundleDaemon.h.
Referenced by load_registrations().
ContactManager* dtn::BundleDaemon::contactmgr_ [protected] |
The contact manager.
Definition at line 414 of file BundleDaemon.h.
Referenced by BundleDaemon(), contactmgr(), get_routing_state(), handle_bundle_cancel(), handle_bundle_inject(), handle_bundle_send(), handle_contact_up(), handle_event(), handle_link_state_change_request(), handle_shutdown_request(), dtnsim::Node::process(), reset_stats(), and ~BundleDaemon().
FragmentManager* dtn::BundleDaemon::fragmentmgr_ [protected] |
The fragmentation / reassembly manager.
Definition at line 417 of file BundleDaemon.h.
Referenced by BundleDaemon(), delete_bundle(), deliver_to_registration(), fragmentmgr(), handle_bundle_received(), handle_bundle_transmitted(), and ~BundleDaemon().
RegistrationTable* dtn::BundleDaemon::reg_table_ [protected] |
The table of active registrations.
Definition at line 420 of file BundleDaemon.h.
Referenced by BundleDaemon(), check_registrations(), handle_registration_added(), handle_registration_expired(), handle_registration_removed(), reg_table(), and ~BundleDaemon().
BundleList* dtn::BundleDaemon::pending_bundles_ [protected] |
The list of all bundles still pending delivery.
Definition at line 423 of file BundleDaemon.h.
Referenced by add_to_pending(), BundleDaemon(), delete_bundle(), delete_from_pending(), find_duplicate(), handle_bundle_cancel(), handle_bundle_send(), handle_custody_timeout(), handle_registration_added(), pending_bundles(), try_delete_from_pending(), and ~BundleDaemon().
BundleList* dtn::BundleDaemon::custody_bundles_ [protected] |
The list of all bundles that we have custody of.
Definition at line 426 of file BundleDaemon.h.
Referenced by accept_custody(), BundleDaemon(), custody_bundles(), handle_bundle_cancel(), handle_bundle_received(), handle_bundle_send(), handle_custody_signal(), release_custody(), and ~BundleDaemon().
oasys::MsgQueue<BundleEvent*>* dtn::BundleDaemon::eventq_ [protected] |
The event queue.
Reimplemented in dtnsim::Node.
Definition at line 429 of file BundleDaemon.h.
Referenced by do_init(), get_daemon_stats(), post_event(), run(), and ~BundleDaemon().
EndpointID dtn::BundleDaemon::local_eid_ [protected] |
The default endpoint id for reaching this daemon, used for bundle status reports, routing, etc.
Definition at line 433 of file BundleDaemon.h.
Referenced by accept_custody(), BundleDaemon(), generate_custody_signal(), generate_status_report(), local_eid(), and set_local_eid().
Stats dtn::BundleDaemon::stats_ [protected] |
Stats instance.
Definition at line 447 of file BundleDaemon.h.
Referenced by BundleDaemon(), get_bundle_stats(), get_daemon_stats(), handle_bundle_delivered(), handle_bundle_expired(), handle_bundle_received(), handle_bundle_transmitted(), handle_event(), and reset_stats().
ShutdownProc dtn::BundleDaemon::app_shutdown_proc_ [protected] |
Application-specific shutdown handler.
Definition at line 450 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_app_shutdown().
void* dtn::BundleDaemon::app_shutdown_data_ [protected] |
Application-specific shutdown data.
Definition at line 453 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_app_shutdown().
ShutdownProc dtn::BundleDaemon::rtr_shutdown_proc_ [protected] |
Router-specific shutdown handler.
Definition at line 456 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_rtr_shutdown().
void* dtn::BundleDaemon::rtr_shutdown_data_ [protected] |
Router-specific shutdown data.
Definition at line 459 of file BundleDaemon.h.
Referenced by BundleDaemon(), handle_shutdown_request(), and set_rtr_shutdown().
bool dtn::BundleDaemon::shutting_down_ [static, protected] |
Definition at line 462 of file BundleDaemon.h.
Referenced by handle_shutdown_request(), and shutting_down().
bool dtn::BundleDaemon::is_simulator_ [static, protected] |
Definition at line 465 of file BundleDaemon.h.
Referenced by handle_bundle_received(), and is_simulator().