25 #ifndef NDN_CXX_NET_NETWORK_MONITOR_HPP
26 #define NDN_CXX_NET_NETWORK_MONITOR_HPP
37 class NetworkMonitorImpl;
54 class Error :
public std::runtime_error
57 using std::runtime_error::runtime_error;
88 shared_ptr<const NetworkInterface>
96 [[nodiscard]] std::vector<shared_ptr<const NetworkInterface>>
110 const unique_ptr<NetworkMonitorImpl> m_impl;
143 virtual shared_ptr<const NetworkInterface>
146 virtual std::vector<shared_ptr<const NetworkInterface>>
150 static shared_ptr<NetworkInterface>
signal::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > onInterfaceRemoved
signal::Signal< NetworkMonitorImpl > onNetworkStateChanged
signal::Signal< NetworkMonitorImpl > onEnumerationCompleted
virtual uint32_t getCapabilities() const =0
virtual std::vector< shared_ptr< const NetworkInterface > > listNetworkInterfaces() const =0
static shared_ptr< NetworkInterface > makeNetworkInterface()
virtual shared_ptr< const NetworkInterface > getNetworkInterface(const std::string &) const =0
signal::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > onInterfaceAdded
virtual ~NetworkMonitorImpl()=default
Network interface monitor.
NetworkMonitor(boost::asio::io_context &ioCtx)
Construct instance, request enumeration of all network interfaces, and start monitoring for network s...
signal::Signal< NetworkMonitorImpl > & onNetworkStateChanged
uint32_t getCapabilities() const
Returns a bitwise OR'ed set of Capability flags supported on the current platform.
signal::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > & onInterfaceAdded
Fires whenever a new interface is detected on the system.
signal::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > & onInterfaceRemoved
Fires whenever an interface disappears from the system.
std::vector< shared_ptr< const NetworkInterface > > listNetworkInterfaces() const
Lists all network interfaces currently available on the system.
shared_ptr< const NetworkInterface > getNetworkInterface(const std::string &ifname) const
Returns the NetworkInterface with the given name, or nullptr if it does not exist.
@ CAP_NONE
NetworkMonitor is not supported and is a no-op.
@ CAP_IF_ADD_REMOVE
NetworkMonitor onInterfaceAdded and onInterfaceRemoved signals are supported.
@ CAP_ENUM
listNetworkInterfaces() and getNetworkInterface() are supported
@ CAP_MTU_CHANGE
NetworkInterface onMtuChanged signal is supported.
@ CAP_STATE_CHANGE
NetworkInterface onStateChanged signal is supported.
@ CAP_ADDR_ADD_REMOVE
NetworkInterface onAddressAdded and onAddressRemoved signals are supported.
NetworkMonitorImpl & getImpl()
signal::Signal< NetworkMonitorImpl > & onEnumerationCompleted
Fires when the enumeration of all network interfaces on the system is complete.
Provides a lightweight signal / event system.
This header provides macros that allows a signal to be emitted from a derived class of its owner.
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a 'emit_signalName' method