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

Safe HaskellNone



Dealing with IPv6 address text representations, canonization and manipulations.

  • ----------------------------------------------------------------------------



maybeIPv6Addr :: Text -> Maybe IPv6AddrSource

Returns Just the text representation of a canonized IPv6Addr in conformation with RFC 5952, or Nothing.

 maybeIPv6Addr "0:0::FFFF:" == Just (IPv6Addr "::ffff:")

maybePureIPv6Addr :: Text -> Maybe IPv6AddrSource

Returns Just a pure IPv6Addr, or Nothing.

 maybePureIPv6Addr "::ffff:" == Just (IPv6Addr "::ffff:c000:280")

maybeFullIPv6Addr :: Text -> Maybe IPv6AddrSource

Returns Just a pure and expanded IPv6Addr, or Nothing.

 maybeFullIPv6Addr "::ffff:" == Just (IPv6Addr "0000:0000:0000:0000:0000:ffff:c000:0280")

getIPv6AddrOf :: String -> IO (Maybe IPv6Addr)Source

Returns Just the canonized IPv6Addr of the given network interface, or Nothing.

 getIPv6AddrOf "eth0"

ip6arpa :: Text -> Maybe TextSource

Returns Just the reverse lookup domain name corresponding of the given IPv6 address, as define in RFC 3596 Section 2.5, or Nothing.

 ip6arpa "4321:0:1:2:3:4:567:89ab" == Just "b.a."