IBR-DTN  1.0.0
dtn::core::BundleCore Class Reference

#include <BundleCore.h>

Inheritance diagram for dtn::core::BundleCore:
Inheritance graph
Collaboration diagram for dtn::core::BundleCore:
Collaboration graph

Public Member Functions

WallClockgetClock ()
 
virtual void onConfigurationChanged (const dtn::daemon::Configuration &conf) throw ()
 
void setStorage (dtn::storage::BundleStorage *storage)
 
dtn::storage::BundleStoragegetStorage ()
 
void setSeeker (dtn::storage::BundleSeeker *seeker)
 
dtn::storage::BundleSeekergetSeeker ()
 
void setRouter (dtn::routing::BaseRouter *router)
 
dtn::routing::BaseRoutergetRouter () const
 
dtn::net::ConnectionManagergetConnectionManager ()
 
dtn::net::DiscoveryAgentgetDiscoveryAgent ()
 
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::routing::QueueBundleEvent &evt) throw ()
 
void raiseEvent (const dtn::core::BundlePurgeEvent &evt) throw ()
 
void raiseEvent (const dtn::net::TransferCompletedEvent &evt) throw ()
 
void raiseEvent (const dtn::net::TransferAbortedEvent &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)
 
BundleFilter::ACTION filter (BundleFilter::TABLE table, const FilterContext &context, dtn::data::Bundle &bundle) const
 
BundleFilter::ACTION evaluate (BundleFilter::TABLE table, const FilterContext &context) const
 
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::data::Validator
virtual ~Validator ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::routing::QueueBundleEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::core::BundlePurgeEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::net::TransferCompletedEvent >
virtual ~EventReceiver ()
 
- Public Member Functions inherited from dtn::core::EventReceiver< dtn::net::TransferAbortedEvent >
virtual ~EventReceiver ()
 

Static Public Member Functions

static BundleCoregetInstance ()
 
static void processBlocks (dtn::data::Bundle &b)
 
static void inject (const dtn::data::EID &source, dtn::data::Bundle &bundle)
 

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

Detailed Description

The BundleCore manage the Bundle Protocol basics

Definition at line 72 of file BundleCore.h.

Member Function Documentation

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.

Parameters
destination
nexthop
timeout

Definition at line 270 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().

Here is the call graph for this function:

void dtn::core::BundleCore::componentDown ( )
throw (
)
protectedvirtual

Implements dtn::daemon::IntegratedComponent.

Definition at line 126 of file BundleCore.cpp.

References dtn::daemon::IntegratedComponent::terminate().

Here is the call graph for this function:

void dtn::core::BundleCore::componentUp ( )
throw (
)
protectedvirtual
void dtn::core::BundleCore::eventNotify ( const ibrcommon::LinkEvent &  evt)
WallClock & dtn::core::BundleCore::getClock ( )

Definition at line 255 of file BundleCore.cpp.

dtn::net::ConnectionManager & dtn::core::BundleCore::getConnectionManager ( )

Make the connection manager available to other modules.

Returns
The connection manager reference

