26 #include "ndn-cxx-config.hpp" 28 #if defined(NDN_CXX_HAVE_OSX_FRAMEWORKS) 29 #include "detail/network-monitor-impl-osx.hpp" 30 #define NETWORK_MONITOR_IMPL_TYPE NetworkMonitorImplOsx 31 #elif defined(NDN_CXX_HAVE_RTNETLINK) 32 #include "detail/network-monitor-impl-rtnl.hpp" 33 #define NETWORK_MONITOR_IMPL_TYPE NetworkMonitorImplRtnl 35 #include "detail/network-monitor-impl-noop.hpp" 36 #define NETWORK_MONITOR_IMPL_TYPE NetworkMonitorImplNoop 48 : m_impl(
std::move(impl))
59 return m_impl->getCapabilities();
62 shared_ptr<const NetworkInterface>
65 return m_impl->getNetworkInterface(ifname);
68 std::vector<shared_ptr<const NetworkInterface>>
71 return m_impl->listNetworkInterfaces();
74 shared_ptr<NetworkInterface>
Copyright (c) 2013-2017 Regents of the University of California.
NetworkMonitor(boost::asio::io_service &io)
Construct instance, request enumeration of all network interfaces, and start monitoring for network s...
static shared_ptr< NetworkInterface > makeNetworkInterface()
util::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > & onInterfaceAdded
Fires when a new interface is added.
unique_ptr< T > make_unique(Args &&...args)
util::Signal< NetworkMonitorImpl > & onNetworkStateChanged
shared_ptr< const NetworkInterface > getNetworkInterface(const std::string &ifname) const
Returns the NetworkInterface with the given name, or nullptr if it does not exist.
#define NETWORK_MONITOR_IMPL_TYPE
Copyright (c) 2013-2017 Regents of the University of California.
Network interface monitor.
uint32_t getCapabilities() const
Returns a bitwise OR'ed set of Capability flags supported on the current platform.
Represents one network interface attached to the host.
util::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > & onInterfaceRemoved
Fires when an interface is removed.
std::vector< shared_ptr< const NetworkInterface > > listNetworkInterfaces() const
Lists all network interfaces currently available on the system.
util::Signal< NetworkMonitorImpl > & onEnumerationCompleted
Fires when network interfaces enumeration is complete.