| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Net.Types
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
| Eq IPv6 # | |
| Ord IPv6 # | |
| Read IPv6 # | |
| Show IPv6 # | |
| ToJSON IPv6 # | |
| FromJSON IPv6 # | |
| Prim IPv6 # | |
Defined in Net.IPv6 Methods alignment# :: IPv6 -> Int# # indexByteArray# :: ByteArray# -> Int# -> IPv6 # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, IPv6#) # writeByteArray# :: MutableByteArray# s -> Int# -> IPv6 -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> IPv6 -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> IPv6 # readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, IPv6#) # writeOffAddr# :: Addr# -> Int# -> IPv6 -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> IPv6 -> State# s -> State# s # | |
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.
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 | |
Fields
| |
Instances
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
| Eq Mac # | |
| Ord Mac # | |
| Read Mac # | |
| Show Mac # | |
| Generic Mac # | |
| Hashable Mac # | |
| ToJSON Mac # | |
| ToJSONKey Mac # | |
Defined in Net.Mac | |
| FromJSON Mac # | |
| FromJSONKey Mac # | |
Defined in Net.Mac | |
| Prim Mac # | 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 Methods 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 # | |
Constructors
| MacCodec | |
Fields | |
Instances
| Eq MacCodec # | |
| Ord MacCodec # | |
Defined in Net.Mac | |
| Read MacCodec # | |
| Show MacCodec # | |
| Generic MacCodec # | |
| type Rep MacCodec # | |
Defined in Net.Mac type Rep MacCodec = D1 (MetaData "MacCodec" "Net.Mac" "ip-1.3.0-7N4lB8kCRXPABCtLutZeVu" 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 #
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, |
| MacGroupingTriples !Char | Three-character groups, |
| MacGroupingQuadruples !Char | Four-character groups, |
| MacGroupingNoSeparator | No separator, |