IBR-DTNSuite
0.12
|
#include <ConnectionManager.h>
Classes | |
class | ShutdownException |
Public Member Functions | |
ConnectionManager () | |
virtual | ~ConnectionManager () |
void | add (const dtn::core::Node &n) |
void | remove (const dtn::core::Node &n) |
void | add (ConvergenceLayer *cl) |
void | remove (ConvergenceLayer *cl) |
void | add (P2PDialupExtension *ext) |
void | remove (P2PDialupExtension *ext) |
void | queue (dtn::net::BundleTransfer &job) |
void | raiseEvent (const dtn::core::Event *evt) throw () |
void | open (const dtn::core::Node &node) throw (ibrcommon::Exception) |
const std::set< dtn::core::Node > | getNeighbors () |
bool | isNeighbor (const dtn::core::Node &) |
const dtn::core::Node | getNeighbor (const dtn::data::EID &eid) throw (NeighborNotAvailableException) |
void | updateNeighbor (const dtn::core::Node &n) |
virtual const std::string | getName () const |
void | getStats (dtn::net::ConvergenceLayer::stats_data &data) |
void | resetStats () |
Public Member Functions inherited from dtn::core::EventReceiver | |
virtual | ~EventReceiver ()=0 |
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 |
Protected Member Functions | |
void | discovered (const dtn::core::Node &node) |
virtual void | componentUp () throw () |
virtual void | componentDown () throw () |
Definition at line 56 of file ConnectionManager.h.
dtn::net::ConnectionManager::ConnectionManager | ( | ) |
Definition at line 55 of file ConnectionManager.cpp.
|
virtual |
Definition at line 60 of file ConnectionManager.cpp.
void dtn::net::ConnectionManager::add | ( | const dtn::core::Node & | n) |
Definition at line 181 of file ConnectionManager.cpp.
References dtn::core::Node::add(), dtn::core::BundleCore::addRoute(), dtn::core::Node::get(), dtn::core::Node::getAll(), dtn::core::Node::getEID(), dtn::core::BundleCore::getInstance(), dtn::data::EID::getScheme(), dtn::utils::Clock::getTime(), dtn::core::Node::has(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::core::Node::isAnnounced(), dtn::core::Node::isAvailable(), dtn::core::NODE_AVAILABLE, dtn::core::NODE_DATA_ADDED, dtn::core::NodeEvent::raise(), dtn::core::Node::remove(), dtn::core::Node::setAnnounced(), dtn::core::Node::size(), and updateNeighbor().
Referenced by dtn::daemon::NativeDaemon::addConnection(), dtn::net::WifiP2PManager::componentUp(), discovered(), dtn_dht_handle_lookup_result(), dtn::net::P2PDialupExtension::fireConnected(), dtn::net::P2PDialupExtension::fireDiscovered(), dtn::net::P2PDialupExtension::P2PDialupExtension(), and dtn::api::ApiP2PExtensionHandler::setup().
void dtn::net::ConnectionManager::add | ( | ConvergenceLayer * | cl) |
Add a convergence layer
Definition at line 263 of file ConnectionManager.cpp.
void dtn::net::ConnectionManager::add | ( | P2PDialupExtension * | ext) |
Add a p2p dial-up extension
Definition at line 295 of file ConnectionManager.cpp.
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 80 of file ConnectionManager.cpp.
References dtn::core::EventDispatcher< E >::remove().
|
protectedvirtual |
Implements dtn::daemon::IntegratedComponent.
Definition at line 64 of file ConnectionManager.cpp.
References dtn::core::EventDispatcher< E >::add(), dtn::daemon::Configuration::Network::getAutoConnect(), dtn::daemon::Configuration::getInstance(), dtn::daemon::Configuration::getNetwork(), and dtn::utils::Clock::getTime().
|
protected |
trigger for periodical discovery of nodes
node |
Definition at line 307 of file ConnectionManager.cpp.
References add(), dtn::core::Node::getEID(), and dtn::core::BundleCore::local.
Referenced by updateNeighbor().
|
virtual |
Implements dtn::daemon::Component.
Definition at line 575 of file ConnectionManager.cpp.
const dtn::core::Node dtn::net::ConnectionManager::getNeighbor | ( | const dtn::data::EID & | eid) | ||
throw | ( | NeighborNotAvailableException | |||
) |
Get the neighbor with the given EID.
dtn::net::NeighborNotAvailableException | if the neighbor is not available. |
eid | The EID of the neighbor. |
Definition at line 550 of file ConnectionManager.cpp.
References dtn::core::Node::isAvailable().
Referenced by dtn::daemon::NativeDaemon::getInfo(), and dtn::daemon::NativeDaemon::initiateConnection().
const std::set< dtn::core::Node > dtn::net::ConnectionManager::getNeighbors | ( | ) |
get a set with all neighbors
Definition at line 535 of file ConnectionManager.cpp.
References dtn::core::Node::isAvailable().
Referenced by dtn::dht::DHTNameService::componentRun(), dtn::routing::NeighborRoutingExtension::eventBundleQueued(), dtn::routing::FloodRoutingExtension::eventBundleQueued(), dtn::routing::EpidemicRoutingExtension::eventBundleQueued(), dtn::routing::ProphetRoutingExtension::eventBundleQueued(), dtn::daemon::NativeDaemon::getNeighbors(), dtn::daemon::NativeDaemon::getStats(), dtn::daemon::DTNTPWorker::raiseEvent(), dtn::routing::BaseRouter::raiseEvent(), dtn::api::ExtendedApiHandler::run(), dtn::routing::FloodRoutingExtension::run(), and dtn::routing::EpidemicRoutingExtension::run().
void dtn::net::ConnectionManager::getStats | ( | dtn::net::ConvergenceLayer::stats_data & | data) |
Returns statistic data about all convergence-layers
Definition at line 275 of file ConnectionManager.cpp.
References dtn::net::ConvergenceLayer::getStats().
Referenced by dtn::daemon::NativeDaemon::getStats().
bool dtn::net::ConnectionManager::isNeighbor | ( | const dtn::core::Node & | node) |
Checks if a node is already known as neighbor.
@return |
Definition at line 559 of file ConnectionManager.cpp.
References dtn::core::Node::getEID(), and dtn::core::Node::isAvailable().
Referenced by dtn_dht_handle_lookup_result().
void dtn::net::ConnectionManager::open | ( | const dtn::core::Node & | node) | ||
throw | ( | ibrcommon::Exception | |||
) |
Definition at line 410 of file ConnectionManager.cpp.
References dtn::net::ConvergenceLayer::getDiscoveryProtocol(), and dtn::net::ConvergenceLayer::open().
Referenced by dtn::daemon::NativeDaemon::initiateConnection().
void dtn::net::ConnectionManager::queue | ( | dtn::net::BundleTransfer & | job) |
queue a bundle for transmission
Definition at line 499 of file ConnectionManager.cpp.
References dtn::net::BundleTransfer::abort(), dtn::net::BundleTransfer::getNeighbor(), dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_LEVEL, and dtn::net::TransferAbortedEvent::REASON_CONNECTION_DOWN.
Referenced by dtn::routing::RetransmissionExtension::raiseEvent(), and dtn::routing::RoutingExtension::transferTo().
|
virtual |
method to receive new events from the EventSwitch
Implements dtn::core::EventReceiver.
Definition at line 102 of file ConnectionManager.cpp.
References dtn::net::ConnectionEvent::CONNECTION_DOWN, dtn::net::ConnectionEvent::CONNECTION_UP, dtn::core::Node::doConnectImmediately(), dtn::core::TimeEvent::getAction(), dtn::core::NodeEvent::getAction(), dtn::core::GlobalEvent::getAction(), dtn::core::NodeEvent::getNode(), dtn::net::ConnectionEvent::getNode(), dtn::net::ConnectionEvent::getState(), dtn::core::NODE_AVAILABLE, and dtn::core::TIME_SECOND_TICK.
void dtn::net::ConnectionManager::remove | ( | const dtn::core::Node & | n) |
Definition at line 243 of file ConnectionManager.cpp.
References dtn::core::Node::getEID(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::core::NODE_DATA_REMOVED, dtn::core::NodeEvent::raise(), and dtn::core::Node::size().
Referenced by dtn::net::WifiP2PManager::componentDown(), dtn::api::ApiP2PExtensionHandler::finally(), dtn::net::P2PDialupExtension::fireDisconnected(), dtn::daemon::NativeDaemon::removeConnection(), and dtn::net::P2PDialupExtension::~P2PDialupExtension().
void dtn::net::ConnectionManager::remove | ( | ConvergenceLayer * | cl) |
Remove a convergence layer
Definition at line 269 of file ConnectionManager.cpp.
void dtn::net::ConnectionManager::remove | ( | P2PDialupExtension * | ext) |
Remove a p2p dial-up extension
Definition at line 301 of file ConnectionManager.cpp.
void dtn::net::ConnectionManager::resetStats | ( | ) |
Definition at line 285 of file ConnectionManager.cpp.
References dtn::net::ConvergenceLayer::resetStats().
void dtn::net::ConnectionManager::updateNeighbor | ( | const dtn::core::Node & | n) |
Add collected data about a neighbor to the neighbor database.
n | The node object of the neighbor |
Definition at line 570 of file ConnectionManager.cpp.
References discovered().
Referenced by add(), and dtn::net::DiscoveryAgent::onBeaconReceived().