Skip to main content

Module wire

Module wire 

Available on crate features dns and std only.
Expand description

DNS wire-format vocabulary and parsing.

This module contains protocol data, not request-context extensions. Name handles case-preserving DNS names and RFC 1035 compression; ServiceBinding represents the common RDATA wire format used by both RecordType::SVCB and RecordType::HTTPS resource records.

Message assembles that vocabulary into an RFC 1035 message parser for the header, question section, and answer section. It stops there: the authority and additional sections are skipped, and telemetry policy such as answer caps, name normalisation, and string flattening stays with the caller. Parsing is lenient by default and keeps every record decoded before a failure; Message::parse_strict rejects such a message instead, while still handing that partial result back with the error.

Structs§

AddressRdataParseError
Error returned when address-record RDATA has the wrong wire length.
AlpnList
A validated ALPN protocol-name list backed by one shared wire buffer.
Message
A parsed DNS message header, question section, and answer section.
MessageHeader
The fixed twelve-octet header of a DNS message.
MessageParseError
Error returned when a DNS message cannot be decoded.
Name
A fully qualified DNS name in uncompressed wire format.
NameParseError
Error returned when a DNS name cannot be decoded.
Question
One entry of a DNS message’s question section.
ResourceRecord
One resource record of a DNS message’s answer section.
ServiceBinding
Decoded RDATA shared by SVCB and HTTPS resource records.
ServiceBindingParseError
Error returned when SVCB-compatible RDATA is malformed or inconsistent.
Txt
One validated TXT-record RDATA value.
TxtParseError
Error returned when TXT RDATA or decoded strings violate RFC 1035 framing.

Enums§

RecordClass
A DNS resource-record class from the IANA DNS CLASSes registry.
RecordData
Decoded RDATA of an answer record.
RecordType
A DNS resource-record type from the IANA DNS Parameters registry.
ResponseCode
A DNS response code (RCODE) from the IANA DNS RCODEs registry.
SvcParam
A decoded service binding parameter.
SvcParamKey
Numeric key for a service binding parameter.

Functions§

parse_a_rdata
Parse one complete A-record RDATA value.
parse_aaaa_rdata
Parse one complete AAAA-record RDATA value.