network-ip-0.3: Internet Protocol data structures

Safe Haskell | None
Language | Haskell2010

Network.IP.Addr

Contents

- Host address
  - IPv4 address
  - IPv6 address
  - IP address
- Network address
- Port number
- Socket address

Description

Internet Protocol addressing.

Synopsis

- newtype IP4 = IP4 {
  - unIP4 :: Word32
  }
- 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
  - = GeneralIP4
  - | ThisHostIP4
  - | PrivateUseIP4
  - | SharedSpaceIP4
  - | LoopbackIP4
  - | LinkLocalIP4
  - | ReservedIP4
  - | DSLiteIP4
  - | DocumentationIP4
  - | IP6To4IP4
  - | BenchmarkingIP4
  - | MulticastIP4
  - | FutureUseIP4
  - | BroadcastIP4
- ip4Range :: IP4 -> Range4
- newtype IP6 = IP6 {
  - unIP6 :: Word128
  }
- 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
  - = GeneralIP6
  - | AnyIP6
  - | LoopbackIP6
  - | IP4MappedIP6
  - | IP4EmbeddedIP6
  - | DiscardIP6
  - | ReservedIP6
  - | TeredoIP6
  - | BenchmarkingIP6
  - | DocumentationIP6
  - | OrchidIP6
  - | IP6To4IP6
  - | UniqueLocalIP6
  - | LinkLocalIP6
  - | MulticastIP6
- ip6Range :: IP6 -> Range6
- data IP46 t₄ t₆
  - = IPv4 t₄
  - | IPv6 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 {
  - inetHost :: a
  - inetPort :: !InetPort
  }
- 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

newtype IP4 #

IPv4 address.

Constructors

IP4 |
Fields unIP4 :: Word32

Instances

