]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Main.hs
Moved the min/max address/octetN functions out of IPv4Address and in to Cidr.
[hath.git] / src / Main.hs
index a3b1bfe4a811faad00f6e8503b58de540bd8703f..eeee9f6b6fe07f4ae40b580e093c818042b253c9 100644 (file)
@@ -4,7 +4,15 @@ import System.IO (stderr, hPutStrLn)
 
 import Cidr (Cidr(..),
              cidr_from_string,
-             combine_all)
+             combine_all,
+             max_octet1,
+             max_octet2,
+             max_octet3,
+             max_octet4,
+             min_octet1,
+             min_octet2,
+             min_octet3,
+             min_octet4 )
 
 import CommandLine (help_set,
                     help_text,
@@ -13,7 +21,6 @@ import CommandLine (help_set,
                     parse_errors,
                     parse_mode)
     
-import IPv4Address
 import Octet
     
 -- Some exit codes, used in the ExitFailure constructor.
@@ -54,14 +61,14 @@ cidr_to_regex cidr =
       range2 = numeric_range min2 max2
       range3 = numeric_range min3 max3
       range4 = numeric_range min4 max4
-      min1   = octet_to_int (min_octet1 (ipv4address cidr) (maskbits cidr))
-      min2   = octet_to_int (min_octet2 (ipv4address cidr) (maskbits cidr))
-      min3   = octet_to_int (min_octet3 (ipv4address cidr) (maskbits cidr))
-      min4   = octet_to_int (min_octet4 (ipv4address cidr) (maskbits cidr))
-      max1   = octet_to_int (max_octet1 (ipv4address cidr) (maskbits cidr))
-      max2   = octet_to_int (max_octet2 (ipv4address cidr) (maskbits cidr))
-      max3   = octet_to_int (max_octet3 (ipv4address cidr) (maskbits cidr))
-      max4   = octet_to_int (max_octet4 (ipv4address cidr) (maskbits cidr))
+      min1   = octet_to_int (min_octet1 cidr)
+      min2   = octet_to_int (min_octet2 cidr)
+      min3   = octet_to_int (min_octet3 cidr)
+      min4   = octet_to_int (min_octet4 cidr)
+      max1   = octet_to_int (max_octet1 cidr)
+      max2   = octet_to_int (max_octet2 cidr)
+      max3   = octet_to_int (max_octet3 cidr)
+      max4   = octet_to_int (max_octet4 cidr)