return send_request(mesh, c, "%d %s %d.%d", ID, mesh->self->connection->name, mesh->self->connection->protocol_major, minor);
}
-static bool finalize_invitation(meshlink_handle_t *mesh, connection_t *c, const char *data, uint16_t len) {
+static bool finalize_invitation(meshlink_handle_t *mesh, connection_t *c, const void *data, uint16_t len) {
if(strchr(data, '\n')) {
logger(DEBUG_ALWAYS, LOG_ERR, "Received invalid key from invited node %s (%s)!\n", c->name, c->hostname);
return false;
return false;
}
- fprintf(f, "ECDSAPublicKey = %s\n", data);
+ fprintf(f, "ECDSAPublicKey = %s\n", (const char *)data);
fclose(f);
logger(DEBUG_CONNECTIONS, LOG_INFO, "Key succesfully received from %s (%s)", c->name, c->hostname);
//TODO: callback to application to inform of an accepted invitation
sptps_send_record(&c->sptps, 2, data, 0);
+
+ load_all_nodes(mesh);
+
return true;
}
-static bool receive_invitation_sptps(void *handle, uint8_t type, const char *data, uint16_t len) {
+static bool receive_invitation_sptps(void *handle, uint8_t type, const void *data, uint16_t len) {
connection_t *c = handle;
meshlink_handle_t *mesh = c->mesh;
to create node_t and edge_t structures. */
struct timeval now;
- bool choice;
/* Estimate weight */
bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
char hisport[MAX_STRING_SIZE];
char *hisaddress;
- int weight, mtu;
+ int weight;
uint32_t options;
node_t *n;
- bool choice;
if(sscanf(request, "%*d " MAX_STRING " %d %x", hisport, &weight, &options) != 3) {
logger(DEBUG_ALWAYS, LOG_ERR, "Got bad %s from %s (%s)", "ACK", c->name,