Bounded IP4 # |
Methods minBound :: IP4 # maxBound :: IP4 #
Enum IP4 # |
Methods succ :: IP4 -> IP4 # pred :: IP4 -> IP4 # toEnum :: Int -> IP4 # fromEnum :: IP4 -> Int # enumFrom :: IP4 -> [IP4] # enumFromThen :: IP4 -> IP4 -> [IP4] # enumFromTo :: IP4 -> IP4 -> [IP4] # enumFromThenTo :: IP4 -> IP4 -> IP4 -> [IP4] #
Eq IP4 # |
Methods (==) :: IP4 -> IP4 -> Bool # (/=) :: IP4 -> IP4 -> Bool #
Data IP4 # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IP4 -> c IP4 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IP4 # toConstr :: IP4 -> Constr # dataTypeOf :: IP4 -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c IP4) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IP4) # gmapT :: (forall b. Data b => b -> b) -> IP4 -> IP4 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IP4 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IP4 -> r # gmapQ :: (forall d. Data d => d -> u) -> IP4 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IP4 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IP4 -> m IP4 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IP4 -> m IP4 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IP4 -> m IP4 #
Num IP4 # |
Methods (+) :: IP4 -> IP4 -> IP4 # (-) :: IP4 -> IP4 -> IP4 # (*) :: IP4 -> IP4 -> IP4 # negate :: IP4 -> IP4 # abs :: IP4 -> IP4 # signum :: IP4 -> IP4 # fromInteger :: Integer -> IP4 #
Ord IP4 # |
Methods compare :: IP4 -> IP4 -> Ordering # (<) :: IP4 -> IP4 -> Bool # (<=) :: IP4 -> IP4 -> Bool # (>) :: IP4 -> IP4 -> Bool # (>=) :: IP4 -> IP4 -> Bool # max :: IP4 -> IP4 -> IP4 # min :: IP4 -> IP4 -> IP4 #
Read Net4Addr # |
Methods readsPrec :: Int -> ReadS Net4Addr # readList :: ReadS [Net4Addr] # readPrec :: ReadPrec Net4Addr # readListPrec :: ReadPrec [Net4Addr] #
Read IP4 # |
Methods readsPrec :: Int -> ReadS IP4 # readList :: ReadS [IP4] # readPrec :: ReadPrec IP4 # readListPrec :: ReadPrec [IP4] #
Show IP4 # |
Methods showsPrec :: Int -> IP4 -> ShowS # show :: IP4 -> String # showList :: [IP4] -> ShowS #
Ix IP4 # |
Methods range :: (IP4, IP4) -> [IP4] # index :: (IP4, IP4) -> IP4 -> Int # unsafeIndex :: (IP4, IP4) -> IP4 -> Int inRange :: (IP4, IP4) -> IP4 -> Bool # rangeSize :: (IP4, IP4) -> Int # unsafeRangeSize :: (IP4, IP4) -> Int
Storable IP4 # |
Methods sizeOf :: IP4 -> Int # alignment :: IP4 -> Int # peekElemOff :: Ptr IP4 -> Int -> IO IP4 # pokeElemOff :: Ptr IP4 -> Int -> IP4 -> IO () # peekByteOff :: Ptr b -> Int -> IO IP4 # pokeByteOff :: Ptr b -> Int -> IP4 -> IO () # peek :: Ptr IP4 -> IO IP4 # poke :: Ptr IP4 -> IP4 -> IO () #
Bits IP4 # |
Methods (.&.) :: IP4 -> IP4 -> IP4 # (.|.) :: IP4 -> IP4 -> IP4 # xor :: IP4 -> IP4 -> IP4 # complement :: IP4 -> IP4 # shift :: IP4 -> Int -> IP4 # rotate :: IP4 -> Int -> IP4 # zeroBits :: IP4 # bit :: Int -> IP4 # setBit :: IP4 -> Int -> IP4 # clearBit :: IP4 -> Int -> IP4 # complementBit :: IP4 -> Int -> IP4 # testBit :: IP4 -> Int -> Bool # bitSizeMaybe :: IP4 -> Maybe Int # bitSize :: IP4 -> Int # isSigned :: IP4 -> Bool # shiftL :: IP4 -> Int -> IP4 # unsafeShiftL :: IP4 -> Int -> IP4 # shiftR :: IP4 -> Int -> IP4 # unsafeShiftR :: IP4 -> Int -> IP4 # rotateL :: IP4 -> Int -> IP4 # rotateR :: IP4 -> Int -> IP4 # popCount :: IP4 -> Int #
Default IP4 # |
Methods def :: IP4 #
Hashable IP4 # |
Methods hashWithSalt :: Int -> IP4 -> Int # hash :: IP4 -> Int #
Serializable IP # |
Methods put :: Serializer s => IP -> s #
Serializable IP4 # |
Methods put :: Serializer s => IP4 -> s #
SizedSerializable IP4 # |
Methods size :: Proxy * IP4 -> Int #
Deserializable Net4Addr # |
Methods get :: Deserializer μ => μ Net4Addr #
Deserializable IP # |
Methods get :: Deserializer μ => μ IP #
Deserializable IP4 # |
Methods get :: Deserializer μ => μ IP4 #
Textual Inet4Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Inet4Addr
Textual Net4Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Net4Addr
Textual IP # |
Methods textual :: (Monad μ, CharParsing μ) => μ IP
Textual IP4 # |
Methods textual :: (Monad μ, CharParsing μ) => μ IP4
Printable Inet4Addr # |
Methods print :: Printer p => Inet4Addr -> p
Printable IP # |
Methods print :: Printer p => IP -> p
Printable IP4 # |
Methods print :: Printer p => IP4 -> p
IsNetAddr Net4Addr # |
Associated Types type NetHost Net4Addr :: * # Methods netHost :: Net4Addr -> NetHost Net4Addr # netHostIx :: Net4Addr -> NetHost Net4Addr # netPrefix :: Net4Addr -> NetHost Net4Addr # netMask :: Net4Addr -> NetHost Net4Addr # netLength :: Net4Addr -> Word8 # netAddr :: NetHost Net4Addr -> Word8 -> Net4Addr # inNetwork :: NetHost Net4Addr -> Net4Addr -> Bool #
Read (NetAddr IP) # |
Methods readsPrec :: Int -> ReadS (NetAddr IP) # readList :: ReadS [NetAddr IP] # readPrec :: ReadPrec (NetAddr IP) # readListPrec :: ReadPrec [NetAddr IP] #
Deserializable (NetAddr IP) # |
Methods get :: Deserializer μ => μ (NetAddr IP) #
Textual (InetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP)
Textual (NetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP)
Printable (InetAddr IP) # |
Methods print :: Printer p => InetAddr IP -> p
IsNetAddr (NetAddr IP) # |
Associated Types type NetHost (NetAddr IP) :: * # Methods netHost :: NetAddr IP -> NetHost (NetAddr IP) # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) # netMask :: NetAddr IP -> NetHost (NetAddr IP) # netLength :: NetAddr IP -> Word8 # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool #
type NetHost Net4Addr # |
type NetHost Net4Addr = IP4
type NetHost (NetAddr IP) # |
type NetHost (NetAddr IP) = IP

anIP4 :: Proxy IP4 #

`IP4` proxy value.

ip4ToOctets :: IP4 -> (Word8, Word8, Word8, Word8) #

The octets of an IPv4 address.

ip4ToOctetList :: IP4 -> [Word8] #

List the octets of an IPv4 address.

ip4FromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IP4 #

Assemble IPv4 address from the octets.

ip4FromOctetList :: [Word8] -> Maybe IP4 #

Assemble IPv4 address from the octet list.

anyIP4 :: IP4 #

IPv4 address `0.0.0.0`.

loopbackIP4 :: IP4 #

IPv4 address `127.0.0.1`.

broadcastIP4 :: IP4 #

IPv4 address `255.255.255.255`.

data Range4 #

IPv4 address range classification (per RFC6890).

