IBR-DTNSuite
0.12
|
#include <LinkManager.h>
Classes | |
class | EventCallback |
Public Member Functions | |
virtual | ~LinkManager () |
virtual void | up () throw () |
virtual void | down () throw () |
virtual const ibrcommon::vinterface | getInterface (int index) const =0 |
virtual const std::list< vaddress > | getAddressList (const vinterface &iface, const std::string &scope="")=0 |
virtual void | addEventListener (const vinterface &, LinkManager::EventCallback *) throw () |
virtual void | removeEventListener (const vinterface &, LinkManager::EventCallback *) throw () |
virtual void | removeEventListener (LinkManager::EventCallback *) throw () |
void | raiseEvent (const LinkEvent &lme) |
std::set< vinterface > | getMonitoredInterfaces () |
Static Public Member Functions | |
static LinkManager & | getInstance () |
static void | initialize () |
static void | setLinkRequestInterval (size_t interval) |
static size_t | getLinkRequestInterval () |
Protected Types | |
typedef std::set < LinkManager::EventCallback * > | callback_set |
typedef std::map < ibrcommon::vinterface, callback_set > | listener_map |
Protected Attributes | |
ibrcommon::Mutex | _listener_mutex |
listener_map | _listener |
Static Protected Attributes | |
static size_t | _link_request_interval = 5000 |
Definition at line 35 of file LinkManager.h.
|
protected |
Definition at line 87 of file LinkManager.h.
|
protected |
Definition at line 88 of file LinkManager.h.
|
inlinevirtual |
Definition at line 45 of file LinkManager.h.
|
virtual |
Reimplemented in ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Definition at line 67 of file LinkManager.cpp.
Referenced by ibrcommon::PosixLinkManager::addEventListener(), ibrcommon::Win32LinkManager::addEventListener(), dtn::net::IPNDAgent::componentUp(), dtn::net::UDPConvergenceLayer::componentUp(), dtn::core::BundleCore::onConfigurationChanged(), and dtn::net::IPNDAgent::raiseEvent().
|
inlinevirtual |
Reimplemented in ibrcommon::NetLinkManager, ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Definition at line 48 of file LinkManager.h.
|
pure virtual |
Implemented in ibrcommon::NetLinkManager, ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Referenced by ibrcommon::vinterface::getAddresses(), and ibrcommon::LinkMonitor::run().
|
static |
Return the singleton instance of the LinkManager
Definition at line 45 of file LinkManager.cpp.
Referenced by dtn::net::IPNDAgent::componentDown(), dtn::net::UDPConvergenceLayer::componentDown(), dtn::core::BundleCore::componentDown(), dtn::net::IPNDAgent::componentUp(), dtn::net::UDPConvergenceLayer::componentUp(), ibrcommon::vinterface::getAddresses(), initialize(), dtn::core::BundleCore::onConfigurationChanged(), dtn::daemon::Configuration::params(), dtn::net::IPNDAgent::raiseEvent(), dtn::net::TCPConvergenceLayer::raiseEvent(), ibrcommon::rtnl_addr_get_local_vaddress(), and dtn::net::TCPConvergenceLayer::~TCPConvergenceLayer().
|
pure virtual |
Implemented in ibrcommon::NetLinkManager, ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Referenced by ibrcommon::rtnl_addr_get_local_vaddress().
|
static |
Get the interval for checking address changes on interfaces
Definition at line 137 of file LinkManager.cpp.
References _link_request_interval.
Referenced by ibrcommon::LinkMonitor::run().
std::set< vinterface > ibrcommon::LinkManager::getMonitoredInterfaces | ( | ) |
Definition at line 142 of file LinkManager.cpp.
References _listener, and _listener_mutex.
Referenced by ibrcommon::LinkMonitor::remove(), and ibrcommon::LinkMonitor::run().
|
static |
Initialize the LinkManager
Definition at line 58 of file LinkManager.cpp.
References getInstance(), and up().
void ibrcommon::LinkManager::raiseEvent | ( | const LinkEvent & | lme) |
Definition at line 109 of file LinkManager.cpp.
References _listener, _listener_mutex, ibrcommon::LinkEvent::ACTION_ADDRESS_ADDED, ibrcommon::LinkEvent::getAction(), ibrcommon::LinkEvent::getInterface(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::Thread::sleep(), and ibrcommon::LinkEvent::toString().
Referenced by ibrcommon::LinkMonitor::run().
|
virtual |
Reimplemented in ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Definition at line 76 of file LinkManager.cpp.
Referenced by dtn::net::IPNDAgent::componentDown(), dtn::net::UDPConvergenceLayer::componentDown(), dtn::core::BundleCore::componentDown(), dtn::core::BundleCore::onConfigurationChanged(), dtn::net::IPNDAgent::raiseEvent(), dtn::net::TCPConvergenceLayer::raiseEvent(), ibrcommon::PosixLinkManager::removeEventListener(), ibrcommon::Win32LinkManager::removeEventListener(), and dtn::net::TCPConvergenceLayer::~TCPConvergenceLayer().
|
virtual |
Reimplemented in ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Definition at line 91 of file LinkManager.cpp.
|
static |
Set the interval for checking address changes on interfaces
Definition at line 132 of file LinkManager.cpp.
References _link_request_interval.
|
inlinevirtual |
Reimplemented in ibrcommon::NetLinkManager, ibrcommon::Win32LinkManager, and ibrcommon::PosixLinkManager.
Definition at line 47 of file LinkManager.h.
Referenced by initialize().
|
staticprotected |
Definition at line 91 of file LinkManager.h.
Referenced by getLinkRequestInterval(), and setLinkRequestInterval().
|
protected |
Definition at line 89 of file LinkManager.h.
Referenced by getMonitoredInterfaces(), and raiseEvent().
|
protected |
Definition at line 85 of file LinkManager.h.
Referenced by getMonitoredInterfaces(), and raiseEvent().