diff options
Diffstat (limited to 'usr.sbin/unbound/util/storage/dnstree.c')
-rw-r--r-- | usr.sbin/unbound/util/storage/dnstree.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/unbound/util/storage/dnstree.c b/usr.sbin/unbound/util/storage/dnstree.c index f883044afa4..eef393f91b6 100644 --- a/usr.sbin/unbound/util/storage/dnstree.c +++ b/usr.sbin/unbound/util/storage/dnstree.c @@ -71,6 +71,14 @@ int addr_tree_compare(const void* k1, const void* k2) return 0; } +int addr_tree_addrport_compare(const void* k1, const void* k2) +{ + struct addr_tree_node* n1 = (struct addr_tree_node*)k1; + struct addr_tree_node* n2 = (struct addr_tree_node*)k2; + return sockaddr_cmp(&n1->addr, n1->addrlen, &n2->addr, + n2->addrlen); +} + void name_tree_init(rbtree_type* tree) { rbtree_init(tree, &name_tree_compare); @@ -81,6 +89,11 @@ void addr_tree_init(rbtree_type* tree) rbtree_init(tree, &addr_tree_compare); } +void addr_tree_addrport_init(rbtree_type* tree) +{ + rbtree_init(tree, &addr_tree_addrport_compare); +} + int name_tree_insert(rbtree_type* tree, struct name_tree_node* node, uint8_t* name, size_t len, int labs, uint16_t dclass) { |