Constructors

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 # |
Methods succ :: Range4 -> Range4 # pred :: Range4 -> Range4 # toEnum :: Int -> Range4 # fromEnum :: Range4 -> Int # enumFrom :: Range4 -> [Range4] # enumFromThen :: Range4 -> Range4 -> [Range4] # enumFromTo :: Range4 -> Range4 -> [Range4] # enumFromThenTo :: Range4 -> Range4 -> Range4 -> [Range4] #
Eq Range4 # |
Methods (==) :: Range4 -> Range4 -> Bool # (/=) :: Range4 -> Range4 -> Bool #
Data Range4 # |
Methods 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 # |
Methods compare :: Range4 -> Range4 -> Ordering # (<) :: Range4 -> Range4 -> Bool # (<=) :: Range4 -> Range4 -> Bool # (>) :: Range4 -> Range4 -> Bool # (>=) :: Range4 -> Range4 -> Bool # max :: Range4 -> Range4 -> Range4 # min :: Range4 -> Range4 -> Range4 #
Read Range4 # |
Methods readsPrec :: Int -> ReadS Range4 # readList :: ReadS [Range4] # readPrec :: ReadPrec Range4 # readListPrec :: ReadPrec [Range4] #
Show Range4 # |
Methods showsPrec :: Int -> Range4 -> ShowS # show :: Range4 -> String # showList :: [Range4] -> ShowS #

ip4Range :: IP4 -> Range4 #

Determine the address range type.

## IPv6 address

newtype IP6 #

IPv6 address.

Constructors

IP6 |
Fields unIP6 :: Word128

Instances

Bounded IP6 # |
Methods minBound :: IP6 # maxBound :: IP6 #
Enum IP6 # |
Methods succ :: IP6 -> IP6 # pred :: IP6 -> IP6 # toEnum :: Int -> IP6 # fromEnum :: IP6 -> Int # enumFrom :: IP6 -> [IP6] # enumFromThen :: IP6 -> IP6 -> [IP6] # enumFromTo :: IP6 -> IP6 -> [IP6] # enumFromThenTo :: IP6 -> IP6 -> IP6 -> [IP6] #
Eq IP6 # |
Methods (==) :: IP6 -> IP6 -> Bool # (/=) :: IP6 -> IP6 -> Bool #
Data IP6 # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IP6 -> c IP6 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IP6 # toConstr :: IP6 -> Constr # dataTypeOf :: IP6 -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c IP6) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IP6) # gmapT :: (forall b. Data b => b -> b) -> IP6 -> IP6 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IP6 -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IP6 -> r # gmapQ :: (forall d. Data d => d -> u) -> IP6 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IP6 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IP6 -> m IP6 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IP6 -> m IP6 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IP6 -> m IP6 #
Num IP6 # |
Methods (+) :: IP6 -> IP6 -> IP6 # (-) :: IP6 -> IP6 -> IP6 # (*) :: IP6 -> IP6 -> IP6 # negate :: IP6 -> IP6 # abs :: IP6 -> IP6 # signum :: IP6 -> IP6 # fromInteger :: Integer -> IP6 #
Ord IP6 # |
Methods compare :: IP6 -> IP6 -> Ordering # (<) :: IP6 -> IP6 -> Bool # (<=) :: IP6 -> IP6 -> Bool # (>) :: IP6 -> IP6 -> Bool # (>=) :: IP6 -> IP6 -> Bool # max :: IP6 -> IP6 -> IP6 # min :: IP6 -> IP6 -> IP6 #
Read Net6Addr # |
Methods readsPrec :: Int -> ReadS Net6Addr # readList :: ReadS [Net6Addr] # readPrec :: ReadPrec Net6Addr # readListPrec :: ReadPrec [Net6Addr] #
Read IP6 # |
Methods readsPrec :: Int -> ReadS IP6 # readList :: ReadS [IP6] # readPrec :: ReadPrec IP6 # readListPrec :: ReadPrec [IP6] #
Show IP6 # |
Methods showsPrec :: Int -> IP6 -> ShowS # show :: IP6 -> String # showList :: [IP6] -> ShowS #
Ix IP6 # |
Methods range :: (IP6, IP6) -> [IP6] # index :: (IP6, IP6) -> IP6 -> Int # unsafeIndex :: (IP6, IP6) -> IP6 -> Int inRange :: (IP6, IP6) -> IP6 -> Bool # rangeSize :: (IP6, IP6) -> Int # unsafeRangeSize :: (IP6, IP6) -> Int
Storable IP6 # |
Methods sizeOf :: IP6 -> Int # alignment :: IP6 -> Int # peekElemOff :: Ptr IP6 -> Int -> IO IP6 # pokeElemOff :: Ptr IP6 -> Int -> IP6 -> IO () # peekByteOff :: Ptr b -> Int -> IO IP6 # pokeByteOff :: Ptr b -> Int -> IP6 -> IO () # peek :: Ptr IP6 -> IO IP6 # poke :: Ptr IP6 -> IP6 -> IO () #
Bits IP6 # |
Methods (.&.) :: IP6 -> IP6 -> IP6 # (.|.) :: IP6 -> IP6 -> IP6 # xor :: IP6 -> IP6 -> IP6 # complement :: IP6 -> IP6 # shift :: IP6 -> Int -> IP6 # rotate :: IP6 -> Int -> IP6 # zeroBits :: IP6 # bit :: Int -> IP6 # setBit :: IP6 -> Int -> IP6 # clearBit :: IP6 -> Int -> IP6 # complementBit :: IP6 -> Int -> IP6 # testBit :: IP6 -> Int -> Bool # bitSizeMaybe :: IP6 -> Maybe Int # bitSize :: IP6 -> Int # isSigned :: IP6 -> Bool # shiftL :: IP6 -> Int -> IP6 # unsafeShiftL :: IP6 -> Int -> IP6 # shiftR :: IP6 -> Int -> IP6 # unsafeShiftR :: IP6 -> Int -> IP6 # rotateL :: IP6 -> Int -> IP6 # rotateR :: IP6 -> Int -> IP6 # popCount :: IP6 -> Int #
Default IP6 # |
Methods def :: IP6 #
Hashable IP6 # |
Methods hashWithSalt :: Int -> IP6 -> Int # hash :: IP6 -> Int #
Serializable IP # |
Methods put :: Serializer s => IP -> s #
Serializable IP6 # |
Methods put :: Serializer s => IP6 -> s #
SizedSerializable IP6 # |
Methods size :: Proxy * IP6 -> Int #
Deserializable Net6Addr # |
Methods get :: Deserializer μ => μ Net6Addr #
Deserializable IP # |
Methods get :: Deserializer μ => μ IP #
Deserializable IP6 # |
Methods get :: Deserializer μ => μ IP6 #
Textual Inet6Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Inet6Addr
Textual Net6Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Net6Addr
Textual IP # |
Methods textual :: (Monad μ, CharParsing μ) => μ IP
Textual IP6 # |
Methods textual :: (Monad μ, CharParsing μ) => μ IP6
Printable Inet6Addr # |
Methods print :: Printer p => Inet6Addr -> p
Printable IP # |
Methods print :: Printer p => IP -> p
Printable IP6 # |
Methods print :: Printer p => IP6 -> p
IsNetAddr Net6Addr # |
Associated Types type NetHost Net6Addr :: * # Methods netHost :: Net6Addr -> NetHost Net6Addr # netHostIx :: Net6Addr -> NetHost Net6Addr # netPrefix :: Net6Addr -> NetHost Net6Addr # netMask :: Net6Addr -> NetHost Net6Addr # netLength :: Net6Addr -> Word8 # netAddr :: NetHost Net6Addr -> Word8 -> Net6Addr # inNetwork :: NetHost Net6Addr -> Net6Addr -> Bool #
Read (NetAddr IP) # |
Methods readsPrec :: Int -> ReadS (NetAddr IP) # readList :: ReadS [NetAddr IP] # readPrec :: ReadPrec (NetAddr IP) # readListPrec :: ReadPrec [NetAddr IP] #
Deserializable (NetAddr IP) # |
Methods get :: Deserializer μ => μ (NetAddr IP) #
Textual (InetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP)
Textual (NetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP)
Printable (InetAddr IP) # |
Methods print :: Printer p => InetAddr IP -> p
IsNetAddr (NetAddr IP) # |
Associated Types type NetHost (NetAddr IP) :: * # Methods netHost :: NetAddr IP -> NetHost (NetAddr IP) # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) # netMask :: NetAddr IP -> NetHost (NetAddr IP) # netLength :: NetAddr IP -> Word8 # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool #
type NetHost Net6Addr # |
type NetHost Net6Addr = IP6
type NetHost (NetAddr IP) # |
type NetHost (NetAddr IP) = IP

