Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module re-exports all of the thematic types that this library defines.
Synopsis
- newtype IPv4 = IPv4 {}
- newtype IPv6 = IPv6 {}
- newtype IP = IP {}
- data IPv4Range = IPv4Range {
- ipv4RangeBase :: !IPv4
- ipv4RangeLength :: !Word8
- data IPv6Range = IPv6Range {
- ipv6RangeBase :: !IPv6
- ipv6RangeLength :: !Word8
- newtype Mac = Mac Word64
- data MacCodec = MacCodec {}
- data MacGrouping
Documentation
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.
Instances
A 128-bit Internet Protocol version 6 address.
Instances
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.
Instances
Eq IP Source # | |
Data IP Source # | |
Defined in Net.IP 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 # 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 :: forall r r'. (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 # | |
Read IP Source # | |
Show IP Source # | |
Ix IP Source # | |
Generic IP Source # | |
ToJSON IP Source # | |
FromJSON IP Source # | |
NFData IP Source # | |
type Rep IP 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.
IPv4Range | |
|
Instances
IPv6Range | |
|
Instances
Eq IPv6Range Source # | |
Data IPv6Range Source # | |
Defined in Net.IPv6 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 :: forall r r'. (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 # | |
Defined in Net.IPv6 | |
Read IPv6Range Source # | |
Show IPv6Range Source # | |
Generic IPv6Range Source # | |
ToJSON IPv6Range Source # | |
FromJSON IPv6Range Source # | |
NFData IPv6Range Source # | |
type Rep IPv6Range Source # | |
Defined in Net.IPv6 type Rep IPv6Range = D1 ('MetaData "IPv6Range" "Net.IPv6" "ip-1.7.4-GcJkQaKYvn5ASDWIAeokGb" 'False) (C1 ('MetaCons "IPv6Range" 'PrefixI 'True) (S1 ('MetaSel ('Just "ipv6RangeBase") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 IPv6) :*: S1 ('MetaSel ('Just "ipv6RangeLength") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8))) |
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.
Instances
Bounded Mac Source # | |
Enum Mac Source # | |
Eq Mac Source # | |
Data Mac Source # | |
Defined in Net.Mac 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 # 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 :: forall r r'. (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 # | |
Read Mac Source # | |
Show Mac Source # | |
Ix Mac Source # | |
Generic Mac Source # | |
Hashable Mac Source # | |
ToJSON Mac Source # | |
ToJSONKey Mac Source # | |
Defined in Net.Mac | |
FromJSON Mac Source # | |
FromJSONKey Mac Source # | |
Defined in Net.Mac | |
NFData Mac Source # | |
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 |
Defined in Net.Mac alignment# :: Mac -> Int# # indexByteArray# :: ByteArray# -> Int# -> Mac # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Mac #) # writeByteArray# :: MutableByteArray# s -> Int# -> Mac -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Mac -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> Mac # readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Mac #) # writeOffAddr# :: Addr# -> Int# -> Mac -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> Mac -> State# s -> State# s # | |
type Rep Mac Source # | |
Instances
Eq MacCodec Source # | |
Data MacCodec Source # | |
Defined in Net.Mac 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 :: forall r r'. (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 # | |
Read MacCodec Source # | |
Show MacCodec Source # | |
Generic MacCodec Source # | |
type Rep MacCodec Source # | |
Defined in Net.Mac type Rep MacCodec = D1 ('MetaData "MacCodec" "Net.Mac" "ip-1.7.4-GcJkQaKYvn5ASDWIAeokGb" '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.
MacGroupingPairs !Char | Two-character groups, |
MacGroupingTriples !Char | Three-character groups, |
MacGroupingQuadruples !Char | Four-character groups, |
MacGroupingNoSeparator | No separator, |