/*
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
#include "system.h"
#include "splay_tree.h"
-#include "control_common.h"
#include "edge.h"
#include "logger.h"
#include "netutl.h"
/* 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) {
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);
-}