anIP6 :: Proxy IP6 #

`IP6` proxy value.

ip6ToWords :: IP6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) #

The 16-bit pieces of an IPv6 address.

ip6ToWordList :: IP6 -> [Word16] #

List the 16-bit pieces of an IPv6 address.

ip6FromWords :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IP6 #

Assemble IPv6 address from the 16-bit pieces.

ip6FromWordList :: [Word16] -> Maybe IP6 #

Assemble IPv6 address from the list of 16-bit pieces.

anyIP6 :: IP6 #

IPv6 address `::`.

loopbackIP6 :: IP6 #

IPv6 address `::1`.

data Range6 #

IPv6 address range classification (per RFC6890).

Constructors

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 # |
Methods succ :: Range6 -> Range6 # pred :: Range6 -> Range6 # toEnum :: Int -> Range6 # fromEnum :: Range6 -> Int # enumFrom :: Range6 -> [Range6] # enumFromThen :: Range6 -> Range6 -> [Range6] # enumFromTo :: Range6 -> Range6 -> [Range6] # enumFromThenTo :: Range6 -> Range6 -> Range6 -> [Range6] #
Eq Range6 # |
Methods (==) :: Range6 -> Range6 -> Bool # (/=) :: Range6 -> Range6 -> Bool #
Data Range6 # |
Methods 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 # |
Methods compare :: Range6 -> Range6 -> Ordering # (<) :: Range6 -> Range6 -> Bool # (<=) :: Range6 -> Range6 -> Bool # (>) :: Range6 -> Range6 -> Bool # (>=) :: Range6 -> Range6 -> Bool # max :: Range6 -> Range6 -> Range6 # min :: Range6 -> Range6 -> Range6 #
Read Range6 # |
Methods readsPrec :: Int -> ReadS Range6 # readList :: ReadS [Range6] # readPrec :: ReadPrec Range6 # readListPrec :: ReadPrec [Range6] #
Show Range6 # |
Methods showsPrec :: Int -> Range6 -> ShowS # show :: Range6 -> String # showList :: [Range6] -> ShowS #

ip6Range :: IP6 -> Range6 #

Determine the address range type.

## IP address

data IP46 t₄ t₆ #

IPv4- or IPv6-specific data.

