IBR-DTN
1.0.0
|
#include <DHTNameService.h>
Public Member Functions | |
DHTNameService () | |
virtual | ~DHTNameService () |
const std::string | getName () const |
void | raiseEvent (const dtn::routing::QueueBundleEvent &evt) throw () |
void | raiseEvent (const dtn::core::NodeEvent &evt) throw () |
void | onUpdateBeacon (const ibrcommon::vinterface &iface, DiscoveryBeacon &beacon) throw (dtn::net::DiscoveryBeaconHandler::NoServiceHereException) |
![]() | |
IndependentComponent () | |
virtual | ~IndependentComponent () |
virtual void | initialize () throw () |
virtual void | startup () throw () |
virtual void | terminate () throw () |
![]() | |
virtual | ~Component ()=0 |
![]() | |
virtual | ~EventReceiver () |
![]() | |
virtual | ~EventReceiver () |
![]() | |
virtual | ~DiscoveryBeaconHandler ()=0 |
virtual void | onAdvertiseBeacon (const ibrcommon::vinterface &iface, const DiscoveryBeacon &beacon) throw () |
Protected Member Functions | |
void | __cancellation () throw () |
void | componentUp () throw () |
void | componentRun () throw () |
void | componentDown () throw () |
![]() | |
void | run () throw () |
This Service provides a Lookup service for node and group EIDs in a bittorrent DHT. It is fully event driven. It provides the following mechanisms: Publishes the own EID to the DHT, also as specific neighbour EIDs. Registers for Routing Events to look up automatically for the embedded EIDs in the DHT Adds the found EID with its Convergence Layers as a Node. Adds routes to the neighbour EIDs of the found EID. Uses IPND to announce the DHT name service to local neighbour nodes.
Definition at line 59 of file DHTNameService.h.
dtn::dht::DHTNameService::DHTNameService | ( | ) |
Definition at line 43 of file DHTNameService.cpp.
|
virtual |
Definition at line 49 of file DHTNameService.cpp.
|
protectedvirtual |
returns true
Implements dtn::daemon::IndependentComponent.
Definition at line 57 of file DHTNameService.cpp.
|
protectedvirtual |
Calls the interrupt pipe to exit the main loop. And so ends up the main loop indirectly
Implements dtn::daemon::IndependentComponent.
Definition at line 440 of file DHTNameService.cpp.
References dtn::core::BundleCore::getDiscoveryAgent(), dtn::core::BundleCore::getInstance(), and dtn::net::DiscoveryAgent::unregisterService().
|
protectedvirtual |
Runs the bootstrapping method and starts the DHT. Executes the main loop with dtn_dht_periodic. After exiting the main loop, the DHT is shut down.
Implements dtn::daemon::IndependentComponent.
Definition at line 193 of file DHTNameService.cpp.
References dtn::core::EventDispatcher< E >::add(), dtn::core::BundleCore::getConnectionManager(), dtn::storage::BundleStorage::getDistinctDestinations(), dtn::daemon::Configuration::getEMail(), dtn::core::BundleCore::getInstance(), dtn::daemon::Configuration::getInstance(), dtn::daemon::Configuration::Network::getInterfaces(), dtn::net::ConnectionManager::getNeighbors(), dtn::daemon::Configuration::getNetwork(), dtn::daemon::Configuration::EMail::getOwnAddress(), dtn::core::BundleCore::getStorage(), dtn::core::BundleCore::local, and dtn::core::EventDispatcher< E >::remove().
|
protectedvirtual |
Reads the configured settings for the DHT and initializes all needed sockets(IPv4&IPv6) for the DHT
Implements dtn::daemon::IndependentComponent.
Definition at line 75 of file DHTNameService.cpp.
References dtn::daemon::Configuration::Network::doForwarding(), dtn::core::BundleCore::getDiscoveryAgent(), dtn::core::BundleCore::getInstance(), dtn::daemon::Configuration::getInstance(), dtn::daemon::Configuration::getNetwork(), and dtn::net::DiscoveryAgent::registerService().
|
virtual |
Returns the name of this Service: "DHT Naming Service"
Implements dtn::daemon::Component.
Definition at line 53 of file DHTNameService.cpp.
|
virtual |
this method updates the given values for discovery service It publishes the port number of the DHT instance
Reimplemented from dtn::net::DiscoveryBeaconHandler.
Definition at line 806 of file DHTNameService.cpp.
|
virtual |
Handles all incomming Events, for which the Service is registered It is registered for this types of events: dtn::routing::QueueBundleEvent dtn::core::NodeEvent
Implements dtn::core::EventReceiver< dtn::routing::QueueBundleEvent >.
Definition at line 571 of file DHTNameService.cpp.
References dtn::core::BundleCore::local.
|
virtual |
Implements dtn::core::EventReceiver< dtn::core::NodeEvent >.
Definition at line 579 of file DHTNameService.cpp.
References dtn::core::Node::getEID(), dtn::core::BundleCore::local, dtn::core::NODE_AVAILABLE, dtn::core::NODE_UNAVAILABLE, and dtn::data::EID::sameHost().