-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Internet Protocol data structures
--   
--   This package provides Internet Protocol data structures
@package network-ip
@version 0.3


-- | Internet Protocol addressing.
module Network.IP.Addr

-- | IPv4 address.
newtype IP4
IP4 :: Word32 -> IP4
[unIP4] :: IP4 -> Word32

-- | <a>IP4</a> proxy value.
anIP4 :: Proxy IP4

-- | The octets of an IPv4 address.
ip4ToOctets :: IP4 -> (Word8, Word8, Word8, Word8)

-- | List the octets of an IPv4 address.
ip4ToOctetList :: IP4 -> [Word8]

-- | Assemble IPv4 address from the octets.
ip4FromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IP4

-- | Assemble IPv4 address from the octet list.
ip4FromOctetList :: [Word8] -> Maybe IP4

-- | IPv4 address <tt>0.0.0.0</tt>.
anyIP4 :: IP4

-- | IPv4 address <tt>127.0.0.1</tt>.
loopbackIP4 :: IP4

-- | IPv4 address <tt>255.255.255.255</tt>.
broadcastIP4 :: IP4

-- | IPv4 address range classification (per RFC6890).
data Range4

-- | General IPv4 address.
GeneralIP4 :: Range4

-- | This host on this network.
ThisHostIP4 :: Range4

-- | Private-Use networks.
PrivateUseIP4 :: Range4

-- | Shared address space.
SharedSpaceIP4 :: Range4

-- | Loopback address.
LoopbackIP4 :: Range4

-- | Link local address.
LinkLocalIP4 :: Range4

-- | Reserved address.
ReservedIP4 :: Range4

-- | Dual-Stack Lite.
DSLiteIP4 :: Range4

-- | Reserved for documentation.
DocumentationIP4 :: Range4

-- | 6to4.
IP6To4IP4 :: Range4

-- | Benchmark testing.
BenchmarkingIP4 :: Range4

-- | Multicast address.
MulticastIP4 :: Range4

-- | Future use.
FutureUseIP4 :: Range4

-- | Limited broadcast.
BroadcastIP4 :: Range4

-- | Determine the address range type.
ip4Range :: IP4 -> Range4

-- | IPv6 address.
newtype IP6
IP6 :: Word128 -> IP6
[unIP6] :: IP6 -> Word128

-- | <a>IP6</a> proxy value.
anIP6 :: Proxy IP6

-- | The 16-bit pieces of an IPv6 address.
ip6ToWords :: IP6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)

-- | List the 16-bit pieces of an IPv6 address.
ip6ToWordList :: IP6 -> [Word16]

-- | Assemble IPv6 address from the 16-bit pieces.
ip6FromWords :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IP6

-- | Assemble IPv6 address from the list of 16-bit pieces.
ip6FromWordList :: [Word16] -> Maybe IP6

-- | IPv6 address <tt>::</tt>.
anyIP6 :: IP6

-- | IPv6 address <tt>::1</tt>.
loopbackIP6 :: IP6

-- | IPv6 address range classification (per RFC6890).
data Range6

-- | General IPv6 address.
GeneralIP6 :: Range6

-- | Unspecified address.
AnyIP6 :: Range6

-- | Loopback address.
LoopbackIP6 :: Range6

-- | Mapped IPv4 address.
IP4MappedIP6 :: Range6

-- | Embedded IPv4 address.
IP4EmbeddedIP6 :: Range6

-- | Discard address.
DiscardIP6 :: Range6

-- | Reserved address.
ReservedIP6 :: Range6

-- | Teredo address.
TeredoIP6 :: Range6

-- | Benchmark testing.
BenchmarkingIP6 :: Range6

-- | Reserved for documentation.
DocumentationIP6 :: Range6

-- | ORCHID address.
OrchidIP6 :: Range6

-- | 6to4.
IP6To4IP6 :: Range6

-- | Unique local address.
UniqueLocalIP6 :: Range6

-- | Link local address.
LinkLocalIP6 :: Range6

-- | Multicast address.
MulticastIP6 :: Range6

-- | Determine the address range type.
ip6Range :: IP6 -> Range6

-- | IPv4- or IPv6-specific data.
data IP46 t₄ t₆
IPv4 :: t₄ -> IP46 t₄ t₆
IPv6 :: t₆ -> IP46 t₄ t₆

-- | <a>IP46</a> proxy value.
anIP46 :: Proxy IP46

-- | <a>IP46</a> <i>t₄</i> <i>t₆</i> proxy value.
anIP46Of :: Proxy t₄ -> Proxy t₆ -> Proxy (IP46 t₄ t₆)

