network-ip-0.3.0.2: Internet Protocol data structures

Safe HaskellNone
LanguageHaskell2010

Network.IP.Addr

Contents

Description

Internet Protocol addressing.

Synopsis

Host address

IPv4 address

newtype IP4 Source #

IPv4 address.

Constructors

IP4 

Fields

Instances

Bounded IP4 Source # 

Methods

minBound :: IP4 #

maxBound :: IP4 #

Enum IP4 Source # 

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 Source # 

Methods

(==) :: IP4 -> IP4 -> Bool #

(/=) :: IP4 -> IP4 -> Bool #

Data IP4 Source # 

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 Source # 

Methods

(+) :: IP4 -> IP4 -> IP4 #

(-) :: IP4 -> IP4 -> IP4 #

(*) :: IP4 -> IP4 -> IP4 #

negate :: IP4 -> IP4 #

abs :: IP4 -> IP4 #

signum :: IP4 -> IP4 #

fromInteger :: Integer -> IP4 #

Ord IP4 Source # 

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 Source # 
Read IP4 Source # 
Show IP4 Source # 

Methods

showsPrec :: Int -> IP4 -> ShowS #

show :: IP4 -> String #

showList :: [IP4] -> ShowS #

Ix IP4 Source # 

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 Source # 

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 Source # 

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 Source # 

Methods

def :: IP4 #

Hashable IP4 Source # 

Methods

hashWithSalt :: Int -> IP4 -> Int #

hash :: IP4 -> Int #

Deserializable Net4Addr Source # 

Methods

get :: Deserializer μ => μ Net4Addr #

Deserializable IP Source # 

Methods

get :: Deserializer μ => μ IP #

Deserializable IP4 Source # 

Methods

get :: Deserializer μ => μ IP4 #

Serializable IP Source # 

Methods

put :: Serializer s => IP -> s #

Serializable IP4 Source # 

Methods

put :: Serializer s => IP4 -> s #

SizedSerializable IP4 Source # 

Methods

size :: Proxy * IP4 -> Int #

Printable Inet4Addr Source # 

Methods

print :: Printer p => Inet4Addr -> p #

Printable IP Source # 

Methods

print :: Printer p => IP -> p #

Printable IP4 Source # 

Methods

print :: Printer p => IP4 -> p #

Textual Inet4Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Inet4Addr #

Textual Net4Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Net4Addr #

Textual IP Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ IP #

Textual IP4 Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ IP4 #

IsNetAddr Net4Addr Source # 
Read (NetAddr IP) Source # 
Deserializable (NetAddr IP) Source # 

Methods

get :: Deserializer μ => μ (NetAddr IP) #

Printable (InetAddr IP) Source # 

Methods

print :: Printer p => InetAddr IP -> p #

Textual (InetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP) #

Textual (NetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP) #

IsNetAddr (NetAddr IP) Source # 
type NetHost Net4Addr Source # 
type NetHost (NetAddr IP) Source # 
type NetHost (NetAddr IP) = IP

anIP4 :: Proxy IP4 Source #

IP4 proxy value.

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

The octets of an 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.

ip4FromOctetList :: [Word8] -> Maybe IP4 Source #

Assemble IPv4 address from the octet list.

anyIP4 :: IP4 Source #

IPv4 address 0.0.0.0.

loopbackIP4 :: IP4 Source #

IPv4 address 127.0.0.1.

broadcastIP4 :: IP4 Source #

IPv4 address 255.255.255.255.

data Range4 Source #

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 Source # 
Eq Range4 Source # 

Methods

(==) :: Range4 -> Range4 -> Bool #

(/=) :: Range4 -> Range4 -> Bool #

Data Range4 Source # 

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 Source # 
Read Range4 Source # 
Show Range4 Source # 

ip4Range :: IP4 -> Range4 Source #

Determine the address range type.

IPv6 address

newtype IP6 Source #

IPv6 address.

Constructors

IP6 

Fields

Instances

Bounded IP6 Source # 

Methods

minBound :: IP6 #

maxBound :: IP6 #

Enum IP6 Source # 

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 Source # 

Methods

(==) :: IP6 -> IP6 -> Bool #

(/=) :: IP6 -> IP6 -> Bool #

Data IP6 Source # 

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 Source # 

Methods

(+) :: IP6 -> IP6 -> IP6 #

(-) :: IP6 -> IP6 -> IP6 #

(*) :: IP6 -> IP6 -> IP6 #

negate :: IP6 -> IP6 #

abs :: IP6 -> IP6 #

signum :: IP6 -> IP6 #

fromInteger :: Integer -> IP6 #

Ord IP6 Source # 

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 Source # 
Read IP6 Source # 
Show IP6 Source # 

Methods

