- for(node = node_tree->head; node; node = node->next) {
- n = (node_t *) node->data;
- for(node2 = n->edge_tree->head; node2; node2 = node2->next) {
- e = (edge_t *) node2->data;
- address = sockaddr2hostname(&e->address);
- logger(LOG_DEBUG, _(" %s to %s at %s options %lx weight %d"),
- e->from->name, e->to->name, address, e->options, e->weight);
+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);
+ char *local_address = sockaddr2hostname(&e->local_address);
+ send_request(c, "%d %d %s %s %s %s %x %d",
+ CONTROL, REQ_DUMP_EDGES,
+ e->from->name, e->to->name, address,
+ local_address, e->options, e->weight);