dnsbase
Copyright(c) Viktor Dukhovni 2026
LicenseBSD-3-Clause
Maintainerietf-dane@dukhovni.org
Stabilityunstable
Safe HaskellNone
LanguageGHC2024

Net.DNSBase.RData.SRV

Description

This module gathers RR types that map a name to a service endpoint or address locator. T_mx (RFC 1035), T_srv (RFC 2782), T_afsdb (RFC 1183), and T_naptr (RFC 3403) are pre-RFC-4034 records pointing at a host via a domain name; canonical RDATA lower-cases the embedded domain. The ILNP family (T_nid, T_l32, T_l64, T_lp; RFC 6742) and T_amtrelay (RFC 8777) are later records — those with a domain field treat it case-sensitively in canonical form per RFC 6840 section 5.1.

Synopsis

Documentation

data T_mx Source #

The MX resource record (RFC 1035 section 3.3.9) — a mail exchanger for the owner name: a 16-bit preference (lower is preferred) and a Domain naming the exchange host.

 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 |                  PREFERENCE                   |
 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
 /                   EXCHANGE                    /
 /                                               /
 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

The exchange field is subject to wire-form name compression on encode (RFC 3597 section 4) and canonicalises to lower case (RFC 4034 section 6.2). The Eq and Ord instances compare the exchange in canonical wire form (via equalWireHost / compareWireHost), so Ord is canonical.

A name that resolves to a CNAME should not be used in the exchange field (RFC 2181 section 10.3, RFC 5321 section 5.1).

Constructors

T_MX 

Fields

Instances

Instances details
Presentable T_mx Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_mx Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_mx 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

rdataExtensionVal :: forall b -> b ~ T_mx => RDataExtensionVal T_mx Source #

rdType :: forall b -> b ~ T_mx => RRTYPE Source #

rdTypePres :: forall b -> b ~ T_mx => Builder -> Builder Source #

rdDecode :: forall b -> b ~ T_mx => RDataExtensionVal T_mx -> Int -> SGet RData Source #

rdEncode :: T_mx -> SPut s RData Source #

cnEncode :: T_mx -> SPut s RData Source #

Show T_mx Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

showsPrec :: Int -> T_mx -> ShowS #

show :: T_mx -> String #

showList :: [T_mx] -> ShowS #

Eq T_mx Source #

Case-insensitive wire-form equality.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: T_mx -> T_mx -> Bool #

(/=) :: T_mx -> T_mx -> Bool #

Ord T_mx Source #

Case-insensitive wire-form order.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

compare :: T_mx -> T_mx -> Ordering #

(<) :: T_mx -> T_mx -> Bool #

(<=) :: T_mx -> T_mx -> Bool #

(>) :: T_mx -> T_mx -> Bool #

(>=) :: T_mx -> T_mx -> Bool #

max :: T_mx -> T_mx -> T_mx #

min :: T_mx -> T_mx -> T_mx #

type RDataExtensionVal T_mx Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

data T_srv Source #

The SRV resource record (RFC 2782) — names the location of a service: 16-bit priority, weight, and port, plus a Domain naming the target host.

The target field is not subject to wire-form name compression on encode (RFC 3597 section 4) but compression is tolerated on decode. It canonicalises to lower case (RFC 4034 section 6.2). The Eq and Ord instances compare the target in canonical wire form (via equalWireHost / compareWireHost), so Ord is canonical.

Constructors

T_SRV 

Instances

Instances details
Presentable T_srv Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_srv Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_srv 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

rdataExtensionVal :: forall b -> b ~ T_srv => RDataExtensionVal T_srv Source #

rdType :: forall b -> b ~ T_srv => RRTYPE Source #

rdTypePres :: forall b -> b ~ T_srv => Builder -> Builder Source #

rdDecode :: forall b -> b ~ T_srv => RDataExtensionVal T_srv -> Int -> SGet RData Source #

rdEncode :: T_srv -> SPut s RData Source #

cnEncode :: T_srv -> SPut s RData Source #

Show T_srv Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

showsPrec :: Int -> T_srv -> ShowS #

show :: T_srv -> String #

