ip-1.7.0: Library for IP and MAC addresses

Safe HaskellNone
LanguageHaskell2010

Net.Types

Description

This module re-exports all of the thematic types that this library defines.

Synopsis

Documentation

newtype IPv4 Source #

A 32-bit Internet Protocol version 4 address. To use this with the network library, it is necessary to use Network.Socket.htonl to convert the underlying Word32 from host byte order to network byte order.

Constructors

IPv4 

Fields

Instances
Bounded IPv4 Source # 
Instance details

Defined in Net.IPv4

Enum IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

succ :: IPv4 -> IPv4 #

pred :: IPv4 -> IPv4 #

toEnum :: Int -> IPv4 #

fromEnum :: IPv4 -> Int #

enumFrom :: IPv4 -> [IPv4] #

enumFromThen :: IPv4 -> IPv4 -> [IPv4] #

enumFromTo :: IPv4 -> IPv4 -> [IPv4] #

enumFromThenTo :: IPv4 -> IPv4 -> IPv4 -> [IPv4] #

Eq IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

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

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

Data IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPv4 -> c IPv4 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IPv4 #

toConstr :: IPv4 -> Constr #

dataTypeOf :: IPv4 -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IPv4) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IPv4) #

gmapT :: (forall b. Data b => b -> b) -> IPv4 -> IPv4 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPv4 -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPv4 -> r #

gmapQ :: (forall d. Data d => d -> u) -> IPv4 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IPv4 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPv4 -> m IPv4 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv4 -> m IPv4 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv4 -> m IPv4 #

Ord IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

compare :: IPv4 -> IPv4 -> Ordering #

(<) :: IPv4 -> IPv4 -> Bool #

(<=) :: IPv4 -> IPv4 -> Bool #

(>) :: IPv4 -> IPv4 -> Bool #

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

max :: IPv4 -> IPv4 -> IPv4 #

min :: IPv4 -> IPv4 -> IPv4 #

Read IPv4 Source # 
Instance details

Defined in Net.IPv4

Show IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

showsPrec :: Int -> IPv4 -> ShowS #

show :: IPv4 -> String #

showList :: [IPv4] -> ShowS #

Ix IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

range :: (IPv4, IPv4) -> [IPv4] #

index :: (IPv4, IPv4) -> IPv4 -> Int #

unsafeIndex :: (IPv4, IPv4) -> IPv4 -> Int

inRange :: (IPv4, IPv4) -> IPv4 -> Bool #

rangeSize :: (IPv4, IPv4) -> Int #

unsafeRangeSize :: (IPv4, IPv4) -> Int

Generic IPv4 Source # 
Instance details

Defined in Net.IPv4

Associated Types

type Rep IPv4 :: Type -> Type #

Methods

from :: IPv4 -> Rep IPv4 x #

to :: Rep IPv4 x -> IPv4 #

Hashable IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

hashWithSalt :: Int -> IPv4 -> Int #

hash :: IPv4 -> Int #

ToJSON IPv4 Source # 
Instance details

Defined in Net.IPv4

ToJSONKey IPv4 Source # 
Instance details

Defined in Net.IPv4

FromJSON IPv4 Source # 
Instance details

Defined in Net.IPv4

FromJSONKey IPv4 Source # 
Instance details

Defined in Net.IPv4

Storable IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

sizeOf :: IPv4 -> Int #

alignment :: IPv4 -> Int #

peekElemOff :: Ptr IPv4 -> Int -> IO IPv4 #

pokeElemOff :: Ptr IPv4 -> Int -> IPv4 -> IO () #

peekByteOff :: Ptr b -> Int -> IO IPv4 #

pokeByteOff :: Ptr b -> Int -> IPv4 -> IO () #

peek :: Ptr IPv4 -> IO IPv4 #

poke :: Ptr IPv4 -> IPv4 -> IO () #

Bits IPv4 Source # 
Instance details

