aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.c')
-rw-r--r--src/libutil/util.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c
index a4117d3c3..73ab64453 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -1855,43 +1855,6 @@ rspamd_str_pool_copy (gconstpointer data, gpointer ud)
return data ? rspamd_mempool_strdup (pool, data) : NULL;
}
-gboolean
-parse_ipmask_v4 (const char *line, struct in_addr *ina, int *mask)
-{
- const char *pos;
- char ip_buf[INET_ADDRSTRLEN + 1], mask_buf[3] = { '\0', '\0', '\0' };
-
- bzero (ip_buf, sizeof (ip_buf));
-
- if ((pos = strchr (line, '/')) != NULL) {
- rspamd_strlcpy (ip_buf, line,
- MIN ((gsize)(pos - line), sizeof (ip_buf)));
- rspamd_strlcpy (mask_buf, pos + 1, sizeof (mask_buf));
- }
- else {
- rspamd_strlcpy (ip_buf, line, sizeof (ip_buf));
- }
-
- if (!inet_aton (ip_buf, ina)) {
- return FALSE;
- }
-
- if (mask_buf[0] != '\0') {
- /* Also parse mask */
- *mask = (mask_buf[0] - '0') * 10 + mask_buf[1] - '0';
- if (*mask > 32) {
- return FALSE;
- }
- }
- else {
- *mask = 32;
- }
-
- *mask = G_MAXUINT32 << (32 - *mask);
-
- return TRUE;
-}
-
static volatile sig_atomic_t saved_signo[NSIG];
static
@@ -2253,7 +2216,7 @@ rspamd_inet_address_connect (rspamd_inet_addr_t *addr, gint type,
*/
gchar *
-rspamd_encode_base32(guchar *in, gsize inlen)
+rspamd_encode_base32 (guchar *in, gsize inlen)
{
gint remain = -1, r, x;
gsize i;