dns-3.0.4: DNS library in Haskell

Safe Haskell | None
Language | Haskell2010

Network.DNS.Types

Contents

- Resource Records
  - Types
  - Resource Record Types
  - Resource Data
- DNS Message
  - DNS Header
  - DNS Body
- DNS Error
- EDNS0
  - Accessors
  - Converters
- EDNS0 option data
- Other types

Description

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

Synopsis

- data ResourceRecord = ResourceRecord {
  - rrname :: Domain
  - rrtype :: TYPE
  - rrclass :: CLASS
  - rrttl :: TTL
  - rdata :: RData
  }
- type Domain = ByteString
- type CLASS = Word16
- classIN :: CLASS
- type TTL = Word32
- data TYPE where
  - pattern A :: TYPE
  - pattern NS :: TYPE
  - pattern CNAME :: TYPE
  - pattern SOA :: TYPE
  - pattern NULL :: TYPE
  - pattern PTR :: TYPE
  - pattern MX :: TYPE
  - pattern TXT :: TYPE
  - pattern AAAA :: TYPE
  - pattern SRV :: TYPE
  - pattern DNAME :: TYPE
  - pattern OPT :: TYPE
  - pattern DS :: TYPE
  - pattern RRSIG :: TYPE
  - pattern NSEC :: TYPE
  - pattern DNSKEY :: TYPE
  - pattern NSEC3 :: TYPE
  - pattern NSEC3PARAM :: TYPE
  - pattern TLSA :: TYPE
  - pattern CDS :: TYPE
  - pattern CDNSKEY :: TYPE
  - pattern CSYNC :: TYPE
  - pattern ANY :: TYPE
- fromTYPE :: TYPE -> Word16
- toTYPE :: Word16 -> TYPE
- data RData
  - = RD_A IPv4
  - | RD_NS Domain
  - | RD_CNAME Domain
  - | RD_SOA Domain Mailbox Word32 Word32 Word32 Word32 Word32
  - | RD_NULL
  - | RD_PTR Domain
  - | RD_MX Word16 Domain
  - | RD_TXT ByteString
  - | RD_AAAA IPv6
  - | RD_SRV Word16 Word16 Word16 Domain
  - | RD_DNAME Domain
  - | RD_OPT [OData]
  - | RD_DS Word16 Word8 Word8 ByteString
  - | RD_DNSKEY Word16 Word8 Word8 ByteString
  - | RD_NSEC3PARAM Word8 Word8 Word16 ByteString
  - | RD_TLSA Word8 Word8 Word8 ByteString
  - | UnknownRData ByteString
- data DNSMessage = DNSMessage {
  - header :: DNSHeader
  - question :: [Question]
  - answer :: [ResourceRecord]
  - authority :: [ResourceRecord]
  - additional :: [ResourceRecord]
  }
- defaultQuery :: DNSMessage
- defaultResponse :: DNSMessage
- type DNSFormat = DNSMessage
- data DNSHeader = DNSHeader {
  - identifier :: Identifier
  - flags :: DNSFlags
  }
- type Identifier = Word16
- data QorR
  - = QR_Query
  - | QR_Response
- data DNSFlags = DNSFlags {
  - qOrR :: QorR
  - opcode :: OPCODE
  - authAnswer :: Bool
  - trunCation :: Bool
  - recDesired :: Bool
  - recAvailable :: Bool
  - rcode :: RCODE
  - authenData :: Bool
  }
- data OPCODE
  - = OP_STD
  - | OP_INV
  - | OP_SSR
- data RCODE where
  - pattern NoErr :: RCODE
  - pattern FormatErr :: RCODE
  - pattern ServFail :: RCODE
  - pattern NameErr :: RCODE
  - pattern NotImpl :: RCODE
  - pattern Refused :: RCODE
  - pattern YXDomain :: RCODE
  - pattern YXRRSet :: RCODE
  - pattern NXRRSet :: RCODE
  - pattern NotAuth :: RCODE
  - pattern NotZone :: RCODE
  - pattern BadOpt :: RCODE
