From 42cb2fa791d4c8a00f9bd7a95b1ec7891d4708ed Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 23 May 2010 12:20:39 -0400 Subject: [PATCH] Added min/max_address for IPv4Address. --- src/IPv4Address.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- 2.44.2