iproute-1.7.0: IP Routing Table

Safe HaskellNone
LanguageHaskell2010

Data.IP.Internal

Synopsis

Documentation

newtype IPv4 Source

The abstract data type to express an IPv4 address. To create this, use toIPv4. Or use read "192.0.2.1" :: IPv4, for example. Also, "192.0.2.1" can be used as literal with OverloadedStrings.

>>> read "192.0.2.1" :: IPv4
192.0.2.1

Constructors

IP4 IPv4Addr 

newtype IPv6 Source

The abstract data type to express an IPv6 address. To create this, use toIPv6. Or use read "2001:DB8::1" :: IPv6, for example. Also, "2001:DB8::1" can be used as literal with OverloadedStrings.

>>> read "2001:db8:00:00:00:00:00:01" :: IPv6
2001:db8::1
>>> read "2001:db8:11e:c00::101" :: IPv6
2001:db8:11e:c00::101
>>> read "2001:db8:11e:c00:aa:bb:192.0.2.1" :: IPv6
2001:db8:11e:c00:aa:bb:c000:201
>>> read "2001:db8::192.0.2.1" :: IPv6
2001:db8::c000:201
>>> read "0::ffff:192.0.2.1" :: IPv6
::ffff:192.0.2.1
>>> read "0::0:c000:201" :: IPv6
::192.0.2.1
>>> read "::0.0.0.1" :: IPv6
::1

Constructors

IP6 IPv6Addr 

data AddrRange a Source

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.

>>> read "192.0.2.1/24" :: AddrRange IPv4
192.0.2.0/24
>>> read "2001:db8:00:00:00:00:00:01/48" :: AddrRange IPv6
2001:db8::/48

Constructors

AddrRange 

Fields

addr :: !a

The addr function returns an address from AddrRange.

mask :: !a

The mask function returns a contiguous IP mask from AddrRange.

mlen :: !Int

The mlen function returns a mask length from AddrRange.