) where
import Test.HUnit
+import Test.QuickCheck
import qualified Bit as B
import Maskbits
oct4 = (octet4 addr)
+instance Arbitrary IPv4Address where
+ arbitrary = do
+ oct1 <- arbitrary :: Gen Octet
+ oct2 <- arbitrary :: Gen Octet
+ oct3 <- arbitrary :: Gen Octet
+ oct4 <- arbitrary :: Gen Octet
+ return (IPv4Address oct1 oct2 oct3 oct4)
+
+ coarbitrary _ = variant 0
+
+
+
-- We don't export our constructor so this function is the only
-- way to construct an address from octets. As a result, we can
-- return IPv4Address.None in response to being passed one of more