BJ?w%      !"#$#Copyright Michel Boucey 2011-2015 BSD-Stylemichel.boucey@gmail.com Safe-Inferred=An embedded IPv4 address as representation of the last 32-BitPA double-colon stands for a unique compression of many consecutive 16-Bit chunks!A separator between 16-Bit chunksAn all zeros 16-Bit chunk;A four hexadecimal digits group representing a 16-Bit chunk  #Copyright Michel Boucey 2011-2015 BSD-Stylemichel.boucey@gmail.com Safe-Inferred  Returns the % of an IPv6 address. Given an arbitrary list of , returns the corresponding %.&Returns the corresponding % of an IPv6 address token. Returns ' if a list of " constitutes a valid IPv6 Address. (This is the main function which returns ( the list of a tokenized IPv6 address text representation validated against RFC 4291 and canonized in conformation with RFC 5952, or ). Returns (` the list of tokenized pure IPv6 address, always rewriting an embedded IPv4 address if present. Tokenize a % into ( a list of , or ).*+An embedded IPv4 address have to be rewritten to output a pure IPv6 Address text representation in hexadecimal digits. But some well-known prefixed IPv6 addresses have to keep visible in their text representation the fact that they deals with IPv4 to IPv6 transition process (RFC 5952 Section 5):-IPv4-compatible IPv6 address like "::1.2.3.4".IPv4-mapped IPv6 address like "::ffff:1.2.3.4"/IPv4-translated address like "::ffff:0:1.2.3.4"1IPv4-translatable address like "64:ff9b::1.2.3.4"(ISATAP address like "fe80::5efe:1.2.3.4"Rewrites an embedded % into the corresponding list of pure  tokens. \ipv4AddrToIPv6AddrTokens (IPv4Addr "127.0.0.1") == [SixteenBits "7f0",Colon,SixteenBits "1"]+ & , *-./0123     + & , *-./0123#Copyright Michel Boucey 2011-2015 BSD-Stylemichel.boucey@gmail.com Safe-InferredReturns ( a random ] token based on a mask "____", each underscore being replaced by a random hexadecimal digit. 4randIPv6AddrChunk "_f__" == Just (SixteenBit "bfd4")Generates a random partial  with n /Given a MAC address, returns the corresponding  list, or an empty list. rmacAddrToIPv6AddrTokens "fa:1d:58:cc:95:16" == [SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]9Given a valid name of a local network interface, returns (9 the list of tokens of the interface's IPv6 address, or ). getTokIPv6AddrOf "eth0" == Just [SixteenBit "fe80",DoubleColon,SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]:Given a valid name of a local network interface, returns ( the corresponding list of % of the interface's MAC Address, or ). bgetTokMacAddrOf "eth0" == Just [SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]None Returns () the text representation of a canonized # in conformation with RFC 5952, or ). MmaybeIPv6Addr "0:0::FFFF:192.0.2.128" == Just (IPv6Addr "::ffff:192.0.2.128")Returns ( a pure , or ). KmaybePureIPv6Addr "::ffff:192.0.2.128" == Just (IPv6Addr "::ffff:c000:280")Returns ( a pure and fully expanded , or ). cmaybeFullIPv6Addr "::ffff:192.0.2.128" == Just (IPv6Addr "0000:0000:0000:0000:0000:ffff:c000:0280")Returns 'E if arguments are two textual representations of a same IPv6 address.fReturns the reverse lookup domain name corresponding of the given IPv6 address (RFC 3596 Section 2.5). }toIP6ARPA (IPv6Addr "4321:0:1:2:3:4:567:89ab") == "b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.0.0.0.0.1.2.3.4.IP6.ARPA."  Given an , returns the corresponding 4.! Given an IPv6addr, returns the corresponding 5 address."Returns ( the canonized + of the given local network interface, or ). getIPv6AddrOf "eth0"#Returns a random .$Returns a random #, optionally with the given prefix. .randIPv6AddrWithPrefix (Just "4321:0:1:2:3:4")  !"#$6   !"#$  ! "#$  !"#$67       !"#$%&'()*+,-./012013456789:;<=>?@ABCDEIPv6Addr-0.6.0.1Text.IPv6Addr.TypesText.IPv6Addr.InternalText.IPv6Addr.Manip Text.IPv6Addr IPv6AddrTokenIPv4Addr DoubleColonColonAllZeros SixteenBitIPv6Addr$fShowIPv6Addr fromIPv6Addripv6TokensToText isIPv6AddrmaybeTokIPv6AddrmaybeTokPureIPv6AddrmaybeIPv6AddrTokensipv4AddrToIPv6AddrTokens expandTokensfromDoubleColon toDoubleColonipv6TokensToIPv6AddrnetworkInterfacesIPv6AddrListmacAddrrandIPv6AddrChunkrandPartialIPv6AddrmacAddrToIPv6AddrTokensgetTokIPv6AddrOfgetTokMacAddrOf maybeIPv6AddrmaybePureIPv6AddrmaybeFullIPv6Addr sameIPv6Addr toIP6ARPA toHostNametoIPv6 getIPv6AddrOf randIPv6AddrrandIPv6AddrWithPrefix text-1.2.0.4Data.Text.InternalTextipv6TokenToTextghc-prim GHC.TypesTruebase Data.MaybeJustNothingipv4AddrRewritetok0 countIPv4AddrfullSixteenBit sixteenBitipv4Addr doubleColoncolonipv6AddrFullChunkhexaCharnetwork-2.6.0.2Network.SocketHostName iproute-1.3.2 Data.IP.AddrIPv6 $fEqIPv6Addr