char *p;
init_configuration(&config_tree);
- if(!read_host_config(config_tree, n->name))
+ if(!read_host_config(mesh, config_tree, n->name))
goto exit;
/* First, check for simple ECDSAPublicKey statement */
if(!c->config_tree) {
init_configuration(&c->config_tree);
- if(!read_host_config(c->config_tree, c->name))
+ if(!read_host_config(mesh, c->config_tree, c->name))
return false;
}
continue;
}
- io_add(&mesh->listen_socket[mesh->listen_sockets].tcp, handle_new_meta_connection, &mesh->listen_socket[mesh->listen_sockets], tcp_fd, IO_READ);
- io_add(&mesh->listen_socket[mesh->listen_sockets].udp, handle_incoming_vpn_data, &mesh->listen_socket[mesh->listen_sockets], udp_fd, IO_READ);
+ io_add(&mesh->loop, &mesh->listen_socket[mesh->listen_sockets].tcp, handle_new_meta_connection, &mesh->listen_socket[mesh->listen_sockets], tcp_fd, IO_READ);
+ io_add(&mesh->loop, &mesh->listen_socket[mesh->listen_sockets].udp, handle_incoming_vpn_data, &mesh->listen_socket[mesh->listen_sockets], udp_fd, IO_READ);
if(mesh->debug_level >= DEBUG_CONNECTIONS) {
char *hostname = sockaddr2hostname((sockaddr_t *) aip->ai_addr);
mesh->self->connection = new_connection();
mesh->self->name = name;
mesh->self->connection->name = xstrdup(name);
- read_host_config(mesh->config, name);
+ read_host_config(mesh, mesh->config, name);
if(!get_config_string(lookup_config(mesh->config, "Port"), &mesh->myport))
mesh->myport = xstrdup("655");
mesh->self->nexthop = mesh->self;
mesh->self->via = mesh->self;
mesh->self->status.reachable = true;
- mesh->self->last_state_change = now.tv_sec;
+ mesh->self->last_state_change = mesh->loop.now.tv_sec;
node_add(mesh->self);
graph();
/* Done. */
- mesh->last_config_check = now.tv_sec;
+ mesh->last_config_check = mesh->loop.now.tv_sec;
return true;
}
}
for(int i = 0; i < mesh->listen_sockets; i++) {
- io_del(&mesh->listen_socket[i].tcp);
- io_del(&mesh->listen_socket[i].udp);
+ io_del(&mesh->loop, &mesh->listen_socket[i].tcp);
+ io_del(&mesh->loop, &mesh->listen_socket[i].udp);
close(mesh->listen_socket[i].tcp.fd);
close(mesh->listen_socket[i].udp.fd);
}