Defined in Net.IPv4

FiniteBits IPv4 Source # 
Instance details

Defined in Net.IPv4

NFData IPv4 Source # 
Instance details

Defined in Net.IPv4

Methods

rnf :: IPv4 -> () #

Prim IPv4 Source # 
Instance details

Defined in Net.IPv4

Unbox IPv4 Source # 
Instance details

Defined in Net.IPv4

Vector Vector IPv4 Source # 
Instance details

Defined in Net.IPv4

MVector MVector IPv4 Source # 
Instance details

Defined in Net.IPv4

type Rep IPv4 Source # 
Instance details

Defined in Net.IPv4

type Rep IPv4 = D1 (MetaData "IPv4" "Net.IPv4" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" True) (C1 (MetaCons "IPv4" PrefixI True) (S1 (MetaSel (Just "getIPv4") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word32)))
newtype Vector IPv4 Source # 
Instance details

Defined in Net.IPv4

newtype MVector s IPv4 Source # 
Instance details

Defined in Net.IPv4

newtype MVector s IPv4 = MV_IPv4 (MVector s IPv4)

newtype IPv6 Source #

A 128-bit Internet Protocol version 6 address.

Constructors

IPv6 

Fields

Instances
Bounded IPv6 Source # 
Instance details

Defined in Net.IPv6

Enum IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

succ :: IPv6 -> IPv6 #

pred :: IPv6 -> IPv6 #

toEnum :: Int -> IPv6 #

fromEnum :: IPv6 -> Int #

enumFrom :: IPv6 -> [IPv6] #

enumFromThen :: IPv6 -> IPv6 -> [IPv6] #

enumFromTo :: IPv6 -> IPv6 -> [IPv6] #

enumFromThenTo :: IPv6 -> IPv6 -> IPv6 -> [IPv6] #

Eq IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

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

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

Data IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPv6 -> c IPv6 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IPv6 #

toConstr :: IPv6 -> Constr #

dataTypeOf :: IPv6 -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IPv6) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IPv6) #

gmapT :: (forall b. Data b => b -> b) -> IPv6 -> IPv6 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPv6 -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPv6 -> r #

gmapQ :: (forall d. Data d => d -> u) -> IPv6 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IPv6 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPv6 -> m IPv6 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv6 -> m IPv6 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv6 -> m IPv6 #

Ord IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

compare :: IPv6 -> IPv6 -> Ordering #

(<) :: IPv6 -> IPv6 -> Bool #

(<=) :: IPv6 -> IPv6 -> Bool #

(>) :: IPv6 -> IPv6 -> Bool #

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

max :: IPv6 -> IPv6 -> IPv6 #

min :: IPv6 -> IPv6 -> IPv6 #

Read IPv6 Source # 
Instance details

Defined in Net.IPv6

Show IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

showsPrec :: Int -> IPv6 -> ShowS #

show :: IPv6 -> String #

showList :: [IPv6] -> ShowS #

Ix IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

range :: (IPv6, IPv6) -> [IPv6] #

index :: (IPv6, IPv6) -> IPv6 -> Int #

unsafeIndex :: (IPv6, IPv6) -> IPv6 -> Int

inRange :: (IPv6, IPv6) -> IPv6 -> Bool #

rangeSize :: (IPv6, IPv6) -> Int #

unsafeRangeSize :: (IPv6, IPv6) -> Int

ToJSON IPv6 Source # 
Instance details

Defined in Net.IPv6

FromJSON IPv6 Source # 
Instance details

Defined in Net.IPv6

Storable IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

sizeOf :: IPv6 -> Int #

alignment :: IPv6 -> Int #

peekElemOff :: Ptr IPv6 -> Int -> IO IPv6 #

pokeElemOff :: Ptr IPv6 -> Int -> IPv6 -> IO () #

peekByteOff :: Ptr b -> Int -> IO IPv6 #

