g_free (tree);
}
+uintptr_t
+radix32_tree_find_addr (radix_tree_t *tree, rspamd_inet_addr_t *addr)
+{
+ if (addr == NULL || addr->af != AF_INET) {
+ return RADIX_NO_VALUE;
+ }
+
+ return radix32tree_find (tree, ntohl (addr->addr.s4.sin_addr.s_addr));
+}
+
/*
* vi:ts=4
*/
#include "config.h"
#include "mem_pool.h"
+#include "util.h"
#define RADIX_NO_VALUE (uintptr_t)-1
*/
uintptr_t radix32tree_find (radix_tree_t *tree, guint32 key);
+/**
+ * Find specified address in tree (works only for ipv4 addresses)
+ * @param tree
+ * @param addr
+ * @return
+ */
+uintptr_t radix32_tree_find_addr (radix_tree_t *tree, rspamd_inet_addr_t *addr);
+
/**
* Traverse via the whole tree calling specified callback
*/