X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fgraph.c;fp=src%2Fgraph.c;h=f8c906b017bb6b04e00dd7953614551d8eb001e0;hb=1c1ea3e501944f1e49cb65add689d9cd6dea8af6;hp=396e35a3e68d2e9373a6dde4a753402ad7d4228f;hpb=7f7b53dc2011fc8ceda1e0678d9f78b1dbd8c1d1;p=meshlink diff --git a/src/graph.c b/src/graph.c index 396e35a3..f8c906b0 100644 --- a/src/graph.c +++ b/src/graph.c @@ -45,17 +45,13 @@ #include "system.h" #include "connection.h" -#include "device.h" #include "edge.h" #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" @@ -232,33 +228,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[1], "DEVICE=%s", device ? : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); - 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); @@ -277,7 +247,6 @@ static void check_reachability(void) { } void graph(void) { - subnet_cache_flush(); sssp_bfs(); check_reachability(); mst_kruskal();