123module juptune.dns.encoding;
alias dnsDecodePayload = __MARMOS_BUG__;
Decodes a DNS on-the-wire payload, passing each part into caller-provided callbacks.
Please - for the love of dogs - do not escape any of the domainNameDoNotEscapefields. These are stack allocated! Copy them instead!
This is a low-level function that generally doesn't need to be called by itself, please use the higher level stuff such as TODO.
This function does not automatically throw if the payload contains an error code.
If this function throws then the state of readeris undefined.
DnsEncodingError.eofif the end of readeris unexpectedly reached.
DnsEncodingError.domainNameTooLongif a decoded domain name is longer than DNS_MAX_DOMAIN_LENGTH.
DnsEncodingError.invalidLabelfor various reasons.
DnsEncodingError.trailingDataif the payload is fully decoded, but readerstill has bytes left that weren't read in.
Anything dnsSplitDomainNamecan throw.
Anything that any of the callback functions can throw.