-- | IP address.
type IP = IP46 IP4 IP6

-- | <a>IP</a> proxy value.
anIP :: Proxy IP

-- | Network address.
class IsNetAddr n where type NetHost n where {
    type family NetHost n;
}

-- | Host address.
netHost :: IsNetAddr n => n -> NetHost n

-- | Host index.
netHostIx :: IsNetAddr n => n -> NetHost n

-- | Network prefix.
netPrefix :: IsNetAddr n => n -> NetHost n

-- | Network mask.
netMask :: IsNetAddr n => n -> NetHost n

-- | Network prefix length.
netLength :: IsNetAddr n => n -> Word8

-- | Make a network address.
netAddr :: IsNetAddr n => NetHost n -> Word8 -> n

-- | Test if the address is in the network.
inNetwork :: IsNetAddr n => NetHost n -> n -> Bool

-- | IPv4 network address.
type Net4Addr = NetAddr IP4

-- | IPv6 network address.
type Net6Addr = NetAddr IP6

-- | Network address: host address + network prefix length.
data NetAddr a

-- | <a>NetAddr</a> proxy value.
aNetAddr :: Proxy NetAddr

-- | <a>NetAddr</a> <i>a</i> proxy value.
aNetAddrOf :: Proxy a -> Proxy (NetAddr a)

-- | <a>Net4Addr</a> proxy value.
aNet4Addr :: Proxy Net4Addr

-- | <a>Net6Addr</a> proxy value.
aNet6Addr :: Proxy Net6Addr

-- | <a>NetAddr</a> <a>IP</a> proxy value.
aNetAddrIP :: Proxy (NetAddr IP)

-- | An alias for <a>netAddr</a>.
net4Addr :: IP4 -> Word8 -> Net4Addr

-- | An alias for <a>netAddr</a>.
net6Addr :: IP6 -> Word8 -> Net6Addr

-- | Pull <a>IP46</a> from a <a>NetAddr</a>.
toNetAddr46 :: NetAddr IP -> IP46 (NetAddr IP4) (NetAddr IP6)

-- | Push <a>IP46</a> into a <a>NetAddr</a>.
fromNetAddr46 :: IP46 (NetAddr IP4) (NetAddr IP6) -> NetAddr IP

-- | Print network address (CIDR notation).
printNetAddr :: (IsNetAddr n, Printable (NetHost n), Printer p) => n -> p

-- | IPv4 network address parser (CIDR notation).
net4Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP4) => μ n

-- | IPv6 network address parser (CIDR notation).
net6Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP6) => μ n

-- | IP network address parser (CIDR notation).
netParser :: (IsNetAddr n, NetHost n ~ IP, CharParsing μ, Monad μ) => μ n

-- | Serialize a network address (host address followed by 8-bit prefix
--   length).
putNetAddr :: (IsNetAddr n, Serializable (NetHost n), Serializer s) => n -> s

-- | Deserialize a network address (host address followed by 8-bit prefix
--   length).
getNetAddr :: (IsNetAddr n, Deserializable (NetHost n), Deserializer μ) => μ n

-- | Port number.
newtype InetPort
InetPort :: Word16 -> InetPort
[unInetPort] :: InetPort -> Word16

-- | <a>InetPort</a> proxy value.
anInetPort :: Proxy InetPort

