|
IBR-DTNSuite
0.12
|
#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 dtn::core::Event *evt) throw () |
| void | onAdvertiseBeacon (const ibrcommon::vinterface &iface, const DiscoveryBeacon &beacon) throw () |
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 () |
Public Member Functions inherited from dtn::net::DiscoveryBeaconHandler | |
| virtual | ~DiscoveryBeaconHandler ()=0 |
| virtual void | onUpdateBeacon (const ibrcommon::vinterface &iface, DiscoveryBeacon &beacon) throw (NoServiceHereException) |
Protected Member Functions | |
| virtual void | componentRun () throw () |
| virtual void | componentUp () throw () |
| virtual void | componentDown () throw () |
| void | __cancellation () throw () |
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 |
Definition at line 44 of file IPNDAgent.h.
| dtn::net::IPNDAgent::IPNDAgent | ( | int | port) |
Definition at line 54 of file IPNDAgent.cpp.
|
virtual |
Definition at line 63 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 520 of file IPNDAgent.cpp.
References ibrcommon::vsocket::down().

| void dtn::net::IPNDAgent::add | ( | const ibrcommon::vaddress & | address) |
Definition at line 68 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 73 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 410 of file IPNDAgent.cpp.
References ibrcommon::vsocket::destroy(), dtn::core::BundleCore::getDiscoveryAgent(), ibrcommon::LinkManager::getInstance(), dtn::core::BundleCore::getInstance(), ibrcommon::JoinableThread::join(), dtn::core::EventDispatcher< E >::remove(), ibrcommon::LinkManager::removeEventListener(), ibrcommon::JoinableThread::stop(), and dtn::net::DiscoveryAgent::unregisterService().

|
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 431 of file IPNDAgent.cpp.
References ibrcommon::vaddress::address(), dtn::core::Node::CONN_TCPIP, ibrcommon::LogLevel::error, dtn::core::BundleCore::getDiscoveryAgent(), dtn::core::BundleCore::getInstance(), dtn::net::DiscoveryService::getParameters(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::net::DiscoveryAgent::obtainBeacon(), dtn::net::DiscoveryAgent::onBeaconReceived(), ibrcommon::datagramsocket::recvfrom(), ibrcommon::vsocket::select(), dtn::net::DiscoveryBeacon::setEID(), dtn::net::DiscoveryService::update(), ibrcommon::Exception::what(), and ibrcommon::Thread::yield().

|
protectedvirtual | |||||||||||||
Is called in preparation of the component. Before componentRun() is called.
Implements dtn::daemon::IndependentComponent.
Definition at line 338 of file IPNDAgent.cpp.
References ibrcommon::vsocket::add(), dtn::core::EventDispatcher< E >::add(), ibrcommon::LinkManager::addEventListener(), ibrcommon::LogLevel::error, ibrcommon::vaddress::family(), dtn::core::BundleCore::getDiscoveryAgent(), ibrcommon::LinkManager::getInstance(), dtn::core::BundleCore::getInstance(), IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::JoinableThread::join(), dtn::net::DiscoveryAgent::registerService(), ibrcommon::vaddress::toString(), ibrcommon::vsocket::up(), ibrcommon::multicastsocket::up(), and ibrcommon::Exception::what().

|
virtual |
Implements ibrcommon::LinkManager::EventCallback.
Definition at line 300 of file IPNDAgent.cpp.
References ibrcommon::LinkEvent::ACTION_ADDRESS_ADDED, ibrcommon::LinkEvent::ACTION_ADDRESS_REMOVED, ibrcommon::LinkEvent::ACTION_LINK_DOWN, ibrcommon::LinkEvent::getAction(), ibrcommon::LinkEvent::getAddress(), ibrcommon::LinkEvent::getInterface(), ibrcommon::JoinableThread::join(), and ibrcommon::vaddress::setService().

|
virtual |
Implements dtn::daemon::Component.
Definition at line 526 of file IPNDAgent.cpp.
|
virtual | ||||||||||||||||||||
This method is called by the DiscoveryAgent every time a beacon is ready for advertisement
Reimplemented from dtn::net::DiscoveryBeaconHandler.
Definition at line 202 of file IPNDAgent.cpp.
References ibrcommon::LogLevel::error, ibrcommon::vaddress::family(), ibrcommon::udpsocket::get_address(), ibrcommon::basesocket::get_family(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::datagramsocket::sendto(), ibrcommon::vaddress::toString(), ibrcommon::LogLevel::warning, and ibrcommon::Exception::what().

|
virtual | ||||||||||||||
Implements dtn::core::EventReceiver.
Definition at line 240 of file IPNDAgent.cpp.
References ibrcommon::LinkManager::addEventListener(), dtn::core::BundleCore::getDiscoveryAgent(), ibrcommon::LinkManager::getInstance(), dtn::core::BundleCore::getInstance(), dtn::net::P2PDialupEvent::iface, dtn::net::P2PDialupEvent::INTERFACE_DOWN, dtn::net::P2PDialupEvent::INTERFACE_UP, dtn::net::DiscoveryAgent::registerService(), ibrcommon::LinkManager::removeEventListener(), dtn::net::P2PDialupEvent::type, and dtn::net::DiscoveryAgent::unregisterService().
