import Data.List (nubBy)
import Test.HUnit
+import Test.QuickCheck
import IPv4Address
import ListUtils
show cidr = (show (ipv4address cidr)) ++ "/" ++ (show (maskbits cidr))
+instance Arbitrary Cidr where
+ arbitrary = do
+ ipv4 <- arbitrary :: Gen IPv4Address
+ mask <- arbitrary :: Gen Maskbits
+ return (Cidr ipv4 mask)
+
+ coarbitrary _ = variant 0
+
+
-- Two CIDR ranges are equivalent if they have the same network bits
-- and the masks are the same.
equivalent :: Cidr -> Cidr -> Bool