// TODO: hack, remove once all global variables are gone.
static void set_mesh(meshlink_handle_t *localmesh) {
mesh = localmesh;
- loop = &mesh->loop;
}
static bool ecdsa_keygen(meshlink_handle_t *mesh) {
init_configuration(&mesh->config);
- if(!read_server_config())
+ if(!read_server_config(mesh))
return meshlink_close(mesh), NULL;
// Setup up everything
// TODO: we should not open listening sockets yet
- if(!setup_network())
+ if(!setup_network(mesh))
return meshlink_close(mesh), NULL;
return mesh;
}
static void __attribute__((constructor)) meshlink_init(void) {
- gettimeofday(&now, NULL);
- srand(now.tv_sec + now.tv_usec);
crypto_init();
}