-void dump_edges(void)
-{
- avl_node_t *node;
- edge_t *e;
- char *address;
-cp
- syslog(LOG_DEBUG, _("Edges:"));
-
- for(node = edge_tree->head; node; node = node->next)
- {
- e = (edge_t *)node->data;
- address = sockaddr2hostname(&e->address);
- syslog(LOG_DEBUG, _(" %s to %s at %s options %lx weight %d"),
- e->from->name, e->to->name, address,
- e->options, e->weight);
- free(address);
- }
-
- syslog(LOG_DEBUG, _("End of edges."));
-cp
+bool dump_edges(connection_t *c) {
+ splay_node_t *node, *node2;
+ node_t *n;
+ edge_t *e;
+ char *address;
+
+ for(node = node_tree->head; node; node = node->next) {
+ n = node->data;
+ for(node2 = n->edge_tree->head; node2; node2 = node2->next) {
+ e = node2->data;
+ address = sockaddr2hostname(&e->address);
+ send_request(c, "%d %d %s to %s at %s options %x weight %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);