-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) {
+ 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);
+ free(address);
+ free(local_address);
+ }
+ }
+
+ return send_request(c, "%d %d", CONTROL, REQ_DUMP_EDGES);