/* * http://www.faqs.org/rfcs/rfc2915.html * 8. DNS Packet Format The packet format for the NAPTR record is: 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 / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ where: FLAGS A which contains various flags. SERVICES A which contains protocol and service identifiers. REGEXP A which contains a regular expression. REPLACEMENT A which specifies the new value in the case where the regular expression is a simple replacement operation. and as used here are defined in RFC1035 [1]. */ using MailSharp.DNS.Records; namespace MailSharp.DNS.Records; public record RecordNAPTR(RecordReader rr) : DnsRecord(rr) { public ushort Order { get; } = rr.ReadUInt16(); public ushort Preference { get; } = rr.ReadUInt16(); public string Flags { get; } = rr.ReadString(); public string Services { get; } = rr.ReadString(); public string Regexp { get; } = rr.ReadString(); public string Replacement { get; } = rr.ReadDomainName(); public override string ToString() => $"{Order} {Preference} \"{Flags}\" \"{Services}\" \"{Regexp}\" {Replacement}"; }