IBR-DTNSuite
0.10
|
#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 |
void | transferTo (dtn::net::BundleTransfer &transfer) throw (P2PDialupException) |
dtn::net::ConnectionManager & | getConnectionManager () |
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) |
![]() | |
IntegratedComponent () | |
virtual | ~IntegratedComponent () |
virtual void | initialize () throw () |
virtual void | startup () throw () |
virtual void | terminate () throw () |
![]() | |
virtual | ~Component ()=0 |
![]() | |
virtual | ~EventReceiver ()=0 |
![]() | |
virtual | ~Validator () |
![]() | |
virtual | ~EventCallback () |
Static Public Member Functions | |
static BundleCore & | getInstance () |
static void | processBlocks (dtn::data::Bundle &b) |
Static Public Attributes | |
static const std::string | TAG = "BundleCore" |
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 63 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 262 of file BundleCore.cpp.
References dtn::routing::StaticRouteChangeEvent::raiseEvent(), and dtn::routing::StaticRouteChangeEvent::ROUTE_ADD.
Referenced by dtn_dht_handle_lookup_result().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 114 of file BundleCore.cpp.
References ibrcommon::LinkManager::getInstance(), ibrcommon::LinkManager::removeEventListener(), and dtn::daemon::IntegratedComponent::terminate().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 102 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 237 of file BundleCore.cpp.
dtn::net::ConnectionManager & dtn::core::BundleCore::getConnectionManager | ( | ) |
Make the connection manager available to other modules.
Definition at line 257 of file BundleCore.cpp.
Referenced by dtn::daemon::NativeDaemon::addConnection(), dtn::net::WifiP2PManager::componentDown(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::net::WifiP2PManager::componentUp(), dtn_dht_handle_lookup_result(), 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::routing::NeighborRoutingExtension::notify(), dtn::routing::FloodRoutingExtension::notify(), dtn::routing::EpidemicRoutingExtension::notify(), dtn::routing::ProphetRoutingExtension::notify(), dtn::net::P2PDialupExtension::P2PDialupExtension(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::net::DiscoveryAgent::received(), dtn::daemon::NativeDaemon::removeConnection(), dtn::api::ExtendedApiHandler::run(), dtn::api::ApiP2PExtensionHandler::setup(), and dtn::net::P2PDialupExtension::~P2PDialupExtension().
|
static |
Definition at line 77 of file BundleCore.cpp.
Referenced by dtn::routing::AcknowledgementSet::add(), dtn::daemon::NativeDaemon::addConnection(), dtn::daemon::CapsuleWorker::callbackBundleReceived(), dtn::daemon::NativeDaemon::clearStorage(), dtn::net::WifiP2PManager::componentDown(), dtn::net::FileConvergenceLayer::componentRun(), dtn::core::FragmentManager::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::net::WifiP2PManager::componentUp(), dtn::api::NativeSession::delivered(), dtn_dht_handle_lookup_result(), 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::routing::RetransmissionExtension::notify(), dtn::routing::NeighborRoutingExtension::notify(), dtn::routing::FloodRoutingExtension::notify(), dtn::routing::EpidemicRoutingExtension::notify(), dtn::routing::ProphetRoutingExtension::notify(), dtn::net::P2PDialupExtension::P2PDialupExtension(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), dtn::daemon::DTNTPWorker::raiseEvent(), raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::api::Registration::receive(), dtn::net::DiscoveryAgent::received(), dtn::daemon::NativeDaemon::removeConnection(), dtn::net::LOWPANConnectionSender::run(), dtn::api::ExtendedApiHandler::run(), dtn::net::DatagramConnection::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(), and dtn::net::P2PDialupExtension::~P2PDialupExtension().
|
virtual |
Implements dtn::daemon::Component.
Definition at line 565 of file BundleCore.cpp.
dtn::routing::BaseRouter & dtn::core::BundleCore::getRouter | ( | ) | const |
Definition at line 209 of file BundleCore.cpp.
dtn::storage::BundleSeeker & dtn::core::BundleCore::getSeeker | ( | ) |
Definition at line 228 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 219 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::routing::RetransmissionExtension::notify(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::HTTPConvergenceLayer::queue(), 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 272 of file BundleCore.cpp.
|
virtual |
Implements dtn::daemon::Configuration::OnChangeListener.
Definition at line 122 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, ibrcommon::LinkManager::removeEventListener(), dtn::utils::Clock::setTimezone(), and TAG.
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 277 of file BundleCore.cpp.
References dtn::data::PrimaryBlock::APPDATA_IS_ADMRECORD, dtn::core::BundlePurgeEvent::bundle, dtn::routing::QueueBundleEvent::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::BundleID::fragment, dtn::data::MetaBundle::get(), dtn::data::PrimaryBlock::get(), dtn::net::TransferCompletedEvent::getBundle(), dtn::net::TransferAbortedEvent::getBundleID(), getInstance(), dtn::data::EID::getNode(), dtn::net::TransferCompletedEvent::getPeer(), dtn::net::TransferAbortedEvent::getPeer(), getStorage(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::data::StatusReportBlock::NO_ADDITIONAL_INFORMATION, dtn::data::StatusReportBlock::NO_KNOWN_ROUTE_TO_DESTINATION_FROM_HERE, ibrcommon::LogLevel::notice, dtn::core::TimeAdjustmentEvent::offset, 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::utils::Clock::setOffset(), dtn::data::PrimaryBlock::source, dtn::data::BundleID::toString(), and dtn::data::Bundle::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 267 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 204 of file BundleCore.cpp.
void dtn::core::BundleCore::setSeeker | ( | dtn::storage::BundleSeeker * | seeker | ) |
Definition at line 199 of file BundleCore.cpp.
void dtn::core::BundleCore::setStorage | ( | dtn::storage::BundleStorage * | storage | ) |
Definition at line 194 of file BundleCore.cpp.
void dtn::core::BundleCore::transferTo | ( | dtn::net::BundleTransfer & | transfer | ) | throw (P2PDialupException) |
Definition at line 242 of file BundleCore.cpp.
References dtn::net::TransferAbortedEvent::REASON_CONNECTION_DOWN.
Referenced by dtn::routing::RetransmissionExtension::notify(), and dtn::routing::RoutingExtension::transferTo().
|
virtual |
Implements dtn::data::Validator.
Definition at line 441 of file BundleCore.cpp.
References forwarding, dtn::utils::Clock::getRating(), dtn::utils::Clock::getTime(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, 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::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 407 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 125 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 131 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 146 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Definition at line 68 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::net::FileConvergenceLayer::componentRun(), dtn::core::FragmentManager::componentRun(), dtn::net::DatagramConvergenceLayer::componentRun(), dtn::net::HTTPConvergenceLayer::componentRun(), dtn::dht::DHTNameService::componentRun(), dtn::security::SecurityManager::decrypt(), dtn::net::ConnectionManager::discovered(), dtn_dht_handle_lookup_result(), dtn::security::SecurityManager::encrypt(), dtn::daemon::NativeDaemon::getLocalUri(), dtn::api::NativeSession::getNodeEID(), dtn::core::AbstractWorker::initialize(), 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::storage::BundleStorage::rejectCustody(), dtn::api::NativeSession::removeEndpoint(), dtn::api::OrderedStreamHandler::run(), dtn::routing::StaticRoutingExtension::run(), dtn::api::BinaryStreamClient::run(), dtn::routing::FloodRoutingExtension::run(), dtn::api::ExtendedApiHandler::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::net::TCPConnection::run(), dtn::net::IPNDAgent::sendAnnoucement(), dtn::net::DatagramConvergenceLayer::sendAnnoucement(), dtn::net::LOWPANConvergenceLayer::sendAnnoucement(), dtn::api::NativeSession::setEndpoint(), 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 152 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 136 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Define the maximum offset for the timestamp of pre-dated bundles
Definition at line 141 of file BundleCore.h.
Referenced by onConfigurationChanged(), and validate().
|
static |
Definition at line 66 of file BundleCore.h.
Referenced by onConfigurationChanged().