+void meshlink_set_dev_class_maxtimeout(struct meshlink_handle *mesh, dev_class_t devclass, int maxtimeout) {
+ if(!mesh || devclass < 0 || devclass >= DEV_CLASS_COUNT) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(maxtimeout < 0) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(pthread_mutex_lock(&mesh->mutex) != 0) {
+ abort();
+ }
+
+ mesh->dev_class_traits[devclass].maxtimeout = maxtimeout;
+ pthread_mutex_unlock(&mesh->mutex);
+}
+
+void meshlink_reset_timers(struct meshlink_handle *mesh) {
+ if(!mesh) {
+ return;
+ }
+
+ if(pthread_mutex_lock(&mesh->mutex) != 0) {
+ abort();
+ }
+
+ handle_network_change(mesh, true);
+
+ if(mesh->discovery.enabled) {
+ discovery_refresh(mesh);
+ }
+
+ pthread_mutex_unlock(&mesh->mutex);
+}
+
+void meshlink_set_inviter_commits_first(struct meshlink_handle *mesh, bool inviter_commits_first) {
+ if(!mesh) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(pthread_mutex_lock(&mesh->mutex) != 0) {
+ abort();
+ }
+
+ mesh->inviter_commits_first = inviter_commits_first;
+ pthread_mutex_unlock(&mesh->mutex);
+}
+
+void meshlink_set_external_address_discovery_url(struct meshlink_handle *mesh, const char *url) {
+ if(!mesh) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(url && (strncmp(url, "http://", 7) || strchr(url, ' '))) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(pthread_mutex_lock(&mesh->mutex) != 0) {
+ abort();
+ }
+
+ free(mesh->external_address_url);
+ mesh->external_address_url = url ? xstrdup(url) : NULL;
+ pthread_mutex_unlock(&mesh->mutex);
+}
+
+void meshlink_set_scheduling_granularity(struct meshlink_handle *mesh, long granularity) {
+ if(!mesh || granularity < 0) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ utcp_set_clock_granularity(granularity);
+}
+
+void meshlink_set_storage_policy(struct meshlink_handle *mesh, meshlink_storage_policy_t policy) {
+ if(!mesh) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(pthread_mutex_lock(&mesh->mutex) != 0) {
+ abort();
+ }
+
+ mesh->storage_policy = policy;
+ pthread_mutex_unlock(&mesh->mutex);
+}
+