pokeByteOff :: Ptr b -> Int -> IPv6 -> IO () #

peek :: Ptr IPv6 -> IO IPv6 #

poke :: Ptr IPv6 -> IPv6 -> IO () #

Bits IPv6 Source # 
Instance details

Defined in Net.IPv6

FiniteBits IPv6 Source # 
Instance details

Defined in Net.IPv6

NFData IPv6 Source # 
Instance details

Defined in Net.IPv6

Methods

rnf :: IPv6 -> () #

Prim IPv6 Source # 
Instance details

Defined in Net.IPv6

newtype IP Source #

A 32-bit IPv4 address or a 128-bit IPv6 address. Internally, this is just represented as an IPv6 address. The functions provided in Net.IP help simulate constructing and pattern matching on values of this type. All functions and typeclass methods that convert IP values to text will display it as an IPv4 address if possible.

Constructors

IP 

Fields

Instances
Eq IP Source # 
Instance details

Defined in Net.IP

Methods

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

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

Data IP Source # 
Instance details

Defined in Net.IP

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IP -> c IP #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IP #

toConstr :: IP -> Constr #

dataTypeOf :: IP -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IP) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IP) #

gmapT :: (forall b. Data b => b -> b) -> IP -> IP #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IP -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IP -> r #

gmapQ :: (forall d. Data d => d -> u) -> IP -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IP -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IP -> m IP #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IP -> m IP #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IP -> m IP #

Ord IP Source # 
Instance details

Defined in Net.IP

Methods

compare :: IP -> IP -> Ordering #

(<) :: IP -> IP -> Bool #

(<=) :: IP -> IP -> Bool #

(>) :: IP -> IP -> Bool #

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

max :: IP -> IP -> IP #

min :: IP -> IP -> IP #

Read IP Source # 
Instance details

Defined in Net.IP

Show IP Source # 
Instance details

Defined in Net.IP

Methods

showsPrec :: Int -> IP -> ShowS #

show :: IP -> String #

showList :: [IP] -> ShowS #

Ix IP Source # 
Instance details

Defined in Net.IP

Methods

range :: (IP, IP) -> [IP] #

index :: (IP, IP) -> IP -> Int #

unsafeIndex :: (IP, IP) -> IP -> Int

inRange :: (IP, IP) -> IP -> Bool #

rangeSize :: (IP, IP) -> Int #

unsafeRangeSize :: (IP, IP) -> Int

Generic IP Source # 
Instance details

Defined in Net.IP

Associated Types

type Rep IP :: Type -> Type #

Methods

from :: IP -> Rep IP x #

to :: Rep IP x -> IP #

ToJSON IP Source # 
Instance details

Defined in Net.IP

FromJSON IP Source # 
Instance details

Defined in Net.IP

NFData IP Source # 
Instance details

Defined in Net.IP

Methods

rnf :: IP -> () #

type Rep IP Source # 
Instance details

Defined in Net.IP

type Rep IP = D1 (MetaData "IP" "Net.IP" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" True) (C1 (MetaCons "IP" PrefixI True) (S1 (MetaSel (Just "getIP") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IPv6)))

data IPv4Range Source #

The length should be between 0 and 32. These bounds are inclusive. This expectation is not in any way enforced by this library because it does not cause errors. A mask length greater than 32 will be treated as if it were 32.

Constructors

IPv4Range 
Instances
Eq IPv4Range Source # 
Instance details

Defined in Net.IPv4

Data IPv4Range Source # 
Instance details

Defined in Net.IPv4

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPv4Range -> c IPv4Range #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IPv4Range #

toConstr :: IPv4Range -> Constr #

dataTypeOf :: IPv4Range -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IPv4Range) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IPv4Range) #

gmapT :: (forall b. Data b => b -> b) -> IPv4Range -> IPv4Range #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPv4Range -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPv4Range -> r #

