From 89a411447ebc068efbe4c841c95adeaf9a1bbcd0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 4 Jun 2013 14:51:42 +0100 Subject: Allow restriction of update commands for fuzzy storage. Now it is possible to specify ip or networks from which fuzzy updates or removes are possible. Rework sockets logic while I'm here. Create universal utility for parsing ipv4/mask strings. --- src/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 6d0bdc098..39473a85e 100644 --- a/src/util.h +++ b/src/util.h @@ -381,4 +381,13 @@ void rspamd_hash_table_copy (GHashTable *src, GHashTable *dst, */ gpointer rspamd_str_pool_copy (gconstpointer data, gpointer ud); +/** + * Parse ipv4 address with optional mask in CIDR format + * @param line cidr notation of ipv4 address + * @param ina destination address + * @param mask destination mask + * @return + */ +gboolean parse_ipmask_v4 (const char *line, struct in_addr *ina, int *mask); + #endif -- cgit v1.2.3