dns-1.4.5: DNS library in Haskell

Safe HaskellNone
LanguageHaskell2010

Network.DNS.Types

Contents

Description

Data types for DNS Query and Response. For more information, see http://www.ietf.org/rfc/rfc1035.

Synopsis

Domain

type Domain = ByteString Source

Type for domain.

Resource Records

data RR a Source

Raw data format for resource records.

Constructors

ResourceRecord 

Fields

rrname :: Domain
 
rrtype :: TYPE
 
rrttl :: Int
 
rdlen :: Int
 
rdata :: a
 

Instances

Functor RR 
Foldable RR 
Traversable RR 
Eq a => Eq (RR a) 
Show a => Show (RR a) 

type RDATA = RD [Int] Source

rrMapWithType :: (TYPE -> a -> b) -> RR a -> RR b Source

Like fmap except that RR TYPE context is available within the map.

Resource Record Type

data TYPE Source

Types for resource records.

Constructors

A 
AAAA 
NS 
TXT 
MX 
CNAME 
SOA 
PTR 
SRV 
DNAME 
UNKNOWN Int 

Instances

DNS Error

data DNSError Source

An enumeration of all possible DNS errors that can occur.

Constructors

SequenceNumberMismatch

The sequence number of the answer doesn't match our query. This could indicate foul play.

TimeoutExpired

The request simply timed out.

UnexpectedRDATA

The answer has the correct sequence number, but returned an unexpected RDATA format.

IllegalDomain

The domain for query is illegal.

FormatError

The name server was unable to interpret the query.

ServerFailure

The name server was unable to process this query due to a problem with the name server.

NameError

Meaningful only for responses from an authoritative name server, this code signifies that the domain name referenced in the query does not exist.

NotImplemented

The name server does not support the requested kind of query.

OperationRefused

The name server refuses to perform the specified operation for policy reasons. For example, a name server may not wish to provide the information to the particular requester, or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data.

DNS Format

data DNSMessage a Source

Raw data format for DNS Query and Response.

Constructors

DNSFormat 

Fields

header :: DNSHeader
 
question :: [Question]
 
answer :: [RR a]
 
authority :: [RR a]
 
additional :: [RR a]
 

dnsMapWithType :: (TYPE -> a -> b) -> DNSMessage a -> DNSMessage b Source

Like fmap except that RR TYPE context is available within the map.

dnsTraverseWithType :: Applicative f => (TYPE -> a -> f b) -> DNSMessage a -> f (DNSMessage b) Source

Behaves exactly like a regular traverse except that the traversing function also has access to the RR TYPE associated with a value.

DNS Header

data DNSHeader Source

Raw data format for the header of DNS Query and Response.

Constructors

DNSHeader 

DNS Flags

data DNSFlags Source

Raw data format for the flags of DNS Query and Response.

Instances

DNS Body

data QorR Source

Constructors

QR_Query 
QR_Response 

Instances

data OPCODE Source

Constructors

OP_STD 
OP_INV 
OP_SSR 

data Question Source

Raw data format for DNS questions.

Constructors

Question 

Fields

qname :: Domain
 
qtype :: TYPE
 

Instances