-connection_t *lookup_active(ipv4_t address, short unsigned int port)
-{
- connection_t cl;
-cp
- cl.address = address;
- cl.port = port;
-
- return avl_search(active_tree, &cl);
-}
-
-connection_t *lookup_id(char *name)
-{
- connection_t cl, *p;
-cp
- cl.name = name;
- p = avl_search(id_tree, &cl);
- if(p)
- return p;
- else
- return NULL;
-}
-
-/* Debugging */
-
-void dump_connection_list(void)
-{
- avl_node_t *node;
- connection_t *cl;
-cp
- syslog(LOG_DEBUG, _("Connection list:"));
-
- for(node = connection_tree->head; node; node = node->next)
- {
- cl = (connection_t *)node->data;
- syslog(LOG_DEBUG, _(" %s at %s port %hd options %ld sockets %d, %d status %04x"),
- cl->name, cl->hostname, cl->port, cl->options,
- cl->socket, cl->meta_socket, cl->status);
- }
-
- syslog(LOG_DEBUG, _("Known hosts:"));
-
- for(node = id_tree->head; node; node = node->next)
- {
- cl = (connection_t *)node->data;
- syslog(LOG_DEBUG, _(" %s at %s port %hd options %ld sockets %d, %d status %04x nexthop %s lastbutonehop %s"),
- cl->name, cl->hostname, cl->port, cl->options,
- cl->socket, cl->meta_socket, cl->status, cl->nexthop->name, cl->lastbutonehop->name);
- }
-
- syslog(LOG_DEBUG, _("End of connection list."));
-cp
-}
+ for(node = connection_tree->head; node; node = node->next) {
+ c = node->data;
+ send_request(cdump, "%d %d %s at %s options %x socket %d status %04x",
+ CONTROL, REQ_DUMP_CONNECTIONS,
+ c->name, c->hostname, c->options, c->socket,
+ bitfield_to_int(&c->status, sizeof c->status));
+ }