| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
Net.DNSBase.RData
Description
The existential RData wrapper holds any KnownRData
instance, so a heterogeneous list of records — an answer
section, a zone — can share a single Haskell type.
fromRData and rdataType recover the underlying value or
its type code; monoRData is the bulk form, filtering a list
of RData values by type.
Unrecognised RR types decode into OpaqueRData, which
preserves the raw wire bytes under a type-level codepoint and
presents in the generic
RFC 3597
#-prefixed form.
Advanced applications can add support for any missing RR types,
not yet supported by the library, by implementing a corresponding
KnownRData instance and exposing it to the resolver via
registerRRtype (see
Net.DNSBase.Resolver). KnownRData carries any per-type
extension value (RDataExtensionVal) the codec consumes.
RR types that admit type-driven extension (presently, just SVCB
and HTTPS) also implement a TypeExtensible instance whose
extendByType method is invoked by
extendRRwithType.
The encoder and decoder combinator modules are re-exported for
the benefit of authors of new KnownRData instances; ordinary
callers do not need them.
Synopsis
- data RData = KnownRData a => RData a
- fromRData :: KnownRData a => RData -> Maybe a
- monoRData :: (KnownRData a, Foldable t) => t RData -> [a]
- rdataType :: RData -> RRTYPE
- data OpaqueRData (n :: Nat) = Nat16 n => OpaqueRData ShortByteString
- opaqueRData :: Word16 -> ShortByteString -> RData
- toOpaqueRData :: RData -> Either (EncodeErr (Maybe RData)) RData
- fromOpaqueRData :: ResolvSeed -> RData -> Either DNSError RData
- class (Typeable a, Eq a, Ord a, Show a, Presentable a) => KnownRData a where
- type RDataExtensionVal a
- rdataExtensionVal :: forall b -> b ~ a => RDataExtensionVal a
- rdType :: forall b -> b ~ a => RRTYPE
- rdTypePres :: forall b -> b ~ a => Builder -> Builder
- rdDecode :: forall b -> b ~ a => RDataExtensionVal a -> Int -> SGet RData
- rdEncode :: a -> SPut s RData
- cnEncode :: a -> SPut s RData
- class TypeExtensible a v where
- type TypeExtensionArg a b
- extendByType :: forall t b -> (t ~ a, TypeExtensionArg t b) => v -> v
- data RDataCodec
- module Net.DNSBase.Decode.State
- module Net.DNSBase.Encode.Metric
- module Net.DNSBase.Encode.State
Basic RData API
Wrapper around any concrete KnownRData type.
Its presentation form includes both the type and the value, space-separated. The underlying concrete types present just their values.
Constructors
| KnownRData a => RData a |
Instances
| Presentable RData Source # | Presents the type and value, space-separated. |
Defined in Net.DNSBase.Internal.RData Methods present :: RData -> Builder -> Builder Source # presentLazy :: RData -> ByteString -> ByteString Source # | |
| Show RData Source # | |
| Eq RData Source # | |
| Ord RData Source # | Compare RData first by RRtype number, then by content. When two RRtype 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 RRtype, compare their opaque encodings (this could throw an error if one of the objects is not encodable, perhaps because encoding would be too long). |
fromRData :: KnownRData a => RData -> Maybe a Source #
Recover a typed RR payload from the existential RData wrapper.
Returns when the dynamic payload's type matches the
caller's expected type Just xa, and Nothing otherwise.
The target type is selected by the result-side pattern; once
there's a concrete constructor on the Just side, the
constraint is resolved without an explicit type
ascription. A typical use is a view-pattern dispatch that
handles two or more RR types at once:KnownRData a
evalIP :: (IP -> a) -> RData -> Maybe a evalIP f (fromRData -> Just (T_A ip)) = Just $! f (IPv4 ip) evalIP f (fromRData -> Just (T_AAAA ip)) = Just $! f (IPv6 ip) evalIP _ _ = Nothing
fromRData is the right tool when the value in hand is already
an RData. If you instead have an RR (or a list of them, as
returned by lookupAnswers), rrDataCast is the convenience
composition . And fromRData . rrDatamonoRData performs
the filter-and-cast over a Foldable container in one step.
monoRData :: (KnownRData a, Foldable t) => t RData -> [a] Source #
Filter a Foldable of RData down to the elements whose
payload type matches the caller's target a, returning a
monomorphic list of those typed values. Elements with a
different payload type are dropped.
For example, the T_mx payloads from a mixed RData list:
mxs :: [RData] -> [T_mx] mxs = monoRData
Equivalent to ,
but in one fused pass. See mapMaybe fromRData . toListfromRData for the single-element
cast, and rrDataCast for the RR-input analogue.
Opaque RData
data OpaqueRData (n :: Nat) Source #
Opaque RData, for RRTYPEs not known at runtime
Constructors
| Nat16 n => OpaqueRData ShortByteString |
Instances
opaqueRData :: Word16 -> ShortByteString -> RData Source #
Create opaque RData from its type number and Bytes16 value
toOpaqueRData :: RData -> Either (EncodeErr (Maybe RData)) RData Source #
Convert RData to its opaque equivalent of the same RRtype.
OpaqueRData values will be returned as-is. Otherwise, this will attempt
to encode the record without name compression, the encoding may fail, in
which case the return value will be Nothing.
fromOpaqueRData :: ResolvSeed -> RData -> Either DNSError RData Source #
Convert RData to its Known equivalent of the same RRtype
using the types known in the provided ResolvSeed. If the input
value is already non-opaque, or if there's no entry for the
RRTYPE in the provided ResolvSeed, the
input will be returned as-is.
Otherwise, this will attempt to decode the opaque record without name compression, the decode may fail, and an error reason returned instead.
Extensibility
class (Typeable a, Eq a, Ord a, Show a, Presentable a) => KnownRData a where Source #
Abstract DNS Resource Record (type-specific) data.
The decoding, encoding and presentation functions are responsible for just
the value, presentation of the associated RR type defaults to the built-in
names, for novel types override rdTypePres.
The Show instance is typically derived, and will output the type
constructor (its output strives to produce syntactically valid Haskell
values), in contrast with Presentable which produces RFC-standard
presentation forms.
Associated Types
type RDataExtensionVal a Source #
The codec-consumed extension value for type a. Defaults
to (). Types with non-trivial extension data (SVCB and
HTTPS, which carry the SvcParam decoder map) supply their
own associated-type definition.
type RDataExtensionVal a = ()
Methods
rdataExtensionVal :: forall b -> b ~ a => RDataExtensionVal a Source #
The library's built-in starting RDataExtensionVal for type
a. Used as the baseline when the library installs its
built-in registration for a, and as the starting point
when the user extends the codec for a. For
types the class default applies.RDataExtensionVal a ~ ()
default rdataExtensionVal :: RDataExtensionVal a ~ () => forall b -> b ~ a => RDataExtensionVal a Source #
rdType :: forall b -> b ~ a => RRTYPE Source #
rdTypePres :: forall b -> b ~ a => Builder -> Builder Source #
rdDecode :: forall b -> b ~ a => RDataExtensionVal a -> Int -> SGet RData Source #
Instances
| KnownRData T_a Source # | |||||
Defined in Net.DNSBase.RData.A Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_a => RDataExtensionVal T_a Source # rdType :: forall b -> b ~ T_a => RRTYPE Source # rdTypePres :: forall b -> b ~ T_a => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_a => RDataExtensionVal T_a -> Int -> SGet RData Source # | |||||
| KnownRData T_aaaa Source # | |||||
Defined in Net.DNSBase.RData.A Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_aaaa => RDataExtensionVal T_aaaa Source # rdType :: forall b -> b ~ T_aaaa => RRTYPE Source # rdTypePres :: forall b -> b ~ T_aaaa => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_aaaa => RDataExtensionVal T_aaaa -> Int -> SGet RData Source # | |||||
| KnownRData T_caa Source # | |||||
Defined in Net.DNSBase.RData.CAA Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_caa => RDataExtensionVal T_caa Source # rdType :: forall b -> b ~ T_caa => RRTYPE Source # rdTypePres :: forall b -> b ~ T_caa => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_caa => RDataExtensionVal T_caa -> Int -> SGet RData Source # | |||||
| KnownRData T_csync Source # | |||||
Defined in Net.DNSBase.RData.CSYNC Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_csync => RDataExtensionVal T_csync Source # rdType :: forall b -> b ~ T_csync => RRTYPE Source # rdTypePres :: forall b -> b ~ T_csync => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_csync => RDataExtensionVal T_csync -> Int -> SGet RData Source # | |||||
| KnownRData T_dsync Source # | |||||
Defined in Net.DNSBase.RData.CSYNC Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_dsync => RDataExtensionVal T_dsync Source # rdType :: forall b -> b ~ T_dsync => RRTYPE Source # rdTypePres :: forall b -> b ~ T_dsync => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_dsync => RDataExtensionVal T_dsync -> Int -> SGet RData Source # | |||||
| KnownRData T_ipseckey Source # | |||||
Defined in Net.DNSBase.RData.Dnssec Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_ipseckey => RDataExtensionVal T_ipseckey Source # rdType :: forall b -> b ~ T_ipseckey => RRTYPE Source # rdTypePres :: forall b -> b ~ T_ipseckey => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_ipseckey => RDataExtensionVal T_ipseckey -> Int -> SGet RData Source # | |||||
| KnownRData T_zonemd Source # | |||||
Defined in Net.DNSBase.RData.Dnssec Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_zonemd => RDataExtensionVal T_zonemd Source # rdType :: forall b -> b ~ T_zonemd => RRTYPE Source # rdTypePres :: forall b -> b ~ T_zonemd => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_zonemd => RDataExtensionVal T_zonemd -> Int -> SGet RData Source # | |||||
| KnownRData T_dname Source # | Name compression used on input only. | ||||
Defined in Net.DNSBase.RData.Internal.XNAME Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_dname => RDataExtensionVal T_dname Source # rdType :: forall b -> b ~ T_dname => RRTYPE Source # rdTypePres :: forall b -> b ~ T_dname => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_dname => RDataExtensionVal T_dname -> Int -> SGet RData Source # | |||||
| KnownRData T_nsec Source # | |||||
Defined in Net.DNSBase.RData.NSEC Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_nsec => RDataExtensionVal T_nsec Source # rdType :: forall b -> b ~ T_nsec => RRTYPE Source # rdTypePres :: forall b -> b ~ T_nsec => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_nsec => RDataExtensionVal T_nsec -> Int -> SGet RData Source # | |||||
| KnownRData T_nsec3 Source # | |||||
Defined in Net.DNSBase.RData.NSEC Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_nsec3 => RDataExtensionVal T_nsec3 Source # rdType :: forall b -> b ~ T_nsec3 => RRTYPE Source # rdTypePres :: forall b -> b ~ T_nsec3 => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_nsec3 => RDataExtensionVal T_nsec3 -> Int -> SGet RData Source # | |||||
| KnownRData T_nsec3param Source # | |||||
Defined in Net.DNSBase.RData.NSEC Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_nsec3param => RDataExtensionVal T_nsec3param Source # rdType :: forall b -> b ~ T_nsec3param => RRTYPE Source # rdTypePres :: forall b -> b ~ T_nsec3param => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_nsec3param => RDataExtensionVal T_nsec3param -> Int -> SGet RData Source # | |||||
| KnownRData T_nxt Source # | |||||
Defined in Net.DNSBase.RData.NSEC Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_nxt => RDataExtensionVal T_nxt Source # rdType :: forall b -> b ~ T_nxt => RRTYPE Source # rdTypePres :: forall b -> b ~ T_nxt => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_nxt => RDataExtensionVal T_nxt -> Int -> SGet RData Source # | |||||
| KnownRData T_a6 Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_a6 => RDataExtensionVal T_a6 Source # rdType :: forall b -> b ~ T_a6 => RRTYPE Source # rdTypePres :: forall b -> b ~ T_a6 => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_a6 => RDataExtensionVal T_a6 -> Int -> SGet RData Source # | |||||
| KnownRData T_gpos Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_gpos => RDataExtensionVal T_gpos Source # rdType :: forall b -> b ~ T_gpos => RRTYPE Source # rdTypePres :: forall b -> b ~ T_gpos => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_gpos => RDataExtensionVal T_gpos -> Int -> SGet RData Source # | |||||
| KnownRData T_isdn Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_isdn => RDataExtensionVal T_isdn Source # rdType :: forall b -> b ~ T_isdn => RRTYPE Source # rdTypePres :: forall b -> b ~ T_isdn => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_isdn => RDataExtensionVal T_isdn -> Int -> SGet RData Source # | |||||
| KnownRData T_kx Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_kx => RDataExtensionVal T_kx Source # rdType :: forall b -> b ~ T_kx => RRTYPE Source # rdTypePres :: forall b -> b ~ T_kx => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_kx => RDataExtensionVal T_kx -> Int -> SGet RData Source # | |||||
| KnownRData T_minfo Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_minfo => RDataExtensionVal T_minfo Source # rdType :: forall b -> b ~ T_minfo => RRTYPE Source # rdTypePres :: forall b -> b ~ T_minfo => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_minfo => RDataExtensionVal T_minfo -> Int -> SGet RData Source # | |||||
| KnownRData T_nsap Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_nsap => RDataExtensionVal T_nsap Source # rdType :: forall b -> b ~ T_nsap => RRTYPE Source # rdTypePres :: forall b -> b ~ T_nsap => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_nsap => RDataExtensionVal T_nsap -> Int -> SGet RData Source # | |||||
| KnownRData T_nsapptr Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_nsapptr => RDataExtensionVal T_nsapptr Source # rdType :: forall b -> b ~ T_nsapptr => RRTYPE Source # rdTypePres :: forall b -> b ~ T_nsapptr => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_nsapptr => RDataExtensionVal T_nsapptr -> Int -> SGet RData Source # | |||||
| KnownRData T_px Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_px => RDataExtensionVal T_px Source # rdType :: forall b -> b ~ T_px => RRTYPE Source # rdTypePres :: forall b -> b ~ T_px => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_px => RDataExtensionVal T_px -> Int -> SGet RData Source # | |||||
| KnownRData T_rt Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_rt => RDataExtensionVal T_rt Source # rdType :: forall b -> b ~ T_rt => RRTYPE Source # rdTypePres :: forall b -> b ~ T_rt => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_rt => RDataExtensionVal T_rt -> Int -> SGet RData Source # | |||||
| KnownRData T_x25 Source # | |||||
Defined in Net.DNSBase.RData.Obsolete Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_x25 => RDataExtensionVal T_x25 Source # rdType :: forall b -> b ~ T_x25 => RRTYPE Source # rdTypePres :: forall b -> b ~ T_x25 => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_x25 => RDataExtensionVal T_x25 -> Int -> SGet RData Source # | |||||
| KnownRData T_rp Source # | |||||
Defined in Net.DNSBase.RData.SOA Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_rp => RDataExtensionVal T_rp Source # rdType :: forall b -> b ~ T_rp => RRTYPE Source # rdTypePres :: forall b -> b ~ T_rp => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_rp => RDataExtensionVal T_rp -> Int -> SGet RData Source # | |||||
| KnownRData T_soa Source # | |||||
Defined in Net.DNSBase.RData.SOA Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_soa => RDataExtensionVal T_soa Source # rdType :: forall b -> b ~ T_soa => RRTYPE Source # rdTypePres :: forall b -> b ~ T_soa => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_soa => RDataExtensionVal T_soa -> Int -> SGet RData 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 # | |||||
| KnownRData T_amtrelay Source # | |||||
Defined in Net.DNSBase.RData.SRV Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_amtrelay => RDataExtensionVal T_amtrelay Source # rdType :: forall b -> b ~ T_amtrelay => RRTYPE Source # rdTypePres :: forall b -> b ~ T_amtrelay => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_amtrelay => RDataExtensionVal T_amtrelay -> Int -> SGet RData 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 # | |||||
| 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 # | |||||
| 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 # | |||||
| 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 # | |||||
| 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 # | |||||
| KnownRData T_openpgpkey Source # | |||||
Defined in Net.DNSBase.RData.TLSA Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_openpgpkey => RDataExtensionVal T_openpgpkey Source # rdType :: forall b -> b ~ T_openpgpkey => RRTYPE Source # rdTypePres :: forall b -> b ~ T_openpgpkey => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_openpgpkey => RDataExtensionVal T_openpgpkey -> Int -> SGet RData Source # | |||||
| KnownRData T_sshfp Source # | |||||
Defined in Net.DNSBase.RData.TLSA Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_sshfp => RDataExtensionVal T_sshfp Source # rdType :: forall b -> b ~ T_sshfp => RRTYPE Source # rdTypePres :: forall b -> b ~ T_sshfp => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_sshfp => RDataExtensionVal T_sshfp -> Int -> SGet RData Source # | |||||
| KnownRData T_hinfo Source # | |||||
Defined in Net.DNSBase.RData.TXT Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_hinfo => RDataExtensionVal T_hinfo Source # rdType :: forall b -> b ~ T_hinfo => RRTYPE Source # rdTypePres :: forall b -> b ~ T_hinfo => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_hinfo => RDataExtensionVal T_hinfo -> Int -> SGet RData Source # | |||||
| KnownRData T_null Source # | |||||
Defined in Net.DNSBase.RData.TXT Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_null => RDataExtensionVal T_null Source # rdType :: forall b -> b ~ T_null => RRTYPE Source # rdTypePres :: forall b -> b ~ T_null => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_null => RDataExtensionVal T_null -> Int -> SGet RData Source # | |||||
| KnownRData T_txt Source # | |||||
Defined in Net.DNSBase.RData.TXT Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_txt => RDataExtensionVal T_txt Source # rdType :: forall b -> b ~ T_txt => RRTYPE Source # rdTypePres :: forall b -> b ~ T_txt => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_txt => RDataExtensionVal T_txt -> Int -> SGet RData Source # | |||||
| KnownRData T_wks Source # | |||||
Defined in Net.DNSBase.RData.WKS Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_wks => RDataExtensionVal T_wks Source # rdType :: forall b -> b ~ T_wks => RRTYPE Source # rdTypePres :: forall b -> b ~ T_wks => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_wks => RDataExtensionVal T_wks -> Int -> SGet RData Source # | |||||
| Nat16 n => KnownRData (OpaqueRData n) Source # | |||||
Defined in Net.DNSBase.Internal.RData Associated Types
Methods rdataExtensionVal :: forall b -> b ~ OpaqueRData n => RDataExtensionVal (OpaqueRData n) Source # rdType :: forall b -> b ~ OpaqueRData n => RRTYPE Source # rdTypePres :: forall b -> b ~ OpaqueRData n => Builder -> Builder Source # rdDecode :: forall b -> b ~ OpaqueRData n => RDataExtensionVal (OpaqueRData n) -> Int -> SGet RData Source # | |||||
| (Nat16 n, KnownSymbol (XdsConName n)) => KnownRData (X_ds n) Source # | |||||
Defined in Net.DNSBase.RData.Dnssec Associated Types
Methods rdataExtensionVal :: forall b -> b ~ X_ds n => RDataExtensionVal (X_ds n) Source # rdType :: forall b -> b ~ X_ds n => RRTYPE Source # rdTypePres :: forall b -> b ~ X_ds n => Builder -> Builder Source # rdDecode :: forall b -> b ~ X_ds n => RDataExtensionVal (X_ds n) -> Int -> SGet RData Source # | |||||
| (Nat16 n, KnownSymbol (XkeyConName n)) => KnownRData (X_key n) Source # | |||||
Defined in Net.DNSBase.RData.Dnssec Associated Types
Methods rdataExtensionVal :: forall b -> b ~ X_key n => RDataExtensionVal (X_key n) Source # rdType :: forall b -> b ~ X_key n => RRTYPE Source # rdTypePres :: forall b -> b ~ X_key n => Builder -> Builder Source # rdDecode :: forall b -> b ~ X_key n => RDataExtensionVal (X_key n) -> Int -> SGet RData Source # | |||||
| (Nat16 n, KnownSymbol (XsigConName n)) => KnownRData (X_sig n) Source # | |||||
Defined in Net.DNSBase.RData.Dnssec Associated Types
Methods rdataExtensionVal :: forall b -> b ~ X_sig n => RDataExtensionVal (X_sig n) Source # rdType :: forall b -> b ~ X_sig n => RRTYPE Source # rdTypePres :: forall b -> b ~ X_sig n => Builder -> Builder Source # rdDecode :: forall b -> b ~ X_sig n => RDataExtensionVal (X_sig n) -> Int -> SGet RData Source # | |||||
| (Typeable n, Nat16 n, KnownSymbol (XdomainConName n)) => KnownRData (X_domain n) Source # | Name compression used on input and output. | ||||
Defined in Net.DNSBase.RData.Internal.XNAME Associated Types
Methods rdataExtensionVal :: forall b -> b ~ X_domain n => RDataExtensionVal (X_domain n) Source # rdType :: forall b -> b ~ X_domain n => RRTYPE Source # rdTypePres :: forall b -> b ~ X_domain n => Builder -> Builder Source # rdDecode :: forall b -> b ~ X_domain n => RDataExtensionVal (X_domain n) -> Int -> SGet RData 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 (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 # | |||||
| (Nat16 n, KnownSymbol (XtlsaConName n)) => KnownRData (X_tlsa n) Source # | |||||
Defined in Net.DNSBase.RData.TLSA Associated Types
Methods rdataExtensionVal :: forall b -> b ~ X_tlsa n => RDataExtensionVal (X_tlsa n) Source # rdType :: forall b -> b ~ X_tlsa n => RRTYPE Source # rdTypePres :: forall b -> b ~ X_tlsa n => Builder -> Builder Source # rdDecode :: forall b -> b ~ X_tlsa n => RDataExtensionVal (X_tlsa n) -> Int -> SGet RData Source # | |||||
class TypeExtensible a v where Source #
RR-data or EDNS-option types whose codec admits a type-driven extension. See Adding a custom RR type for an example of this mechanism in use, and Writing a type-driven extensible codec for the steps to implement a type-driven extensible codec of your own.
Associated Types
type TypeExtensionArg a b Source #
Constraint a caller's extension type b must satisfy.
Methods
extendByType :: forall t b -> (t ~ a, TypeExtensionArg t b) => v -> v Source #
Fold a caller's extension type b into the existing
codec context value of type v.
data RDataCodec Source #
Known RData Proxy + Codec parameter pair
Encoder and Decoder combinators
module Net.DNSBase.Decode.State
module Net.DNSBase.Encode.Metric
module Net.DNSBase.Encode.State