Definition at line 260 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::routing::BaseRouter::extensionsUp(), 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::daemon::DTNTPWorker::raiseEvent(), dtn::routing::RetransmissionExtension::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::daemon::NativeDaemon::removeConnection(), dtn::api::ExtendedApiHandler::run(), dtn::routing::NeighborRoutingExtension::run(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::api::ApiP2PExtensionHandler::setup(), dtn::routing::RoutingExtension::transferTo(), and dtn::net::P2PDialupExtension::~P2PDialupExtension().

BundleCore & dtn::core::BundleCore::getInstance ( )
static

Definition at line 82 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::UDPConvergenceLayer::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::routing::BaseRouter::extensionsUp(), 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::daemon::DTNTPWorker::raiseEvent(), dtn::routing::RetransmissionExtension::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::NeighborRoutingExtension::run(), dtn::routing::FloodRoutingExtension::run(), dtn::net::DatagramConnection::run(), dtn::routing::StaticRoutingExtension::run(), dtn::routing::EpidemicRoutingExtension::run(), dtn::net::LOWPANConnection::run(), dtn::net::DownloadThread::run(), dtn::net::TCPConnection::run(), dtn::daemon::NativeDaemon::setConfigFile(), dtn::daemon::NativeDaemon::setGloballyConnected(), 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().

const std::string dtn::core::BundleCore::getName ( ) const
virtual
See Also
Component::getName()

Implements dtn::daemon::Component.

Definition at line 636 of file BundleCore.cpp.

dtn::routing::BaseRouter & dtn::core::BundleCore::getRouter ( ) const

Definition at line 227 of file BundleCore.cpp.

Referenced by dtn::routing::RoutingExtension::operator*().

dtn::storage::BundleSeeker & dtn::core::BundleCore::getSeeker ( )
bool dtn::core::BundleCore::isGloballyConnected ( ) const

Determine if this daemon is globally connected.

Returns
True, if the daemon is globally connected.

Definition at line 280 of file BundleCore.cpp.

void dtn::core::BundleCore::onConfigurationChanged ( const dtn::daemon::Configuration conf)
throw (
)
virtual
void dtn::core::BundleCore::raiseEvent ( const dtn::core::BundlePurgeEvent evt)
throw (
)
virtual

Implements dtn::core::EventReceiver< dtn::core::BundlePurgeEvent >.

Definition at line 385 of file BundleCore.cpp.

References getInstance(), getStorage(), and dtn::storage::BundleStorage::remove().

Here is the call graph for this function:

void dtn::core::BundleCore::removeRoute ( const dtn::data::EID destination,
const dtn::data::EID nexthop 
)

Remove a static route from the static routing module.

Parameters
destination
nexthop

Definition at line 275 of file BundleCore.cpp.

References dtn::routing::StaticRouteChangeEvent::raiseEvent(), and dtn::routing::StaticRouteChangeEvent::ROUTE_DEL.

Here is the call graph for this function:

void dtn::core::BundleCore::setGloballyConnected ( bool  val)
void dtn::core::BundleCore::setRouter ( dtn::routing::BaseRouter router)
void dtn::core::BundleCore::setSeeker ( dtn::storage::BundleSeeker seeker)

Definition at line 217 of file BundleCore.cpp.

void dtn::core::BundleCore::setStorage ( dtn::storage::BundleStorage storage)

Definition at line 212 of file BundleCore.cpp.

void dtn::core::BundleCore::validate ( const dtn::data::Block obj,
const dtn::data::Number size 
) const
throw (RejectedException
)
virtual

Implements dtn::data::Validator.

Definition at line 498 of file BundleCore.cpp.

References dtn::core::BundleFilter::ACCEPT, blocksizelimit, and dtn::core::FilterContext::setBlock().

Here is the call graph for this function:

void dtn::core::BundleCore::validate ( const dtn::data::PrimaryBlock bundle,
const dtn::data::Block obj,
const dtn::data::Number size 
) const
throw (RejectedException
)
virtual
void dtn::core::BundleCore::validate ( const dtn::data::MetaBundle obj) const
throw (RejectedException
)
virtual

Member Data Documentation

dtn::data::Length dtn::core::BundleCore::blocksizelimit = 0
static

Define a global block size limit. This is used in the validator to reject bundles while receiving.

Definition at line 153 of file BundleCore.h.

Referenced by onConfigurationChanged(), and validate().

dtn::data::Length dtn::core::BundleCore::foreign_blocksizelimit = 0
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 159 of file BundleCore.h.

Referenced by onConfigurationChanged(), and validate().

bool dtn::core::BundleCore::forwarding = true
static

Define if forwarding is allowed. If set to false, this daemon only accepts bundles for local applications.

Definition at line 174 of file BundleCore.h.

Referenced by onConfigurationChanged(), and validate().

dtn::data::EID dtn::core::BundleCore::local
static

Definition at line 79 of file BundleCore.h.

Referenced by dtn::storage::BundleStorage::acceptCustody(), dtn::api::NativeSession::addEndpoint(), dtn::routing::DeliveryPredictabilityMap::age(), dtn::security::SecurityManager::auth(), dtn::security::NoneProtocol::begin(), dtn::security::HashProtocol::begin(), dtn::security::JPAKEProtocol::begin(), dtn::daemon::DTNTPWorker::callbackBundleReceived(), dtn::security::KeyExchanger::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(), inject(), dtn::net::DiscoveryAgent::obtainBeacon(), dtn::net::DiscoveryAgent::onBeaconReceived(), dtn::security::SecurityKeyManager::onConfigurationChanged(), onConfigurationChanged(), dtn::routing::NodeHandshakeExtension::processHandshake(), dtn::routing::ProphetRoutingExtension::processHandshake(), dtn::routing::ProphetRoutingExtension::ProphetRoutingExtension(), dtn::net::HTTPConvergenceLayer::queue(), dtn::core::FragmentManager::raiseEvent(), 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::security::NoneProtocol::step(), dtn::security::HashProtocol::step(), dtn::security::JPAKEProtocol::step(), dtn::security::DHProtocol::step(), dtn::security::KeyExchanger::submit(), dtn::core::AbstractWorker::transmit(), dtn::routing::DeliveryPredictabilityMap::update(), validate(), and dtn::security::SecurityManager::verifyIntegrity().

dtn::data::Length dtn::core::BundleCore::max_lifetime = 0
static

Define the maximum lifetime for accepted bundles

Definition at line 164 of file BundleCore.h.

Referenced by onConfigurationChanged(), and validate().

dtn::data::Length dtn::core::BundleCore::max_timestamp_future = 0
static

Define the maximum offset for the timestamp of pre-dated bundles

Definition at line 169 of file BundleCore.h.

Referenced by onConfigurationChanged(), and validate().


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