-/* Debugging */
-
-void dump_connection_list(void)
-{
- rbl_t *rbl;
- connection_t *cl;
-cp
- syslog(LOG_DEBUG, _("Connection list:"));
-
- syslog(LOG_DEBUG, _(" %s at %s port %hd flags %d sockets %d, %d status %04x"),
- myself->name, myself->hostname, myself->port, myself->flags,
- myself->socket, myself->meta_socket, myself->status);
-
- RBL_FOREACH(connection_tree, rbl)
- {
- cl = (connection_t *)rbl->data;
- syslog(LOG_DEBUG, _(" %s at %s port %hd flags %d sockets %d, %d status %04x"),
- cl->name, cl->hostname, cl->port, cl->flags,
- cl->socket, cl->meta_socket, cl->status);
- }
-
- syslog(LOG_DEBUG, _("End of connection list."));
-cp
+int dump_connections(struct evbuffer *out) {
+ splay_node_t *node;
+ connection_t *c;
+
+ for(node = connection_tree->head; node; node = node->next) {
+ c = node->data;
+ if(evbuffer_add_printf(out,
+ " %s at %s options %x socket %d status %04x\n",
+ c->name, c->hostname, c->options, c->socket,
+ bitfield_to_int(&c->status, sizeof c->status)) == -1)
+ return errno;
+ }
+
+ return 0;