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:
@@ -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
|
||||
|
Reference in New Issue
Block a user