268
trie_node_print(struct f_trie_node *t, char **sep)
268
trie_node_format(struct f_trie_node *t, buffer *buf)
273
273
if (ipa_nonzero(t->accept))
275
logn("%s%I/%d{%I}", *sep, t->addr, t->plen, t->accept);
274
buffer_print(buf, "%I/%d{%I}, ", t->addr, t->plen, t->accept);
279
trie_node_print(t->c[0], sep);
280
trie_node_print(t->c[1], sep);
276
trie_node_format(t->c[0], buf);
277
trie_node_format(t->c[1], buf);
285
* @t: trie to be printed
282
* @t: trie to be formatted
283
* @buf: destination buffer
287
* Prints the trie to the log buffer.
285
* Prints the trie to the supplied buffer.
290
trie_print(struct f_trie *t)
288
trie_format(struct f_trie *t, buffer *buf)
290
buffer_puts(buf, "[");
296
logn("%I/%d", IPA_NONE, 0);
299
trie_node_print(&t->root, &sep);
293
buffer_print(buf, "%I/%d", IPA_NONE, 0);
294
trie_node_format(&t->root, buf);
296
/* Undo last separator */
297
if (buf->pos[-1] != '[')
300
buffer_puts(buf, "]");