showList :: [T_srv] -> ShowS #

Eq T_srv Source #

Equality is not case-senstive on the target host name.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: T_srv -> T_srv -> Bool #

(/=) :: T_srv -> T_srv -> Bool #

Ord T_srv Source #

Order is not case-senstive on the target host name.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

compare :: T_srv -> T_srv -> Ordering #

(<) :: T_srv -> T_srv -> Bool #

(<=) :: T_srv -> T_srv -> Bool #

(>) :: T_srv -> T_srv -> Bool #

(>=) :: T_srv -> T_srv -> Bool #

max :: T_srv -> T_srv -> T_srv #

min :: T_srv -> T_srv -> T_srv #

type RDataExtensionVal T_srv Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

data T_afsdb Source #

The AFSDB resource record (RFC 1183 section 1; see also RFC 5864 section 5) — points at an AFS-cell or DCE-authentication-cell server: a 16-bit subtype tag and a Domain hostname.

The hostname field is not subject to wire-form name compression on encode but compression is tolerated on decode. It canonicalises to lower case (RFC 4034 section 6.2). The Eq and Ord instances compare the hostname in canonical wire form (via equalWireHost / compareWireHost), so Ord is canonical.

Constructors

T_AFSDB 

Instances

Instances details
Presentable T_afsdb Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_afsdb Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_afsdb 
Instance details

Defined in Net.DNSBase.RData.SRV

Show T_afsdb Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Eq T_afsdb Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: T_afsdb -> T_afsdb -> Bool #

(/=) :: T_afsdb -> T_afsdb -> Bool #

Ord T_afsdb Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

type RDataExtensionVal T_afsdb Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

data T_naptr Source #

The NAPTR resource record (RFC 3403 section 4) — Naming Authority Pointer: a rewriting rule that translates the owner name into another resource via the flags/services tags, an optional regexp, and a replacement domain.

                                1  1  1  1  1  1
  0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                     ORDER                     |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                   PREFERENCE                  |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/                     FLAGS                     /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/                   SERVICES                    /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/                    REGEXP                     /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/                  REPLACEMENT                  /
/                                               /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

The replacement field is not subject to wire-form name compression on encode but compression is tolerated on decode. It canonicalises to lower case (RFC 4034 section 6.2). The Eq and Ord instances compare the replacement in canonical wire form (via equalWireHost / compareWireHost) and the character-string fields as DNS character-strings, so Ord is canonical.

Instances

Instances details
Presentable T_naptr Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_naptr Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_naptr 
Instance details

Defined in Net.DNSBase.RData.SRV

Show T_naptr Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Eq T_naptr Source #

Equality is not case-senstive on the replacement domain.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: T_naptr -> T_naptr -> Bool #

(/=) :: T_naptr -> T_naptr -> Bool #

Ord T_naptr Source #

Order is not case-senstive on the replacement domain.

Instance details

Defined in Net.DNSBase.RData.SRV

type RDataExtensionVal T_naptr Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

NID and L64

data X_nid (n :: Nat) Source #

Shared wire-format representation for ILNP node-identifier and locator records: NID (RFC 6742 section 2.1.1) carries a 64-bit Node-ID, and L64 (RFC 6742 section 2.3.1) carries a 64-bit IPv6 locator prefix. The type parameter n (either N_nid or N_l64) determines the RR type. Each has its own type synonym (T_nid, T_l64) and matching record pattern synonym (T_NID, T_L64) with the corresponding field-name prefix (nid, l64). The role of X_nid is nominal: the 64-bit payload means different things in each, so T_nid and T_l64 are not coercible.

Derived Ord is canonical: no embedded domain, fields compared in wire-encoding order. See T_l32 and T_lp for the rest of the ILNP record family.

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |          Preference           |                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
 |                             NodeID                            |
 +                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Constructors

X_NID 

Fields

Bundled Patterns

pattern T_NID

Record pattern synonym viewing the shared X_nid record as an NID (Node Identifier) record, RFC 6742. Fields: nidPref, nidAddr. Not coercible to/from T_l64: the role of X_nid is nominal because the 64-bit payload means a Node-ID here and a 64-bit locator prefix in L64.

