|
IBR-DTNSuite
0.10
|
#include <IPNDAgent.h>


Public Member Functions | |
| IPNDAgent (int port) | |
| virtual | ~IPNDAgent () |
| void | add (const ibrcommon::vaddress &address) |
| void | bind (const ibrcommon::vinterface &net) |
| virtual const std::string | getName () const |
| void | eventNotify (const ibrcommon::LinkEvent &evt) |
| void | raiseEvent (const Event *evt) throw () |
Public Member Functions inherited from dtn::net::DiscoveryAgent | |
| DiscoveryAgent (const dtn::daemon::Configuration::Discovery &config) | |
| virtual | ~DiscoveryAgent ()=0 |
| void | received (const dtn::data::EID &source, const std::list< DiscoveryService > &services, const dtn::data::Number &timeout=0) |
| void | addService (dtn::net::DiscoveryServiceProvider *provider) |
Public Member Functions inherited from dtn::core::EventReceiver | |
| virtual | ~EventReceiver ()=0 |
Public Member Functions inherited from dtn::daemon::IndependentComponent | |
| IndependentComponent () | |
| virtual | ~IndependentComponent () |
| 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 ibrcommon::LinkManager::EventCallback | |
| virtual | ~EventCallback () |
Static Public Attributes | |
| static const std::string | TAG = "IPNDAgent" |
Protected Member Functions | |
| void | sendAnnoucement (const uint16_t &sn, std::list< dtn::net::DiscoveryServiceProvider * > &provider) |
| virtual void | componentRun () throw () |
| virtual void | componentUp () throw () |
| virtual void | componentDown () throw () |
| void | __cancellation () throw () |
Protected Member Functions inherited from dtn::net::DiscoveryAgent | |
| void | timeout () |
Protected Member Functions inherited from dtn::daemon::IndependentComponent | |
| void | run () throw () |
Protected Member Functions inherited from ibrcommon::JoinableThread | |
| virtual | ~JoinableThread ()=0 |
| void | join (void) throw (ThreadException) |
| bool | isRunning (void) |
| void | start (int priority=0) throw (ThreadException) |
| void | stop () throw () |
| JoinableThread (size_t size=DEFAULT_STACKSIZE) | |
Additional Inherited Members | |
Protected Attributes inherited from dtn::net::DiscoveryAgent | |
| const dtn::daemon::Configuration::Discovery & | _config |
Definition at line 45 of file IPNDAgent.h.
| dtn::net::IPNDAgent::IPNDAgent | ( | int | port | ) |
Definition at line 48 of file IPNDAgent.cpp.
References dtn::net::DiscoveryAgent::_config, ibrcommon::vsocket::add(), dtn::net::DiscoveryAnnouncement::DISCO_VERSION_00, dtn::net::DiscoveryAnnouncement::DISCO_VERSION_01, dtn::net::DiscoveryAnnouncement::DTND_IPDISCOVERY, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::info, and dtn::daemon::Configuration::Discovery::version().

|
virtual |
Definition at line 72 of file IPNDAgent.cpp.
References ibrcommon::vsocket::destroy().

|
protectedvirtual |
This method is called after componentDown() and should should guarantee that blocking calls in componentRun() will unblock.
Implements dtn::daemon::IndependentComponent.
Definition at line 535 of file IPNDAgent.cpp.
References ibrcommon::vsocket::down().

| void dtn::net::IPNDAgent::add | ( | const ibrcommon::vaddress & | address | ) |
Definition at line 78 of file IPNDAgent.cpp.
References IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::info, and ibrcommon::vaddress::toString().

| void dtn::net::IPNDAgent::bind | ( | const ibrcommon::vinterface & | net | ) |
Definition at line 83 of file IPNDAgent.cpp.
References IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::info, and ibrcommon::vinterface::toString().

|
protectedvirtual |
This method is called if the component should stop. Clean-up code should be inserted here.
Implements dtn::daemon::IndependentComponent.
Definition at line 414 of file IPNDAgent.cpp.
References ibrcommon::vsocket::destroy(), ibrcommon::vsocket::down(), ibrcommon::LinkManager::getInstance(), ibrcommon::JoinableThread::join(), dtn::core::EventDispatcher< E >::remove(), ibrcommon::LinkManager::removeEventListener(), and ibrcommon::JoinableThread::stop().

|
protectedvirtual |
This is the run method. The component should loop in there until componentDown() or __cancellation() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 435 of file IPNDAgent.cpp.
References ibrcommon::vaddress::address(), ibrcommon::TimeMeasurement::getMilliseconds(), dtn::net::DiscoveryService::getName(), dtn::net::DiscoveryService::getParameters(), dtn::net::DiscoveryAgent::received(), ibrcommon::datagramsocket::recvfrom(), ibrcommon::vsocket::select(), ibrcommon::TimeMeasurement::start(), ibrcommon::TimeMeasurement::stop(), dtn::net::DiscoveryAgent::timeout(), and ibrcommon::Thread::yield().

|
protectedvirtual |
Is called in preparation of the component. Before componentRun() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 368 of file IPNDAgent.cpp.
References dtn::core::EventDispatcher< E >::add(), ibrcommon::LinkManager::addEventListener(), ibrcommon::LogLevel::error, ibrcommon::LinkManager::getInstance(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, TAG, ibrcommon::vsocket::up(), and ibrcommon::Exception::what().

|
virtual |
Implements ibrcommon::LinkManager::EventCallback.
Definition at line 309 of file IPNDAgent.cpp.
References ibrcommon::LinkEvent::ACTION_ADDRESS_ADDED, ibrcommon::LinkEvent::ACTION_ADDRESS_REMOVED, ibrcommon::LinkEvent::ACTION_LINK_DOWN, ibrcommon::vsocket::add(), ibrcommon::vaddress::address(), ibrcommon::udpsocket::down(), ibrcommon::vsocket::get(), ibrcommon::udpsocket::get_address(), ibrcommon::LinkEvent::getAction(), ibrcommon::LinkEvent::getAddress(), ibrcommon::LinkEvent::getInterface(), ibrcommon::vsocket::remove(), and ibrcommon::udpsocket::up().

|
virtual |
Implements dtn::daemon::Component.
Definition at line 541 of file IPNDAgent.cpp.
|
virtual |
Implements dtn::core::EventReceiver.
Definition at line 249 of file IPNDAgent.cpp.
References ibrcommon::LinkManager::addEventListener(), ibrcommon::LinkManager::getInstance(), dtn::net::P2PDialupEvent::iface, dtn::net::P2PDialupEvent::INTERFACE_DOWN, dtn::net::P2PDialupEvent::INTERFACE_UP, ibrcommon::LinkManager::removeEventListener(), and dtn::net::P2PDialupEvent::type.

|
protectedvirtual |
Implements dtn::net::DiscoveryAgent.
Definition at line 166 of file IPNDAgent.cpp.
References dtn::net::DiscoveryAgent::_config, dtn::net::DiscoveryAnnouncement::clearServices(), dtn::core::BundleCore::local, dtn::net::DiscoveryAnnouncement::setSequencenumber(), dtn::daemon::Configuration::Discovery::shortbeacon(), and dtn::net::DiscoveryServiceProvider::update().

|
static |
Definition at line 48 of file IPNDAgent.h.
Referenced by componentUp().