Data.IP
Description
Data structures to express IPv4, IPv6 and IP range.
Documentation
IP data
IP range data
The Addr range consists of an address, a contiguous mask, and mask length. The contiguous mask and the mask length are essentially same information but contained for pre calculation.
To create this, use makeAddrRange or read "192.0.2.0/24" :: AddrRange IPv4.
Also, "192.0.2.0/24" can be used as literal with OverloadedStrings.
Address class
makeAddrRange :: Addr a => a -> Int -> AddrRange aSource
The makeAddrRange functions takes an Addr address and a mask
length. It creates a bit mask from the mask length and masks
the Addr address, then returns AddrRange made of them.