IBR-DTNSuite
0.8
|
#include <IPNDAgent.h>
Public Member Functions | |
IPNDAgent (int port, const ibrcommon::vaddress &address) | |
virtual | ~IPNDAgent () |
void | bind (const ibrcommon::vinterface &net) |
virtual const std::string | getName () const |
void | eventNotify (const ibrcommon::LinkManagerEvent &evt) |
Protected Member Functions | |
void | sendAnnoucement (const u_int16_t &sn, std::list< DiscoveryService > &services) |
virtual void | componentRun () |
virtual void | componentUp () |
virtual void | componentDown () |
void | __cancellation () |
Definition at line 35 of file IPNDAgent.h.
dtn::net::IPNDAgent::IPNDAgent | ( | int | port, |
const ibrcommon::vaddress & | address | ||
) |
Definition at line 24 of file IPNDAgent.cpp.
References dtn::net::DiscoveryAgent::_config, dtn::net::DiscoveryAnnouncement::DISCO_VERSION_00, dtn::net::DiscoveryAnnouncement::DISCO_VERSION_01, dtn::net::DiscoveryAnnouncement::DTND_IPDISCOVERY, IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::vaddress::isMulticast(), ibrcommon::vsocket::set(), ibrcommon::vaddress::toString(), dtn::daemon::Configuration::Discovery::version(), ibrcommon::vsocket::VSOCKET_BROADCAST, ibrcommon::vsocket::VSOCKET_MULTICAST, and ibrcommon::vsocket::VSOCKET_REUSEADDR.
dtn::net::IPNDAgent::~IPNDAgent | ( | ) | [virtual] |
Definition at line 59 of file IPNDAgent.cpp.
void dtn::net::IPNDAgent::__cancellation | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 260 of file IPNDAgent.cpp.
References ibrcommon::vsocket::close().
void dtn::net::IPNDAgent::bind | ( | const ibrcommon::vinterface & | net | ) |
Definition at line 63 of file IPNDAgent.cpp.
References IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, and ibrcommon::vinterface::toString().
Referenced by __daemon_run().
void dtn::net::IPNDAgent::componentDown | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 185 of file IPNDAgent.cpp.
References ibrcommon::JoinableThread::join(), ibrcommon::vsocket::setEventCallback(), ibrcommon::vsocket::shutdown(), and ibrcommon::JoinableThread::stop().
void dtn::net::IPNDAgent::componentRun | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 197 of file IPNDAgent.cpp.
References dtn::net::DiscoveryAnnouncement::addService(), ibrcommon::TimeMeasurement::getMilliseconds(), dtn::net::DiscoveryAnnouncement::getServices(), dtn::net::DiscoveryAnnouncement::isShort(), dtn::net::DiscoveryAgent::received(), ibrcommon::recvfrom(), ibrcommon::vsocket::select(), ibrcommon::TimeMeasurement::start(), ibrcommon::TimeMeasurement::stop(), dtn::net::DiscoveryAgent::timeout(), and ibrcommon::Thread::yield().
void dtn::net::IPNDAgent::componentUp | ( | ) | [protected, virtual] |
Implements dtn::daemon::IndependentComponent.
Definition at line 146 of file IPNDAgent.cpp.
References ibrcommon::vsocket::bind(), ibrcommon::vinterface::empty(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_ENDL, ibrcommon::vaddress::isMulticast(), ibrcommon::MulticastSocket::joinGroup(), ibrcommon::vsocket::setEventCallback(), and ibrcommon::Exception::what().
void dtn::net::IPNDAgent::eventNotify | ( | const ibrcommon::LinkManagerEvent & | evt | ) | [virtual] |
Implements ibrcommon::LinkManager::EventCallback.
Definition at line 134 of file IPNDAgent.cpp.
References ibrcommon::LinkManagerEvent::EVENT_ADDRESS_ADDED, ibrcommon::LinkManagerEvent::getInterface(), ibrcommon::LinkManagerEvent::getType(), ibrcommon::vaddress::isMulticast(), and ibrcommon::MulticastSocket::joinGroup().
const std::string dtn::net::IPNDAgent::getName | ( | ) | const [virtual] |
Implements dtn::daemon::Component.
Definition at line 266 of file IPNDAgent.cpp.
void dtn::net::IPNDAgent::sendAnnoucement | ( | const u_int16_t & | sn, |
std::list< DiscoveryService > & | services | ||
) | [protected] |
Definition at line 97 of file IPNDAgent.cpp.
References dtn::net::DiscoveryAgent::_config, dtn::net::DiscoveryAnnouncement::addService(), dtn::net::DiscoveryAnnouncement::clearServices(), dtn::core::BundleCore::local, dtn::net::DiscoveryAnnouncement::setSequencenumber(), dtn::daemon::Configuration::Discovery::shortbeacon(), and dtn::net::DiscoveryService::update().