-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Network Host Addresses -- -- Host addresses as described in RFC2396 section 3.2.2 with additional -- consideration of -- -- @package hostaddress @version 0.2.0.0 -- | Host addresses as described in RFC2396 section 3.2.2 with additional -- consideration of -- -- -- -- Port numbers must be within the range [0,2^16-1]. -- -- All hostnames are considered fully qualified and thus the final dot is -- omitted. -- -- For hostnames we follow the specification for "Server-based Naming -- Authority" for URIs from RFC2396 section 3.2.2.: -- --
--   hostport      = host [ ":" port ]
--   host          = hostname | IPv4address
--   hostname      = *( domainlabel "." ) toplabel [ "." ]
--   domainlabel   = alphanum | alphanum *( alphanum | "-" ) alphanum
--   toplabel      = alpha | alpha *( alphanum | "-" ) alphanum
--   
--   IPv4address   = 1*digit "." 1*digit "." 1*digit "." 1*digit
--   port          = *digit
--   
-- -- 1*digit designates the decimal representation of an octet. -- The specification takes the form of hostnames from section 2.1 -- RFC1123, but limiting the rightmost (top-most) label to the from given -- in section 3 of RFC1034, which allows to disambiguate domain names and -- IPv4 addresses. -- -- IPv6 Addresses are partially supported. IPv6 address are parsed as -- described in RFC4291, but embedding of IPv4 addresses is not -- supported. IPv6 addresses are printed exactly as they where parsed. No -- normalization is performed. In particular the recommendations from -- RFC5952 are not considered. For host addresses RFC3986 and RFC5952 are -- followed by requiring that IPv6 literals are enclosed in square -- brackets. Anything else from RFC3986, which is concerning URIs is -- ignored. -- -- Additional restriction for hostname apply from RFC1123: labels must -- have not more than 63 octets, letters are case-insensitive. The -- maximum length must not exceed 254 octets, excluding the (optional) -- terminating dot. -- -- See https://cs.uwaterloo.ca/twiki/view/CF/HostNamingRules for -- an extensive overview of different standards for host names. -- -- Non-ascii characters are encoded via Punycode and are of no concern in -- this implementation. module Network.HostAddress data Port portToText :: Port -> Text portFromText :: MonadThrow m => Text -> m Port readPortBytes :: MonadThrow m => ByteString -> m Port data Hostname hostnameBytes :: Hostname -> ByteString readHostnameBytes :: MonadThrow m => ByteString -> m Hostname hostnameToText :: Hostname -> Text hostnameFromText :: MonadThrow m => Text -> m Hostname unsafeHostnameFromText :: HasCallStack => Text -> Hostname type IPv4 = (Word8, Word8, Word8, Word8) type IPv6 = [Maybe Word16] pattern HostName :: CI ByteString -> Hostname pattern HostIPv4 :: IPv4 -> Hostname pattern HostIPv6 :: IPv6 -> Hostname localhost :: Hostname -- | Using explicit IP addresses and not to "localhost" greatly improves -- networking performance and Mac OS X. localhostIPv4 :: Hostname -- | Using explicit IP addresses and not to "localhost" greatly improves -- networking performance and Mac OS X. localhostIPv6 :: Hostname anyIpv4 :: Hostname broadcast :: Hostname loopback :: Hostname isReservedHostname :: Hostname -> Bool isPrivateHostname :: Hostname -> Bool isLocalIp :: IPv4 -> Bool data HostAddress HostAddress :: !Hostname -> !Port -> HostAddress [_hostAddressHost] :: HostAddress -> !Hostname [_hostAddressPort] :: HostAddress -> !Port hostAddressPort :: Lens' HostAddress Port hostAddressHost :: Lens' HostAddress Hostname hostAddressBytes :: HostAddress -> ByteString readHostAddressBytes :: MonadThrow m => ByteString -> m HostAddress hostAddressToText :: HostAddress -> Text hostAddressFromText :: MonadThrow m => Text -> m HostAddress unsafeHostAddressFromText :: HasCallStack => Text -> HostAddress isPrivateHostAddress :: HostAddress -> Bool isReservedHostAddress :: HostAddress -> Bool instance Control.DeepSeq.NFData Network.HostAddress.HostAddressParserException instance Data.Hashable.Class.Hashable Network.HostAddress.HostAddressParserException instance GHC.Generics.Generic Network.HostAddress.HostAddressParserException instance GHC.Classes.Ord Network.HostAddress.HostAddressParserException instance GHC.Classes.Eq Network.HostAddress.HostAddressParserException instance GHC.Show.Show Network.HostAddress.HostAddressParserException instance Data.Hashable.Class.Hashable Network.HostAddress.HostType instance GHC.Generics.Generic Network.HostAddress.HostType instance GHC.Classes.Ord Network.HostAddress.HostType instance GHC.Classes.Eq Network.HostAddress.HostType instance GHC.Show.Show Network.HostAddress.HostType instance GHC.Enum.Enum Network.HostAddress.Port instance GHC.Enum.Bounded Network.HostAddress.Port instance GHC.Num.Num Network.HostAddress.Port instance GHC.Real.Integral Network.HostAddress.Port instance GHC.Real.Real Network.HostAddress.Port instance GHC.Show.Show Network.HostAddress.Port instance Control.DeepSeq.NFData Network.HostAddress.Port instance Data.Hashable.Class.Hashable Network.HostAddress.Port instance GHC.Generics.Generic Network.HostAddress.Port instance GHC.Classes.Ord Network.HostAddress.Port instance GHC.Classes.Eq Network.HostAddress.Port instance Control.DeepSeq.NFData Network.HostAddress.Hostname instance Data.Hashable.Class.Hashable Network.HostAddress.Hostname instance GHC.Generics.Generic Network.HostAddress.Hostname instance GHC.Classes.Ord Network.HostAddress.Hostname instance GHC.Classes.Eq Network.HostAddress.Hostname instance Control.DeepSeq.NFData Network.HostAddress.HostAddress instance Data.Hashable.Class.Hashable Network.HostAddress.HostAddress instance GHC.Generics.Generic Network.HostAddress.HostAddress instance GHC.Classes.Ord Network.HostAddress.HostAddress instance GHC.Classes.Eq Network.HostAddress.HostAddress instance GHC.Show.Show Network.HostAddress.HostAddress instance GHC.Show.Show Network.HostAddress.Hostname instance GHC.Exception.Type.Exception Network.HostAddress.HostAddressParserException