You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
516 B
21 lines
516 B
|
2 years ago
|
|
||
|
|
module Packets.MacAddress
|
||
|
|
(
|
||
|
|
MacAddress(..)
|
||
|
|
, broadcastMac
|
||
|
|
) where
|
||
|
|
|
||
|
|
import qualified Data.ByteString as B
|
||
|
|
import Data.Word (Word8)
|
||
|
|
import Packets.Serializable (Serializable (..))
|
||
|
|
|
||
|
|
data MacAddress =
|
||
|
|
MacAddress Word8 Word8 Word8 Word8 Word8 Word8
|
||
|
|
deriving (Show, Eq)
|
||
|
|
|
||
|
|
instance Serializable MacAddress where
|
||
|
|
serialize (MacAddress b1 b2 b3 b4 b5 b6) = B.pack [b1, b2, b3, b4, b5, b6]
|
||
|
|
|
||
|
|
broadcastMac :: MacAddress
|
||
|
|
broadcastMac = MacAddress 0xff 0xff 0xff 0xff 0xff 0xff
|