Fields

pattern T_L64

Record pattern synonym viewing the shared X_nid record as an L64 (64-bit locator) record, RFC 6742. Fields: l64Pref, l64Addr. Not coercible to/from T_nid (see T_NID note).

Fields

Instances

Instances details
KnownSymbol (XnidConName n) => Presentable (X_nid n) Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

(Nat16 n, KnownSymbol (XnidConName n)) => KnownRData (X_nid n) Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal (X_nid n) 
Instance details

Defined in Net.DNSBase.RData.SRV

type RDataExtensionVal (X_nid n) = ()

Methods

rdataExtensionVal :: forall b -> b ~ X_nid n => RDataExtensionVal (X_nid n) Source #

rdType :: forall b -> b ~ X_nid n => RRTYPE Source #

rdTypePres :: forall b -> b ~ X_nid n => Builder -> Builder Source #

rdDecode :: forall b -> b ~ X_nid n => RDataExtensionVal (X_nid n) -> Int -> SGet RData Source #

rdEncode :: X_nid n -> SPut s RData Source #

cnEncode :: X_nid n -> SPut s RData Source #

(Nat16 n, KnownSymbol (XnidConName n)) => Show (X_nid n) Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

showsPrec :: Int -> X_nid n -> ShowS #

show :: X_nid n -> String #

showList :: [X_nid n] -> ShowS #

KnownSymbol (XnidConName n) => Eq (X_nid n) Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: X_nid n -> X_nid n -> Bool #

(/=) :: X_nid n -> X_nid n -> Bool #

KnownSymbol (XnidConName n) => Ord (X_nid n) Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

compare :: X_nid n -> X_nid n -> Ordering #

(<) :: X_nid n -> X_nid n -> Bool #

(<=) :: X_nid n -> X_nid n -> Bool #

(>) :: X_nid n -> X_nid n -> Bool #

(>=) :: X_nid n -> X_nid n -> Bool #

max :: X_nid n -> X_nid n -> X_nid n #

min :: X_nid n -> X_nid n -> X_nid n #

type RDataExtensionVal (X_nid n) Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

type RDataExtensionVal (X_nid n) = ()

type family XnidConName (n :: Nat) :: Symbol where ... Source #

Equations

