-void dump_connections(void)
-{
- avl_node_t *node;
- connection_t *c;
- cp();
- syslog(LOG_DEBUG, _("Connections:"));
-
- for(node = connection_tree->head; node; node = node->next)
- {
- c = (connection_t *)node->data;
- syslog(LOG_DEBUG, _(" %s at %s options %lx socket %d status %04x"),
- c->name, c->hostname, c->options, c->socket, c->status);
- }
-
- syslog(LOG_DEBUG, _("End of connections."));
- cp();
+int dump_connections(struct evbuffer *out) {
+ splay_node_t *node;
+ connection_t *c;
+
+ cp();
+
+ for(node = connection_tree->head; node; node = node->next) {
+ c = node->data;
+ if(evbuffer_add_printf(out,
+ _(" %s at %s options %lx socket %d status %04x\n"),
+ c->name, c->hostname, c->options, c->socket,
+ c->status.value) == -1)
+ return errno;
+ }
+
+ return 0;