summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-11-26 03:26:36 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-11-26 03:26:36 +0100
commit14fc24f3a53ebc5525b854ccdc93274aa74a400f (patch)
treeef3cbfe4e0e6ff1c1d21677c232626e08ee8d5e8 /test
parent062e69bf520e5788913bdd564076ad9892b24a87 (diff)
Trie: Implement longest-prefix-match queries and walks
The prefix trie now supports longest-prefix-match query by function trie_match_longest_ipX() and it can be extended to iteration over all covering prefixes for a given prefix (from longest to shortest) using TRIE_WALK_TO_ROOT_IPx() macro.
Diffstat (limited to 'test')
-rw-r--r--test/birdtest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/birdtest.c b/test/birdtest.c
index 053954e1..6ad743ce 100644
--- a/test/birdtest.c
+++ b/test/birdtest.c
@@ -510,7 +510,10 @@ bt_fmt_ipa(char *buf, size_t size, const void *data)
void
bt_format_net(char *buf, size_t size, const void *data)
{
- bsnprintf(buf, size, "%N", (const net_addr *) data);
+ if (data)
+ bsnprintf(buf, size, "%N", (const net_addr *) data);
+ else
+ bsnprintf(buf, size, "(null)");
}
int