showsPrec :: Int -> IP6 -> ShowS #

show :: IP6 -> String #

showList :: [IP6] -> ShowS #

Ix IP6 Source # 

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 Source # 

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 Source # 

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 Source # 

Methods

def :: IP6 #

Hashable IP6 Source # 

Methods

hashWithSalt :: Int -> IP6 -> Int #

hash :: IP6 -> Int #

Deserializable Net6Addr Source # 

Methods

get :: Deserializer μ => μ Net6Addr #

Deserializable IP Source # 

Methods

get :: Deserializer μ => μ IP #

Deserializable IP6 Source # 

Methods

get :: Deserializer μ => μ IP6 #

Serializable IP Source # 

Methods

put :: Serializer s => IP -> s #

Serializable IP6 Source # 

Methods

put :: Serializer s => IP6 -> s #

SizedSerializable IP6 Source # 

Methods

size :: Proxy * IP6 -> Int #

Printable Inet6Addr Source # 

Methods

print :: Printer p => Inet6Addr -> p #

Printable IP Source # 

Methods

print :: Printer p => IP -> p #

Printable IP6 Source # 

Methods

print :: Printer p => IP6 -> p #

Textual Inet6Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Inet6Addr #

Textual Net6Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Net6Addr #

Textual IP Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ IP #

Textual IP6 Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ IP6 #

IsNetAddr Net6Addr Source # 
Read (NetAddr IP) Source # 
Deserializable (NetAddr IP) Source # 

Methods

get :: Deserializer μ => μ (NetAddr IP) #

Printable (InetAddr IP) Source # 

Methods

print :: Printer p => InetAddr IP -> p #

Textual (InetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP) #

Textual (NetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP) #

IsNetAddr (NetAddr IP) Source # 
type NetHost Net6Addr Source # 
type NetHost (NetAddr IP) Source # 
type NetHost (NetAddr IP) = IP

anIP6 :: Proxy IP6 Source #

IP6 proxy value.

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.

anyIP6 :: IP6 Source #

IPv6 address ::.

loopbackIP6 :: IP6 Source #

IPv6 address ::1.

data Range6 Source #

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 Source # 
Eq Range6 Source # 

Methods

(==) :: Range6 -> Range6 -> Bool #

(/=) :: Range6 -> Range6 -> Bool #

Data Range6 Source # 

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 Source # 
Read Range6 Source # 
Show Range6 Source # 

ip6Range :: IP6 -> Range6 Source #

Determine the address range type.

IP address

data IP46 t₄ t₆ Source #

IPv4- or IPv6-specific data.

Constructors

IPv4 t₄ 
IPv6 t₆ 

Instances

Deserializable IP Source # 

Methods

get :: Deserializer μ => μ IP #

Serializable IP Source # 

Methods

put :: Serializer s => IP -> s #

Printable IP Source # 

Methods

print :: Printer p => IP -> p #

Textual IP Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ IP #

Read (NetAddr IP) Source # 
Deserializable (NetAddr IP) Source # 

Methods

get :: Deserializer μ => μ (NetAddr IP) #

Printable (InetAddr IP) Source # 

Methods

print :: Printer p => InetAddr IP -> p #

Textual (InetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP) #

Textual (NetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP) #

IsNetAddr (NetAddr IP) Source # 
(Eq t₆, Eq t₄) => Eq (IP46 t₄ t₆) Source # 

Methods

(==) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool #

(/=) :: IP46 t₄ t₆ -> IP46 t₄ t₆ -> Bool #

(Data t₆, Data t₄) => Data (IP46 t₄ t₆) Source # 

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₆) Source # 

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₆) Source # 

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₆) Source # 

Methods

showsPrec :: Int -> IP46 t₄ t₆ -> ShowS #

show :: IP46 t₄ t₆ -> String #

showList :: [IP46 t₄ t₆] -> ShowS #

type NetHost (NetAddr IP) Source # 
type NetHost (NetAddr IP) = IP

anIP46 :: Proxy IP46 Source #

IP46 proxy value.

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

IP46 t₄ t₆ proxy value.

type IP = IP46 IP4 IP6 Source #

IP address.

anIP :: Proxy IP Source #

IP proxy value.

Network address

class IsNetAddr n where Source #

Network address.

Minimal complete definition

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

Associated Types

type NetHost n Source #

The address type.

Methods

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.

type Net4Addr = NetAddr IP4 Source #

IPv4 network address.

type Net6Addr = NetAddr IP6 Source #

IPv6 network address.

data NetAddr a Source #

Network address: host address + network prefix length.

Instances

Read Net6Addr Source # 
Read Net4Addr Source # 
Deserializable Net6Addr Source # 

Methods

get :: Deserializer μ => μ Net6Addr #

