diff options
| author | Joseph Henry <[email protected]> | 2023-08-03 15:47:50 -0700 |
|---|---|---|
| committer | Joseph Henry <[email protected]> | 2023-08-03 15:47:50 -0700 |
| commit | dd0d606422b19f89029a3664bf6bc723efceef21 (patch) | |
| tree | 21856281aa8378269ef4ca730483948baa0b1278 | |
| parent | 431c4214a50ad108b300326fcb7975b2a28b51a0 (diff) | |
Add missing zts_init_set_low_bandwidth_mode
| -rw-r--r-- | include/ZeroTierSockets.h | 17 | ||||
| -rw-r--r-- | src/Controls.cpp | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/ZeroTierSockets.h b/include/ZeroTierSockets.h index eb3c6c1..8c74b9f 100644 --- a/include/ZeroTierSockets.h +++ b/include/ZeroTierSockets.h @@ -1316,6 +1316,23 @@ ZTS_API int ZTCALL zts_init_blacklist_if(const char* prefix, unsigned int len); ZTS_API int ZTCALL zts_init_set_roots(const void* roots_data, unsigned int len); /** + * @brief Enable or disable low-bandwidth mode. This is an initialization function that can + * only be called before `zts_node_start()`. + * + * Low-bandwidth mode reduces the ambient traffic that ZeroTier sends + * at the expense of responsiveness to network changes. It does not reduce your + * established connection speeds. It is an adjustment to multiple internal + * timers that results in fewer keepalive probes and network configuration + * requests being sent. This is a good option if your underlying physical network + * doesn't change much. + * + * @param enabled Whether low-bandwidth mode is enabled or not (default: false) + * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node + * experiences a problem. + */ +ZTS_API int ZTCALL zts_init_set_low_bandwidth_mode(int enabled); + +/** * @brief Set the port to which the node should bind. This is an initialization function that can * only be called before `zts_node_start()`. * diff --git a/src/Controls.cpp b/src/Controls.cpp index 2fd3bc7..8aa0a72 100644 --- a/src/Controls.cpp +++ b/src/Controls.cpp @@ -154,7 +154,7 @@ 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) +int zts_init_set_low_bandwidth_mode(int enabled) { ACQUIRE_SERVICE_OFFLINE(); return zts_service->setLowBandwidthMode(enabled); |
