| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
Net.DNSBase.RData.SVCB
Description
The Service Binding RR (T_svcb) and its HTTPS-specific
variant (T_https), defined by RFC 9460. Both share a wire
format with three fields — priority, target name, and a list
of typed (key, value) service parameters — represented
internally by the X_svcb data type, indexed by a type-level
natural that determines the specific RR type.
The service-parameter machinery is split across submodules:
- Net.DNSBase.RData.SVCB.SVCParamKey — the 16-bit key codes, with pattern synonyms for the registered keys.
- Net.DNSBase.RData.SVCB.SVCParamValue — the
KnownSVCParamValuetypeclass, the existentialSVCParamValuewrapper, and theOpaqueSPVfallback for unrecognised keys. - Net.DNSBase.RData.SVCB.SPV — the concrete value types
(
SPV_alpn,SPV_port, ...). - Net.DNSBase.RData.SVCB.SPVSet — the (key-indexed) collection holding the parameters of a single SVCB/HTTPS record.
New service-parameter value types can be installed at runtime via
extendRRwithType on the SVCB or HTTPS
RR type — see Net.DNSBase.Extensible for a worked example. The
mandatory key (codepoint 0) is reserved and cannot be replaced
by user code.
Synopsis
- data X_svcb (n :: Nat) where
- type family XsvcbConName (n :: Nat) :: Symbol where ...
- type T_svcb = X_svcb N_svcb
- type T_https = X_svcb N_https
- svcPriority :: T_svcb -> Word16
- svcTarget :: T_svcb -> Domain
- svcParamValues :: T_svcb -> SPVSet
- httpsPriority :: T_https -> Word16
- httpsTarget :: T_https -> Domain
- httpsParamValues :: T_https -> SPVSet
- class (Typeable a, Eq a, Ord a, Show a, Presentable a) => KnownSVCParamValue a where
- spvKey :: forall b -> b ~ a => SVCParamKey
- spvKeyPres :: forall b -> b ~ a => Builder -> Builder
- encodeSPV :: ErrorContext r => a -> SPut s r
- decodeSPV :: forall b -> b ~ a => Int -> SGet SVCParamValue
- data SPVSet where
- pattern SPVMap :: IntMap SVCParamValue -> SPVSet
- spvLookup :: KnownSVCParamValue a => SPVSet -> Maybe a
- newtype SPV_alpn = SPV_ALPN (NonEmpty ShortByteString)
- newtype SPV_docpath = SPV_DOCPATH [ShortByteString]
- newtype SPV_dohpath = SPV_DOHPATH Text
- newtype SPV_ech = SPV_ECH ShortByteString
- newtype SPV_ipv4hint = SPV_IPV4HINT (NonEmpty IPv4)
- newtype SPV_ipv6hint = SPV_IPV6HINT (NonEmpty IPv6)
- data SPV_mandatory where
- pattern SPV_MANDATORY :: Set SVCParamKey -> SPV_mandatory
- data SPV_ndalpn = SPV_NDALPN
- newtype SPV_port = SPV_PORT Word16
- data SPV_pvd = SPV_PVD
- newtype SPV_tlsgroups = SPV_TLSGROUPS (NonEmpty Word16)
- fromSPV :: KnownSVCParamValue a => SVCParamValue -> Maybe a
- opaqueSPV :: Word16 -> ShortByteString -> SVCParamValue
- serviceParamKey :: SVCParamValue -> SVCParamKey
- toOpaqueSPV :: SVCParamValue -> Either (EncodeErr (Maybe ())) SVCParamValue
- class (Typeable a, Eq a, Ord a, Show a, Presentable a) => KnownSVCParamValue a where
- spvKey :: forall b -> b ~ a => SVCParamKey
- spvKeyPres :: forall b -> b ~ a => Builder -> Builder
- encodeSPV :: ErrorContext r => a -> SPut s r
- decodeSPV :: forall b -> b ~ a => Int -> SGet SVCParamValue
- data OpaqueSPV (n :: Nat) where
- OpaqueSPV :: forall (n :: Nat). Nat16 n => ShortByteString -> OpaqueSPV n
- data SVCParamValue = KnownSVCParamValue a => SVCParamValue a
- pattern ALPN :: SVCParamKey
- pattern DOCPATH :: SVCParamKey
- pattern DOHPATH :: SVCParamKey
- pattern ECH :: SVCParamKey
- pattern IPV4HINT :: SVCParamKey
- pattern IPV6HINT :: SVCParamKey
- pattern MANDATORY :: SVCParamKey
- pattern NODEFAULTALPN :: SVCParamKey
- pattern OHTTP :: SVCParamKey
- pattern PORT :: SVCParamKey
- pattern PVD :: SVCParamKey
- pattern TLSGROUPS :: SVCParamKey
- newtype SVCParamKey = SVCParamKey Word16
SVCB and HTTPS
data X_svcb (n :: Nat) Source #
Shared wire-format representation for the SVCB service
binding record
(RFC 9460 section 2)
and its HTTPS-specific variant
(RFC 9460 section 9).
The type parameter n (either N_svcb or N_https) determines
the RR type. Each has its own type synonym (T_svcb,
T_https) and matching record pattern synonym (T_SVCB,
T_HTTPS) with the corresponding field-name prefix (svc,
https). The wire format is shared, but the type role of
n is nominal: a T_svcb value cannot be used where a
T_https is expected. This is deliberate — the two RR types
serve different transports, and future SvcParamKeys may apply
to only one of them.
1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | SvcPriority | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / TargetName / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / SvcParams / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
The target field is not subject to wire-form name compression
(RFC 3597 section 4)
and is not in the
RFC 4034 section 6.2
list of types that lower-case their RDATA names — it is
compared case-sensitively in canonical form. The Ord
instance compares structurally on the parsed fields rather
than on the wire form, so it is not canonical: callers that
need RFC 4034 canonical ordering must serialise to wire form
first.
The SvcParams field is a list of (key, length, value)
triples — possibly empty — making up the rest of the RData:
1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | SvcParamKey | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | SvcParamLen | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / SvcParamValue / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
On the wire the list must be in strictly ascending key order;
the presentation form may list keys in any order. Each value
has the type associated with its key in the decoder state
configured for the RR type — keys absent from the state decode
as OpaqueSPV, preserving the raw bytes.
The record pattern synonyms T_SVCB and T_HTTPS build the
corresponding T_svcb or T_https value directly, with their
own field-name prefixes (svc and https):
let s = T_SVCB { svcPriority = 0
, svcTarget = RootDomain
, svcParamValues = [] }
h = T_HTTPS { httpsPriority = 0
, httpsTarget = RootDomain
, httpsParamValues = [] }
in RData s : RData h : []Functions that work on either RR type can use the
underscore-prefixed selectors on the shared X_svcb record:
aliasDomain :: forall n. X_svcb n -> Maybe Domain
aliasDomain r | _svcPriority r == 0 = Just $ _svcTarget r
| otherwise = NothingConstructors
| X_SVCB | |
Fields
| |
Bundled Patterns
| pattern T_SVCB | Record pattern synonym viewing the shared |
| pattern T_HTTPS | Record pattern synonym viewing the shared |
Instances
| Presentable (X_svcb n) Source # | |||||
Defined in Net.DNSBase.RData.SVCB Methods present :: X_svcb n -> Builder -> Builder Source # presentLazy :: X_svcb n -> ByteString -> ByteString Source # | |||||
| (Nat16 n, KnownSymbol (XsvcbConName n)) => KnownRData (X_svcb n) Source # | |||||
Defined in Net.DNSBase.RData.SVCB Associated Types
Methods rdataExtensionVal :: forall b -> b ~ X_svcb n => RDataExtensionVal (X_svcb n) Source # rdType :: forall b -> b ~ X_svcb n => RRTYPE Source # rdTypePres :: forall b -> b ~ X_svcb n => Builder -> Builder Source # rdDecode :: forall b -> b ~ X_svcb n => RDataExtensionVal (X_svcb n) -> Int -> SGet RData Source # | |||||
| KnownSymbol (XsvcbConName n) => Show (X_svcb n) Source # | |||||
| Eq (X_svcb n) Source # | |||||
| Ord (X_svcb n) Source # | |||||
Defined in Net.DNSBase.RData.SVCB | |||||
| type RDataExtensionVal (X_svcb n) Source # | |||||
Defined in Net.DNSBase.RData.SVCB | |||||
| type TypeExtensionArg (X_svcb n) b Source # | |||||
Defined in Net.DNSBase.RData.SVCB | |||||
type family XsvcbConName (n :: Nat) :: Symbol where ... Source #
Equations
| XsvcbConName N_svcb = "T_SVCB" | |
| XsvcbConName N_https = "T_HTTPS" | |
| XsvcbConName n = TypeError ('ShowType n ':<>: 'Text " is not a SVCB-based RRTYPE") :: Symbol |
T_SVCB fields
svcPriority :: T_svcb -> Word16 Source #
svcParamValues :: T_svcb -> SPVSet Source #
T_HTTPS fields
httpsPriority :: T_https -> Word16 Source #
httpsTarget :: T_https -> Domain Source #
httpsParamValues :: T_https -> SPVSet Source #
Service parameter values
class (Typeable a, Eq a, Ord a, Show a, Presentable a) => KnownSVCParamValue a where Source #
The class of types representing the value side of a service
parameter inside an SVCB or HTTPS record. Each instance
corresponds to a specific SVCParamKey; the encodeSPV and
decodeSPV methods handle only the value bytes. The
surrounding (key, length) frame is owned by the SVCB-record
encoder: encodeSPV writes just the payload, and the framework
wraps the result in the 2-byte length prefix.
For value-less parameters this means encodeSPV is just
pure ().
The Presentable instance builds the RFC 9460 zone-file
presentation form: the key name followed (where the value is
non-empty) by = and the value. The Show instance is
typically derived and aims to produce syntactically valid
Haskell.
Methods
spvKey :: forall b -> b ~ a => SVCParamKey Source #
The associated key number
spvKeyPres :: forall b -> b ~ a => Builder -> Builder Source #
CPS presentation form builder for the key
encodeSPV :: ErrorContext r => a -> SPut s r Source #
Encode value to wire form
decodeSPV :: forall b -> b ~ a => Int -> SGet SVCParamValue Source #
Decode value from wire form
Instances
The set of service parameters in an SVCB or HTTPS record,
with at most one value per SVCParamKey. The Monoid
instance provides the empty set; the Semigroup instance is
left-biased on key collisions.
Bundled Patterns
| pattern SPVMap | One-sided pattern that exposes the underlying |
Fields
| |
Instances
| Presentable SPVSet Source # | |
Defined in Net.DNSBase.RData.SVCB.SPVSet Methods present :: SPVSet -> Builder -> Builder Source # presentLazy :: SPVSet -> ByteString -> ByteString Source # | |
| Monoid SPVSet Source # | |
| Semigroup SPVSet Source # | |
| IsList SPVSet Source # | Construction is via |
| Show SPVSet Source # | |
| Eq SPVSet Source # | |
| type Item SPVSet Source # | |
Defined in Net.DNSBase.RData.SVCB.SPVSet | |
spvLookup :: KnownSVCParamValue a => SPVSet -> Maybe a Source #
Look up the parameter at the key associated with type a,
returning a Just only when the stored value really is of type
a. A value of the same key code but held as OpaqueSPV
(because the typed instance was not registered when the record
was decoded) does not match — opaque values must be
retrieved through SPVMap.
The alpn service parameter
(RFC 9460 section 7.1)
— the set of Application-Layer Protocol Negotiation
(RFC 7301)
protocol identifiers this service endpoint supports. Together
with SPV_ndalpn it defines the SVCB ALPN set: by default the
scheme's protocol is implicitly included, and SPV_ndalpn
suppresses that default.
Constructors
| SPV_ALPN (NonEmpty ShortByteString) |
Instances
| Presentable SPV_alpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods present :: SPV_alpn -> Builder -> Builder Source # presentLazy :: SPV_alpn -> ByteString -> ByteString Source # | |
| KnownSVCParamValue SPV_alpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Show SPV_alpn Source # | |
| Eq SPV_alpn Source # | |
| Ord SPV_alpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
newtype SPV_docpath Source #
The docpath service parameter
(RFC 9953 section 8.2)
— the absolute path to the DNS-over-CoAP (DoC) resource at this
service endpoint, represented as a list of path segments. An
empty list denotes the root path "/" (on the wire: a
zero-length SvcParamValue).
Each segment is 1..255 octets per the RFC ABNF; the wire-form
decoder rejects zero-length segments. Presentation form is a
comma-separated list of segments using the standard RFC 9460
Appendix A.1 quoting and escaping rules, identical to those of
SPV_alpn.
Constructors
| SPV_DOCPATH [ShortByteString] |
Instances
newtype SPV_dohpath Source #
The dohpath service parameter
(RFC 9461)
— a URI template (UTF-8) advertising the DNS-over-HTTPS
endpoint at this service. Typically seen on resolver-discovery
answers to queries for _dns.resolver.arpa or on explicit
queries to a specific operator's resolver.
Constructors
| SPV_DOHPATH Text |
Instances
The ech service parameter
(RFC9848, Section 3)
— an Encrypted Client Hello (ECH) configuration list.
Presented as a base64-encoded value.
Constructors
| SPV_ECH ShortByteString |
Instances
| Presentable SPV_ech Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods present :: SPV_ech -> Builder -> Builder Source # presentLazy :: SPV_ech -> ByteString -> ByteString Source # | |
| KnownSVCParamValue SPV_ech Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Show SPV_ech Source # | |
| Eq SPV_ech Source # | |
| Ord SPV_ech Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
newtype SPV_ipv4hint Source #
The ipv4hint service parameter
(RFC 9460 section 7.3)
— a non-empty list of IPv4 addresses for this service endpoint
that a client may use to start a connection in parallel with
an authoritative A lookup. Hints are advisory; clients
should still validate them against authoritative address
records when they arrive.
Constructors
| SPV_IPV4HINT (NonEmpty IPv4) |
Instances
newtype SPV_ipv6hint Source #
The ipv6hint service parameter
(RFC 9460 section 7.3)
— the IPv6 counterpart of SPV_ipv4hint: a non-empty list of
IPv6 addresses to try in parallel with the authoritative
AAAA lookup.
Constructors
| SPV_IPV6HINT (NonEmpty IPv6) |
Instances
data SPV_mandatory where Source #
The mandatory service parameter
(RFC 9460 section 8)
— the set of additional SVCParamKey codes a client must
recognise to make sense of this RR, on top of any keys that
are automatically mandatory for the application protocol. A
client that does not understand all the listed keys must
ignore the RR.
The set may not be empty on the wire (an empty list is
encoded as the parameter being absent) and may hold at most
32767 keys. The constructor is not exported; build instances
via fromNonEmptyList or by combining values with their
Semigroup instance.
Bundled Patterns
| pattern SPV_MANDATORY | One-way pattern exposing the underlying key set for lookups.
Construction is available only via |
Fields
| |
Instances
data SPV_ndalpn Source #
The no-default-alpn service parameter
(RFC 9460 section 7.1)
— a value-less flag that suppresses the scheme's default ALPN
from the SVCB ALPN set. Meaningful only alongside an explicit
SPV_alpn that supplies a replacement protocol list.
Constructors
| SPV_NDALPN |
Instances
| Presentable SPV_ndalpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods present :: SPV_ndalpn -> Builder -> Builder Source # presentLazy :: SPV_ndalpn -> ByteString -> ByteString Source # | |
| KnownSVCParamValue SPV_ndalpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_ndalpn => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_ndalpn => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_ndalpn -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_ndalpn => Int -> SGet SVCParamValue Source # | |
| Show SPV_ndalpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods showsPrec :: Int -> SPV_ndalpn -> ShowS # show :: SPV_ndalpn -> String # showList :: [SPV_ndalpn] -> ShowS # | |
| Eq SPV_ndalpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Ord SPV_ndalpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods compare :: SPV_ndalpn -> SPV_ndalpn -> Ordering # (<) :: SPV_ndalpn -> SPV_ndalpn -> Bool # (<=) :: SPV_ndalpn -> SPV_ndalpn -> Bool # (>) :: SPV_ndalpn -> SPV_ndalpn -> Bool # (>=) :: SPV_ndalpn -> SPV_ndalpn -> Bool # max :: SPV_ndalpn -> SPV_ndalpn -> SPV_ndalpn # min :: SPV_ndalpn -> SPV_ndalpn -> SPV_ndalpn # | |
The port service parameter
(RFC 9460 section 7.2)
— overrides the scheme's default TCP or UDP port for reaching
this service endpoint.
Instances
| Presentable SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods present :: SPV_port -> Builder -> Builder Source # presentLazy :: SPV_port -> ByteString -> ByteString Source # | |
| KnownSVCParamValue SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Bounded SPV_port Source # | |
| Enum SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Num SPV_port Source # | |
| Read SPV_port Source # | |
| Integral SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Real SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods toRational :: SPV_port -> Rational # | |
| Show SPV_port Source # | |
| Eq SPV_port Source # | |
| Ord SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
The pvd service parameter
(draft-ietf-intarea-proxy-config-14 section 7.5)
— a value-less flag that announces the host supports
Provisioning Domain discovery via the well-known PvD URI. Its
presence in an SVCB or HTTPS RR signals that a client MAY
fetch PvD Additional Information from
https://host/.well-known/pvd. Per the draft, the wire
value MUST be empty; the presentation form is just the bare
key name with no '='.
Constructors
| SPV_PVD |
Instances
| Presentable SPV_pvd Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods present :: SPV_pvd -> Builder -> Builder Source # presentLazy :: SPV_pvd -> ByteString -> ByteString Source # | |
| KnownSVCParamValue SPV_pvd Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| Show SPV_pvd Source # | |
| Eq SPV_pvd Source # | |
| Ord SPV_pvd Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
newtype SPV_tlsgroups Source #
The tls-supported-groups service parameter
(draft-ietf-tls-key-share-prediction-04 section 5)
— a non-empty list of TLS Named Group codepoints (the
IANA TLS Supported Groups registry)
that the service supports. Clients can use this hint to
predict an acceptable key share, reducing the chance of a
HelloRetryRequest round-trip.
The wire form is a non-empty sequence of 16-bit codepoints in network byte order; the decoder rejects an empty value. The presentation form is a comma-separated list of decimal integers and forbids zone-file escape sequences (per the draft). Duplicates are flagged as a syntax error by the specification but are not currently rejected by either the encoder or the decoder — callers are expected to feed in a duplicate-free list, in their preferred order (the spec does not impose canonical ordering on the wire).
Constructors
| SPV_TLSGROUPS (NonEmpty Word16) |
Instances
| Presentable SPV_tlsgroups Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods present :: SPV_tlsgroups -> Builder -> Builder Source # presentLazy :: SPV_tlsgroups -> ByteString -> ByteString Source # | |
| KnownSVCParamValue SPV_tlsgroups Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_tlsgroups => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_tlsgroups => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_tlsgroups -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_tlsgroups => Int -> SGet SVCParamValue Source # | |
| Show SPV_tlsgroups Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods showsPrec :: Int -> SPV_tlsgroups -> ShowS # show :: SPV_tlsgroups -> String # showList :: [SPV_tlsgroups] -> ShowS # | |
| Eq SPV_tlsgroups Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods (==) :: SPV_tlsgroups -> SPV_tlsgroups -> Bool # (/=) :: SPV_tlsgroups -> SPV_tlsgroups -> Bool # | |
| Ord SPV_tlsgroups Source # | Wire-form canonical order: by length first, then elementwise. |
Defined in Net.DNSBase.RData.SVCB.SPV Methods compare :: SPV_tlsgroups -> SPV_tlsgroups -> Ordering # (<) :: SPV_tlsgroups -> SPV_tlsgroups -> Bool # (<=) :: SPV_tlsgroups -> SPV_tlsgroups -> Bool # (>) :: SPV_tlsgroups -> SPV_tlsgroups -> Bool # (>=) :: SPV_tlsgroups -> SPV_tlsgroups -> Bool # max :: SPV_tlsgroups -> SPV_tlsgroups -> SPV_tlsgroups # min :: SPV_tlsgroups -> SPV_tlsgroups -> SPV_tlsgroups # | |
fromSPV :: KnownSVCParamValue a => SVCParamValue -> Maybe a Source #
Extract specific known SVCParamValue from existential wrapping
opaqueSPV :: Word16 -> ShortByteString -> SVCParamValue Source #
Build an SVCParamValue from a raw numeric key and a raw
byte payload. Useful when a caller has a wire encoding for a
key that has no registered KnownSVCParamValue instance, or
when round-tripping bytes for keys that should remain
uninterpreted.
serviceParamKey :: SVCParamValue -> SVCParamKey Source #
Key associated with a generic SvcParamValue
toOpaqueSPV :: SVCParamValue -> Either (EncodeErr (Maybe ())) SVCParamValue Source #
Encode an SVCParamValue to its OpaqueSPV equivalent under
the same key code. Values that are already opaque are returned
unchanged. For typed values this re-encodes the payload to
wire form; encoding can fail (for example if the result would
be too long to fit a 16-bit length field), in which case the
EncodeErr is returned.
class (Typeable a, Eq a, Ord a, Show a, Presentable a) => KnownSVCParamValue a where Source #
The class of types representing the value side of a service
parameter inside an SVCB or HTTPS record. Each instance
corresponds to a specific SVCParamKey; the encodeSPV and
decodeSPV methods handle only the value bytes. The
surrounding (key, length) frame is owned by the SVCB-record
encoder: encodeSPV writes just the payload, and the framework
wraps the result in the 2-byte length prefix.
For value-less parameters this means encodeSPV is just
pure ().
The Presentable instance builds the RFC 9460 zone-file
presentation form: the key name followed (where the value is
non-empty) by = and the value. The Show instance is
typically derived and aims to produce syntactically valid
Haskell.
Methods
spvKey :: forall b -> b ~ a => SVCParamKey Source #
The associated key number
spvKeyPres :: forall b -> b ~ a => Builder -> Builder Source #
CPS presentation form builder for the key
encodeSPV :: ErrorContext r => a -> SPut s r Source #
Encode value to wire form
decodeSPV :: forall b -> b ~ a => Int -> SGet SVCParamValue Source #
Decode value from wire form
Instances
| KnownSVCParamValue SPV_alpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| KnownSVCParamValue SPV_docpath Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_docpath => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_docpath => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_docpath -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_docpath => Int -> SGet SVCParamValue Source # | |
| KnownSVCParamValue SPV_dohpath Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_dohpath => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_dohpath => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_dohpath -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_dohpath => Int -> SGet SVCParamValue Source # | |
| KnownSVCParamValue SPV_ech Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| KnownSVCParamValue SPV_ipv4hint Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_ipv4hint => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_ipv4hint => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_ipv4hint -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_ipv4hint => Int -> SGet SVCParamValue Source # | |
| KnownSVCParamValue SPV_ipv6hint Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_ipv6hint => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_ipv6hint => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_ipv6hint -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_ipv6hint => Int -> SGet SVCParamValue Source # | |
| KnownSVCParamValue SPV_mandatory Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_mandatory => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_mandatory => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_mandatory -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_mandatory => Int -> SGet SVCParamValue Source # | |
| KnownSVCParamValue SPV_ndalpn Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_ndalpn => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_ndalpn => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_ndalpn -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_ndalpn => Int -> SGet SVCParamValue Source # | |
| KnownSVCParamValue SPV_port Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| KnownSVCParamValue SPV_pvd Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV | |
| KnownSVCParamValue SPV_tlsgroups Source # | |
Defined in Net.DNSBase.RData.SVCB.SPV Methods spvKey :: forall b -> b ~ SPV_tlsgroups => SVCParamKey Source # spvKeyPres :: forall b -> b ~ SPV_tlsgroups => Builder -> Builder Source # encodeSPV :: ErrorContext r => SPV_tlsgroups -> SPut s r Source # decodeSPV :: forall b -> b ~ SPV_tlsgroups => Int -> SGet SVCParamValue Source # | |
| Nat16 n => KnownSVCParamValue (OpaqueSPV n) Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue | |
data OpaqueSPV (n :: Nat) where Source #
Fallback carrier for service-parameter values whose key code
has no KnownSVCParamValue instance registered. The key code
is encoded as a type-level natural so OpaqueSPV values with
different codes have distinct types. The wire payload is kept
as raw bytes and round-trips losslessly; the presentation form
is keyN=... with the value as a DnsText character-string.
Constructors
| OpaqueSPV :: forall (n :: Nat). Nat16 n => ShortByteString -> OpaqueSPV n |
Instances
| Nat16 n => Presentable (OpaqueSPV n) Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue Methods present :: OpaqueSPV n -> Builder -> Builder Source # presentLazy :: OpaqueSPV n -> ByteString -> ByteString Source # | |
| Nat16 n => KnownSVCParamValue (OpaqueSPV n) Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue | |
| Show (OpaqueSPV n) Source # | |
| Eq (OpaqueSPV n) Source # | |
| Ord (OpaqueSPV n) Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue | |
data SVCParamValue Source #
Existential wrapper around any KnownSVCParamValue, so a
single list can hold a mix of typed service parameters. The
present method delegates to the underlying instance, which
emits both the key name and the value.
Constructors
| KnownSVCParamValue a => SVCParamValue a |
Instances
| Presentable SVCParamValue Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue Methods present :: SVCParamValue -> Builder -> Builder Source # presentLazy :: SVCParamValue -> ByteString -> ByteString Source # | |
| Show SVCParamValue Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue Methods showsPrec :: Int -> SVCParamValue -> ShowS # show :: SVCParamValue -> String # showList :: [SVCParamValue] -> ShowS # | |
| Eq SVCParamValue Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue Methods (==) :: SVCParamValue -> SVCParamValue -> Bool # (/=) :: SVCParamValue -> SVCParamValue -> Bool # | |
| Ord SVCParamValue Source # | Compare first by key number, then by content. When two key numbers match, but the data types nevertheless differ, order opaque type after non-opaque. In the unlikely case of two non-opaque types with the same key, compare their opaque encodings (this could throw an error if one of the objects is not encodable, perhaps because encoding would be too long). |
Defined in Net.DNSBase.RData.SVCB.SVCParamValue Methods compare :: SVCParamValue -> SVCParamValue -> Ordering # (<) :: SVCParamValue -> SVCParamValue -> Bool # (<=) :: SVCParamValue -> SVCParamValue -> Bool # (>) :: SVCParamValue -> SVCParamValue -> Bool # (>=) :: SVCParamValue -> SVCParamValue -> Bool # max :: SVCParamValue -> SVCParamValue -> SVCParamValue # min :: SVCParamValue -> SVCParamValue -> SVCParamValue # | |
pattern ALPN :: SVCParamKey Source #
Application-Layer Protocol Negotiation identifiers RFC9460, Section 14.3.2
pattern DOCPATH :: SVCParamKey Source #
DNS over CoAP path RFC9953, Section 3
pattern DOHPATH :: SVCParamKey Source #
URI template for DNS-over-HTTPS resolver discovery RFC9461, Section 4
pattern ECH :: SVCParamKey Source #
Encrypted Client Hello configuration RFC9848, IANA Considerations
pattern IPV4HINT :: SVCParamKey Source #
Speculative IPv4 address hints RFC9460, Section 14.3.2
pattern IPV6HINT :: SVCParamKey Source #
Speculative IPv6 address hints RFC9460, Section 14.3.2
pattern MANDATORY :: SVCParamKey Source #
Keys the client must understand to use this RR RFC9460, Section 14.3.2
pattern NODEFAULTALPN :: SVCParamKey Source #
Suppress the default ALPN for this scheme RFC9460, Section 14.3.2
pattern OHTTP :: SVCParamKey Source #
Oblivious HTTP support indicator RFC9540, Section 4
pattern PORT :: SVCParamKey Source #
Alternative TCP/UDP port RFC9460, Section 14.3.2
pattern PVD :: SVCParamKey Source #
Provisioning Domain RFC-ietf-intarea-proxy-config-14, Section 7.5
pattern TLSGROUPS :: SVCParamKey Source #
TLS supported groups draft-ietf-tls-key-share-prediction-04, section 5
newtype SVCParamKey Source #
A service-parameter key code
(RFC 9460 section 2.1).
The pattern synonyms below name the keys that have standardised
value formats; an unrecognised code keeps its numeric form and
presents as keyN.
Constructors
| SVCParamKey Word16 |
Instances
| Presentable SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods present :: SVCParamKey -> Builder -> Builder Source # presentLazy :: SVCParamKey -> ByteString -> ByteString Source # | |
| Bounded SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey | |
| Enum SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods succ :: SVCParamKey -> SVCParamKey # pred :: SVCParamKey -> SVCParamKey # toEnum :: Int -> SVCParamKey # fromEnum :: SVCParamKey -> Int # enumFrom :: SVCParamKey -> [SVCParamKey] # enumFromThen :: SVCParamKey -> SVCParamKey -> [SVCParamKey] # enumFromTo :: SVCParamKey -> SVCParamKey -> [SVCParamKey] # enumFromThenTo :: SVCParamKey -> SVCParamKey -> SVCParamKey -> [SVCParamKey] # | |
| Num SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods (+) :: SVCParamKey -> SVCParamKey -> SVCParamKey # (-) :: SVCParamKey -> SVCParamKey -> SVCParamKey # (*) :: SVCParamKey -> SVCParamKey -> SVCParamKey # negate :: SVCParamKey -> SVCParamKey # abs :: SVCParamKey -> SVCParamKey # signum :: SVCParamKey -> SVCParamKey # fromInteger :: Integer -> SVCParamKey # | |
| Read SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods readsPrec :: Int -> ReadS SVCParamKey # readList :: ReadS [SVCParamKey] # readPrec :: ReadPrec SVCParamKey # readListPrec :: ReadPrec [SVCParamKey] # | |
| Integral SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods quot :: SVCParamKey -> SVCParamKey -> SVCParamKey # rem :: SVCParamKey -> SVCParamKey -> SVCParamKey # div :: SVCParamKey -> SVCParamKey -> SVCParamKey # mod :: SVCParamKey -> SVCParamKey -> SVCParamKey # quotRem :: SVCParamKey -> SVCParamKey -> (SVCParamKey, SVCParamKey) # divMod :: SVCParamKey -> SVCParamKey -> (SVCParamKey, SVCParamKey) # toInteger :: SVCParamKey -> Integer # | |
| Real SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods toRational :: SVCParamKey -> Rational # | |
| Show SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods showsPrec :: Int -> SVCParamKey -> ShowS # show :: SVCParamKey -> String # showList :: [SVCParamKey] -> ShowS # | |
| Eq SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey | |
| Ord SVCParamKey Source # | |
Defined in Net.DNSBase.RData.SVCB.SVCParamKey Methods compare :: SVCParamKey -> SVCParamKey -> Ordering # (<) :: SVCParamKey -> SVCParamKey -> Bool # (<=) :: SVCParamKey -> SVCParamKey -> Bool # (>) :: SVCParamKey -> SVCParamKey -> Bool # (>=) :: SVCParamKey -> SVCParamKey -> Bool # max :: SVCParamKey -> SVCParamKey -> SVCParamKey # min :: SVCParamKey -> SVCParamKey -> SVCParamKey # | |