combine_all,
contains,
contains_proper,
+ enumerate,
max_octet1,
max_octet2,
max_octet3,
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Test.QuickCheck (Arbitrary(..), Gen, Property, (==>))
+import Text.Read (readMaybe)
import qualified Bit as B
import IPv4Address
-- of its octets (as Ints).
octets_from_cidr_string :: String -> [Octet]
octets_from_cidr_string s =
- mapMaybe octet_from_string (take 4 (splitOneOf "./" s))
+ mapMaybe readMaybe (take 4 (splitOneOf "./" s))
-- | Return Nothing if we can't parse both maskbits and octets from
mbits2 = maskbits cidr2
-
+enumerate :: Cidr -> [IPv4Address]
+enumerate cidr = [(min_host cidr)..(max_host cidr)]
-- HUnit Tests