- fromRCODE :: RCODE -> Word16
- toRCODE :: Word16 -> RCODE
- fromRCODEforHeader :: RCODE -> Word16
- toRCODEforHeader :: Word16 -> RCODE
- data Question = Question {
  - qname :: Domain
  - qtype :: TYPE
  }
- data DNSError
  - = SequenceNumberMismatch
  - | RetryLimitExceeded
  - | TimeoutExpired
  - | UnexpectedRDATA
  - | IllegalDomain
  - | FormatError
  - | ServerFailure
  - | NameError
  - | NotImplemented
  - | OperationRefused
  - | BadOptRecord
  - | BadConfiguration
  - | NetworkFailure IOException
  - | DecodeError String
  - | UnknownDNSError
- data EDNS0
- defaultEDNS0 :: EDNS0
- maxUdpSize :: Word16
- minUdpSize :: Word16
- udpSize :: EDNS0 -> Word16
- extRCODE :: EDNS0 -> RCODE
- dnssecOk :: EDNS0 -> Bool
- options :: EDNS0 -> [OData]
- fromEDNS0 :: EDNS0 -> ResourceRecord
- toEDNS0 :: DNSFlags -> ResourceRecord -> Maybe EDNS0
- data OData
  - = OD_ClientSubnet Word8 Word8 IP
  - | UnknownOData OptCode ByteString
- data OptCode where
  - pattern ClientSubnet :: OptCode
- fromOptCode :: OptCode -> Word16
- toOptCode :: Word16 -> OptCode
- type Mailbox = ByteString

# Resource Records

data ResourceRecord Source #

Raw data format for resource records.

Constructors

ResourceRecord |

Fields

- rrname :: Domain

  Name

- rrtype :: TYPE

  Resource record type

- rrclass :: CLASS

  Resource record class

- rrttl :: TTL

  Time to live

- rdata :: RData

  Resource data

Instances

Eq ResourceRecord Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: ResourceRecord -> ResourceRecord -> Bool Source # (/=) :: ResourceRecord -> ResourceRecord -> Bool Source #
Show ResourceRecord Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> ResourceRecord -> ShowS Source # show :: ResourceRecord -> String Source # showList :: [ResourceRecord] -> ShowS Source #

## Types

type Domain = ByteString Source #

Type for domain.

type CLASS = Word16 Source #

Resource record class.

classIN :: CLASS Source #

Resource record class for the Internet.

type TTL = Word32 Source #

Time to live in second.

## Resource Record Types

data TYPE where Source #

Types for resource records.

Bundled Patterns

pattern A :: TYPE | IPv4 address
pattern NS :: TYPE | An authoritative name serve
pattern CNAME :: TYPE | The canonical name for an alias
pattern SOA :: TYPE | Marks the start of a zone of authority
pattern NULL :: TYPE | A null RR (EXPERIMENTAL)
pattern PTR :: TYPE | A domain name pointer
pattern MX :: TYPE | Mail exchange
pattern TXT :: TYPE | Text strings
pattern AAAA :: TYPE | IPv6 Address
pattern SRV :: TYPE | Server Selection (RFC2782)
pattern DNAME :: TYPE | DNAME (RFC6672)
pattern OPT :: TYPE | OPT (RFC6891)
pattern DS :: TYPE | Delegation Signer (RFC4034)
pattern RRSIG :: TYPE | RRSIG (RFC4034)
pattern NSEC :: TYPE | NSEC (RFC4034)
pattern DNSKEY :: TYPE | DNSKEY (RFC4034)
pattern NSEC3 :: TYPE | NSEC3 (RFC5155)
pattern NSEC3PARAM :: TYPE | NSEC3PARAM (RFC5155)
pattern TLSA :: TYPE | TLSA (RFC6698)
pattern CDS :: TYPE | Child DS (RFC7344)
pattern CDNSKEY :: TYPE | DNSKEY(s) the Child wants reflected in DS (RFC7344)
pattern CSYNC :: TYPE | Child-To-Parent Synchronization (RFC7477)
pattern ANY :: TYPE | A request for all records the server/cache has available

