FILE *fp;
char *fname;
- xasprintf(&fname, "%s" SLASH "ecdsa_key.priv", confbase);
+ xasprintf(&fname, "%s" SLASH "ecdsa_key.priv", mesh->confbase);
fp = fopen(fname, "r");
free(fname);
invitation_key = NULL;
}
- xasprintf(&fname, "%s" SLASH "invitations" SLASH "ecdsa_key.priv", confbase);
+ xasprintf(&fname, "%s" SLASH "invitations" SLASH "ecdsa_key.priv", mesh->confbase);
fp = fopen(fname, "r");
struct dirent *ent;
char *dname;
- xasprintf(&dname, "%s" SLASH "hosts", confbase);
+ xasprintf(&dname, "%s" SLASH "hosts", mesh->confbase);
dir = opendir(dname);
if(!dir) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", dname, strerror(errno));
char *get_name(void) {
char *name = NULL;
- get_config_string(lookup_config(config_tree, "Name"), &name);
+ get_config_string(lookup_config(mesh->config, "Name"), &name);
if(!name)
return NULL;
mesh->self->connection = new_connection();
mesh->self->name = name;
mesh->self->connection->name = xstrdup(name);
- read_host_config(config_tree, name);
+ read_host_config(mesh->config, name);
- if(!get_config_string(lookup_config(config_tree, "Port"), &myport))
+ if(!get_config_string(lookup_config(mesh->config, "Port"), &myport))
myport = xstrdup("655");
else
port_specified = true;
/* Done. */
- last_config_check = now.tv_sec;
+ mesh->last_config_check = now.tv_sec;
return true;
}
close all open network connections
*/
void close_network_connections(void) {
- for(list_node_t *node = connection_list->head, *next; node; node = next) {
+ for(list_node_t *node = mesh->connections->head, *next; node; node = next) {
next = node->next;
connection_t *c = node->data;
c->outgoing = NULL;
terminate_connection(c, false);
}
- if(outgoing_list)
- list_delete_list(outgoing_list);
+ if(mesh->outgoings)
+ list_delete_list(mesh->outgoings);
if(mesh->self && mesh->self->connection) {
terminate_connection(mesh->self->connection, false);