IPv6Addr-0.4: Library to deal with IPv6 address text representations.

Safe HaskellNone



Dealing with IPv6 address text representations, canonization and manipulations.



maybeIPv6AddrTokens :: Text -> Maybe [IPv6AddrToken]Source

Tokenize a Text into Just a list of IPv6AddrToken, or Nothing.

ipv4AddrToIPv6AddrTokens :: IPv6AddrToken -> [IPv6AddrToken]Source

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

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

ipv6TokensToText :: [IPv6AddrToken] -> 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 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.

fromIPv6Addr :: IPv6Addr -> TextSource

Returns the Text of an IPv6 address.