summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8c8b506)
The latter function just sets the timers so they should time out immediately.
+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_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.
/* Return an array of edges in the current network graph.
* Data captures the current state and will not be updated.
+
+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 = 0;
+
+ if(c) {
+ c->last_key_renewal = 0;
+ }
+}
/// Debug function pointer variable for asynchronous DNS resolving
extern void (*devtool_adns_resolve_probe)(void);
/// Debug function pointer variable for asynchronous DNS resolving
extern void (*devtool_adns_resolve_probe)(void);
+/// Debug function pointer variable for SPTPS key renewal
+/** This function pointer variable is a userspace tracepoint or debugger callback for
+ * SPTPS key renewal.
+ *
+ * @param node The node whose SPTPS key(s) are being renewed
+ */
+extern void (*devtool_sptps_renewal_probe)(meshlink_node_t *node);
+
/// Debug function pointer variable for asserting inviter/invitee committing sequence
/** This function pointer variable is a userspace tracepoint or debugger callback which
* invokes either after inviter writing invitees host file into the disk
/// Debug function pointer variable for asserting inviter/invitee committing sequence
/** This function pointer variable is a userspace tracepoint or debugger callback which
* invokes either after inviter writing invitees host file into the disk
#include "utils.h"
#include "conf.h"
#include "connection.h"
#include "utils.h"
#include "conf.h"
#include "connection.h"
#include "graph.h"
#include "logger.h"
#include "meshlink_internal.h"
#include "graph.h"
#include "logger.h"
#include "meshlink_internal.h"
}
if(c->status.active && c->last_key_renewal + 3600 < mesh->loop.now.tv_sec) {
}
if(c->status.active && c->last_key_renewal + 3600 < mesh->loop.now.tv_sec) {
+ devtool_sptps_renewal_probe((meshlink_node_t *)c->node);
+
if(!sptps_force_kex(&c->sptps)) {
logger(mesh, MESHLINK_ERROR, "SPTPS key renewal for connection with %s failed", c->name);
terminate_connection(mesh, c, true);
if(!sptps_force_kex(&c->sptps)) {
logger(mesh, MESHLINK_ERROR, "SPTPS key renewal for connection with %s failed", c->name);
terminate_connection(mesh, c, true);
if(n->status.validkey && n->last_req_key + 3600 < mesh->loop.now.tv_sec) {
logger(mesh, MESHLINK_DEBUG, "SPTPS key renewal for node %s", n->name);
if(n->status.validkey && n->last_req_key + 3600 < mesh->loop.now.tv_sec) {
logger(mesh, MESHLINK_DEBUG, "SPTPS key renewal for node %s", n->name);
+ devtool_sptps_renewal_probe((meshlink_node_t *)n);
if(!sptps_force_kex(&n->sptps)) {
logger(mesh, MESHLINK_ERROR, "SPTPS key renewal for node %s failed", n->name);
if(!sptps_force_kex(&n->sptps)) {
logger(mesh, MESHLINK_ERROR, "SPTPS key renewal for node %s failed", n->name);