diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-27 12:15:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-27 12:15:57 +0000 |
commit | e47d8db1f1c1b8983263075ad00401a49e90560c (patch) | |
tree | ca19db73c777520ff311a2445f53edf3203c0773 /src/libutil/addr.h | |
parent | 2aeb35054e5ed990dd795e0f688be893bf16e243 (diff) | |
download | rspamd-e47d8db1f1c1b8983263075ad00401a49e90560c.tar.gz rspamd-e47d8db1f1c1b8983263075ad00401a49e90560c.zip |
[Minor] Allow to parse and create stack based inet_addr_t
Diffstat (limited to 'src/libutil/addr.h')
-rw-r--r-- | src/libutil/addr.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libutil/addr.h b/src/libutil/addr.h index e648a2b07..2d31e4f23 100644 --- a/src/libutil/addr.h +++ b/src/libutil/addr.h @@ -92,6 +92,16 @@ gboolean rspamd_parse_inet_address_ip4 (const guchar *text, gsize len, gpointer target); /** + * Parse ipv4 or ipv6 address to a static buffer `target`. Does not support Unix sockets + * @param src + * @param srclen + * @param target + * @return + */ +gboolean rspamd_parse_inet_address_ip (const char *src, + gsize srclen, rspamd_inet_addr_t *target); + +/** * Try to parse address from string * @param target target to fill * @param src IP string representation @@ -266,4 +276,10 @@ gboolean rspamd_inet_address_equal (gconstpointer a, gconstpointer b); */ gboolean rspamd_inet_address_is_local (const rspamd_inet_addr_t *addr); +/** + * Returns size of storage required to store a complete IP address + * @return + */ +gsize rspamd_inet_address_storage_size (void); + #endif /* ADDR_H_ */ |