Move check_if_ipmask() from support.* to match.*.
[ircu2.10.12-pk.git] / ircd / match.c
index 5cb91da54b3dea2059ac4df0ba1edf2b7b6b2206..615a52f005f3750ef4e52f1f9b8cfd8231355df6 100644 (file)
@@ -24,7 +24,6 @@
 #include "ircd_chattr.h"
 #include "ircd_string.h"
 #include "ircd_snprintf.h"
-#include "support.h"
 
 /*
  * mmatch()
@@ -814,6 +813,22 @@ static int ipmask_parse_ipv4(const char *in, struct in_addr *out)
   return bits;
 }
 
+int check_if_ipmask(const char *mask)
+{
+  int has_digit = 0;
+  const char *p;
+
+  for (p = mask; *p; ++p)
+    if (*p != '*' && *p != '?' && *p != '.' && *p != '/')
+    {
+      if (!IsDigit(*p))
+        return 0;
+      has_digit = -1;
+    }
+
+  return has_digit;
+}
+
 int ipmask_parse(const char *in, struct irc_in_addr *mask, unsigned char *bits_ptr)
 {
   struct in_addr ipv4;