XnidConName N_nid = "T_NID" 
XnidConName N_l64 = "T_L64" 
XnidConName n = TypeError ('ShowType n ':<>: 'Text " is not a NID or L64 RRTYPE") :: Symbol 

type T_nid = X_nid N_nid Source #

X_nid specialised to NID records.

type T_l64 = X_nid N_l64 Source #

X_nid specialised to L64 records.

T_NID fields

T_L64 fields

L32

data T_l32 Source #

The L32 resource record (RFC 6742 section 2.2.1) — an ILNP 32-bit locator: a 16-bit preference and a 32-bit network locator carried in an IPv4 value.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Preference           |      Locator32 (16 MSBs)      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Locator32 (16 LSBs)       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Derived Ord is canonical: no embedded domain, fields compared in wire-encoding order. See X_nid and T_lp for the rest of the ILNP record family.

Constructors

T_L32 

Fields

Instances

Instances details
Presentable T_l32 Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_l32 Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_l32 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

rdataExtensionVal :: forall b -> b ~ T_l32 => RDataExtensionVal T_l32 Source #

rdType :: forall b -> b ~ T_l32 => RRTYPE Source #

rdTypePres :: forall b -> b ~ T_l32 => Builder -> Builder Source #

rdDecode :: forall b -> b ~ T_l32 => RDataExtensionVal T_l32 -> Int -> SGet RData Source #

rdEncode :: T_l32 -> SPut s RData Source #

cnEncode :: T_l32 -> SPut s RData Source #

Show T_l32 Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

showsPrec :: Int -> T_l32 -> ShowS #

show :: T_l32 -> String #

showList :: [T_l32] -> ShowS #

Eq T_l32 Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: T_l32 -> T_l32 -> Bool #

(/=) :: T_l32 -> T_l32 -> Bool #

Ord T_l32 Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

compare :: T_l32 -> T_l32 -> Ordering #

(<) :: T_l32 -> T_l32 -> Bool #

(<=) :: T_l32 -> T_l32 -> Bool #

(>) :: T_l32 -> T_l32 -> Bool #

(>=) :: T_l32 -> T_l32 -> Bool #

max :: T_l32 -> T_l32 -> T_l32 #

min :: T_l32 -> T_l32 -> T_l32 #

type RDataExtensionVal T_l32 Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

LP

data T_lp Source #

The LP resource record (RFC 6742 section 2.4.1) — an ILNP locator pointer: a 16-bit preference and a Domain naming a host that publishes locator records.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Preference           |                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               /
/                                                               /
/                              FQDN                             /
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The FQDN field is not subject to wire-form name compression. The Eq and Ord instances compare the FQDN case-insensitively in wire form (via equalWireHost / compareWireHost).

See X_nid and T_l32 for the rest of the ILNP record family.

Constructors

T_LP 

Fields

Instances

Instances details
Presentable T_lp Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_lp Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_lp 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

rdataExtensionVal :: forall b -> b ~ T_lp => RDataExtensionVal T_lp Source #

rdType :: forall b -> b ~ T_lp => RRTYPE Source #

rdTypePres :: forall b -> b ~ T_lp => Builder -> Builder Source #

rdDecode :: forall b -> b ~ T_lp => RDataExtensionVal T_lp -> Int -> SGet RData Source #

rdEncode :: T_lp -> SPut s RData Source #

cnEncode :: T_lp -> SPut s RData Source #

Show T_lp Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Methods

showsPrec :: Int -> T_lp -> ShowS #

show :: T_lp -> String #

showList :: [T_lp] -> ShowS #

Eq T_lp Source #

Case-insensitive wire-form equality.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

(==) :: T_lp -> T_lp -> Bool #

(/=) :: T_lp -> T_lp -> Bool #

Ord T_lp Source #

Case-insensitive wire-form order.

Instance details

Defined in Net.DNSBase.RData.SRV

Methods

compare :: T_lp -> T_lp -> Ordering #

(<) :: T_lp -> T_lp -> Bool #

(<=) :: T_lp -> T_lp -> Bool #

(>) :: T_lp -> T_lp -> Bool #

(>=) :: T_lp -> T_lp -> Bool #

max :: T_lp -> T_lp -> T_lp #

min :: T_lp -> T_lp -> T_lp #

type RDataExtensionVal T_lp Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

AMTRELAY

data T_amtrelay Source #

The AMTRELAY resource record (RFC 8777 section 4) — the relay-address for AMT (Automatic Multicast Tunneling) discovery. An 8-bit precedence, a 1-bit discovery-optional flag, a 7-bit relay-type field, and an AmtRelay value whose format depends on the type:

0       empty
1       wire-form IPv4 address
2       wire-form IPv6 address
3       uncompressed wire-form domain name
4-127   reserved (unlikely to be specified)
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   precedence  |D|    type     |                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
 ~                            relay                              ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Derived Ord compares precedence, then discovery flag, then AmtRelay (constructor order, then field), matching the canonical wire-form ordering. The Domain inside an Amt_Host relay is compared case-sensitively, as is the convention for RR types defined after RFC 4034.

Constructors

T_AMTRELAY 

Fields

Instances

Instances details
Presentable T_amtrelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

KnownRData T_amtrelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Associated Types

type RDataExtensionVal T_amtrelay 
Instance details

Defined in Net.DNSBase.RData.SRV

Show T_amtrelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Eq T_amtrelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Ord T_amtrelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

type RDataExtensionVal T_amtrelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

data AmtRelay Source #

New variants of the AmtRelay value type are not expected, so an ADT is used to capture just the specified variants and an opaque catchall.

Bundled Patterns

pattern Amt_Opaque :: Word8 -> ShortByteString -> AmtRelay

Smart constructor of opaque relay forms, that ensures a non-empty value and type in [4,127]. The underlying Amt_Any_ constructor is not exposed.

Instances

Instances details
Show AmtRelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Eq AmtRelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV

Ord AmtRelay Source # 
Instance details

Defined in Net.DNSBase.RData.SRV