Deserializable Net4Addr Source # 

Methods

get :: Deserializer μ => μ Net4Addr #

Textual Net6Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Net6Addr #

Textual Net4Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Net4Addr #

IsNetAddr Net6Addr Source # 
IsNetAddr Net4Addr Source # 
Eq a => Eq (NetAddr a) Source # 

Methods

(==) :: NetAddr a -> NetAddr a -> Bool #

(/=) :: NetAddr a -> NetAddr a -> Bool #

Data a => Data (NetAddr a) Source # 

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) Source # 
Show a => Show (NetAddr a) Source # 

Methods

showsPrec :: Int -> NetAddr a -> ShowS #

show :: NetAddr a -> String #

showList :: [NetAddr a] -> ShowS #

Deserializable (NetAddr IP) Source # 

Methods

get :: Deserializer μ => μ (NetAddr IP) #

Serializable a => Serializable (NetAddr a) Source # 

Methods

put :: Serializer s => NetAddr a -> s #

SizedSerializable a => SizedSerializable (NetAddr a) Source # 

Methods

size :: Proxy * (NetAddr a) -> Int #

Printable a => Printable (NetAddr a) Source # 

Methods

print :: Printer p => NetAddr a -> p #

Textual (NetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (NetAddr IP) #

IsNetAddr (NetAddr IP) Source # 
type NetHost Net6Addr Source # 
type NetHost Net4Addr Source # 
type NetHost (NetAddr IP) Source # 
type NetHost (NetAddr IP) = IP

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

NetAddr a proxy value.

net4Addr :: IP4 -> Word8 -> Net4Addr Source #

An alias for netAddr.

net6Addr :: IP6 -> Word8 -> Net6Addr Source #

An alias for netAddr.

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

newtype InetPort Source #

Port number.

Constructors

InetPort 

Fields

Instances

Bounded InetPort Source # 
Enum InetPort Source # 
Eq InetPort Source # 
Integral InetPort Source # 
Data InetPort Source # 

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 Source # 
Ord InetPort Source # 
Read InetPort Source # 
Real InetPort Source # 
Show InetPort Source # 
Ix InetPort Source # 
Storable InetPort Source # 
Bits InetPort Source # 
Hashable InetPort Source # 

Methods

hashWithSalt :: Int -> InetPort -> Int #

hash :: InetPort -> Int #

Deserializable InetPort Source # 

Methods

get :: Deserializer μ => μ InetPort #

Serializable InetPort Source # 

Methods

put :: Serializer s => InetPort -> s #

SizedSerializable InetPort Source # 

Methods

size :: Proxy * InetPort -> Int #

Printable InetPort Source # 

Methods

print :: Printer p => InetPort -> p #

Textual InetPort Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ InetPort #

Socket address

data InetAddr a Source #

Socket address: host address + port number.

Constructors

InetAddr 

Fields

Instances

Functor InetAddr Source # 

Methods

fmap :: (a -> b) -> InetAddr a -> InetAddr b #

(<$) :: a -> InetAddr b -> InetAddr a #

Printable Inet6Addr Source # 

Methods

print :: Printer p => Inet6Addr -> p #

Printable Inet4Addr Source # 

Methods

print :: Printer p => Inet4Addr -> p #

Textual Inet6Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Inet6Addr #

Textual Inet4Addr Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ Inet4Addr #

Eq a => Eq (InetAddr a) Source # 

Methods

(==) :: InetAddr a -> InetAddr a -> Bool #

(/=) :: InetAddr a -> InetAddr a -> Bool #

Data a => Data (InetAddr a) Source # 

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) Source # 

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) Source # 
Show a => Show (InetAddr a) Source # 

Methods

showsPrec :: Int -> InetAddr a -> ShowS #

show :: InetAddr a -> String #

showList :: [InetAddr a] -> ShowS #

Hashable a => Hashable (InetAddr a) Source # 

Methods

hashWithSalt :: Int -> InetAddr a -> Int #

hash :: InetAddr a -> Int #

Deserializable a => Deserializable (InetAddr a) Source # 

Methods

get :: Deserializer μ => μ (InetAddr a) #

Serializable a => Serializable (InetAddr a) Source # 

Methods

put :: Serializer s => InetAddr a -> s #

SizedSerializable a => SizedSerializable (InetAddr a) Source # 

Methods

size :: Proxy * (InetAddr a) -> Int #

Printable (InetAddr IP) Source # 

Methods

print :: Printer p => InetAddr IP -> p #

Textual (InetAddr IP) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (InetAddr IP) #

type Inet4Addr = InetAddr IP4 Source #

IPv4 socket address.

type Inet6Addr = InetAddr IP6 Source #

IPv6 socket address.

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

InetAddr a proxy value.