1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

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.
This commit is contained in:
Ondrej Zajicek (work)
2021-11-26 03:26:36 +01:00
parent 062e69bf52
commit 14fc24f3a5
4 changed files with 359 additions and 2 deletions

View File

@@ -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