X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fdevtools.c;h=2a98e595054850a78fecd489058acba6914db846;hp=22a0818b559b3e6f291a3e27e36531e4a305071e;hb=b2d1ccdaf1554f2f34e8acb86f89190cb93b6634;hpb=0298c10effe496200dc761a4a26d57fc01ee2cf8 diff --git a/src/devtools.c b/src/devtools.c index 22a0818b..2a98e595 100644 --- a/src/devtools.c +++ b/src/devtools.c @@ -367,3 +367,17 @@ void devtool_force_sptps_renewal(meshlink_handle_t *mesh, meshlink_node_t *node) c->last_key_renewal = -3600; } } + +void devtool_set_meta_status_cb(meshlink_handle_t *mesh, meshlink_node_status_cb_t cb) { + if(!mesh) { + meshlink_errno = MESHLINK_EINVAL; + return; + } + + if(pthread_mutex_lock(&mesh->mutex) != 0) { + abort(); + } + + mesh->meta_status_cb = cb; + pthread_mutex_unlock(&mesh->mutex); +}