IPv6Addr-0.2: Library to deal with IPv6 address text representation.

Stabilityprovisional
Maintainermichel.boucey@gmail.com

Text.IPv6Addr.Internal

Description

Dealing with IPv6 address text representation, canonization and manipulations.

Synopsis

Documentation

maybeIPv6AddrToken :: Text -> Maybe IPv6AddrTokenSource

Returns Just one of the valid IPv6AddrToken, or Nothing.

maybeIPv6AddrTokens :: Text -> Maybe [IPv6AddrToken]Source

Returns Just a list of IPv6AddrToken, or Nothing.

ipv6TokensToText :: [IPv6AddrToken] -> Maybe TextSource

Given an arbitrary list of IPv6AddrToken, returns the corresponding Text.

isIPv6Addr :: [IPv6AddrToken] -> BoolSource

Returns True if a list of IPv6AddrToken constitutes a valid IPv6 Address.

maybeTokIPv6Addr :: Text -> Maybe [IPv6AddrToken]Source

This is the main function which returns Just the list of a tokenized IPv6 address's text representation validated against RFC 4291 and canonized in conformation with RFC 5952, or Nothing.

maybeTokPureIPv6Addr :: Text -> Maybe [IPv6AddrToken]Source

Returns Just the list of tokenized pure IPv6 address, always rewriting an embedded IPv4 address if present.

ipv4AddrToIPv6AddrTokens :: IPv6AddrToken -> [IPv6AddrToken]Source

Rewrites Just an embedded IPv4Addr into the corresponding list of pure IPv6Addr tokens.

 ipv4AddrToIPv6AddrTokens (IPv4Addr "127.0.0.1") == [SixteenBits "7f0",Colon,SixteenBits "1"]