module IPv4Address
( ipv4address_from_octets,
IPv4Address(None),
- Maskbits,
max_octet1,
max_octet2,
max_octet3,
where
import Bit
+import Maskbits
import Octet
-type Maskbits = Int
-
data IPv4Address = None | IPv4Address { octet1 :: Octet,
octet2 :: Octet,
octet3 :: Octet,
min_address :: IPv4Address -> Maskbits -> IPv4Address
-min_address addr mask
+min_address _ Maskbits.None = IPv4Address.None
+min_address addr (Maskbits mask)
| mask == 32 = IPv4Address oct1 oct2 oct3 oct4
| mask == 31 = IPv4Address oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 a30 a31 Zero)
| mask == 30 = IPv4Address oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 a30 Zero Zero)
max_address :: IPv4Address -> Maskbits -> IPv4Address
-max_address addr mask
+max_address _ Maskbits.None = IPv4Address.None
+max_address addr (Maskbits mask)
| mask == 32 = IPv4Address oct1 oct2 oct3 oct4
| mask == 31 = IPv4Address oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 a30 a31 One)
| mask == 30 = IPv4Address oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 a30 One One)