Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internet Protocol addressing.
- newtype IP4 = IP4 {}
- anIP4 :: Proxy IP4
- ip4ToOctets :: IP4 -> (Word8, Word8, Word8, Word8)
- ip4ToOctetList :: IP4 -> [Word8]
- ip4FromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IP4
- ip4FromOctetList :: [Word8] -> Maybe IP4
- anyIP4 :: IP4
- loopbackIP4 :: IP4
- broadcastIP4 :: IP4
- data Range4
- ip4Range :: IP4 -> Range4
- newtype IP6 = IP6 {}
- anIP6 :: Proxy IP6
- ip6ToWords :: IP6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)
- ip6ToWordList :: IP6 -> [Word16]
- ip6FromWords :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IP6
- ip6FromWordList :: [Word16] -> Maybe IP6
- anyIP6 :: IP6
- loopbackIP6 :: IP6
- data Range6
- ip6Range :: IP6 -> Range6
- data IP46 t₄ t₆
- anIP46 :: Proxy IP46
- anIP46Of :: Proxy t₄ -> Proxy t₆ -> Proxy (IP46 t₄ t₆)
- type IP = IP46 IP4 IP6
- anIP :: Proxy IP
- class IsNetAddr n where
- type NetHost n
- type Net4Addr = NetAddr IP4
- type Net6Addr = NetAddr IP6
- data NetAddr a
- aNetAddr :: Proxy NetAddr
- aNetAddrOf :: Proxy a -> Proxy (NetAddr a)
- aNet4Addr :: Proxy Net4Addr
- aNet6Addr :: Proxy Net6Addr
- aNetAddrIP :: Proxy (NetAddr IP)
- net4Addr :: IP4 -> Word8 -> Net4Addr
- net6Addr :: IP6 -> Word8 -> Net6Addr
- toNetAddr46 :: NetAddr IP -> IP46 (NetAddr IP4) (NetAddr IP6)
- fromNetAddr46 :: IP46 (NetAddr IP4) (NetAddr IP6) -> NetAddr IP
- printNetAddr :: (IsNetAddr n, Printable (NetHost n), Printer p) => n -> p
- net4Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP4) => μ n
- net6Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP6) => μ n
- netParser :: (IsNetAddr n, NetHost n ~ IP, CharParsing μ, Monad μ) => μ n
- putNetAddr :: (IsNetAddr n, Serializable (NetHost n), Serializer s) => n -> s
- getNetAddr :: (IsNetAddr n, Deserializable (NetHost n), Deserializer μ) => μ n
- newtype InetPort = InetPort {
- unInetPort :: Word16
- anInetPort :: Proxy InetPort
- data InetAddr a = InetAddr {}
- type Inet4Addr = InetAddr IP4
- type Inet6Addr = InetAddr IP6
- anInetAddr :: Proxy InetAddr
- anInetAddrOf :: Proxy a -> Proxy (InetAddr a)
- anInet4Addr :: Proxy Inet4Addr
- anInet6Addr :: Proxy Inet6Addr
- anInetAddrIP :: Proxy (InetAddr IP)
- toInetAddr46 :: InetAddr IP -> IP46 (InetAddr IP4) (InetAddr IP6)
- fromInetAddr46 :: IP46 (InetAddr IP4) (InetAddr IP6) -> InetAddr IP
Host address
IPv4 address
IPv4 address.
ip4ToOctetList :: IP4 -> [Word8] Source #
List the octets of an IPv4 address.
ip4FromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IP4 Source #
Assemble IPv4 address from the octets.
loopbackIP4 :: IP4 Source #
IPv4 address 127.0.0.1
.
broadcastIP4 :: IP4 Source #
IPv4 address 255.255.255.255
.
IPv4 address range classification (per RFC6890).
GeneralIP4 | General IPv4 address. |
ThisHostIP4 | This host on this network. |
PrivateUseIP4 | Private-Use networks. |
SharedSpaceIP4 | Shared address space. |
LoopbackIP4 | Loopback address. |
LinkLocalIP4 | Link local address. |
ReservedIP4 | Reserved address. |
DSLiteIP4 | Dual-Stack Lite. |
DocumentationIP4 | Reserved for documentation. |
IP6To4IP4 | 6to4. |
BenchmarkingIP4 | Benchmark testing. |
MulticastIP4 | Multicast address. |
FutureUseIP4 | Future use. |
BroadcastIP4 | Limited broadcast. |
IPv6 address
IPv6 address.
ip6ToWords :: IP6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) Source #
The 16-bit pieces of an IPv6 address.
ip6ToWordList :: IP6 -> [Word16] Source #
List the 16-bit pieces of an IPv6 address.
ip6FromWords :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IP6 Source #
Assemble IPv6 address from the 16-bit pieces.
ip6FromWordList :: [Word16] -> Maybe IP6 Source #
Assemble IPv6 address from the list of 16-bit pieces.
loopbackIP6 :: IP6 Source #
IPv6 address ::1
.
IPv6 address range classification (per RFC6890).
GeneralIP6 | General IPv6 address. |
AnyIP6 | Unspecified address. |
LoopbackIP6 | Loopback address. |
IP4MappedIP6 | Mapped IPv4 address. |
IP4EmbeddedIP6 | Embedded IPv4 address. |
DiscardIP6 | Discard address. |
ReservedIP6 | Reserved address. |
TeredoIP6 | Teredo address. |
BenchmarkingIP6 | Benchmark testing. |
DocumentationIP6 | Reserved for documentation. |
OrchidIP6 | ORCHID address. |
IP6To4IP6 | 6to4. |
UniqueLocalIP6 | Unique local address. |
LinkLocalIP6 | Link local address. |
MulticastIP6 | Multicast address. |
IP address
IPv4- or IPv6-specific data.
Deserializable IP Source # | |
Serializable IP Source # | |
Printable IP Source # | |
Textual IP Source # | |
Read (NetAddr IP) Source # | |
Deserializable (NetAddr IP) Source # | |
Printable (InetAddr IP) Source # | |
Textual (InetAddr IP) Source # | |
Textual (NetAddr IP) Source # | |
IsNetAddr (NetAddr IP) Source # | |
(Eq t₆, Eq t₄) => Eq (IP46 t₄ t₆) Source # | |
(Data t₆, Data t₄) => Data (IP46 t₄ t₆) Source # | |
(Ord t₆, Ord t₄) => Ord (IP46 t₄ t₆) Source # | |
(Read t₆, Read t₄) => Read (IP46 t₄ t₆) Source # | |
(Show t₆, Show t₄) => Show (IP46 t₄ t₆) Source # | |
type NetHost (NetAddr IP) Source # | |
Network address
class IsNetAddr n where Source #
Network address.
netHost :: n -> NetHost n Source #
Host address.
netHostIx :: n -> NetHost n Source #
Host index.
netPrefix :: n -> NetHost n Source #
Network prefix.
netMask :: n -> NetHost n Source #
Network mask.
netLength :: n -> Word8 Source #
Network prefix length.
netAddr :: NetHost n -> Word8 -> n Source #
Make a network address.
inNetwork :: NetHost n -> n -> Bool Source #
Test if the address is in the network.
Network address: host address + network prefix length.
Read Net6Addr Source # | |
Read Net4Addr Source # | |
Deserializable Net6Addr Source # | |
Deserializable Net4Addr Source # | |
Textual Net6Addr Source # | |
Textual Net4Addr Source # | |
IsNetAddr Net6Addr Source # | |
IsNetAddr Net4Addr Source # | |
Eq a => Eq (NetAddr a) Source # | |
Data a => Data (NetAddr a) Source # | |
Read (NetAddr IP) Source # | |
Show a => Show (NetAddr a) Source # | |
Deserializable (NetAddr IP) Source # | |
Serializable a => Serializable (NetAddr a) Source # | |
SizedSerializable a => SizedSerializable (NetAddr a) Source # | |
Printable a => Printable (NetAddr a) Source # | |
Textual (NetAddr IP) Source # | |
IsNetAddr (NetAddr IP) Source # | |
type NetHost Net6Addr Source # | |
type NetHost Net4Addr Source # | |
type NetHost (NetAddr IP) Source # | |
printNetAddr :: (IsNetAddr n, Printable (NetHost n), Printer p) => n -> p Source #
Print network address (CIDR notation).
net4Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP4) => μ n Source #
IPv4 network address parser (CIDR notation).
net6Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP6) => μ n Source #
IPv6 network address parser (CIDR notation).
netParser :: (IsNetAddr n, NetHost n ~ IP, CharParsing μ, Monad μ) => μ n Source #
IP network address parser (CIDR notation).
putNetAddr :: (IsNetAddr n, Serializable (NetHost n), Serializer s) => n -> s Source #
Serialize a network address (host address followed by 8-bit prefix length).
getNetAddr :: (IsNetAddr n, Deserializable (NetHost n), Deserializer μ) => μ n Source #
Deserialize a network address (host address followed by 8-bit prefix length).
Port number
Port number.
Socket address
Socket address: host address + port number.
Functor InetAddr Source # | |
Printable Inet6Addr Source # | |
Printable Inet4Addr Source # | |
Textual Inet6Addr Source # | |
Textual Inet4Addr Source # | |
Eq a => Eq (InetAddr a) Source # | |
Data a => Data (InetAddr a) Source # | |
Ord a => Ord (InetAddr a) Source # | |
Read a => Read (InetAddr a) Source # | |
Show a => Show (InetAddr a) Source # | |
Hashable a => Hashable (InetAddr a) Source # | |
Deserializable a => Deserializable (InetAddr a) Source # | |
Serializable a => Serializable (InetAddr a) Source # | |
SizedSerializable a => SizedSerializable (InetAddr a) Source # | |
Printable (InetAddr IP) Source # | |
Textual (InetAddr IP) Source # | |