Constructors

IPv4 t₄ |
IPv6 t₆ |

Instances

Serializable IP # |
Methods put :: Serializer s => IP -> s #
Deserializable IP # |
Methods get :: Deserializer μ => μ IP #
Textual IP # |
Methods textual :: (Monad μ, CharParsing μ) => μ IP
Printable IP # |
Methods print :: Printer p => IP -> p
Read (NetAddr IP) # |
Methods readsPrec :: Int -> ReadS (NetAddr IP) # readList :: ReadS [NetAddr IP] # readPrec :: ReadPrec (NetAddr IP) # readListPrec :: ReadPrec [NetAddr IP] #
Deserializable (NetAddr IP) # |
Methods get :: Deserializer μ => μ (NetAddr IP) #
Textual (InetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP)
Textual (NetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP)
Printable (InetAddr IP) # |
Methods print :: Printer p => InetAddr IP -> p
IsNetAddr (NetAddr IP) # |
Associated Types type NetHost (NetAddr IP) :: * # Methods netHost :: NetAddr IP -> NetHost (NetAddr IP) # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) # netMask :: NetAddr IP -> NetHost (NetAddr IP) # netLength :: NetAddr IP -> Word8 # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool #
(Eq t₄, Eq t₆) => Eq (IP46 t₄ t₆) # |
Methods (==) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool # (/=) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool #
(Data t₄, Data t₆) => Data (IP46 t₄ t₆) # |
Methods 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₆) # |
Methods compare :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Ordering # (<) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool # (<=) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool # (>) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool # (>=) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool # max :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> IP46 t₄ t₆ # min :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> IP46 t₄ t₆ #
(Read t₄, Read t₆) => Read (IP46 t₄ t₆) # |
Methods readsPrec :: Int -> ReadS (IP46 t₄ t₆) # readList :: ReadS [IP46 t₄ t₆] # readPrec :: ReadPrec (IP46 t₄ t₆) # readListPrec :: ReadPrec [IP46 t₄ t₆] #
(Show t₄, Show t₆) => Show (IP46 t₄ t₆) # |
Methods showsPrec :: Int -> IP46 t₄ t₆ -> ShowS # show :: IP46 t₄ t₆ -> String # showList :: [IP46 t₄ t₆] -> ShowS #
type NetHost (NetAddr IP) # |
type NetHost (NetAddr IP) = IP

anIP46 :: Proxy IP46 #

`IP46` proxy value.

anIP46Of :: Proxy t₄ -> Proxy t₆ -> Proxy (IP46 t₄ t₆) #

`IP46` t₄ t₆ proxy value.

type IP = IP46 IP4 IP6 #

IP address.

anIP :: Proxy IP #

`IP` proxy value.

# Network address

class IsNetAddr n where #

Network address.

Minimal complete definition

netHost, netHostIx, netPrefix, netMask, netLength, netAddr, inNetwork

Associated Types

type NetHost n #

The address type.

Methods

netHost :: n -> NetHost n #

Host address.

netHostIx :: n -> NetHost n #

Host index.

netPrefix :: n -> NetHost n #

Network prefix.

netMask :: n -> NetHost n #

Network mask.

netLength :: n -> Word8 #

Network prefix length.

netAddr :: NetHost n -> Word8 -> n #

Make a network address.

inNetwork :: NetHost n -> n -> Bool #

Test if the address is in the network.

Instances

IsNetAddr Net6Addr # |
Associated Types type NetHost Net6Addr :: * # Methods netHost :: Net6Addr -> NetHost Net6Addr # netHostIx :: Net6Addr -> NetHost Net6Addr # netPrefix :: Net6Addr -> NetHost Net6Addr # netMask :: Net6Addr -> NetHost Net6Addr # netLength :: Net6Addr -> Word8 # netAddr :: NetHost Net6Addr -> Word8 -> Net6Addr # inNetwork :: NetHost Net6Addr -> Net6Addr -> Bool #
IsNetAddr Net4Addr # |
Associated Types type NetHost Net4Addr :: * # Methods netHost :: Net4Addr -> NetHost Net4Addr # netHostIx :: Net4Addr -> NetHost Net4Addr # netPrefix :: Net4Addr -> NetHost Net4Addr # netMask :: Net4Addr -> NetHost Net4Addr # netLength :: Net4Addr -> Word8 # netAddr :: NetHost Net4Addr -> Word8 -> Net4Addr # inNetwork :: NetHost Net4Addr -> Net4Addr -> Bool #
IsNetAddr (NetAddr IP) # |
Associated Types type NetHost (NetAddr IP) :: * # Methods netHost :: NetAddr IP -> NetHost (NetAddr IP) # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) # netMask :: NetAddr IP -> NetHost (NetAddr IP) # netLength :: NetAddr IP -> Word8 # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool #

type Net4Addr = NetAddr IP4 #

IPv4 network address.

type Net6Addr = NetAddr IP6 #

IPv6 network address.

data NetAddr a #

Network address: host address + network prefix length.

Instances