Instances

Eq TYPE Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: TYPE -> TYPE -> Bool Source # (/=) :: TYPE -> TYPE -> Bool Source #
Ord TYPE Source # |
Instance details Defined in Network.DNS.Types Methods compare :: TYPE -> TYPE -> Ordering Source # (<) :: TYPE -> TYPE -> Bool Source # (<=) :: TYPE -> TYPE -> Bool Source # (>) :: TYPE -> TYPE -> Bool Source # (>=) :: TYPE -> TYPE -> Bool Source # max :: TYPE -> TYPE -> TYPE Source # min :: TYPE -> TYPE -> TYPE Source #
Show TYPE Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> TYPE -> ShowS Source # show :: TYPE -> String Source # showList :: [TYPE] -> ShowS Source #

fromTYPE :: TYPE -> Word16 Source #

From type to number.

toTYPE :: Word16 -> TYPE Source #

From number to type.

## Resource Data

data RData Source #

Raw data format for each type.

Constructors

RD_A IPv4 | IPv4 address
RD_NS Domain | An authoritative name serve
RD_CNAME Domain | The canonical name for an alias
RD_SOA Domain Mailbox Word32 Word32 Word32 Word32 Word32 | Marks the start of a zone of authority
RD_NULL | A null RR (EXPERIMENTAL). Anything can be in a NULL record, for now we just drop this data.
RD_PTR Domain | A domain name pointer
RD_MX Word16 Domain | Mail exchange
RD_TXT ByteString | Text strings
RD_AAAA IPv6 | IPv6 Address
RD_SRV Word16 Word16 Word16 Domain | Server Selection (RFC2782)
RD_DNAME Domain | DNAME (RFC6672)
RD_OPT [OData] | OPT (RFC6891)
RD_DS Word16 Word8 Word8 ByteString | Delegation Signer (RFC4034) RD_RRSIG RD_NSEC
RD_DNSKEY Word16 Word8 Word8 ByteString | DNSKEY (RFC4034) RD_NSEC3
RD_NSEC3PARAM Word8 Word8 Word16 ByteString |
RD_TLSA Word8 Word8 Word8 ByteString | TLSA (RFC6698) RD_CDS RD_CDNSKEY RD_CSYNC
UnknownRData ByteString | Unknown resource data

Instances

Eq RData Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: RData -> RData -> Bool Source # (/=) :: RData -> RData -> Bool Source #
Ord RData Source # |
Instance details Defined in Network.DNS.Types Methods compare :: RData -> RData -> Ordering Source # (<) :: RData -> RData -> Bool Source # (<=) :: RData -> RData -> Bool Source # (>) :: RData -> RData -> Bool Source # (>=) :: RData -> RData -> Bool Source # max :: RData -> RData -> RData Source # min :: RData -> RData -> RData Source #
Show RData Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> RData -> ShowS Source # show :: RData -> String Source # showList :: [RData] -> ShowS Source #

# DNS Message

data DNSMessage Source #

Raw data format for DNS Query and Response.

Constructors

DNSMessage |

Fields

- header :: DNSHeader

  Header

- question :: [Question]

  The question for the name server

- answer :: [ResourceRecord]

  RRs answering the question

- authority :: [ResourceRecord]

  RRs pointing toward an authority

- additional :: [ResourceRecord]

  RRs holding additional information

Instances

Eq DNSMessage Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: DNSMessage -> DNSMessage -> Bool Source # (/=) :: DNSMessage -> DNSMessage -> Bool Source #
Show DNSMessage Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> DNSMessage -> ShowS Source # show :: DNSMessage -> String Source # showList :: [DNSMessage] -> ShowS Source #

defaultQuery :: DNSMessage Source #

Default query.

defaultResponse :: DNSMessage Source #

Default response.

type DNSFormat = DNSMessage Source #

Deprecated: Use DNSMessage instead

For backward compatibility.

## DNS Header

data DNSHeader Source #

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

