aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/addr.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-28 13:37:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-28 13:37:22 +0100
commit04127efebacaaa088668198cdbe52f933367b731 (patch)
tree5e19bd17ac25d675666f53b19f746681a57e89da /src/libutil/addr.h
parent8e5517a62b981fedc9e42d1323b066fadf086f1a (diff)
downloadrspamd-04127efebacaaa088668198cdbe52f933367b731.tar.gz
rspamd-04127efebacaaa088668198cdbe52f933367b731.zip
[Fix] Distinguish remote and local addrs parsing
Diffstat (limited to 'src/libutil/addr.h')
-rw-r--r--src/libutil/addr.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libutil/addr.h b/src/libutil/addr.h
index 06413a51a..6a33ad7ec 100644
--- a/src/libutil/addr.h
+++ b/src/libutil/addr.h
@@ -86,6 +86,13 @@ rspamd_inet_addr_t *rspamd_inet_address_from_rnds (
gboolean rspamd_parse_inet_address_ip6 (const guchar *text, gsize len,
gpointer target);
+enum rspamd_inet_address_parse_flags {
+ RSPAMD_INET_ADDRESS_PARSE_DEFAULT = 0,
+ RSPAMD_INET_ADDRESS_PARSE_REMOTE = 1u << 0u,
+ RSPAMD_INET_ADDRESS_PARSE_NO_UNIX = 1u << 1u,
+ RSPAMD_INET_ADDRESS_PARSE_NO_PORT = 1u << 2u,
+};
+
/**
* Parse string with ipv4 address of length `len` to `target` which should be
* at least sizeof (in4_addr_t)
@@ -105,7 +112,8 @@ gboolean rspamd_parse_inet_address_ip4 (const guchar *text, gsize len,
* @return
*/
gboolean rspamd_parse_inet_address_ip (const char *src,
- gsize srclen, rspamd_inet_addr_t *target);
+ gsize srclen,
+ rspamd_inet_addr_t *target);
/**
* Try to parse address from string
@@ -115,7 +123,8 @@ gboolean rspamd_parse_inet_address_ip (const char *src,
*/
gboolean rspamd_parse_inet_address (rspamd_inet_addr_t **target,
const char *src,
- gsize srclen);
+ gsize srclen,
+ enum rspamd_inet_address_parse_flags how);
/**
* Use memory pool allocated inet address
@@ -126,7 +135,8 @@ gboolean rspamd_parse_inet_address (rspamd_inet_addr_t **target,
*/
rspamd_inet_addr_t *rspamd_parse_inet_address_pool (const char *src,
gsize srclen,
- rspamd_mempool_t *pool);
+ rspamd_mempool_t *pool,
+ enum rspamd_inet_address_parse_flags how);
/**
* Returns string representation of inet address