gmapQ :: (forall d. Data d => d -> u) -> IPv4Range -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IPv4Range -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPv4Range -> m IPv4Range #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv4Range -> m IPv4Range #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv4Range -> m IPv4Range #

Ord IPv4Range Source # 
Instance details

Defined in Net.IPv4

Read IPv4Range Source # 
Instance details

Defined in Net.IPv4

Show IPv4Range Source # 
Instance details

Defined in Net.IPv4

Generic IPv4Range Source # 
Instance details

Defined in Net.IPv4

Associated Types

type Rep IPv4Range :: Type -> Type #

Hashable IPv4Range Source # 
Instance details

Defined in Net.IPv4

ToJSON IPv4Range Source # 
Instance details

Defined in Net.IPv4

FromJSON IPv4Range Source # 
Instance details

Defined in Net.IPv4

NFData IPv4Range Source # 
Instance details

Defined in Net.IPv4

Methods

rnf :: IPv4Range -> () #

Unbox IPv4Range Source # 
Instance details

Defined in Net.IPv4

Vector Vector IPv4Range Source # 
Instance details

Defined in Net.IPv4

MVector MVector IPv4Range Source # 
Instance details

Defined in Net.IPv4

type Rep IPv4Range Source # 
Instance details

Defined in Net.IPv4

type Rep IPv4Range = D1 (MetaData "IPv4Range" "Net.IPv4" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" False) (C1 (MetaCons "IPv4Range" PrefixI True) (S1 (MetaSel (Just "ipv4RangeBase") SourceUnpack SourceStrict DecidedStrict) (Rec0 IPv4) :*: S1 (MetaSel (Just "ipv4RangeLength") SourceUnpack SourceStrict DecidedStrict) (Rec0 Word8)))
data Vector IPv4Range Source # 
Instance details

Defined in Net.IPv4

data MVector s IPv4Range Source # 
Instance details

Defined in Net.IPv4

data IPv6Range Source #

An IPv6Range. It is made up of the first IPv6 in the range and its length.

Constructors

IPv6Range 
Instances
Eq IPv6Range Source # 
Instance details

Defined in Net.IPv6

Data IPv6Range Source # 
Instance details

Defined in Net.IPv6

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IPv6Range -> c IPv6Range #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IPv6Range #

toConstr :: IPv6Range -> Constr #

dataTypeOf :: IPv6Range -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IPv6Range) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IPv6Range) #

gmapT :: (forall b. Data b => b -> b) -> IPv6Range -> IPv6Range #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IPv6Range -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IPv6Range -> r #

gmapQ :: (forall d. Data d => d -> u) -> IPv6Range -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IPv6Range -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IPv6Range -> m IPv6Range #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv6Range -> m IPv6Range #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IPv6Range -> m IPv6Range #

Ord IPv6Range Source # 
Instance details

Defined in Net.IPv6

Read IPv6Range Source # 
Instance details

Defined in Net.IPv6

Show IPv6Range Source # 
Instance details

Defined in Net.IPv6

Generic IPv6Range Source # 
Instance details

Defined in Net.IPv6

Associated Types

type Rep IPv6Range :: Type -> Type #

ToJSON IPv6Range Source # 
Instance details

Defined in Net.IPv6

FromJSON IPv6Range Source # 
Instance details

Defined in Net.IPv6

NFData IPv6Range Source # 
Instance details

Defined in Net.IPv6

Methods

rnf :: IPv6Range -> () #

type Rep IPv6Range Source # 
Instance details

Defined in Net.IPv6

