summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/Network.cpp20
-rw-r--r--node/Network.hpp11
-rw-r--r--node/NetworkConfig.hpp2
3 files changed, 1 insertions, 32 deletions
diff --git a/node/Network.cpp b/node/Network.cpp
index 7b96f337..076977a8 100644
--- a/node/Network.cpp
+++ b/node/Network.cpp
@@ -41,7 +41,6 @@ Network::Network(const RuntimeEnvironment *renv,uint64_t nwid,void *uptr) :
_uPtr(uptr),
_id(nwid),
_mac(renv->identity.address(),nwid),
- _enabled(true),
_portInitialized(false),
_lastConfigUpdate(0),
_destroyed(false),
@@ -337,21 +336,9 @@ void Network::learnBridgedMulticastGroup(const MulticastGroup &mg,uint64_t now)
_announceMulticastGroups();
}
-void Network::setEnabled(bool enabled)
-{
- Mutex::Lock _l(_lock);
- if (_enabled != enabled) {
- _enabled = enabled;
- ZT_VirtualNetworkConfig ctmp;
- _externalConfig(&ctmp);
- _portError = RR->node->configureVirtualNetworkPort(_id,&_uPtr,ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE,&ctmp);
- }
-}
-
void Network::destroy()
{
Mutex::Lock _l(_lock);
- _enabled = false;
_destroyed = true;
}
@@ -388,15 +375,8 @@ void Network::_externalConfig(ZT_VirtualNetworkConfig *ec) const
ec->bridge = ((_config.allowPassiveBridging())||(std::find(ab.begin(),ab.end(),RR->identity.address()) != ab.end())) ? 1 : 0;
ec->broadcastEnabled = (_config) ? (_config.enableBroadcast() ? 1 : 0) : 0;
ec->portError = _portError;
- ec->enabled = (_enabled) ? 1 : 0;
ec->netconfRevision = (_config) ? (unsigned long)_config.revision : 0;
- ec->multicastSubscriptionCount = std::min((unsigned int)_myMulticastGroups.size(),(unsigned int)ZT_MAX_NETWORK_MULTICAST_SUBSCRIPTIONS);
- for(unsigned int i=0;i<ec->multicastSubscriptionCount;++i) {
- ec->multicastSubscriptions[i].mac = _myMulticastGroups[i].mac().toInt();
- ec->multicastSubscriptions[i].adi = _myMulticastGroups[i].adi();
- }
-
ec->assignedAddressCount = 0;
for(unsigned int i=0;i<ZT_MAX_ZT_ASSIGNED_ADDRESSES;++i) {
if (i < _config.staticIpCount) {
diff --git a/node/Network.hpp b/node/Network.hpp
index 9d280fbf..f316e050 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -281,16 +281,6 @@ public:
void learnBridgedMulticastGroup(const MulticastGroup &mg,uint64_t now);
/**
- * @return True if traffic on this network's tap is enabled
- */
- inline bool enabled() const throw() { return _enabled; }
-
- /**
- * @param enabled Should traffic be allowed on this network?
- */
- void setEnabled(bool enabled);
-
- /**
* Destroy this network
*
* This causes the network to disable itself, destroy its tap device, and on
@@ -323,7 +313,6 @@ private:
void *_uPtr;
uint64_t _id;
MAC _mac; // local MAC address
- volatile bool _enabled;
volatile bool _portInitialized;
std::vector< MulticastGroup > _myMulticastGroups; // multicast groups that we belong to (according to tap)
diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp
index 998d859f..bf513df1 100644
--- a/node/NetworkConfig.hpp
+++ b/node/NetworkConfig.hpp
@@ -628,7 +628,7 @@ public:
printf("routeCount==%u\n",routeCount);
for(unsigned int i=0;i<routeCount;++i) {
printf(" routes[i].target==%s\n",reinterpret_cast<const struct sockaddr_storage *>(&(routes[i].target))->toString().c_str());
- printf(" routes[i].via==%s\n",reinterpret_cast<const struct sockaddr_storage *>(&(routes[i].via))->toString().c_str());
+ printf(" routes[i].via==%s\n",reinterpret_cast<const struct sockaddr_storage *>(&(routes[i].via))->toIpString().c_str());
}
printf("staticIpCount==%u\n",staticIpCount);
for(unsigned int i=0;i<staticIpCount;++i)