MINOR: standard: Add function for converting cidr to network mask.
diff --git a/src/standard.c b/src/standard.c
index 81df8b1..89af08f 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -791,6 +791,18 @@
 	return 1;
 }
 
+/* convert <cidr> to struct in_addr <mask>. It returns 1 if the conversion
+ * succeeds otherwise zero.
+ */
+int cidr2dotted(int cidr, struct in_addr *mask) {
+
+	if (cidr < 0 || cidr > 32)
+		return 0;
+
+	mask->s_addr = cidr ? htonl(~0UL << (32 - cidr)) : 0;
+	return 1;
+}
+
 /*
  * converts <str> to two struct in_addr* which must be pre-allocated.
  * The format is "addr[/mask]", where "addr" cannot be empty, and mask