]> gitweb.michael.orlitzky.com - hath.git/commitdiff
Added min/max_address for IPv4Address.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 23 May 2010 16:20:39 +0000 (12:20 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 23 May 2010 16:20:39 +0000 (12:20 -0400)
src/IPv4Address.hs

index f52a423a8ffc39894cfbdd01175cbc21fa4a24bb..f7b4a656db96b2ea962a07404d842325e10cad3b 100644 (file)
@@ -105,6 +105,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.