Read Net6Addr # |
Methods readsPrec :: Int -> ReadS Net6Addr # readList :: ReadS [Net6Addr] # readPrec :: ReadPrec Net6Addr # readListPrec :: ReadPrec [Net6Addr] #
Read Net4Addr # |
Methods readsPrec :: Int -> ReadS Net4Addr # readList :: ReadS [Net4Addr] # readPrec :: ReadPrec Net4Addr # readListPrec :: ReadPrec [Net4Addr] #
Deserializable Net6Addr # |
Methods get :: Deserializer μ => μ Net6Addr #
Deserializable Net4Addr # |
Methods get :: Deserializer μ => μ Net4Addr #
Textual Net6Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Net6Addr
Textual Net4Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Net4Addr
IsNetAddr Net6Addr # |
Associated Types type NetHost Net6Addr :: * # Methods netHost :: Net6Addr -> NetHost Net6Addr # netHostIx :: Net6Addr -> NetHost Net6Addr # netPrefix :: Net6Addr -> NetHost Net6Addr # netMask :: Net6Addr -> NetHost Net6Addr # netLength :: Net6Addr -> Word8 # netAddr :: NetHost Net6Addr -> Word8 -> Net6Addr # inNetwork :: NetHost Net6Addr -> Net6Addr -> Bool #
IsNetAddr Net4Addr # |
Associated Types type NetHost Net4Addr :: * # Methods netHost :: Net4Addr -> NetHost Net4Addr # netHostIx :: Net4Addr -> NetHost Net4Addr # netPrefix :: Net4Addr -> NetHost Net4Addr # netMask :: Net4Addr -> NetHost Net4Addr # netLength :: Net4Addr -> Word8 # netAddr :: NetHost Net4Addr -> Word8 -> Net4Addr # inNetwork :: NetHost Net4Addr -> Net4Addr -> Bool #
Eq a => Eq (NetAddr a) # |
Methods (==) :: NetAddr a -> NetAddr a -> Bool # (/=) :: NetAddr a -> NetAddr a -> Bool #
Data a => Data (NetAddr a) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NetAddr a -> c (NetAddr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NetAddr a) # toConstr :: NetAddr a -> Constr # dataTypeOf :: NetAddr a -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (NetAddr a)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NetAddr a)) # gmapT :: (forall b. Data b => b -> b) -> NetAddr a -> NetAddr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NetAddr a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NetAddr a -> r # gmapQ :: (forall d. Data d => d -> u) -> NetAddr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NetAddr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NetAddr a -> m (NetAddr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NetAddr a -> m (NetAddr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NetAddr a -> m (NetAddr a) #
Read (NetAddr IP) # |
Methods readsPrec :: Int -> ReadS (NetAddr IP) # readList :: ReadS [NetAddr IP] # readPrec :: ReadPrec (NetAddr IP) # readListPrec :: ReadPrec [NetAddr IP] #
Show a => Show (NetAddr a) # |
Methods showsPrec :: Int -> NetAddr a -> ShowS # show :: NetAddr a -> String # showList :: [NetAddr a] -> ShowS #
Serializable a => Serializable (NetAddr a) # |
Methods put :: Serializer s => NetAddr a -> s #
SizedSerializable a => SizedSerializable (NetAddr a) # |
Methods size :: Proxy * (NetAddr a) -> Int #
Deserializable (NetAddr IP) # |
Methods get :: Deserializer μ => μ (NetAddr IP) #
Textual (NetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP)
Printable a => Printable (NetAddr a) # |
Methods print :: Printer p => NetAddr a -> p
IsNetAddr (NetAddr IP) # |
Associated Types type NetHost (NetAddr IP) :: * # Methods netHost :: NetAddr IP -> NetHost (NetAddr IP) # netHostIx :: NetAddr IP -> NetHost (NetAddr IP) # netPrefix :: NetAddr IP -> NetHost (NetAddr IP) # netMask :: NetAddr IP -> NetHost (NetAddr IP) # netLength :: NetAddr IP -> Word8 # netAddr :: NetHost (NetAddr IP) -> Word8 -> NetAddr IP # inNetwork :: NetHost (NetAddr IP) -> NetAddr IP -> Bool #
type NetHost Net6Addr # |
type NetHost Net6Addr = IP6
type NetHost Net4Addr # |
type NetHost Net4Addr = IP4
type NetHost (NetAddr IP) # |
type NetHost (NetAddr IP) = IP

aNetAddr :: Proxy NetAddr #

`NetAddr` proxy value.

aNetAddrOf :: Proxy a -> Proxy (NetAddr a) #

`NetAddr` a proxy value.

aNet4Addr :: Proxy Net4Addr #

`Net4Addr` proxy value.

aNet6Addr :: Proxy Net6Addr #

`Net6Addr` proxy value.

aNetAddrIP :: Proxy (NetAddr IP) #

`NetAddr` `IP` proxy value.

net4Addr :: IP4 -> Word8 -> Net4Addr #

An alias for `netAddr`.

net6Addr :: IP6 -> Word8 -> Net6Addr #

An alias for `netAddr`.

toNetAddr46 :: NetAddr IP -> IP46 (NetAddr IP4) (NetAddr IP6) #

Pull `IP46` from a `NetAddr`.

fromNetAddr46 :: IP46 (NetAddr IP4) (NetAddr IP6) -> NetAddr IP #

Push `IP46` into a `NetAddr`.

