25 #ifndef NDN_NET_NETWORK_MONITOR_HPP 26 #define NDN_NET_NETWORK_MONITOR_HPP 40 class NetworkMonitorImpl;
57 class Error :
public std::runtime_error
62 :
std::runtime_error(what)
83 CAP_IF_ADD_REMOVE = 1 << 1,
85 CAP_STATE_CHANGE = 1 << 2,
87 CAP_MTU_CHANGE = 1 << 3,
89 CAP_ADDR_ADD_REMOVE = 1 << 4
94 getCapabilities()
const;
97 shared_ptr<const NetworkInterface>
98 getNetworkInterface(
const std::string& ifname)
const;
105 std::vector<shared_ptr<const NetworkInterface>>
106 listNetworkInterfaces()
const;
119 const unique_ptr<NetworkMonitorImpl> m_impl;
148 getCapabilities()
const = 0;
150 virtual shared_ptr<const NetworkInterface>
151 getNetworkInterface(
const std::string&)
const = 0;
153 virtual std::vector<shared_ptr<const NetworkInterface>>
154 listNetworkInterfaces()
const = 0;
157 static shared_ptr<NetworkInterface>
158 makeNetworkInterface();
176 #endif // NDN_NET_NETWORK_MONITOR_HPP Copyright (c) 2011-2015 Regents of the University of California.
Copyright (c) 2013-2017 Regents of the University of California.
util::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > & onInterfaceAdded
Fires when a new interface is added.
util::Signal< NetworkMonitorImpl > & onNetworkStateChanged
Network interface monitor.
util::Signal< NetworkMonitorImpl > onEnumerationCompleted
util::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > & onInterfaceRemoved
Fires when an interface is removed.
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a 'emit_signalName' method
util::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > onInterfaceRemoved
util::Signal< NetworkMonitorImpl, shared_ptr< const NetworkInterface > > onInterfaceAdded
NetworkMonitorImpl & getImpl()
Error(const std::string &what)
util::Signal< NetworkMonitorImpl > onNetworkStateChanged
util::Signal< NetworkMonitorImpl > & onEnumerationCompleted
Fires when network interfaces enumeration is complete.