- htonl :: Word32 -> Word32
- data QueryType
- = QUERY
- | IQUERY
- | SERVERSTATUS
- parseEnum :: forall m a. (Enum a, Bounded a, Monad m) => Word8 -> m a
- data Header = Header {}
- parseHeader :: Get Header
- serialiseHeader :: Header -> Put
- splitDNSName :: String -> [String]
- serialiseDNSName :: [String] -> Maybe ByteString
- fromDNSName :: [String] -> String
- parseDNSName :: ByteString -> Get [String]
- serialiseQuestion :: ByteString -> DNSType -> Put
- parseQuestion :: ByteString -> Get (String, DNSType)
- parseDNSType :: Get DNSType
- deserialiseQuestion :: ByteString -> Get ([String], DNSType)
- parseGenericRR :: ByteString -> Get ([String], DNSType, Word32, ByteString)
- type Entry = ([String], Word32, RR)
- parseRR :: ByteString -> Get Entry
- data Packet = Packet Header [(String, DNSType)] [Entry] [Entry] [Entry]
- parsePacket :: ByteString -> Either String Packet
Documentation
Types of DNS queries. RFC 1035, 4.1.1.
parseEnum :: forall m a. (Enum a, Bounded a, Monad m) => Word8 -> m aSource
Parse an enum from a Word8 in a monad and fail if the value is out of range. It's assumed that the enum is defined at every value between the min and max bound
A DNS protocol header. RFC 1035, 4.1.1.
serialiseHeader :: Header -> PutSource
splitDNSName :: String -> [String]Source
Break a DNS name (e.g. www.google.com) into a list of labels
serialiseDNSName :: [String] -> Maybe ByteStringSource
Convert a split name into the length-prefixed DNS wire format. FIXME: should work with the IDNA system. Returns Nothing if the name couldn't be serialised. FIXME: catch invalid charactors and > 255 parts
fromDNSName :: [String] -> StringSource
Convert a list of labels to a normal string by interspersing periods
parseDNSName :: ByteString -> Get [String]Source
:: ByteString | the encoded name (see |
-> DNSType | the type of the question |
-> Put |
parseQuestion :: ByteString -> Get (String, DNSType)Source
deserialiseQuestion :: ByteString -> Get ([String], DNSType)Source
parseGenericRR :: ByteString -> Get ([String], DNSType, Word32, ByteString)Source
parseRR :: ByteString -> Get EntrySource