X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FIPv4Address.hs;h=f7b4a656db96b2ea962a07404d842325e10cad3b;hb=42cb2fa791d4c8a00f9bd7a95b1ec7891d4708ed;hp=f52a423a8ffc39894cfbdd01175cbc21fa4a24bb;hpb=75038b45b9c379d8313511e58c3c0fe680810883;p=hath.git 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.