-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 port %hd options %ld socket %d status %04x"),
- c->node->name, c->hostname, c->port, c->options,
- cl->socket, c->status);
- }
-
- syslog(LOG_DEBUG, _("End of connections."));
-cp
+bool dump_connections(connection_t *cdump) {
+ for(list_node_t *node = connection_list->head, *next; node; node = next) {
+ next = node->next;
+ connection_t *c = node->data;
+ send_request(cdump, "%d %d %s %s %x %d %x",
+ CONTROL, REQ_DUMP_CONNECTIONS,
+ c->name, c->hostname, c->options, c->socket,
+ bitfield_to_int(&c->status, sizeof c->status));
+ }
+
+ return send_request(cdump, "%d %d", CONTROL, REQ_DUMP_CONNECTIONS);