Constructors

DNSHeader |

Fields

- identifier :: Identifier

  An identifier.

- flags :: DNSFlags

  The second 16bit word.

Instances

Eq DNSHeader Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: DNSHeader -> DNSHeader -> Bool Source # (/=) :: DNSHeader -> DNSHeader -> Bool Source #
Show DNSHeader Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> DNSHeader -> ShowS Source # show :: DNSHeader -> String Source # showList :: [DNSHeader] -> ShowS Source #

type Identifier = Word16 Source #

An identifier assigned by the program that generates any kind of query.

data QorR Source #

Query or response.

Constructors

QR_Query | Query.
QR_Response | Response.

Instances

Bounded QorR Source # |
Instance details Defined in Network.DNS.Types Methods minBound :: QorR Source # maxBound :: QorR Source #
Enum QorR Source # |
Instance details Defined in Network.DNS.Types Methods succ :: QorR -> QorR Source # pred :: QorR -> QorR Source # toEnum :: Int -> QorR Source # fromEnum :: QorR -> Int Source # enumFrom :: QorR -> [QorR] Source # enumFromThen :: QorR -> QorR -> [QorR] Source # enumFromTo :: QorR -> QorR -> [QorR] Source # enumFromThenTo :: QorR -> QorR -> QorR -> [QorR] Source #
Eq QorR Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: QorR -> QorR -> Bool Source # (/=) :: QorR -> QorR -> Bool Source #
Show QorR Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> QorR -> ShowS Source # show :: QorR -> String Source # showList :: [QorR] -> ShowS Source #

data DNSFlags Source #

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

Constructors

DNSFlags |

Fields

- qOrR :: QorR

  Query or response.

- opcode :: OPCODE

  Kind of query.

- authAnswer :: Bool

  Authoritative Answer - this bit is valid in responses, and specifies that the responding name server is an authority for the domain name in question section.

- trunCation :: Bool

  TrunCation - specifies that this message was truncated due to length greater than that permitted on the transmission channel.

- recDesired :: Bool

  Recursion Desired - this bit may be set in a query and is copied into the response. If RD is set, it directs the name server to pursue the query recursively. Recursive query support is optional.

- recAvailable :: Bool

  Recursion Available - this be is set or cleared in a response, and denotes whether recursive query support is available in the name server.

- rcode :: RCODE

  Response code.

- authenData :: Bool

  Authentic Data (RFC4035).

Instances

Eq DNSFlags Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: DNSFlags -> DNSFlags -> Bool Source # (/=) :: DNSFlags -> DNSFlags -> Bool Source #
Show DNSFlags Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> DNSFlags -> ShowS Source # show :: DNSFlags -> String Source # showList :: [DNSFlags] -> ShowS Source #

data OPCODE Source #

Kind of query.

Constructors

OP_STD | A standard query.
OP_INV | An inverse query.
OP_SSR | A server status request.

Instances

Bounded OPCODE Source # |
Instance details Defined in Network.DNS.Types Methods minBound :: OPCODE Source # maxBound :: OPCODE Source #
Enum OPCODE Source # |

Instance details

Defined in Network.DNS.Types

Methods

succ :: OPCODE -> OPCODE Source #

pred :: OPCODE -> OPCODE Source #

toEnum :: Int -> OPCODE Source #

fromEnum :: OPCODE -> Int Source #

enumFrom :: OPCODE -> [OPCODE] Source #

enumFromThen :: OPCODE -> OPCODE -> [OPCODE] Source #

enumFromTo :: OPCODE -> OPCODE -> [OPCODE] Source #

enumFromThenTo :: OPCODE -> OPCODE -> OPCODE -> [OPCODE] Source #

Eq OPCODE Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: OPCODE -> OPCODE -> Bool Source # (/=) :: OPCODE -> OPCODE -> Bool Source #
Show OPCODE Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> OPCODE -> ShowS Source # show :: OPCODE -> String Source # showList :: [OPCODE] -> ShowS Source #

data RCODE where Source #

Response code including EDNS0's 12bit ones.

