2 import qualified Data.ByteString.Lazy as LBS
4 import Network.DNS.Message
8 parseMsg :: [Word8] -> Message
9 parseMsg = decode . LBS.pack
13 testData = [ (parseMsg [ 0x22, 0x79, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00
14 , 0x00, 0x00, 0x00, 0x00, 0x04, 0x6D, 0x61, 0x69
15 , 0x6C, 0x0A, 0x63, 0x69, 0x65, 0x6C, 0x6F, 0x6E
16 , 0x65, 0x67, 0x72, 0x6F, 0x03, 0x6F, 0x72, 0x67
17 , 0x00, 0x00, 0x05, 0x00, 0x01
23 , hdMessageType = Query
24 , hdOpcode = StandardQuery
25 , hdIsAuthoritativeAnswer = False
26 , hdIsTruncated = False
27 , hdIsRecursionDesired = True
28 , hdIsRecursionAvailable = False
29 , hdResponseCode = NoError
31 , msgQuestions = [ Question {
32 qName = mkDomainName "mail.cielonegro.org."
33 , qType = mkQueryType CNAME
46 main = runTestTT (test testData) >> return ()