Skip to content

Commit

Permalink
Add missing zts_init_set_low_bandwidth_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-henry committed Aug 3, 2023
1 parent 431c421 commit dd0d606
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions include/ZeroTierSockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,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()`.
Expand Down
2 changes: 1 addition & 1 deletion src/Controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dd0d606

Please sign in to comment.