-- | Socket address: host address + port number.
data InetAddr a
InetAddr :: a -> {-# UNPACK #-} !InetPort -> InetAddr a
[inetHost] :: InetAddr a -> a
[inetPort] :: InetAddr a -> {-# UNPACK #-} !InetPort

-- | IPv4 socket address.
type Inet4Addr = InetAddr IP4

-- | IPv6 socket address.
type Inet6Addr = InetAddr IP6

-- | <a>InetAddr</a> proxy value.
anInetAddr :: Proxy InetAddr

-- | <a>InetAddr</a> <i>a</i> proxy value.
anInetAddrOf :: Proxy a -> Proxy (InetAddr a)

-- | <a>Inet4Addr</a> proxy value.
anInet4Addr :: Proxy Inet4Addr

-- | <a>Inet6Addr</a> proxy value.
anInet6Addr :: Proxy Inet6Addr

-- | <a>InetAddr</a> <a>IP</a> proxy value.
anInetAddrIP :: Proxy (InetAddr IP)

-- | Pull <a>IP46</a> from an <a>InetAddr</a>.
toInetAddr46 :: InetAddr IP -> IP46 (InetAddr IP4) (InetAddr IP6)

-- | Push <a>IP46</a> into an <a>InetAddr</a>.
fromInetAddr46 :: IP46 (InetAddr IP4) (InetAddr IP6) -> InetAddr IP
instance GHC.Read.Read a => GHC.Read.Read (Network.IP.Addr.InetAddr a)
instance GHC.Show.Show a => GHC.Show.Show (Network.IP.Addr.InetAddr a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Network.IP.Addr.InetAddr a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Network.IP.Addr.InetAddr a)
instance Data.Textual.Printable Network.IP.Addr.InetPort
instance Data.Hashable.Class.Hashable Network.IP.Addr.InetPort
instance Data.Bits.Bits Network.IP.Addr.InetPort
instance GHC.Real.Integral Network.IP.Addr.InetPort
instance GHC.Real.Real Network.IP.Addr.InetPort
instance GHC.Num.Num Network.IP.Addr.InetPort
instance GHC.Arr.Ix Network.IP.Addr.InetPort
instance GHC.Enum.Enum Network.IP.Addr.InetPort
instance GHC.Enum.Bounded Network.IP.Addr.InetPort
instance GHC.Classes.Ord Network.IP.Addr.InetPort
instance GHC.Classes.Eq Network.IP.Addr.InetPort
instance Data.Data.Data Network.IP.Addr.InetPort
instance GHC.Classes.Eq a => GHC.Classes.Eq (Network.IP.Addr.NetAddr a)
instance (GHC.Read.Read t₄, GHC.Read.Read t₆) => GHC.Read.Read (Network.IP.Addr.IP46 t₄ t₆)
instance (GHC.Show.Show t₄, GHC.Show.Show t₆) => GHC.Show.Show (Network.IP.Addr.IP46 t₄ t₆)
instance (GHC.Classes.Ord t₄, GHC.Classes.Ord t₆) => GHC.Classes.Ord (Network.IP.Addr.IP46 t₄ t₆)
instance (GHC.Classes.Eq t₄, GHC.Classes.Eq t₆) => GHC.Classes.Eq (Network.IP.Addr.IP46 t₄ t₆)
instance (Data.Data.Data t₄, Data.Data.Data t₆) => Data.Data.Data (Network.IP.Addr.IP46 t₄ t₆)
instance GHC.Enum.Enum Network.IP.Addr.Range6
instance GHC.Classes.Ord Network.IP.Addr.Range6
instance GHC.Classes.Eq Network.IP.Addr.Range6
instance GHC.Read.Read Network.IP.Addr.Range6
instance GHC.Show.Show Network.IP.Addr.Range6
instance Data.Data.Data Network.IP.Addr.Range6
instance Data.Hashable.Class.Hashable Network.IP.Addr.IP6
instance Data.Bits.Bits Network.IP.Addr.IP6
instance GHC.Num.Num Network.IP.Addr.IP6
instance GHC.Arr.Ix Network.IP.Addr.IP6
instance GHC.Enum.Enum Network.IP.Addr.IP6
instance GHC.Enum.Bounded Network.IP.Addr.IP6
instance GHC.Classes.Ord Network.IP.Addr.IP6
instance GHC.Classes.Eq Network.IP.Addr.IP6
instance Data.Data.Data Network.IP.Addr.IP6
instance GHC.Enum.Enum Network.IP.Addr.Range4
instance GHC.Classes.Ord Network.IP.Addr.Range4
instance GHC.Classes.Eq Network.IP.Addr.Range4
instance GHC.Read.Read Network.IP.Addr.Range4
instance GHC.Show.Show Network.IP.Addr.Range4
instance Data.Data.Data Network.IP.Addr.Range4
instance Data.Hashable.Class.Hashable Network.IP.Addr.IP4
instance Data.Bits.Bits Network.IP.Addr.IP4
instance GHC.Num.Num Network.IP.Addr.IP4
instance GHC.Arr.Ix Network.IP.Addr.IP4
instance GHC.Enum.Enum Network.IP.Addr.IP4
instance GHC.Enum.Bounded Network.IP.Addr.IP4
instance GHC.Classes.Ord Network.IP.Addr.IP4
instance GHC.Classes.Eq Network.IP.Addr.IP4
instance Data.Data.Data Network.IP.Addr.IP4
instance Data.Data.Data a => Data.Data.Data (Network.IP.Addr.NetAddr a)
instance Data.Data.Data a => Data.Data.Data (Network.IP.Addr.InetAddr a)
instance GHC.Show.Show Network.IP.Addr.IP4
instance GHC.Read.Read Network.IP.Addr.IP4
instance Data.Textual.Printable Network.IP.Addr.IP4
instance Data.Textual.Textual Network.IP.Addr.IP4
instance Foreign.Storable.Storable Network.IP.Addr.IP4
instance Data.Serializer.Serializable Network.IP.Addr.IP4
instance Data.Serializer.SizedSerializable Network.IP.Addr.IP4
instance Data.Deserializer.Deserializable Network.IP.Addr.IP4
instance Data.Default.Class.Default Network.IP.Addr.IP4
instance GHC.Show.Show Network.IP.Addr.IP6
instance GHC.Read.Read Network.IP.Addr.IP6
instance Data.Textual.Printable Network.IP.Addr.IP6
instance Data.Textual.Textual Network.IP.Addr.IP6
instance Foreign.Storable.Storable Network.IP.Addr.IP6
instance Data.Serializer.Serializable Network.IP.Addr.IP6
instance Data.Serializer.SizedSerializable Network.IP.Addr.IP6
instance Data.Deserializer.Deserializable Network.IP.Addr.IP6
instance Data.Default.Class.Default Network.IP.Addr.IP6
instance Data.Textual.Printable Network.IP.Addr.IP
instance Data.Textual.Textual Network.IP.Addr.IP
instance Data.Serializer.Serializable Network.IP.Addr.IP
instance Data.Deserializer.Deserializable Network.IP.Addr.IP
instance GHC.Show.Show a => GHC.Show.Show (Network.IP.Addr.NetAddr a)
instance GHC.Read.Read Network.IP.Addr.Net4Addr
instance GHC.Read.Read Network.IP.Addr.Net6Addr
instance GHC.Read.Read (Network.IP.Addr.NetAddr Network.IP.Addr.IP)
instance Data.Textual.Printable a => Data.Textual.Printable (Network.IP.Addr.NetAddr a)
instance Data.Textual.Textual Network.IP.Addr.Net4Addr
instance Data.Textual.Textual Network.IP.Addr.Net6Addr
instance Data.Textual.Textual (Network.IP.Addr.NetAddr Network.IP.Addr.IP)
instance Data.Serializer.Serializable a => Data.Serializer.Serializable (Network.IP.Addr.NetAddr a)
instance Data.Serializer.SizedSerializable a => Data.Serializer.SizedSerializable (Network.IP.Addr.NetAddr a)
instance Data.Deserializer.Deserializable Network.IP.Addr.Net4Addr
instance Data.Deserializer.Deserializable Network.IP.Addr.Net6Addr
instance Data.Deserializer.Deserializable (Network.IP.Addr.NetAddr Network.IP.Addr.IP)
instance Network.IP.Addr.IsNetAddr Network.IP.Addr.Net4Addr
instance Network.IP.Addr.IsNetAddr Network.IP.Addr.Net6Addr
instance Network.IP.Addr.IsNetAddr (Network.IP.Addr.NetAddr Network.IP.Addr.IP)
instance GHC.Show.Show Network.IP.Addr.InetPort
instance GHC.Read.Read Network.IP.Addr.InetPort
instance Data.Textual.Textual Network.IP.Addr.InetPort
instance Foreign.Storable.Storable Network.IP.Addr.InetPort
instance Data.Serializer.Serializable Network.IP.Addr.InetPort
instance Data.Serializer.SizedSerializable Network.IP.Addr.InetPort
instance Data.Deserializer.Deserializable Network.IP.Addr.InetPort
instance GHC.Base.Functor Network.IP.Addr.InetAddr
instance Data.Textual.Printable Network.IP.Addr.Inet4Addr
instance Data.Textual.Printable Network.IP.Addr.Inet6Addr
instance Data.Textual.Printable (Network.IP.Addr.InetAddr Network.IP.Addr.IP)
instance Data.Textual.Textual Network.IP.Addr.Inet4Addr
instance Data.Textual.Textual Network.IP.Addr.Inet6Addr
instance Data.Textual.Textual (Network.IP.Addr.InetAddr Network.IP.Addr.IP)
instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Network.IP.Addr.InetAddr a)
instance Data.Serializer.Serializable a => Data.Serializer.Serializable (Network.IP.Addr.InetAddr a)
instance Data.Serializer.SizedSerializable a => Data.Serializer.SizedSerializable (Network.IP.Addr.InetAddr a)
instance Data.Deserializer.Deserializable a => Data.Deserializer.Deserializable (Network.IP.Addr.InetAddr a)
