Network interfaces monitor. More...
#include <network-monitor.hpp>
Data Structures | |
class | Error |
class | Impl |
Public Types | |
enum | Capability : uint32_t { CAP_NONE = 0, CAP_ENUM = 1 << 0, CAP_IF_ADD_REMOVE = 1 << 1, CAP_STATE_CHANGE = 1 << 2, CAP_MTU_CHANGE = 1 << 3, CAP_ADDR_ADD_REMOVE = 1 << 4 } |
Public Member Functions | |
NetworkMonitor (boost::asio::io_service &io) | |
Construct instance, request enumeration of all network interfaces, and start monitoring for network state changes. More... | |
~NetworkMonitor () | |
uint32_t | getCapabilities () const |
shared_ptr< NetworkInterface > | getNetworkInterface (const std::string &ifname) const |
std::vector< shared_ptr< NetworkInterface > > | listNetworkInterfaces () const |
Data Fields | |
Signal< NetworkMonitor > | onEnumerationCompleted |
Fires when network interfaces enumeration is complete. More... | |
Signal< NetworkMonitor, shared_ptr< NetworkInterface > > | onInterfaceAdded |
Fires when a new interface is added. More... | |
Signal< NetworkMonitor, shared_ptr< NetworkInterface > > | onInterfaceRemoved |
Fires when an interface is removed. More... | |
Signal< NetworkMonitor > | onNetworkStateChanged |
Network interfaces monitor.
Maintains an up-to-date view of every system network interface and notifies when an interface is added or removed.
Definition at line 58 of file network-monitor.hpp.
enum ndn::util::NetworkMonitor::Capability : uint32_t |
Enumerator | |
---|---|
CAP_NONE |
NetworkMonitor is not supported and is a no-op. |
CAP_ENUM |
listNetworkInterfaces() and getNetworkInterface() are supported |
CAP_IF_ADD_REMOVE |
NetworkMonitor onInterfaceAdded and onInterfaceRemoved signals are supported. |
CAP_STATE_CHANGE |
NetworkInterface onStateChanged signal is supported. |
CAP_MTU_CHANGE |
NetworkInterface onMtuChanged signal is supported. |
CAP_ADDR_ADD_REMOVE |
NetworkInterface onAddressAdded and onAddressRemoved signals are supported. |
Definition at line 85 of file network-monitor.hpp.
|
explicit |
Construct instance, request enumeration of all network interfaces, and start monitoring for network state changes.
io | io_service thread that will dispatch events |
Error | when network monitoring is not supported or there is an error starting monitoring |
Definition at line 39 of file network-monitor.cpp.
|
default |
uint32_t ndn::util::NetworkMonitor::getCapabilities | ( | ) | const |
Capability
supported on current platform Definition at line 47 of file network-monitor.cpp.
shared_ptr< NetworkInterface > ndn::util::NetworkMonitor::getNetworkInterface | ( | const std::string & | ifname | ) | const |
Definition at line 53 of file network-monitor.cpp.
std::vector< shared_ptr< NetworkInterface > > ndn::util::NetworkMonitor::listNetworkInterfaces | ( | ) | const |
Definition at line 59 of file network-monitor.cpp.
Signal<NetworkMonitor> ndn::util::NetworkMonitor::onEnumerationCompleted |
Fires when network interfaces enumeration is complete.
Definition at line 114 of file network-monitor.hpp.
Signal<NetworkMonitor, shared_ptr<NetworkInterface> > ndn::util::NetworkMonitor::onInterfaceAdded |
Fires when a new interface is added.
Definition at line 118 of file network-monitor.hpp.
Signal<NetworkMonitor, shared_ptr<NetworkInterface> > ndn::util::NetworkMonitor::onInterfaceRemoved |
Fires when an interface is removed.
Definition at line 125 of file network-monitor.hpp.
Signal<NetworkMonitor> ndn::util::NetworkMonitor::onNetworkStateChanged |
Definition at line 128 of file network-monitor.hpp.