]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/IPv4Address.hs
Allow apply_mask to take a Bit argument that will be used to replace the host bits.
[hath.git] / src / IPv4Address.hs
index f52a423a8ffc39894cfbdd01175cbc21fa4a24bb..d15f88f0775eb3140e63bba29e48c0a6c4d160f1 100644 (file)
@@ -2,6 +2,8 @@ module IPv4Address
 ( ipv4address_from_octets,
   ipv4address_tests,
   IPv4Address(None),
+  max_address,
+  min_address,
   most_sig_bit_different,
   octet1,
   octet2,
@@ -105,6 +107,16 @@ ipv4address_from_octets oct1 oct2 oct3 oct4
     | otherwise = IPv4Address oct1 oct2 oct3 oct4
 
 
+-- The minimum possible IPv4 address, 0.0.0.0.
+min_address :: IPv4Address
+min_address = IPv4Address min_octet min_octet min_octet min_octet
+
+
+-- The maximum possible IPv4 address, 255.255.255.255.
+max_address :: IPv4Address
+max_address = IPv4Address max_octet max_octet max_octet max_octet
+
+
 -- Given two addresses, find the number of the most significant bit
 -- where they differ. If the addresses are the same, return
 -- Maskbits.Zero.