hw-ip-2.0.0.0: Library for manipulating IP addresses and CIDR blocks

Safe HaskellNone
LanguageHaskell2010

HaskellWorks.Data.Network.Ip.Ipv4

Synopsis

Documentation

newtype IpAddress Source #

Constructors

IpAddress 

Fields

Instances
Bounded IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Enum IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Eq IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Ord IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Read IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Show IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Generic IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Associated Types

type Rep IpAddress :: Type -> Type #

type Rep IpAddress Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

type Rep IpAddress = D1 (MetaData "IpAddress" "HaskellWorks.Data.Network.Ip.Ipv4" "hw-ip-2.0.0.0-6GxjUWGmn6D3Mt1xyOU7IU" True) (C1 (MetaCons "IpAddress" PrefixI True) (S1 (MetaSel (Just "word") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word32)))

newtype IpNetMask Source #

Constructors

IpNetMask 

Fields

Instances
Bounded IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Enum IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Eq IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Ord IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Show IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Generic IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Associated Types

type Rep IpNetMask :: Type -> Type #

type Rep IpNetMask Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

type Rep IpNetMask = D1 (MetaData "IpNetMask" "HaskellWorks.Data.Network.Ip.Ipv4" "hw-ip-2.0.0.0-6GxjUWGmn6D3Mt1xyOU7IU" True) (C1 (MetaCons "IpNetMask" PrefixI True) (S1 (MetaSel (Just "word8") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))

data IpBlock v Source #

An IP block. The type parameter determines whether or not the value of the type is canonical.

Constructors

IpBlock 

Fields

Instances
Eq (IpBlock v) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Methods

(==) :: IpBlock v -> IpBlock v -> Bool #

(/=) :: IpBlock v -> IpBlock v -> Bool #

Ord (IpBlock v) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Methods

compare :: IpBlock v -> IpBlock v -> Ordering #

(<) :: IpBlock v -> IpBlock v -> Bool #

(<=) :: IpBlock v -> IpBlock v -> Bool #

(>) :: IpBlock v -> IpBlock v -> Bool #

(>=) :: IpBlock v -> IpBlock v -> Bool #

max :: IpBlock v -> IpBlock v -> IpBlock v #

min :: IpBlock v -> IpBlock v -> IpBlock v #

Read (IpBlock Unaligned) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Read (IpBlock Canonical) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Show (IpBlock v) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Methods

showsPrec :: Int -> IpBlock v -> ShowS #

show :: IpBlock v -> String #

showList :: [IpBlock v] -> ShowS #

Generic (IpBlock v) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

Associated Types

type Rep (IpBlock v) :: Type -> Type #

Methods

from :: IpBlock v -> Rep (IpBlock v) x #

to :: Rep (IpBlock v) x -> IpBlock v #

type Rep (IpBlock v) Source # 
Instance details

Defined in HaskellWorks.Data.Network.Ip.Ipv4

type Rep (IpBlock v) = D1 (MetaData "IpBlock" "HaskellWorks.Data.Network.Ip.Ipv4" "hw-ip-2.0.0.0-6GxjUWGmn6D3Mt1xyOU7IU" False) (C1 (MetaCons "IpBlock" PrefixI True) (S1 (MetaSel (Just "base") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 IpAddress) :*: S1 (MetaSel (Just "mask") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 IpNetMask)))

isCanonical :: IpBlock v -> Bool Source #

A valid block must have all host-bits set to zero after the mask is applied

canonicaliseIpBlock :: IpBlock v -> IpBlock Canonical Source #

Canonicalise the block by zero-ing out the host bits