Add low-bandwidth mode
This commit is contained in:
@@ -133,6 +133,12 @@ int zts_init_set_roots(const void* roots_data, unsigned int len)
|
||||
return zts_service->setRoots(roots_data, len);
|
||||
}
|
||||
|
||||
int zts_init_set_low_bandwidth_mode(bool enabled)
|
||||
{
|
||||
ACQUIRE_SERVICE_OFFLINE();
|
||||
return zts_service->setLowBandwidthMode(enabled);
|
||||
}
|
||||
|
||||
int zts_init_set_port(unsigned short port)
|
||||
{
|
||||
ACQUIRE_SERVICE_OFFLINE();
|
||||
|
||||
@@ -1829,6 +1829,16 @@ int NodeService::setRoots(const void* rootsData, unsigned int len)
|
||||
return ZTS_ERR_OK;
|
||||
}
|
||||
|
||||
int_fast32_t NodeService::setLowBandwidthMode(bool enabled)
|
||||
{
|
||||
Mutex::Lock _lr(_run_m);
|
||||
if (_run) {
|
||||
return ZTS_ERR_SERVICE;
|
||||
}
|
||||
_node->setLowBandwidthMode(enabled);
|
||||
return ZTS_ERR_OK;
|
||||
}
|
||||
|
||||
int NodeService::addInterfacePrefixToBlacklist(const char* prefix, unsigned int len)
|
||||
{
|
||||
if (! prefix || len == 0 || len > 15) {
|
||||
|
||||
@@ -398,6 +398,9 @@ class NodeService {
|
||||
/** Set the roots definition */
|
||||
int setRoots(const void* data, unsigned int len);
|
||||
|
||||
/** Enable or disable low-bandwidth mode (sends less ambient traffic, network updates happen less frequently) */
|
||||
int setLowBandwidthMode(bool enabled);
|
||||
|
||||
/** Add Interface prefix to blacklist (prevents ZeroTier from using that interface) */
|
||||
int addInterfacePrefixToBlacklist(const char* prefix, unsigned int len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user