printNetAddr :: (IsNetAddr n, Printable (NetHost n), Printer p) => n -> p #

Print network address (CIDR notation).

net4Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP4) => μ n #

IPv4 network address parser (CIDR notation).

net6Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP6) => μ n #

IPv6 network address parser (CIDR notation).

netParser :: (IsNetAddr n, NetHost n ~ IP, CharParsing μ, Monad μ) => μ n #

IP network address parser (CIDR notation).

putNetAddr :: (IsNetAddr n, Serializable (NetHost n), Serializer s) => n -> s #

Serialize a network address (host address followed by 8-bit prefix length).

getNetAddr :: (IsNetAddr n, Deserializable (NetHost n), Deserializer μ) => μ n #

Deserialize a network address (host address followed by 8-bit prefix length).

# Port number

newtype InetPort #

Port number.

Constructors

InetPort |
Fields unInetPort :: Word16

Instances

Bounded InetPort # |
Methods minBound :: InetPort # maxBound :: InetPort #
Enum InetPort # |
Methods succ :: InetPort -> InetPort # pred :: InetPort -> InetPort # toEnum :: Int -> InetPort # fromEnum :: InetPort -> Int # enumFrom :: InetPort -> [InetPort] # enumFromThen :: InetPort -> InetPort -> [InetPort] # enumFromTo :: InetPort -> InetPort -> [InetPort] # enumFromThenTo :: InetPort -> InetPort -> InetPort -> [InetPort] #
Eq InetPort # |
Methods (==) :: InetPort -> InetPort -> Bool # (/=) :: InetPort -> InetPort -> Bool #
Integral InetPort # |
Methods quot :: InetPort -> InetPort -> InetPort # rem :: InetPort -> InetPort -> InetPort # div :: InetPort -> InetPort -> InetPort # mod :: InetPort -> InetPort -> InetPort # quotRem :: InetPort -> InetPort -> (InetPort, InetPort) # divMod :: InetPort -> InetPort -> (InetPort, InetPort) # toInteger :: InetPort -> Integer #
Data InetPort # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InetPort -> c InetPort # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InetPort # toConstr :: InetPort -> Constr # dataTypeOf :: InetPort -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c InetPort) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InetPort) # gmapT :: (forall b. Data b => b -> b) -> InetPort -> InetPort # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InetPort -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InetPort -> r # gmapQ :: (forall d. Data d => d -> u) -> InetPort -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> InetPort -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InetPort -> m InetPort # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InetPort -> m InetPort # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InetPort -> m InetPort #
Num InetPort # |
Methods (+) :: InetPort -> InetPort -> InetPort # (-) :: InetPort -> InetPort -> InetPort # (*) :: InetPort -> InetPort -> InetPort # negate :: InetPort -> InetPort # abs :: InetPort -> InetPort # signum :: InetPort -> InetPort # fromInteger :: Integer -> InetPort #
Ord InetPort # |
Methods compare :: InetPort -> InetPort -> Ordering # (<) :: InetPort -> InetPort -> Bool # (<=) :: InetPort -> InetPort -> Bool # (>) :: InetPort -> InetPort -> Bool # (>=) :: InetPort -> InetPort -> Bool # max :: InetPort -> InetPort -> InetPort # min :: InetPort -> InetPort -> InetPort #
Read InetPort # |
Methods readsPrec :: Int -> ReadS InetPort # readList :: ReadS [InetPort] # readPrec :: ReadPrec InetPort # readListPrec :: ReadPrec [InetPort] #
Real InetPort # |
Methods toRational :: InetPort -> Rational #
Show InetPort # |
Methods showsPrec :: Int -> InetPort -> ShowS # show :: InetPort -> String # showList :: [InetPort] -> ShowS #
Ix InetPort # |
Methods range :: (InetPort, InetPort) -> [InetPort] # index :: (InetPort, InetPort) -> InetPort -> Int # unsafeIndex :: (InetPort, InetPort) -> InetPort -> Int inRange :: (InetPort, InetPort) -> InetPort -> Bool # rangeSize :: (InetPort, InetPort) -> Int # unsafeRangeSize :: (InetPort, InetPort) -> Int
Storable InetPort # |
Methods sizeOf :: InetPort -> Int # alignment :: InetPort -> Int # peekElemOff :: Ptr InetPort -> Int -> IO InetPort # pokeElemOff :: Ptr InetPort -> Int -> InetPort -> IO () # peekByteOff :: Ptr b -> Int -> IO InetPort # pokeByteOff :: Ptr b -> Int -> InetPort -> IO () # peek :: Ptr InetPort -> IO InetPort # poke :: Ptr InetPort -> InetPort -> IO () #
Bits InetPort # |
Methods (.&.) :: InetPort -> InetPort -> InetPort # (.|.) :: InetPort -> InetPort -> InetPort # xor :: InetPort -> InetPort -> InetPort # complement :: InetPort -> InetPort # shift :: InetPort -> Int -> InetPort # rotate :: InetPort -> Int -> InetPort # zeroBits :: InetPort # bit :: Int -> InetPort # setBit :: InetPort -> Int -> InetPort # clearBit :: InetPort -> Int -> InetPort # complementBit :: InetPort -> Int -> InetPort # testBit :: InetPort -> Int -> Bool # bitSizeMaybe :: InetPort -> Maybe Int # bitSize :: InetPort -> Int # isSigned :: InetPort -> Bool # shiftL :: InetPort -> Int -> InetPort # unsafeShiftL :: InetPort -> Int -> InetPort # shiftR :: InetPort -> Int -> InetPort # unsafeShiftR :: InetPort -> Int -> InetPort # rotateL :: InetPort -> Int -> InetPort # rotateR :: InetPort -> Int -> InetPort # popCount :: InetPort -> Int #
Hashable InetPort # |
Methods hashWithSalt :: Int -> InetPort -> Int # hash :: InetPort -> Int #
Serializable InetPort # |
Methods put :: Serializer s => InetPort -> s #
SizedSerializable InetPort # |
Methods size :: Proxy * InetPort -> Int #
Deserializable InetPort # |
Methods get :: Deserializer μ => μ InetPort #
Textual InetPort # |
Methods textual :: (Monad μ, CharParsing μ) => μ InetPort
Printable InetPort # |
Methods print :: Printer p => InetPort -> p