Bundled Patterns

pattern NoErr :: RCODE | No error condition.
pattern FormatErr :: RCODE | Format error - The name server was unable to interpret the query.
pattern ServFail :: RCODE | Server failure - The name server was unable to process this query due to a problem with the name server.
pattern NameErr :: RCODE | Name Error - Meaningful only for responses from an authoritative name server, this code signifies that the domain name referenced in the query does not exist.
pattern NotImpl :: RCODE | Not Implemented - The name server does not support the requested kind of query.
pattern Refused :: RCODE | Refused - 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.
pattern YXDomain :: RCODE | YXDomain - Dynamic update response, a pre-requisite domain that should not exist, does exist.
pattern YXRRSet :: RCODE | YXRRSet - Dynamic update response, a pre-requisite RRSet that should not exist, does exist.
pattern NXRRSet :: RCODE | NXRRSet - Dynamic update response, a pre-requisite RRSet that should exist, does not exist.
pattern NotAuth :: RCODE | NotAuth - Dynamic update response, the server is not authoritative for the zone named in the Zone Section.
pattern NotZone :: RCODE | NotZone - Dynamic update response, a name used in the Prerequisite or Update Section is not within the zone denoted by the Zone Section.
pattern BadOpt :: RCODE | Bad OPT Version (RFC 6891) or TSIG Signature Failure (RFC2845).

Instances

Enum RCODE Source # | Provide an Enum instance for backwards compatibility
Instance details Defined in Network.DNS.Types Methods succ :: RCODE -> RCODE Source # pred :: RCODE -> RCODE Source # toEnum :: Int -> RCODE Source # fromEnum :: RCODE -> Int Source # enumFrom :: RCODE -> [RCODE] Source # enumFromThen :: RCODE -> RCODE -> [RCODE] Source # enumFromTo :: RCODE -> RCODE -> [RCODE] Source # enumFromThenTo :: RCODE -> RCODE -> RCODE -> [RCODE] Source #
Eq RCODE Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: RCODE -> RCODE -> Bool Source # (/=) :: RCODE -> RCODE -> Bool Source #
Show RCODE Source # | Use https://tools.ietf.org/html/rfc2929#section-2.3 names for DNS RCODEs
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> RCODE -> ShowS Source # show :: RCODE -> String Source # showList :: [RCODE] -> ShowS Source #

fromRCODE :: RCODE -> Word16 Source #

From rcode to number.

toRCODE :: Word16 -> RCODE Source #

From number to rcode.

fromRCODEforHeader :: RCODE -> Word16 Source #

From rcode to number for header (4bits only).

toRCODEforHeader :: Word16 -> RCODE Source #

From number in header to rcode (4bits only).

## DNS Body

data Question Source #

Raw data format for DNS questions.

Constructors

Question |

Fields

- qname :: Domain

  A domain name

- qtype :: TYPE

  The type of the query

Instances

Eq Question Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: Question -> Question -> Bool Source # (/=) :: Question -> Question -> Bool Source #
Show Question Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> Question -> ShowS Source # show :: Question -> String Source # showList :: [Question] -> ShowS Source #

# 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.
RetryLimitExceeded | The number of retries for the request was exceeded.
TimeoutExpired | TCP fallback request 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 | 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.
BadOptRecord | The server detected a malformed OPT RR.
BadConfiguration | Configuration is wrong.
NetworkFailure IOException | Network failure.
DecodeError String | Error is unknown
UnknownDNSError |

Instances

Eq DNSError Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: DNSError -> DNSError -> Bool Source # (/=) :: DNSError -> DNSError -> Bool Source #
Show DNSError Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> DNSError -> ShowS Source # show :: DNSError -> String Source # showList :: [DNSError] -> ShowS Source #
Exception DNSError Source # |
Instance details Defined in Network.DNS.Types Methods toException :: DNSError -> SomeException Source # fromException :: SomeException -> Maybe DNSError Source # displayException :: DNSError -> String Source #

# EDNS0

data EDNS0 Source #

EDNS0 infromation defined in RFC 6891.

