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 #

IPv4 address.

Constructors

IP4 

Fields

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

Deserializable Net4Addr # 

Methods

get :: Deserializer μ => μ Net4Addr #

Deserializable IP # 

Methods

get :: Deserializer μ => μ IP #

Deserializable IP4 # 

Methods

get :: Deserializer μ => μ IP4 #

Serializable IP # 

Methods

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

Serializable IP4 # 

Methods

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

SizedSerializable IP4 # 

Methods

size :: Proxy * IP4 -> Int #

Printable Inet4Addr # 

Methods

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

Printable IP # 

Methods

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

Printable IP4 # 

Methods

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

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 #

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

Methods

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

Printable (InetAddr IP) # 

Methods

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

Textual (InetAddr IP) # 

Methods

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

Textual (NetAddr IP) # 

Methods

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

IsNetAddr (NetAddr IP) # 
type NetHost Net4Addr # 
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 # 
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 # 
Read Range4 # 
Show Range4 # 

ip4Range :: IP4 -> Range4 #

Determine the address range type.

IPv6 address

newtype IP6 #

IPv6 address.

Constructors

IP6 

Fields

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

Deserializable Net6Addr # 

Methods

get :: Deserializer μ => μ Net6Addr #

Deserializable IP # 

Methods

get :: Deserializer μ => μ IP #

Deserializable IP6 # 

Methods

get :: Deserializer μ => μ IP6 #

Serializable IP # 

Methods

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

Serializable IP6 # 

Methods

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

SizedSerializable IP6 # 

Methods

size :: Proxy * IP6 -> Int #

Printable Inet6Addr # 

Methods

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

Printable IP # 

Methods

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

Printable IP6 # 

Methods

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

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 #

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

Methods

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

Printable (InetAddr IP) # 

Methods

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

Textual (InetAddr IP) # 

Methods

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

Textual (NetAddr IP) # 

Methods

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

IsNetAddr (NetAddr IP) # 
type NetHost Net6Addr # 
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 # 
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 # 
Read Range6 # 
Show Range6 # 

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

Deserializable IP # 

Methods

get :: Deserializer μ => μ IP #

Serializable IP # 

Methods

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

Printable IP # 

Methods

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

Textual IP # 

Methods

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

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

Methods

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

Printable (InetAddr IP) # 

Methods

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

Textual (InetAddr IP) # 

Methods

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

Textual (NetAddr IP) # 

Methods

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

IsNetAddr (NetAddr IP) # 
(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.

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 # 
Read 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 # 
IsNetAddr Net4Addr # 
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) # 
Show a => Show (NetAddr a) # 

Methods

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

show :: NetAddr a -> String #

showList :: [NetAddr a] -> ShowS #

Deserializable (NetAddr IP) # 

Methods

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

Serializable a => Serializable (NetAddr a) # 

Methods

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

SizedSerializable a => SizedSerializable (NetAddr a) # 

Methods

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

Printable a => Printable (NetAddr a) # 

Methods

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

Textual (NetAddr IP) # 

Methods

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

IsNetAddr (NetAddr IP) # 
type NetHost Net6Addr # 
type NetHost Net4Addr # 
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.

aNetAddrIP :: Proxy (NetAddr IP) #

NetAddr IP proxy value.

net4Addr :: IP4 -> Word8 -> Net4Addr #

An alias for netAddr.

net6Addr :: IP6 -> Word8 -> Net6Addr #

An alias for 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

Instances

Bounded InetPort # 
Enum InetPort # 
Eq InetPort # 
Integral InetPort # 
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 # 
Ord InetPort # 
Read InetPort # 
Real InetPort # 
Show InetPort # 
Ix InetPort # 
Storable InetPort # 
Bits InetPort # 
Hashable InetPort # 

Methods

hashWithSalt :: Int -> InetPort -> Int #

hash :: InetPort -> Int #

Deserializable InetPort # 

Methods

get :: Deserializer μ => μ InetPort #

Serializable InetPort # 

Methods

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

SizedSerializable InetPort # 

Methods

size :: Proxy * InetPort -> Int #

Printable InetPort # 

Methods

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

Textual InetPort # 

Methods

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

Socket address

data InetAddr a #

Socket address: host address + port number.

Constructors

InetAddr 

Fields

Instances

Functor InetAddr # 

Methods

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

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

Printable Inet6Addr # 

Methods

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

Printable Inet4Addr # 

Methods

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

Textual Inet6Addr # 

Methods

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

Textual Inet4Addr # 

Methods

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

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

Deserializable a => Deserializable (InetAddr a) # 

Methods

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

Serializable a => Serializable (InetAddr a) # 

Methods

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

SizedSerializable a => SizedSerializable (InetAddr a) # 

Methods

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

Printable (InetAddr IP) # 

Methods

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

Textual (InetAddr IP) # 

Methods

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

type Inet4Addr = InetAddr IP4 #

IPv4 socket address.

type Inet6Addr = InetAddr IP6 #

IPv6 socket address.

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

InetAddr a proxy value.