From 8001b2c0cb6d35bfbc7b7be78d1a8b6d0fafbd53 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 6 Apr 2015 16:52:52 -0700 Subject: Network now calls port config function as per new API. --- node/Network.hpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 5693ff49..b51164a3 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -192,7 +192,20 @@ public: /** * @return Status of this network */ - ZT1_VirtualNetworkStatus status() const; + inline ZT1_VirtualNetworkStatus status() const + { + Mutex::Lock _l(_lock); + return _status(); + } + + /** + * @param ec Buffer to fill with externally-visible network configuration + */ + inline void externalConfig(ZT1_VirtualNetworkConfig *ec) const + { + Mutex::Lock _l(_lock); + _externalConfig(ec); + } /** * Update and check multicast rate balance for a multicast group @@ -321,6 +334,9 @@ public: void destroy(); private: + ZT1_VirtualNetworkStatus _status() const; + void _externalConfig(ZT1_VirtualNetworkConfig *ec) const; // assumes _lock is locked + const RuntimeEnvironment *RR; uint64_t _id; MAC _mac; // local MAC address @@ -340,12 +356,13 @@ private: volatile bool _destroyed; - volatile enum { + enum { NETCONF_FAILURE_NONE, NETCONF_FAILURE_ACCESS_DENIED, NETCONF_FAILURE_NOT_FOUND, NETCONF_FAILURE_INIT_FAILED } _netconfFailure; + int _portError; // return value from port config callback Mutex _lock; -- cgit v1.2.3