Instances

Eq EDNS0 Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: EDNS0 -> EDNS0 -> Bool Source # (/=) :: EDNS0 -> EDNS0 -> Bool Source #
Show EDNS0 Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> EDNS0 -> ShowS Source # show :: EDNS0 -> String Source # showList :: [EDNS0] -> ShowS Source #

defaultEDNS0 :: EDNS0 Source #

Default information for EDNS0.

    >>> defaultEDNS0
    EDNS0 {udpSize = 4096, extRCODE = NoError, dnssecOk = False, options = []}

maxUdpSize :: Word16 Source #

Maximum UDP size. If `udpSize` of `EDNS0` is larger than this, `fromEDNS0` uses this value instead.

    >>> maxUdpSize
    16384

minUdpSize :: Word16 Source #

Minimum UDP size. If `udpSize` of `EDNS0` is smaller than this, `fromEDNS0` uses this value instead.

    >>> minUdpSize
    512

## Accessors

udpSize :: EDNS0 -> Word16 Source #

UDP payload size.

extRCODE :: EDNS0 -> RCODE Source #

Extended RCODE.

dnssecOk :: EDNS0 -> Bool Source #

Is DNSSEC OK?

options :: EDNS0 -> [OData] Source #

EDNS0 option data.

## Converters

fromEDNS0 :: EDNS0 -> ResourceRecord Source #

Generating a resource record for the additional section based on EDNS0. `DNSFlags` is not generated. Just set the same `RCODE` to `DNSFlags`.

toEDNS0 :: DNSFlags -> ResourceRecord -> Maybe EDNS0 Source #

Generating EDNS0 information from the OPT RR.

# EDNS0 option data

data OData Source #

Optional resource data.

Constructors

OD_ClientSubnet Word8 Word8 IP | Client subnet (RFC7871)
UnknownOData OptCode ByteString | Unknown optional type

Instances

Eq OData Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: OData -> OData -> Bool Source # (/=) :: OData -> OData -> Bool Source #
Ord OData Source # |
Instance details Defined in Network.DNS.Types Methods compare :: OData -> OData -> Ordering Source # (<) :: OData -> OData -> Bool Source # (<=) :: OData -> OData -> Bool Source # (>) :: OData -> OData -> Bool Source # (>=) :: OData -> OData -> Bool Source # max :: OData -> OData -> OData Source # min :: OData -> OData -> OData Source #
Show OData Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> OData -> ShowS Source # show :: OData -> String Source # showList :: [OData] -> ShowS Source #

data OptCode where Source #

EDNS0 Option Code (RFC 6891).

Bundled Patterns

pattern ClientSubnet :: OptCode | Client subnet (RFC7871)

Instances

Eq OptCode Source # |
Instance details Defined in Network.DNS.Types Methods (==) :: OptCode -> OptCode -> Bool Source # (/=) :: OptCode -> OptCode -> Bool Source #
Ord OptCode Source # |
Instance details Defined in Network.DNS.Types Methods compare :: OptCode -> OptCode -> Ordering Source # (<) :: OptCode -> OptCode -> Bool Source # (<=) :: OptCode -> OptCode -> Bool Source # (>) :: OptCode -> OptCode -> Bool Source # (>=) :: OptCode -> OptCode -> Bool Source # max :: OptCode -> OptCode -> OptCode Source # min :: OptCode -> OptCode -> OptCode Source #
Show OptCode Source # |
Instance details Defined in Network.DNS.Types Methods showsPrec :: Int -> OptCode -> ShowS Source # show :: OptCode -> String Source # showList :: [OptCode] -> ShowS Source #

fromOptCode :: OptCode -> Word16 Source #

From option code to number.

toOptCode :: Word16 -> OptCode Source #

From number to option code.

# Other types

type Mailbox = ByteString Source #

Type for a mailbox encoded on the wire as a DNS name, but the first label is conceptually the user name, and sometimes has contains internal periods that are not label separators. Therefore, in mailboxes @ is used as the separator between the first and second labels.