Another file moved; random interface stuff.
[tinc] / lib / graph.c
similarity index 96%
rename from src/graph.c
rename to lib/graph.c
index e8e8baf..f953263 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: graph.c,v 1.4 2002/04/28 12:46:26 zarq Exp $
+    $Id: graph.c,v 1.1 2002/05/02 11:50:07 zarq Exp $
 */
 
 /* We need to generate two trees from the graph:
 #include <netinet/in.h>
 
 #include <avl_tree.h>
+#include <hooks.h>
 #include <utils.h>
 
 #include "netutl.h"
 #include "node.h"
 #include "edge.h"
 #include "connection.h"
-#include "process.h"
 #include "logging.h"
 
 #include "system.h"
@@ -156,7 +156,6 @@ void sssp_bfs(void)
   halfconnection_t to_hc, from_hc;
   avl_tree_t *todo_tree;
   int indirect;
-  char *name;
 
   todo_tree = avl_alloc_tree(NULL, NULL);
 
@@ -260,9 +259,7 @@ void sssp_bfs(void)
           if(debug_lvl >= DEBUG_TRAFFIC)
             syslog(LOG_DEBUG, _("Node %s (%s) became reachable"), n->name, n->hostname);
           n->status.reachable = 1;
-         asprintf(&name, "hosts/%s-up", n->name);
-         execute_script(name);
-         free(name);
+         run_hooks("node-visible", n);
        }
       }
       else
@@ -275,9 +272,7 @@ void sssp_bfs(void)
          n->status.validkey = 0;
          n->status.waitingforkey = 0;
          n->sent_seqno = 0;
-         asprintf(&name, "hosts/%s-down", n->name);
-         execute_script(name);
-         free(name);
+          run_hooks("node-invisible", n);
        }
       }
     }