Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internet Protocol addressing.
Synopsis
- 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 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.
Instances
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. |
Instances
Enum Range4 Source # | |
Defined in Network.IP.Addr | |
Eq Range4 Source # | |
Data Range4 Source # | |
Defined in Network.IP.Addr gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Range4 -> c Range4 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Range4 # toConstr :: Range4 -> Constr # dataTypeOf :: Range4 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Range4) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Range4) # gmapT :: (forall b. Data b => b -> b) -> Range4 -> Range4 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Range4 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Range4 -> r # gmapQ :: (forall d. Data d => d -> u) -> Range4 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Range4 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Range4 -> m Range4 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Range4 -> m Range4 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Range4 -> m Range4 # | |
Ord Range4 Source # | |
Read Range4 Source # | |
Show Range4 Source # | |
IPv6 address
IPv6 address.
Instances
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. |
Instances
Enum Range6 Source # | |
Defined in Network.IP.Addr | |
Eq Range6 Source # | |
Data Range6 Source # | |
Defined in Network.IP.Addr gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Range6 -> c Range6 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Range6 # toConstr :: Range6 -> Constr # dataTypeOf :: Range6 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Range6) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Range6) # gmapT :: (forall b. Data b => b -> b) -> Range6 -> Range6 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Range6 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Range6 -> r # gmapQ :: (forall d. Data d => d -> u) -> Range6 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Range6 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Range6 -> m Range6 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Range6 -> m Range6 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Range6 -> m Range6 # | |
Ord Range6 Source # | |
Read Range6 Source # | |
Show Range6 Source # | |
IP address
IPv4- or IPv6-specific data.
Instances
Serializable IP Source # | |
Defined in Network.IP.Addr put :: Serializer s => IP -> s # | |
Deserializable IP Source # | |
Defined in Network.IP.Addr get :: Deserializer μ => μ IP # | |
Printable IP Source # | |
Defined in Network.IP.Addr | |
Textual IP Source # | |
Defined in Network.IP.Addr textual :: (Monad μ, CharParsing μ) => μ IP # | |
Read (NetAddr IP) Source # | |
Deserializable (NetAddr IP) Source # | |
Defined in Network.IP.Addr get :: Deserializer μ => μ (NetAddr IP) # | |
Printable (InetAddr IP) Source # | |
Textual (InetAddr IP) Source # | |
Defined in Network.IP.Addr | |
Textual (NetAddr IP) Source # | |
Defined in Network.IP.Addr | |
IsNetAddr (NetAddr IP) Source # | |
Defined in Network.IP.Addr netHost :: NetAddr IP -> NetHost (NetAddr IP) Source # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) Source # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) Source # netMask :: NetAddr IP -> NetHost (NetAddr IP) Source # netLength :: NetAddr IP -> Word8 Source # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP Source # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool Source # | |
(Eq t₄, Eq t₆) => Eq (IP46 t₄ t₆) Source # | |
(Data t₄, Data t₆) => Data (IP46 t₄ t₆) Source # | |
Defined in Network.IP.Addr gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IP46 t₄ t₆ -> c (IP46 t₄ t₆) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (IP46 t₄ t₆) # toConstr :: IP46 t₄ t₆ -> Constr # dataTypeOf :: IP46 t₄ t₆ -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (IP46 t₄ t₆)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (IP46 t₄ t₆)) # gmapT :: (forall b. Data b => b -> b) -> IP46 t₄ t₆ -> IP46 t₄ t₆ # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IP46 t₄ t₆ -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IP46 t₄ t₆ -> r # gmapQ :: (forall d. Data d => d -> u) -> IP46 t₄ t₆ -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IP46 t₄ t₆ -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IP46 t₄ t₆ -> m (IP46 t₄ t₆) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IP46 t₄ t₆ -> m (IP46 t₄ t₆) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IP46 t₄ t₆ -> m (IP46 t₄ t₆) # | |
(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 # | |
Defined in Network.IP.Addr |
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.
Make a network address.
Test if the address is in the network.
Instances
IsNetAddr Net6Addr Source # | |
Defined in Network.IP.Addr | |
IsNetAddr Net4Addr Source # | |
Defined in Network.IP.Addr | |
IsNetAddr (NetAddr IP) Source # | |
Defined in Network.IP.Addr netHost :: NetAddr IP -> NetHost (NetAddr IP) Source # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) Source # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) Source # netMask :: NetAddr IP -> NetHost (NetAddr IP) Source # netLength :: NetAddr IP -> Word8 Source # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP Source # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool Source # |
Network address: host address + network prefix length.
Instances
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.
Instances
Socket address
Socket address: host address + port number.