| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
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
- data T_mx = T_MX {}
- data T_srv = T_SRV {}
- data T_afsdb = T_AFSDB {}
- data T_naptr = T_NAPTR {}
- data X_nid (n :: Nat) where
- type family XnidConName (n :: Nat) :: Symbol where ...
- type T_nid = X_nid N_nid
- type T_l64 = X_nid N_l64
- nidPref :: T_nid -> Word16
- nidAddr :: T_nid -> Word64
- l64Pref :: T_l64 -> Word16
- l64Addr :: T_l64 -> Word64
- data T_l32 = T_L32 {}
- data T_lp = T_LP {}
- data T_amtrelay = T_AMTRELAY {}
- data AmtRelay where
Documentation
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).
Instances
| Presentable T_mx Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: T_mx -> Builder -> Builder Source # presentLazy :: T_mx -> ByteString -> ByteString Source # | |||||
| KnownRData T_mx Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
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 # | |||||
| Show T_mx Source # | |||||
| Eq T_mx Source # | Case-insensitive wire-form equality. | ||||
| Ord T_mx Source # | Case-insensitive wire-form order. | ||||
| type RDataExtensionVal T_mx Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
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
| Presentable T_srv Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: T_srv -> Builder -> Builder Source # presentLazy :: T_srv -> ByteString -> ByteString Source # | |||||
| KnownRData T_srv Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
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 # | |||||
| Show T_srv Source # | |||||
| Eq T_srv Source # | Equality is not case-senstive on the target host name. | ||||
| Ord T_srv Source # | Order is not case-senstive on the target host name. | ||||
| type RDataExtensionVal T_srv Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
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 | |
Fields | |
Instances
| Presentable T_afsdb Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: T_afsdb -> Builder -> Builder Source # presentLazy :: T_afsdb -> ByteString -> ByteString Source # | |||||
| KnownRData T_afsdb Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_afsdb => RDataExtensionVal T_afsdb Source # rdType :: forall b -> b ~ T_afsdb => RRTYPE Source # rdTypePres :: forall b -> b ~ T_afsdb => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_afsdb => RDataExtensionVal T_afsdb -> Int -> SGet RData Source # | |||||
| Show T_afsdb Source # | |||||
| Eq T_afsdb Source # | |||||
| Ord T_afsdb Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
| type RDataExtensionVal T_afsdb Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
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.
Constructors
| T_NAPTR | |
Fields | |
Instances
| Presentable T_naptr Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: T_naptr -> Builder -> Builder Source # presentLazy :: T_naptr -> ByteString -> ByteString Source # | |||||
| KnownRData T_naptr Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_naptr => RDataExtensionVal T_naptr Source # rdType :: forall b -> b ~ T_naptr => RRTYPE Source # rdTypePres :: forall b -> b ~ T_naptr => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_naptr => RDataExtensionVal T_naptr -> Int -> SGet RData Source # | |||||
| Show T_naptr Source # | |||||
| Eq T_naptr Source # | Equality is not case-senstive on the replacement domain. | ||||
| Ord T_naptr Source # | Order is not case-senstive on the replacement domain. | ||||
Defined in Net.DNSBase.RData.SRV | |||||
| type RDataExtensionVal T_naptr Source # | |||||
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 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Bundled Patterns
| pattern T_NID | Record pattern synonym viewing the shared |
| pattern T_L64 | Record pattern synonym viewing the shared |
Instances
| KnownSymbol (XnidConName n) => Presentable (X_nid n) Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: X_nid n -> Builder -> Builder Source # presentLazy :: X_nid n -> ByteString -> ByteString Source # | |||||
| (Nat16 n, KnownSymbol (XnidConName n)) => KnownRData (X_nid n) Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
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 # | |||||
| (Nat16 n, KnownSymbol (XnidConName n)) => Show (X_nid n) Source # | |||||
| KnownSymbol (XnidConName n) => Eq (X_nid n) Source # | |||||
| KnownSymbol (XnidConName n) => Ord (X_nid n) Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
| type RDataExtensionVal (X_nid n) Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
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 |
T_NID fields
T_L64 fields
L32
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.
Instances
| Presentable T_l32 Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: T_l32 -> Builder -> Builder Source # presentLazy :: T_l32 -> ByteString -> ByteString Source # | |||||
| KnownRData T_l32 Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
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 # | |||||
| Show T_l32 Source # | |||||
| Eq T_l32 Source # | |||||
| Ord T_l32 Source # | |||||
| type RDataExtensionVal T_l32 Source # | |||||
Defined in Net.DNSBase.RData.SRV | |||||
LP
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).
Instances
| Presentable T_lp Source # | |||||
Defined in Net.DNSBase.RData.SRV Methods present :: T_lp -> Builder -> Builder Source # presentLazy :: T_lp -> ByteString -> ByteString Source # | |||||
| KnownRData T_lp Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
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 # | |||||
| Show T_lp Source # | |||||
| Eq T_lp Source # | Case-insensitive wire-form equality. | ||||
| Ord T_lp Source # | Case-insensitive wire-form order. | ||||
| type RDataExtensionVal T_lp Source # | |||||
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 | |
Instances
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 |