network-dns-0.1.1: A pure Haskell, asyncronous DNS client library

Network.DNS.Common

Synopsis

Documentation

data QueryType Source

Types of DNS queries. RFC 1035, 4.1.1.

Constructors

QUERY 
IQUERY 
SERVERSTATUS 

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

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

serialiseQuestionSource

Arguments

:: ByteString

the encoded name (see serialiseDNSName)

-> DNSType

the type of the question

-> Put 

data Packet Source

Constructors

Packet Header [(String, DNSType)] [Entry] [Entry] [Entry] 

Instances