X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fgraph.c;h=d3ac4e6b0a33a7ef1449d26d03f91d3d8a5f1ec3;hb=158cbe99f972a1613b7d4d95abfe5fe48e019e67;hp=75996eacdd26a8539fecc9166137822d495fdc2f;hpb=b3b89e46b1b84fa6cf1726fabe9e9c7bb0d3d831;p=meshlink diff --git a/src/graph.c b/src/graph.c index 75996eac..d3ac4e6b 100644 --- a/src/graph.c +++ b/src/graph.c @@ -1,7 +1,6 @@ /* graph.c -- graph algorithms - Copyright (C) 2001-2013 Guus Sliepen , - 2001-2005 Ivo Timmermans + Copyright (C) 2014 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,12 +48,9 @@ #include "graph.h" #include "list.h" #include "logger.h" -#include "names.h" #include "netutl.h" #include "node.h" #include "protocol.h" -#include "script.h" -#include "subnet.h" #include "utils.h" #include "xalloc.h" #include "graph.h" @@ -231,31 +227,7 @@ static void check_reachability(void) { timeout_del(&n->mtutimeout); - char *name; - char *address; - char *port; - char *envp[8] = {NULL}; - - xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); - xasprintf(&envp[3], "NODE=%s", n->name); - sockaddr2str(&n->address, &address, &port); - xasprintf(&envp[4], "REMOTEADDRESS=%s", address); - xasprintf(&envp[5], "REMOTEPORT=%s", port); - xasprintf(&envp[6], "NAME=%s", myself->name); - - execute_script(n->status.reachable ? "host-up" : "host-down", envp); - - xasprintf(&name, n->status.reachable ? "hosts/%s-up" : "hosts/%s-down", n->name); - execute_script(name, envp); - - free(name); - free(address); - free(port); - - for(int i = 0; i < 7; i++) - free(envp[i]); - - subnet_update(n, NULL, n->status.reachable); + //TODO: callback to application to inform of this node going up/down if(!n->status.reachable) { update_node_udp(n, NULL); @@ -274,7 +246,6 @@ static void check_reachability(void) { } void graph(void) { - subnet_cache_flush(); sssp_bfs(); check_reachability(); mst_kruskal();