Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- randIPv6AddrChunk :: String -> IO IPv6AddrToken
- randPartialIPv6Addr :: Int -> IO [IPv6AddrToken]
- macAddrToIPv6AddrTokens :: Text -> Maybe [IPv6AddrToken]
- getTokIPv6AddrOf :: String -> IO (Maybe [IPv6AddrToken])
- getTokMacAddrOf :: String -> IO (Maybe [IPv6AddrToken])
Documentation
randIPv6AddrChunk :: String -> IO IPv6AddrToken Source #
Returns Just
a random SixteenBit
token based on a mask "____", each
underscore being replaced by a random hexadecimal digit.
randIPv6AddrChunk "_f__" == Just (SixteenBit "bfd4")
randPartialIPv6Addr :: Int -> IO [IPv6AddrToken] Source #
Generates a random partial IPv6Addr
with n SixteenBit
.
macAddrToIPv6AddrTokens :: Text -> Maybe [IPv6AddrToken] Source #
Given a MAC address, returns Just
the corresponding IPv6AddrToken
list, or Nothing
.
macAddrToIPv6AddrTokens "fa:1d:58:cc:95:16" == Just [SixteenBit "fa1d",Colon,SixteenBit "58cc",Colon,SixteenBit "9516"]
getTokIPv6AddrOf :: String -> IO (Maybe [IPv6AddrToken]) Source #
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"]