#include "netutl.h"
#include "packmsg.h"
#include "protocol.h"
-#include "route.h"
#include "utils.h"
#include "xalloc.h"
bool setup_network(meshlink_handle_t *mesh) {
init_connections(mesh);
init_nodes(mesh);
- init_requests(mesh);
if(!setup_myself(mesh)) {
return false;
close all open network connections
*/
void close_network_connections(meshlink_handle_t *mesh) {
- if(mesh->connections) {
- 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(mesh, c, false);
- }
+ if(mesh->connection) {
+ mesh->connection->outgoing = NULL;
+ terminate_connection(mesh, mesh->connection, false);
}
- exit_requests(mesh);
exit_nodes(mesh);
exit_connections(mesh);
free(mesh->myport);
mesh->myport = NULL;
-
mesh->self = NULL;
-
- return;
}