type Rep IPv6Range = D1 (MetaData "IPv6Range" "Net.IPv6" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" False) (C1 (MetaCons "IPv6Range" PrefixI True) (S1 (MetaSel (Just "ipv6RangeBase") SourceUnpack SourceStrict DecidedStrict) (Rec0 IPv6) :*: S1 (MetaSel (Just "ipv6RangeLength") SourceUnpack SourceStrict DecidedStrict) (Rec0 Word8)))

newtype Mac Source #

A 48-bit MAC address. Do not use the data constructor for this type. It is not considered part of the stable API, and it allows you to construct invalid MAC addresses.

Constructors

Mac Word64 
Instances
Bounded Mac Source # 
Instance details

Defined in Net.Mac

Methods

minBound :: Mac #

maxBound :: Mac #

Enum Mac Source # 
Instance details

Defined in Net.Mac

Methods

succ :: Mac -> Mac #

pred :: Mac -> Mac #

toEnum :: Int -> Mac #

fromEnum :: Mac -> Int #

enumFrom :: Mac -> [Mac] #

enumFromThen :: Mac -> Mac -> [Mac] #

enumFromTo :: Mac -> Mac -> [Mac] #

enumFromThenTo :: Mac -> Mac -> Mac -> [Mac] #

Eq Mac Source # 
Instance details

Defined in Net.Mac

Methods

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

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

Data Mac Source # 
Instance details

Defined in Net.Mac

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Mac -> c Mac #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Mac #

toConstr :: Mac -> Constr #

dataTypeOf :: Mac -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Mac) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Mac) #

gmapT :: (forall b. Data b => b -> b) -> Mac -> Mac #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Mac -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Mac -> r #

gmapQ :: (forall d. Data d => d -> u) -> Mac -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Mac -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Mac -> m Mac #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Mac -> m Mac #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Mac -> m Mac #

Ord Mac Source # 
Instance details

Defined in Net.Mac

Methods

compare :: Mac -> Mac -> Ordering #

(<) :: Mac -> Mac -> Bool #

(<=) :: Mac -> Mac -> Bool #

(>) :: Mac -> Mac -> Bool #

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

max :: Mac -> Mac -> Mac #

min :: Mac -> Mac -> Mac #

Read Mac Source # 
Instance details

Defined in Net.Mac

Show Mac Source # 
Instance details

Defined in Net.Mac

Methods

showsPrec :: Int -> Mac -> ShowS #

show :: Mac -> String #

showList :: [Mac] -> ShowS #

Ix Mac Source # 
Instance details

Defined in Net.Mac

Methods

range :: (Mac, Mac) -> [Mac] #

index :: (Mac, Mac) -> Mac -> Int #

unsafeIndex :: (Mac, Mac) -> Mac -> Int

inRange :: (Mac, Mac) -> Mac -> Bool #

rangeSize :: (Mac, Mac) -> Int #

unsafeRangeSize :: (Mac, Mac) -> Int

Generic Mac Source # 
Instance details

Defined in Net.Mac

Associated Types

type Rep Mac :: Type -> Type #

Methods

from :: Mac -> Rep Mac x #

to :: Rep Mac x -> Mac #

Hashable Mac Source # 
Instance details

Defined in Net.Mac

Methods

hashWithSalt :: Int -> Mac -> Int #

hash :: Mac -> Int #

ToJSON Mac Source # 
Instance details

Defined in Net.Mac

ToJSONKey Mac Source # 
Instance details

Defined in Net.Mac

FromJSON Mac Source # 
Instance details

Defined in Net.Mac

FromJSONKey Mac Source # 
Instance details

Defined in Net.Mac

NFData Mac Source # 
Instance details

Defined in Net.Mac

Methods

rnf :: Mac -> () #

Prim Mac Source #

This only preserves the lower 6 bytes of the 8-byte word that backs a mac address. It runs slower than it would if it used a full 8-byte word, but it consumes less space. When storing millions of mac addresses, this is a good trade to make. When storing a small number of mac address, it might be preferable to make a primitive array of Word64 instead and use the mac address data constructor to coerce between the two.

Instance details

Defined in Net.Mac

type Rep Mac Source # 
Instance details

Defined in Net.Mac

