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

Maintainermichel.boucey@gmail.com
Safe HaskellNone

Text.IPv6Addr.Manip

Description

Dealing with IPv6 address text representations, canonization and manipulations.

Synopsis

Documentation

sixteenBitArbToken :: String -> IO IPv6AddrTokenSource

Returns Just an arbitrary SixteenBit token based on a mask "____", each underscore being replaced by a random hexadecimal digit.

 sixteenBitArbToken "_f__" == Just (SixteenBit "bfd4")

partialRandAddr :: Int -> IO [IPv6AddrToken]Source

Generates a partial IPv6Addr with n SixteenBit

macAddrToIPv6AddrTokens :: Text -> Maybe [IPv6AddrToken]Source

Given a MAC address, returns the corresponding IPv6AddrToken list, or an empty list.

 macAddrToIPv6AddrTokens "fa:1d:58:cc:95:16" == [SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]

getTokIPv6AddrOf :: String -> IO (Maybe [IPv6AddrToken])Source

Given a valid name of a local network interface, returns Just the list of tokens of the interface's IPv6 address, or Nothing.

 getTokIPv6AddrOf "eth0" == Just [SixteenBit "fe80",DoubleColon,SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]

getTokMacAddrOf :: String -> IO (Maybe [IPv6AddrToken])Source

Given a valid name of a local network interface, returns Just the corresponding list of IPv6AddrToken of the interface's MAC Address, or Nothing.

 getTokMacAddrOf "eth0" == Just [SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]