]> git.meshlink.io Git - meshlink/blobdiff - src/edge.c
Remove everything GPL that is not copyright Guus Sliepen, update copyright statements.
[meshlink] / src / edge.c
index 4fc36e40d4aa7b270e8513c9b213f5084cadc6ac..88847909c01b3fb9e31b19e5a08e1a444e293974 100644 (file)
@@ -1,7 +1,6 @@
 /*
     edge.c -- edge tree management
-    Copyright (C) 2000-2006 Guus Sliepen <guus@tinc-vpn.org>,
-                  2000-2005 Ivo Timmermans
+    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
 
     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
@@ -21,7 +20,6 @@
 #include "system.h"
 
 #include "splay_tree.h"
-#include "control_common.h"
 #include "edge.h"
 #include "logger.h"
 #include "netutl.h"
@@ -70,7 +68,7 @@ void exit_edges(void) {
 /* Creation and deletion of connection elements */
 
 edge_t *new_edge(void) {
-       return xmalloc_and_zero(sizeof(edge_t));
+       return xzalloc(sizeof(edge_t));
 }
 
 void free_edge(edge_t *e) {
@@ -105,18 +103,3 @@ edge_t *lookup_edge(node_t *from, node_t *to) {
 
        return splay_search(from->edge_tree, &v);
 }
-
-bool dump_edges(connection_t *c) {
-       for splay_each(node_t, n, node_tree) {
-               for splay_each(edge_t, e, n->edge_tree) {
-                       char *address = sockaddr2hostname(&e->address);
-                       send_request(c, "%d %d %s %s %s %x %d",
-                                       CONTROL, REQ_DUMP_EDGES,
-                                       e->from->name, e->to->name, address,
-                                       e->options, e->weight);
-                       free(address);
-               }
-       }
-
-       return send_request(c, "%d %d", CONTROL, REQ_DUMP_EDGES);
-}