]> git.meshlink.io Git - meshlink/blobdiff - src/devtools.c
When resetting timers that use CLOCK_MONOTONIC, use a negative value.
[meshlink] / src / devtools.c
index 5a49e3a860296a66ad049bd7d238946424ef1b2d..e172b0717950cd43fe526b8796e58fb7e2949ff0 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "devtools.h"
 
-static void trybind_nop_probe(void) {
+static void nop_probe(void) {
        return;
 }
 
@@ -44,9 +44,16 @@ static void inviter_commits_first_nop_probe(bool stage) {
        return;
 }
 
-void (*devtool_trybind_probe)(void) = trybind_nop_probe;
+static void sptps_renewal_nop_probe(meshlink_node_t *node) {
+       (void)node;
+       return;
+}
+
+void (*devtool_trybind_probe)(void) = nop_probe;
 void (*devtool_keyrotate_probe)(int stage) = keyrotate_nop_probe;
 void (*devtool_set_inviter_commits_first)(bool inviter_commited_first) = inviter_commits_first_nop_probe;
+void (*devtool_adns_resolve_probe)(void) = nop_probe;
+void (*devtool_sptps_renewal_probe)(meshlink_node_t *node) = sptps_renewal_nop_probe;
 
 /* Return an array of edges in the current network graph.
  * Data captures the current state and will not be updated.
@@ -336,3 +343,19 @@ meshlink_handle_t *devtool_open_in_netns(const char *confbase, const char *name,
 
        return handle;
 }
+
+void devtool_force_sptps_renewal(meshlink_handle_t *mesh, meshlink_node_t *node) {
+       if(!mesh || !node) {
+               meshlink_errno = MESHLINK_EINVAL;
+               return;
+       }
+
+       node_t *n = (node_t *)node;
+       connection_t *c = n->connection;
+
+       n->last_req_key = -3600;
+
+       if(c) {
+               c->last_key_renewal = -3600;
+       }
+}