anInetPort :: Proxy InetPort #

`InetPort` proxy value.

# Socket address

data InetAddr a #

Socket address: host address + port number.

Constructors

InetAddr |
Fields inetHost :: a inetPort :: !InetPort

Instances

Functor InetAddr # |
Methods fmap :: (a -> b) -> InetAddr a -> InetAddr b # (<$) :: a -> InetAddr b -> InetAddr a #
Textual Inet6Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Inet6Addr
Textual Inet4Addr # |
Methods textual :: (Monad μ, CharParsing μ) => μ Inet4Addr
Printable Inet6Addr # |
Methods print :: Printer p => Inet6Addr -> p
Printable Inet4Addr # |
Methods print :: Printer p => Inet4Addr -> p
Eq a => Eq (InetAddr a) # |
Methods (==) :: InetAddr a -> InetAddr a -> Bool # (/=) :: InetAddr a -> InetAddr a -> Bool #
Data a => Data (InetAddr a) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InetAddr a -> c (InetAddr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (InetAddr a) # toConstr :: InetAddr a -> Constr # dataTypeOf :: InetAddr a -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (InetAddr a)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (InetAddr a)) # gmapT :: (forall b. Data b => b -> b) -> InetAddr a -> InetAddr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InetAddr a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InetAddr a -> r # gmapQ :: (forall d. Data d => d -> u) -> InetAddr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> InetAddr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InetAddr a -> m (InetAddr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InetAddr a -> m (InetAddr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InetAddr a -> m (InetAddr a) #
Ord a => Ord (InetAddr a) # |
Methods compare :: InetAddr a -> InetAddr a -> Ordering # (<) :: InetAddr a -> InetAddr a -> Bool # (<=) :: InetAddr a -> InetAddr a -> Bool # (>) :: InetAddr a -> InetAddr a -> Bool # (>=) :: InetAddr a -> InetAddr a -> Bool # max :: InetAddr a -> InetAddr a -> InetAddr a # min :: InetAddr a -> InetAddr a -> InetAddr a #
Read a => Read (InetAddr a) # |
Methods readsPrec :: Int -> ReadS (InetAddr a) # readList :: ReadS [InetAddr a] # readPrec :: ReadPrec (InetAddr a) # readListPrec :: ReadPrec [InetAddr a] #
Show a => Show (InetAddr a) # |
Methods showsPrec :: Int -> InetAddr a -> ShowS # show :: InetAddr a -> String # showList :: [InetAddr a] -> ShowS #
Hashable a => Hashable (InetAddr a) # |
Methods hashWithSalt :: Int -> InetAddr a -> Int # hash :: InetAddr a -> Int #
Serializable a => Serializable (InetAddr a) # |
Methods put :: Serializer s => InetAddr a -> s #
SizedSerializable a => SizedSerializable (InetAddr a) # |
Methods size :: Proxy * (InetAddr a) -> Int #
Deserializable a => Deserializable (InetAddr a) # |
Methods get :: Deserializer μ => μ (InetAddr a) #
Textual (InetAddr IP) # |
Methods textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP)
Printable (InetAddr IP) # |
Methods print :: Printer p => InetAddr IP -> p

type Inet4Addr = InetAddr IP4 #

IPv4 socket address.

type Inet6Addr = InetAddr IP6 #

IPv6 socket address.

anInetAddr :: Proxy InetAddr #

`InetAddr` proxy value.

anInetAddrOf :: Proxy a -> Proxy (InetAddr a) #

`InetAddr` a proxy value.

anInet4Addr :: Proxy Inet4Addr #

`Inet4Addr` proxy value.

anInet6Addr :: Proxy Inet6Addr #

`Inet6Addr` proxy value.

anInetAddrIP :: Proxy (InetAddr IP) #

`InetAddr` `IP` proxy value.

toInetAddr46 :: InetAddr IP -> IP46 (InetAddr IP4) (InetAddr IP6) #

Pull `IP46` from an `InetAddr`.

fromInetAddr46 :: IP46 (InetAddr IP4) (InetAddr IP6) -> InetAddr IP #

Push `IP46` into an `InetAddr`.