-void dump_nodes(void)
-{
- avl_node_t *node;
- node_t *n;
-cp
- syslog(LOG_DEBUG, _("Nodes:"));
-
- for(node = node_tree->head; node; node = node->next)
- {
- n = (node_t *)node->data;
- syslog(LOG_DEBUG, _(" %s at %s cipher %d digest %d maclength %d compression %d options %lx status %04x nexthop %s via %s"),
- n->name, n->hostname, n->cipher?n->cipher->nid:0, n->digest?n->digest->type:0, n->maclength, n->compression, n->options,
- n->status, n->nexthop?n->nexthop->name:"-", n->via?n->via->name:"-");
- }
-
- syslog(LOG_DEBUG, _("End of nodes."));
-cp
+int dump_nodes(struct evbuffer *out) {
+ splay_node_t *node;
+ node_t *n;
+
+ for(node = node_tree->head; node; node = node->next) {
+ n = node->data;
+ if(evbuffer_add_printf(out, " %s at %s cipher %d digest %d maclength %d compression %d options %x status %04x nexthop %s via %s distance %d pmtu %d (min %d max %d)\n",
+ n->name, n->hostname, cipher_get_nid(&n->outcipher),
+ digest_get_nid(&n->outdigest), digest_length(&n->outdigest), n->outcompression,
+ n->options, bitfield_to_int(&n->status, sizeof n->status), n->nexthop ? n->nexthop->name : "-",
+ n->via ? n->via->name : "-", n->distance, n->mtu, n->minmtu, n->maxmtu) == -1)
+ return errno;
+ }
+
+ return 0;