+void meshlink_set_dev_class_timeouts(meshlink_handle_t *mesh, dev_class_t devclass, int pinginterval, int pingtimeout) {
+ if(!mesh || devclass < 0 || devclass >= DEV_CLASS_COUNT) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(pinginterval < 1 || pingtimeout < 1 || pingtimeout > pinginterval) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ pthread_mutex_lock(&mesh->mutex);
+ mesh->dev_class_traits[devclass].pinginterval = pinginterval;
+ mesh->dev_class_traits[devclass].pingtimeout = pingtimeout;
+ pthread_mutex_unlock(&mesh->mutex);
+}
+
+void meshlink_set_dev_class_fast_retry_period(meshlink_handle_t *mesh, dev_class_t devclass, int fast_retry_period) {
+ if(!mesh || devclass < 0 || devclass >= DEV_CLASS_COUNT) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ if(fast_retry_period < 0) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ pthread_mutex_lock(&mesh->mutex);
+ mesh->dev_class_traits[devclass].fast_retry_period = fast_retry_period;
+ pthread_mutex_unlock(&mesh->mutex);
+}
+
+extern void meshlink_set_inviter_commits_first(struct meshlink_handle *mesh, bool inviter_commits_first) {
+ if(!mesh) {
+ meshlink_errno = EINVAL;
+ return;
+ }
+
+ pthread_mutex_lock(&mesh->mutex);
+ 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;
+ }
+
+ pthread_mutex_lock(&mesh->mutex);
+ 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);
+}
+