Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module was taken, with modifications, from the maccatcher package.
Documentation
A Mac is a 6-byte unique identifier used in layer-two network addressing.
Its Storable
instance occupies 6 bytes of memory when poke
d with the
first byte occupying the lowest address, and the last byte occupying the
highest address.
A Show
instance is omitted to avoid confusion. Use showMac
and
readMac
to convert between String
s.
String conversions
Octet conversions
fromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Mac Source
A Mac address is 48-bits wide. This function will construct a Mac
from
6 octets.
toOctets :: Mac -> (Word8, Word8, Word8, Word8, Word8, Word8) Source
Extract each of the 6 octets from a Mac
.