type Rep Mac = D1 (MetaData "Mac" "Net.Mac" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" True) (C1 (MetaCons "Mac" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word64)))

data MacCodec Source #

A MacCodec allows users to control the encoding/decoding of their Mac addresses.

Instances
Eq MacCodec Source # 
Instance details

Defined in Net.Mac

Data MacCodec Source # 
Instance details

Defined in Net.Mac

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MacCodec -> c MacCodec #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MacCodec #

toConstr :: MacCodec -> Constr #

dataTypeOf :: MacCodec -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MacCodec) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MacCodec) #

gmapT :: (forall b. Data b => b -> b) -> MacCodec -> MacCodec #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MacCodec -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MacCodec -> r #

gmapQ :: (forall d. Data d => d -> u) -> MacCodec -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MacCodec -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MacCodec -> m MacCodec #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MacCodec -> m MacCodec #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MacCodec -> m MacCodec #

Ord MacCodec Source # 
Instance details

Defined in Net.Mac

Read MacCodec Source # 
Instance details

Defined in Net.Mac

Show MacCodec Source # 
Instance details

Defined in Net.Mac

Generic MacCodec Source # 
Instance details

Defined in Net.Mac

Associated Types

type Rep MacCodec :: Type -> Type #

Methods

from :: MacCodec -> Rep MacCodec x #

to :: Rep MacCodec x -> MacCodec #

type Rep MacCodec Source # 
Instance details

Defined in Net.Mac

type Rep MacCodec = D1 (MetaData "MacCodec" "Net.Mac" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" False) (C1 (MetaCons "MacCodec" PrefixI True) (S1 (MetaSel (Just "macCodecGrouping") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 MacGrouping) :*: S1 (MetaSel (Just "macCodecUpperCase") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)))

data MacGrouping Source #

The format expected by the mac address parser. The Word8 taken by some of these constructors is the ascii value of the character to be used as the separator. This is typically a colon, a hyphen, or a space character. All decoding functions are case insensitive.

Constructors

MacGroupingPairs !Char

Two-character groups, FA:2B:40:09:8C:11

MacGroupingTriples !Char

Three-character groups, 24B-F0A-025-829

MacGroupingQuadruples !Char

Four-character groups, A220.0745.CAC7

MacGroupingNoSeparator

No separator, 24AF4B5B0780

Instances
Eq MacGrouping Source # 
Instance details

Defined in Net.Mac

Data MacGrouping Source # 
Instance details

Defined in Net.Mac

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MacGrouping -> c MacGrouping #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MacGrouping #

toConstr :: MacGrouping -> Constr #

dataTypeOf :: MacGrouping -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MacGrouping) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MacGrouping) #

gmapT :: (forall b. Data b => b -> b) -> MacGrouping -> MacGrouping #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MacGrouping -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MacGrouping -> r #

gmapQ :: (forall d. Data d => d -> u) -> MacGrouping -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MacGrouping -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MacGrouping -> m MacGrouping #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MacGrouping -> m MacGrouping #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MacGrouping -> m MacGrouping #

Ord MacGrouping Source # 
Instance details

Defined in Net.Mac

Read MacGrouping Source # 
Instance details

Defined in Net.Mac

Show MacGrouping Source # 
Instance details

Defined in Net.Mac

Generic MacGrouping Source # 
Instance details

Defined in Net.Mac

Associated Types

type Rep MacGrouping :: Type -> Type #

type Rep MacGrouping Source # 
Instance details

Defined in Net.Mac

type Rep MacGrouping = D1 (MetaData "MacGrouping" "Net.Mac" "ip-1.7.0-DzU4P52J9ZcGMd3XENSoJL" False) ((C1 (MetaCons "MacGroupingPairs" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Char)) :+: C1 (MetaCons "MacGroupingTriples" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Char))) :+: (C1 (MetaCons "MacGroupingQuadruples" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Char)) :+: C1 (MetaCons "MacGroupingNoSeparator" PrefixI False) (U1 :: Type -> Type)))