mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 21:33:57 -07:00
Bunch of tap stuff, IP address assignment hookups, etc.
This commit is contained in:
parent
e205e5fdfe
commit
67f1f1892f
16 changed files with 227 additions and 1648 deletions
|
@ -154,11 +154,6 @@
|
|||
*/
|
||||
#define ZT_IF_MTU ZT1_MAX_MTU
|
||||
|
||||
/**
|
||||
* Default interface metric for ZeroTier taps -- should be higher than physical ports
|
||||
*/
|
||||
#define ZT_DEFAULT_IF_METRIC 32768
|
||||
|
||||
/**
|
||||
* Maximum number of packet fragments we'll support
|
||||
*
|
||||
|
@ -313,14 +308,14 @@
|
|||
#define ZT_ANTIRECURSION_HISTORY_SIZE 16
|
||||
|
||||
/**
|
||||
* How often to broadcast beacons over physical local LANs
|
||||
* How often to send LAN beacons
|
||||
*/
|
||||
#define ZT_BEACON_INTERVAL 30000
|
||||
|
||||
/**
|
||||
* Do not respond to any beacon more often than this
|
||||
*/
|
||||
#define ZT_MIN_BEACON_RESPONSE_INTERVAL (ZT_BEACON_INTERVAL / 32)
|
||||
#define ZT_MIN_BEACON_RESPONSE_INTERVAL 2500
|
||||
|
||||
/**
|
||||
* Sanity limit on maximum bridge routes
|
||||
|
|
|
@ -436,7 +436,12 @@ void Network::learnBridgedMulticastGroup(const MulticastGroup &mg,uint64_t now)
|
|||
void Network::setEnabled(bool enabled)
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
_enabled = enabled;
|
||||
if (_enabled != enabled) {
|
||||
_enabled = enabled;
|
||||
ZT1_VirtualNetworkConfig ctmp;
|
||||
_externalConfig(&ctmp);
|
||||
_portError = RR->node->configureVirtualNetworkPort(_id,ZT1_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE,&ctmp);
|
||||
}
|
||||
}
|
||||
|
||||
void Network::destroy()
|
||||
|
@ -478,6 +483,7 @@ void Network::_externalConfig(ZT1_VirtualNetworkConfig *ec) const
|
|||
ec->bridge = (_config) ? ((_config->allowPassiveBridging() || (std::find(_config->activeBridges().begin(),_config->activeBridges().end(),RR->identity.address()) != _config->activeBridges().end())) ? 1 : 0) : 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)ZT1_MAX_NETWORK_MULTICAST_SUBSCRIPTIONS);
|
||||
|
|
|
@ -348,7 +348,7 @@ private:
|
|||
const RuntimeEnvironment *RR;
|
||||
uint64_t _id;
|
||||
MAC _mac; // local MAC address
|
||||
volatile bool _enabled;
|
||||
bool _enabled;
|
||||
|
||||
std::vector< MulticastGroup > _myMulticastGroups; // multicast groups that we belong to including those behind us (updated periodically)
|
||||
std::map< MulticastGroup,uint64_t > _multicastGroupsBehindMe; // multicast groups bridged to us and when we last saw activity on each
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue