IBR-DTNSuite
0.12
|
#include <BaseRouter.h>
Classes | |
class | NoNeighbourFoundException |
class | NoRouteFoundException |
class | RoutingException |
Public Types | |
typedef std::set < RoutingExtension * > | extension_list |
Protected Member Functions | |
virtual void | componentUp () throw () |
virtual void | componentDown () throw () |
Definition at line 50 of file BaseRouter.h.
typedef std::set<RoutingExtension*> dtn::routing::BaseRouter::extension_list |
Definition at line 85 of file BaseRouter.h.
dtn::routing::BaseRouter::BaseRouter | ( | ) |
implementation of the BaseRouter class
Definition at line 62 of file BaseRouter.cpp.
References dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::setRouter().
dtn::routing::BaseRouter::~BaseRouter | ( | ) |
Definition at line 69 of file BaseRouter.cpp.
References clearExtensions(), dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::setRouter().
void dtn::routing::BaseRouter::add | ( | RoutingExtension * | extension) |
Add a routing extension to the routing core.
extension |
Definition at line 82 of file BaseRouter.cpp.
References ibrcommon::RWMutex::LOCK_READWRITE.
void dtn::routing::BaseRouter::clearExtensions | ( | ) |
Delete all extensions
Definition at line 104 of file BaseRouter.cpp.
References ibrcommon::RWMutex::LOCK_READWRITE.
Referenced by ~BaseRouter().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 224 of file BaseRouter.cpp.
References dtn::core::EventDispatcher< E >::remove().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 210 of file BaseRouter.cpp.
References dtn::core::EventDispatcher< E >::add().
void dtn::routing::BaseRouter::doHandshake | ( | const dtn::data::EID & | eid) |
Request a neighbor handshake
eid |
Definition at line 580 of file BaseRouter.cpp.
References dtn::routing::NodeHandshakeExtension::doHandshake().
void dtn::routing::BaseRouter::extensionsDown | ( | ) | ||
throw | ( | |||
) |
disable all extensions
Definition at line 133 of file BaseRouter.cpp.
References dtn::routing::NodeHandshakeExtension::componentDown(), dtn::routing::RetransmissionExtension::componentDown(), dtn::routing::RoutingExtension::componentDown(), and ibrcommon::RWMutex::LOCK_READONLY.
void dtn::routing::BaseRouter::extensionsUp | ( | ) | ||
throw | ( | |||
) |
enable all extensions
Definition at line 117 of file BaseRouter.cpp.
References dtn::routing::NodeHandshakeExtension::componentUp(), dtn::routing::RetransmissionExtension::componentUp(), dtn::routing::RoutingExtension::componentUp(), and ibrcommon::RWMutex::LOCK_READONLY.
bool dtn::routing::BaseRouter::filterKnown | ( | const dtn::data::MetaBundle & | meta) |
check if a bundle is known if the bundle is unkown add it to the known list and return false
id |
Definition at line 611 of file BaseRouter.cpp.
References dtn::data::BundleSet::add(), and dtn::data::BundleSet::has().
ibrcommon::RWMutex & dtn::routing::BaseRouter::getExtensionMutex | ( | ) | ||
throw | ( | |||
) |
Give access to the mutex for the extension list
Definition at line 94 of file BaseRouter.cpp.
Referenced by processHandshake(), requestHandshake(), and responseHandshake().
const BaseRouter::extension_list & dtn::routing::BaseRouter::getExtensions | ( | ) | const |
Returns a reference to all extensions.
Definition at line 99 of file BaseRouter.cpp.
Referenced by processHandshake(), requestHandshake(), and responseHandshake().
const dtn::data::BundleSet dtn::routing::BaseRouter::getKnownBundles | ( | ) |
Get a vector (bloomfilter) of all known bundles.
Definition at line 620 of file BaseRouter.cpp.
|
virtual |
Implements dtn::daemon::Component.
Definition at line 645 of file BaseRouter.cpp.
NeighborDatabase & dtn::routing::BaseRouter::getNeighborDB | ( | ) |
Access to the neighbor database. Where several data about the neighbors is stored.
Definition at line 650 of file BaseRouter.cpp.
const dtn::data::BundleSet dtn::routing::BaseRouter::getPurgedBundles | ( | ) |
Get a vector (bloomfilter) of all purged bundles.
Definition at line 639 of file BaseRouter.cpp.
dtn::storage::BundleSeeker & dtn::routing::BaseRouter::getSeeker | ( | ) |
provides direct access to the bundle seeker
Definition at line 590 of file BaseRouter.cpp.
References dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::getSeeker().
dtn::storage::BundleStorage & dtn::routing::BaseRouter::getStorage | ( | ) |
provides direct access to the bundle storage
Definition at line 585 of file BaseRouter.cpp.
References dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::getStorage().
bool dtn::routing::BaseRouter::isKnown | ( | const dtn::data::BundleID & | id) |
This method returns true, if the given BundleID is known.
id |
Definition at line 602 of file BaseRouter.cpp.
References dtn::data::BundleSet::has().
bool dtn::routing::BaseRouter::isPurged | ( | const dtn::data::BundleID & | id) |
This method returns true, if the given BundleID is purged.
id |
Definition at line 627 of file BaseRouter.cpp.
References dtn::data::BundleSet::has().
void dtn::routing::BaseRouter::processHandshake | ( | const dtn::data::EID & | source, |
NodeHandshake & | answer | ||
) |
Process a completed handshake This method will iterate through all extensions and give each of them a chance to process the completed handshake
Definition at line 150 of file BaseRouter.cpp.
References getExtensionMutex(), getExtensions(), ibrcommon::RWMutex::LOCK_READONLY, dtn::routing::NodeHandshakeExtension::processHandshake(), and dtn::routing::RoutingExtension::processHandshake().
|
virtual |
method to receive new events from the EventSwitch
Implements dtn::core::EventReceiver.
Definition at line 241 of file BaseRouter.cpp.
References dtn::core::BundlePurgeEvent::ACK_RECIEVED, dtn::routing::NeighborDatabase::NeighborEntry::add(), dtn::data::TrackingBlock::append(), dtn::core::BUNDLE_DELETED, dtn::core::BUNDLE_RECEIVED, dtn::net::ConnectionEvent::CONNECTION_UP, dtn::data::MetaBundle::create(), dtn::core::BundlePurgeEvent::DELIVERED, dtn::data::StatusReportBlock::DEPLETED_STORAGE, ibrcommon::LogLevel::error, dtn::data::Bundle::find(), dtn::core::BundleCore::getConnectionManager(), dtn::core::Node::getEID(), dtn::security::SecurityManager::getInstance(), dtn::core::BundleCore::getInstance(), dtn::net::ConnectionManager::getNeighbors(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::data::ScopeControlHopLimitBlock::increment(), dtn::core::BundleCore::local, dtn::core::NODE_AVAILABLE, dtn::core::NODE_DATA_ADDED, dtn::core::NODE_UNAVAILABLE, ibrcommon::LogLevel::notice, dtn::routing::QueueBundleEvent::raise(), dtn::core::BundleEvent::raise(), dtn::net::TransferAbortedEvent::REASON_BUNDLE_DELETED, dtn::net::TransferAbortedEvent::REASON_REFUSED, dtn::routing::NeighborDatabase::NeighborEntry::releaseTransfer(), dtn::security::SecurityManager::verify(), and ibrcommon::Exception::what().
void dtn::routing::BaseRouter::remove | ( | RoutingExtension * | extension) |
Remove a routing extension from the routing core
Definition at line 88 of file BaseRouter.cpp.
References ibrcommon::RWMutex::LOCK_READWRITE.
void dtn::routing::BaseRouter::requestHandshake | ( | const dtn::data::EID & | destination, |
NodeHandshake & | request | ||
) |
Request to a received handshake request This method will iterate through all extensions and ask each of them if they are interested in some sort of routing data of the other peer
Definition at line 190 of file BaseRouter.cpp.
References getExtensionMutex(), getExtensions(), ibrcommon::RWMutex::LOCK_READONLY, dtn::routing::NodeHandshakeExtension::requestHandshake(), and dtn::routing::RoutingExtension::requestHandshake().
void dtn::routing::BaseRouter::responseHandshake | ( | const dtn::data::EID & | source, |
const NodeHandshake & | request, | ||
NodeHandshake & | answer | ||
) |
Respond to a received handshake request This method will iterate through all extensions and give each of them a chance to respond to a received handshake request
Definition at line 170 of file BaseRouter.cpp.
References getExtensionMutex(), getExtensions(), ibrcommon::RWMutex::LOCK_READONLY, dtn::routing::NodeHandshakeExtension::responseHandshake(), and dtn::routing::RoutingExtension::responseHandshake().
void dtn::routing::BaseRouter::setKnown | ( | const dtn::data::MetaBundle & | meta) |
This method add a BundleID to the set of known bundles
id |
Definition at line 595 of file BaseRouter.cpp.
References dtn::data::BundleSet::add().
void dtn::routing::BaseRouter::setPurged | ( | const dtn::data::MetaBundle & | meta) |
Add a bundle to the purge vector of this daemon.
meta | The bundle to purge. |
Definition at line 633 of file BaseRouter.cpp.
References dtn::data::BundleSet::add().