diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-12 15:34:48 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-12 15:34:48 +0000 |
commit | c4141a343c927e2df8819dbbd9ddffab92901265 (patch) | |
tree | d50fe5ad6143cd4adeb8b66394a9e2c0122b0e6a /src/libutil/addr.h | |
parent | fe68df49f6cdd499f82c4edd320c9a9d20e2c0c0 (diff) | |
download | rspamd-c4141a343c927e2df8819dbbd9ddffab92901265.tar.gz rspamd-c4141a343c927e2df8819dbbd9ddffab92901265.zip |
Add more utility functions required.
Diffstat (limited to 'src/libutil/addr.h')
-rw-r--r-- | src/libutil/addr.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libutil/addr.h b/src/libutil/addr.h index d3778f6a7..dd5b6adb6 100644 --- a/src/libutil/addr.h +++ b/src/libutil/addr.h @@ -174,6 +174,33 @@ gboolean rspamd_parse_host_port (const gchar *str, GPtrArray **addrs, gchar **name, guint default_port, rspamd_mempool_t *pool); +/** + * Destroy the specified IP address + * @param addr + */ void rspamd_inet_address_destroy (rspamd_inet_addr_t *addr); +/** + * Apply the specified mask to an address (ignored for AF_UNIX) + * @param addr + * @param mask + */ +void rspamd_inet_address_apply_mask (rspamd_inet_addr_t *addr, guint mask); + +/** + * Compare a1 and a2 and return value >0, ==0 and <0 if a1 is more, equal or less than a2 correspondingly + * @param a1 + * @param a2 + * @return + */ +gint rspamd_inet_address_compare (const rspamd_inet_addr_t *a1, + const rspamd_inet_addr_t *a2); + +/** + * Performs deep copy of rspamd inet addr + * @param addr + * @return + */ +rspamd_inet_addr_t *rspamd_inet_address_copy (const rspamd_inet_addr_t *addr); + #endif /* ADDR_H_ */ |