IBR-DTNSuite
0.12
|
#include <BundleCore.h>
Public Member Functions | |
WallClock & | getClock () |
virtual void | onConfigurationChanged (const dtn::daemon::Configuration &conf) throw () |
void | setStorage (dtn::storage::BundleStorage *storage) |
dtn::storage::BundleStorage & | getStorage () |
void | setSeeker (dtn::storage::BundleSeeker *seeker) |
dtn::storage::BundleSeeker & | getSeeker () |
void | setRouter (dtn::routing::BaseRouter *router) |
dtn::routing::BaseRouter & | getRouter () const |
dtn::net::ConnectionManager & | getConnectionManager () |
dtn::net::DiscoveryAgent & | getDiscoveryAgent () |
void | addRoute (const dtn::data::EID &destination, const dtn::data::EID &nexthop, const dtn::data::Timeout timeout=0) |
void | removeRoute (const dtn::data::EID &destination, const dtn::data::EID &nexthop) |
bool | isGloballyConnected () const |
void | raiseEvent (const dtn::core::Event *evt) throw () |
virtual void | validate (const dtn::data::PrimaryBlock &obj) const throw (RejectedException) |
virtual void | validate (const dtn::data::Block &obj, const dtn::data::Number &) const throw (RejectedException) |
virtual void | validate (const dtn::data::PrimaryBlock &bundle, const dtn::data::Block &obj, const dtn::data::Number &) const throw (RejectedException) |
virtual void | validate (const dtn::data::Bundle &obj) const throw (RejectedException) |
virtual void | validate (const dtn::data::MetaBundle &obj) const throw (RejectedException) |
virtual const std::string | getName () const |
void | setGloballyConnected (bool val) |
void | eventNotify (const ibrcommon::LinkEvent &evt) |
Public Member Functions inherited from dtn::daemon::IntegratedComponent | |
IntegratedComponent () | |
virtual | ~IntegratedComponent () |
virtual void | initialize () throw () |
virtual void | startup () throw () |
virtual void | terminate () throw () |
Public Member Functions inherited from dtn::daemon::Component | |
virtual | ~Component ()=0 |
Public Member Functions inherited from dtn::core::EventReceiver | |
virtual | ~EventReceiver ()=0 |
Public Member Functions inherited from dtn::data::Validator | |
virtual | ~Validator () |
Public Member Functions inherited from ibrcommon::LinkManager::EventCallback | |
virtual | ~EventCallback () |
Static Public Member Functions | |
static BundleCore & | getInstance () |
static void | processBlocks (dtn::data::Bundle &b) |
Static Public Attributes | |
static dtn::data::EID | local |
static dtn::data::Length | blocksizelimit = 0 |
static dtn::data::Length | foreign_blocksizelimit = 0 |
static dtn::data::Length | max_lifetime = 0 |
static dtn::data::Length | max_timestamp_future = 0 |
static bool | forwarding = true |
static dtn::data::Size | max_bundles_in_transit = 5 |
Protected Member Functions | |
virtual void | componentUp () throw () |
virtual void | componentDown () throw () |
The BundleCore manage the Bundle Protocol basics
Definition at line 64 of file BundleCore.h.
void dtn::core::BundleCore::addRoute | ( | const dtn::data::EID & | destination, |
const dtn::data::EID & | nexthop, | ||
const dtn::data::Timeout | timeout = 0 |
||
) |
Add a static route to the static routing module.
destination | |
nexthop | |
timeout |
Definition at line 261 of file BundleCore.cpp.
References dtn::routing::StaticRouteChangeEvent::raiseEvent(), and dtn::routing::StaticRouteChangeEvent::ROUTE_ADD.
Referenced by dtn::net::ConnectionManager::add(), and dtn_dht_handle_lookup_result().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 120 of file BundleCore.cpp.
References ibrcommon::LinkManager::getInstance(), ibrcommon::LinkManager::removeEventListener(), and dtn::daemon::IntegratedComponent::terminate().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 99 of file BundleCore.cpp.
References dtn::daemon::Configuration::getInstance(), dtn::daemon::IntegratedComponent::initialize(), onConfigurationChanged(), and dtn::daemon::IntegratedComponent::startup().
|
virtual |
Implements ibrcommon::LinkManager::EventCallback.
Definition at line 606 of file BundleCore.cpp.
References dtn::daemon::Configuration::getInstance(), ibrcommon::LinkEvent::getInterface(), dtn::daemon::Configuration::Network::getInternetDevices(), and dtn::daemon::Configuration::getNetwork().
WallClock & dtn::core::BundleCore::getClock | ( | ) |
Definition at line 246 of file BundleCore.cpp.
dtn::net::ConnectionManager & dtn::core::BundleCore::getConnectionManager | ( | ) |
Make the connection manager available to other modules.
Definition at line 251 of file BundleCore.cpp.
Referenced by dtn::daemon::NativeDaemon::addConnection(), dtn::net::WifiP2PManager::componentDown(), dtn::dht::DHTNameService::componentRun(), dtn::net::WifiP2PManager::componentUp(), dtn_dht_handle_lookup_result(), dtn::routing::NeighborRoutingExtension::eventBundleQueued(), dtn::routing::FloodRoutingExtension::eventBundleQueued(), dtn::routing::EpidemicRoutingExtension::eventBundleQueued(), dtn::routing::ProphetRoutingExtension::eventBundleQueued(), dtn::api::ApiP2PExtensionHandler::finally(), dtn::net::P2PDialupExtension::fireConnected(), dtn::net::P2PDialupExtension::fireDisconnected(), dtn::net::P2PDialupExtension::fireDiscovered(), dtn::daemon::NativeDaemon::getInfo(), dtn::daemon::NativeDaemon::getNeighbors(), dtn::daemon::NativeDaemon::getStats(), dtn::daemon::NativeDaemon::initiateConnection(), dtn::net::DiscoveryAgent::onBeaconReceived(), dtn::net::P2PDialupExtension::P2PDialupExtension(), dtn::routing::RetransmissionExtension::raiseEvent(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::daemon::NativeDaemon::removeConnection(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::api::ApiP2PExtensionHandler::setup(), dtn::routing::RoutingExtension::transferTo(), and dtn::net::P2PDialupExtension::~P2PDialupExtension().
dtn::net::DiscoveryAgent & dtn::core::BundleCore::getDiscoveryAgent | ( | ) |
Make the discovery agent avilable to other modules.
Definition at line 256 of file BundleCore.cpp.
Referenced by dtn::net::IPNDAgent::componentDown(), dtn::net::UDPConvergenceLayer::componentDown(), dtn::net::LOWPANConvergenceLayer::componentDown(), dtn::net::DatagramConvergenceLayer::componentDown(), dtn::net::EMailConvergenceLayer::componentDown(), dtn::dht::DHTNameService::componentDown(), dtn::net::IPNDAgent::componentRun(), dtn::net::LOWPANConvergenceLayer::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::net::IPNDAgent::componentUp(), dtn::net::UDPConvergenceLayer::componentUp(), dtn::net::LOWPANConvergenceLayer::componentUp(), dtn::net::DatagramConvergenceLayer::componentUp(), dtn::net::EMailConvergenceLayer::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::daemon::DTNTPWorker::DTNTPWorker(), dtn::net::IPNDAgent::raiseEvent(), dtn::net::TCPConvergenceLayer::raiseEvent(), dtn::net::DatagramConvergenceLayer::receive(), dtn::daemon::DTNTPWorker::~DTNTPWorker(), and dtn::net::TCPConvergenceLayer::~TCPConvergenceLayer().
|
static |
Definition at line 76 of file BundleCore.cpp.
Referenced by dtn::routing::AcknowledgementSet::add(), dtn::net::ConnectionManager::add(), dtn::daemon::NativeDaemon::addConnection(), dtn::routing::BaseRouter::BaseRouter(), dtn::daemon::CapsuleWorker::callbackBundleReceived(), dtn::daemon::NativeDaemon::clearStorage(), dtn::net::WifiP2PManager::componentDown(), dtn::net::IPNDAgent::componentDown(), dtn::net::UDPConvergenceLayer::componentDown(), dtn::net::LOWPANConvergenceLayer::componentDown(), dtn::net::DatagramConvergenceLayer::componentDown(), dtn::net::EMailConvergenceLayer::componentDown(), dtn::dht::DHTNameService::componentDown(), dtn::net::FileConvergenceLayer::componentRun(), dtn::net::IPNDAgent::componentRun(), dtn::core::FragmentManager::componentRun(), dtn::net::LOWPANConvergenceLayer::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::net::WifiP2PManager::componentUp(), dtn::net::IPNDAgent::componentUp(), dtn::net::UDPConvergenceLayer::componentUp(), dtn::net::LOWPANConvergenceLayer::componentUp(), dtn::net::DatagramConvergenceLayer::componentUp(), dtn::net::EMailConvergenceLayer::componentUp(), dtn::dht::DHTNameService::componentUp(), dtn::api::NativeSession::delivered(), dtn_dht_handle_lookup_result(), dtn::daemon::DTNTPWorker::DTNTPWorker(), dtn::routing::NeighborRoutingExtension::eventBundleQueued(), dtn::routing::FloodRoutingExtension::eventBundleQueued(), dtn::routing::EpidemicRoutingExtension::eventBundleQueued(), dtn::routing::ProphetRoutingExtension::eventBundleQueued(), dtn::net::TCPConnection::eventConnectionUp(), dtn::api::ApiP2PExtensionHandler::finally(), dtn::net::P2PDialupExtension::fireConnected(), dtn::net::P2PDialupExtension::fireDisconnected(), dtn::net::P2PDialupExtension::fireDiscovered(), dtn::api::NativeSession::free(), dtn::routing::NeighborDatabase::get(), dtn::daemon::NativeDaemon::getInfo(), dtn::daemon::NativeDaemon::getNeighbors(), dtn::routing::BaseRouter::getSeeker(), dtn::daemon::NativeDaemon::getStats(), dtn::routing::BaseRouter::getStorage(), dtn::daemon::NativeDaemon::initiateConnection(), dtn::core::Node::isAvailable(), dtn::api::NativeSession::load(), dtn::net::DiscoveryAgent::onBeaconReceived(), dtn::routing::RoutingExtension::operator*(), dtn::net::P2PDialupExtension::P2PDialupExtension(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::routing::RetransmissionExtension::raiseEvent(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::net::IPNDAgent::raiseEvent(), dtn::net::TCPConvergenceLayer::raiseEvent(), raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::net::DatagramConvergenceLayer::receive(), dtn::api::Registration::receive(), dtn::daemon::NativeDaemon::removeConnection(), dtn::net::LOWPANConnectionSender::run(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), dtn::net::DatagramConnection::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::net::LOWPANConnection::run(), dtn::net::DownloadThread::run(), dtn::net::TCPConnection::run(), dtn::daemon::NativeDaemon::setConfigFile(), dtn::core::FragmentManager::setOffset(), dtn::api::ApiP2PExtensionHandler::setup(), dtn::routing::RoutingExtension::transferTo(), dtn::api::BundleStreamBuf::underflow(), dtn::api::Registration::underflow(), dtn::routing::BaseRouter::~BaseRouter(), dtn::daemon::DTNTPWorker::~DTNTPWorker(), dtn::net::P2PDialupExtension::~P2PDialupExtension(), and dtn::net::TCPConvergenceLayer::~TCPConvergenceLayer().
|
virtual |
Implements dtn::daemon::Component.
Definition at line 565 of file BundleCore.cpp.
dtn::routing::BaseRouter & dtn::core::BundleCore::getRouter | ( | ) | const |
Definition at line 218 of file BundleCore.cpp.
Referenced by dtn::routing::RoutingExtension::operator*().
dtn::storage::BundleSeeker & dtn::core::BundleCore::getSeeker | ( | ) |
Definition at line 237 of file BundleCore.cpp.
Referenced by dtn::routing::BaseRouter::getSeeker(), and dtn::api::Registration::underflow().
dtn::storage::BundleStorage & dtn::core::BundleCore::getStorage | ( | ) |
Definition at line 228 of file BundleCore.cpp.
Referenced by dtn::daemon::NativeDaemon::clearStorage(), dtn::net::FileConvergenceLayer::componentRun(), dtn::core::FragmentManager::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::api::NativeSession::delivered(), dtn::api::NativeSession::free(), dtn::daemon::NativeDaemon::getStats(), dtn::routing::BaseRouter::getStorage(), dtn::api::NativeSession::load(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::routing::RetransmissionExtension::raiseEvent(), raiseEvent(), dtn::api::Registration::receive(), dtn::net::LOWPANConnectionSender::run(), dtn::api::ExtendedApiHandler::run(), dtn::core::FragmentManager::setOffset(), and dtn::api::BundleStreamBuf::underflow().
bool dtn::core::BundleCore::isGloballyConnected | ( | ) | const |
Determine if this daemon is globally connected.
Definition at line 271 of file BundleCore.cpp.
|
virtual |
Implements dtn::daemon::Configuration::OnChangeListener.
Definition at line 134 of file BundleCore.cpp.
References ibrcommon::LinkManager::addEventListener(), blocksizelimit, foreign_blocksizelimit, forwarding, ibrcommon::LinkManager::getInstance(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::info, local, max_bundles_in_transit, max_lifetime, max_timestamp_future, and ibrcommon::LinkManager::removeEventListener().
Referenced by componentUp(), and dtn::daemon::NativeDaemon::setConfigFile().
|
static |
Definition at line 570 of file BundleCore.cpp.
References dtn::data::Bundle::begin(), dtn::data::CompressedPayloadBlock::BLOCK_TYPE, dtn::security::PayloadConfidentialBlock::BLOCK_TYPE, dtn::security::SecurityManager::decrypt(), dtn::data::Bundle::end(), dtn::data::CompressedPayloadBlock::extract(), dtn::security::SecurityManager::getInstance(), dtn::data::Block::getType(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::warning, and ibrcommon::Exception::what().
Referenced by dtn::api::NativeSession::load(), dtn::api::ExtendedApiHandler::run(), and dtn::api::BundleStreamBuf::underflow().
|
virtual |
Implements dtn::core::EventReceiver.
Definition at line 276 of file BundleCore.cpp.
References dtn::data::PrimaryBlock::APPDATA_IS_ADMRECORD, dtn::routing::QueueBundleEvent::bundle, dtn::core::BundlePurgeEvent::bundle, dtn::core::BUNDLE_DELETED, dtn::core::BUNDLE_DELIVERED, dtn::data::MetaBundle::destination, dtn::data::StatusReportBlock::DESTINATION_ENDPOINT_ID_UNINTELLIGIBLE, dtn::data::PrimaryBlock::DESTINATION_IS_SINGLETON, dtn::data::Bundle::find(), dtn::data::MetaBundle::get(), dtn::data::PrimaryBlock::get(), dtn::net::TransferCompletedEvent::getBundle(), dtn::net::TransferAbortedEvent::getBundleID(), getInstance(), dtn::net::TransferCompletedEvent::getPeer(), dtn::net::TransferAbortedEvent::getPeer(), getStorage(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::data::MetaBundle::isFragment(), dtn::data::StatusReportBlock::NO_ADDITIONAL_INFORMATION, dtn::core::BundlePurgeEvent::NO_ROUTE_KNOWN, ibrcommon::LogLevel::notice, dtn::data::MetaBundle::procflags, dtn::core::BundlePurgeEvent::raise(), dtn::core::BundleEvent::raise(), dtn::data::CustodySignalBlock::read(), dtn::net::TransferAbortedEvent::reason, dtn::net::TransferAbortedEvent::REASON_REFUSED, dtn::storage::BundleStorage::remove(), dtn::data::EID::sameHost(), dtn::data::BundleID::source, and dtn::data::BundleID::toString().
void dtn::core::BundleCore::removeRoute | ( | const dtn::data::EID & | destination, |
const dtn::data::EID & | nexthop | ||
) |
Remove a static route from the static routing module.
destination | |
nexthop |
Definition at line 266 of file BundleCore.cpp.
References dtn::routing::StaticRouteChangeEvent::raiseEvent(), and dtn::routing::StaticRouteChangeEvent::ROUTE_DEL.
void dtn::core::BundleCore::setGloballyConnected | ( | bool | val) |
Definition at line 614 of file BundleCore.cpp.
References dtn::core::GlobalEvent::GLOBAL_INTERNET_AVAILABLE, dtn::core::GlobalEvent::GLOBAL_INTERNET_UNAVAILABLE, and dtn::core::GlobalEvent::raise().
void dtn::core::BundleCore::setRouter | ( | dtn::routing::BaseRouter * | router) |
Definition at line 213 of file BundleCore.cpp.
Referenced by dtn::routing::BaseRouter::BaseRouter(), and dtn::routing::BaseRouter::~BaseRouter().
void dtn::core::BundleCore::setSeeker | ( | dtn::storage::BundleSeeker * | seeker) |
Definition at line 208 of file BundleCore.cpp.
void dtn::core::BundleCore::setStorage | ( | dtn::storage::BundleStorage * | storage) |
Definition at line 203 of file BundleCore.cpp.
|
virtual |
Implements dtn::data::Validator.
Definition at line 434 of file BundleCore.cpp.
References forwarding, dtn::utils::Clock::getRating(), dtn::utils::Clock::getTime(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::utils::Clock::isExpired(), local, max_lifetime, max_timestamp_future, and ibrcommon::LogLevel::warning.
Referenced by dtn::routing::AcknowledgementSet::add().
|
virtual |
Implements dtn::data::Validator.
Definition at line 480 of file BundleCore.cpp.
References blocksizelimit, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, and ibrcommon::LogLevel::warning.
|
virtual |
Implements dtn::data::Validator.
Definition at line 491 of file BundleCore.cpp.
References blocksizelimit, foreign_blocksizelimit, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, local, and ibrcommon::LogLevel::warning.
|
virtual |
Implements dtn::data::Validator.
Definition at line 518 of file BundleCore.cpp.
References dtn::data::StatusReportBlock::BLOCK_UNINTELLIGIBLE, dtn::core::BUNDLE_RECEIVED, dtn::data::MetaBundle::create(), dtn::data::Block::DELETE_BUNDLE_IF_NOT_PROCESSED, dtn::security::SecurityManager::fastverify(), dtn::data::Block::get(), dtn::security::SecurityManager::getInstance(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::utils::Clock::isExpired(), dtn::core::BundleEvent::raise(), dtn::data::Block::TRANSMIT_STATUSREPORT_IF_NOT_PROCESSED, ibrcommon::LogLevel::warning, and ibrcommon::Exception::what().
|
virtual |
Definition at line 400 of file BundleCore.cpp.
References dtn::utils::Clock::getRating(), dtn::utils::Clock::getTime(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::utils::Clock::isExpired(), max_lifetime, max_timestamp_future, and ibrcommon::LogLevel::warning.
|
static |
Define a global block size limit. This is used in the validator to reject bundles while receiving.
Definition at line 129 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Define a global block size limit for foreign bundles (not addressed locally). This is used in the validator to reject bundles while receiving.
Definition at line 135 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Define if forwarding is allowed. If set to false, this daemon only accepts bundles for local applications.
Definition at line 150 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Definition at line 69 of file BundleCore.h.
Referenced by dtn::storage::BundleStorage::acceptCustody(), dtn::api::NativeSession::addEndpoint(), dtn::routing::DeliveryPredictabilityMap::age(), dtn::security::SecurityManager::auth(), dtn::daemon::DTNTPWorker::callbackBundleReceived(), dtn::core::FragmentManager::componentRun(), dtn::net::HTTPConvergenceLayer::componentRun(), dtn::net::LOWPANConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::security::SecurityManager::decrypt(), dtn::net::ConnectionManager::discovered(), dtn_dht_handle_lookup_result(), dtn::security::SecurityManager::encrypt(), dtn::net::TCPConnection::eventConnectionUp(), dtn::daemon::NativeDaemon::getLocalUri(), dtn::api::NativeSession::getNodeEID(), dtn::net::DiscoveryAgent::obtainBeacon(), dtn::net::DiscoveryAgent::onBeaconReceived(), onConfigurationChanged(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::routing::ProphetRoutingExtension::processHandshake(), dtn::api::Registration::processIncomingBundle(), dtn::routing::ProphetRoutingExtension::ProphetRoutingExtension(), dtn::net::HTTPConvergenceLayer::queue(), dtn::routing::BaseRouter::raiseEvent(), dtn::dht::DHTNameService::raiseEvent(), dtn::net::DatagramConvergenceLayer::receive(), dtn::storage::BundleStorage::rejectCustody(), dtn::api::NativeSession::removeEndpoint(), dtn::api::BinaryStreamClient::run(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::net::TCPConnection::run(), dtn::security::SecurityManager::sign(), dtn::core::FragmentManager::signal(), dtn::routing::DeliveryPredictabilityMap::update(), validate(), and dtn::security::SecurityManager::verifyPIB().
|
static |
Defines how many bundles should be in transit at once
Definition at line 155 of file BundleCore.h.
Referenced by dtn::routing::NeighborDatabase::NeighborEntry::acquireTransfer(), dtn::routing::NeighborDatabase::NeighborEntry::getFreeTransferSlots(), dtn::routing::NeighborDatabase::NeighborEntry::isTransferThresholdReached(), onConfigurationChanged(), and dtn::api::Registration::underflow().
|
static |
Define the maximum lifetime for accepted bundles
Definition at line 140 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Define the maximum offset for the timestamp of pre-dated bundles
Definition at line 145 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().