From: Michael Orlitzky Date: Sun, 23 May 2010 16:20:39 +0000 (-0400) Subject: Added min/max_address for IPv4Address. X-Git-Tag: 0.0.1~29 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=42cb2fa791d4c8a00f9bd7a95b1ec7891d4708ed;p=hath.git Added min/max_address for IPv4Address. --- diff --git a/src/IPv4Address.hs b/src/IPv4Address.hs index f52a423..f7b4a65 100644 --- a/src/IPv4Address.hs +++ b/src/IPv4Address.hs @@ -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.