aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/addr.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-04 14:15:24 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-04 14:15:24 +0000
commit5836e02b95696a39fc643e9c62ebd9c507634242 (patch)
tree1c0ad2422ea1bc87e3a70fc7a5f50ccf82059738 /src/libutil/addr.h
parentbcf9f0c5710a010783edef75742beef1192c89fb (diff)
downloadrspamd-5836e02b95696a39fc643e9c62ebd9c507634242.tar.gz
rspamd-5836e02b95696a39fc643e9c62ebd9c507634242.zip
[Project] Allow to hash and compare inet addresses considering port
Diffstat (limited to 'src/libutil/addr.h')
-rw-r--r--src/libutil/addr.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libutil/addr.h b/src/libutil/addr.h
index 46b705a4b..bfe586ad1 100644
--- a/src/libutil/addr.h
+++ b/src/libutil/addr.h
@@ -263,7 +263,7 @@ void rspamd_inet_address_apply_mask (rspamd_inet_addr_t *addr, guint mask);
* @return
*/
gint rspamd_inet_address_compare (const rspamd_inet_addr_t *a1,
- const rspamd_inet_addr_t *a2);
+ const rspamd_inet_addr_t *a2, gboolean compare_ports);
/**
* Utility function to compare addresses by in g_ptr_array
@@ -281,15 +281,16 @@ gint rspamd_inet_address_compare_ptr (gconstpointer a1,
rspamd_inet_addr_t *rspamd_inet_address_copy (const rspamd_inet_addr_t *addr);
/**
- * Returns hash for inet address
+ * Returns hash for inet address (ignoring port)
*/
guint rspamd_inet_address_hash (gconstpointer a);
-
+guint rspamd_inet_address_port_hash (gconstpointer a);
/**
* Returns true if two address are equal
*/
gboolean rspamd_inet_address_equal (gconstpointer a, gconstpointer b);
+gboolean rspamd_inet_address_port_equal (gconstpointer a, gconstpointer b);
/**
* Returns TRUE if an address belongs to some local address