private DnsResourceRecord ResolveCaaRecord(ResourceRecordInfo info) { var flag = _reader.ReadByte(); var tag = _reader.ReadString(); var stringValue = DnsDatagramReader.ParseString(_reader, info.RawDataLength - 2 - tag.Length); return(new CaaRecord(info, flag, tag, stringValue)); }
private DnsResourceRecord ResolveTXTRecord(ResourceRecordInfo info) { int pos = _reader.Index; var values = new List <string>(); var utf8Values = new List <string>(); while ((_reader.Index - pos) < info.RawDataLength) { var length = _reader.ReadByte(); var bytes = _reader.ReadBytes(length); var escaped = DnsDatagramReader.ParseString(bytes); var utf = DnsDatagramReader.ReadUTF8String(bytes); values.Add(escaped); utf8Values.Add(utf); } return(new TxtRecord(info, values.ToArray(), utf8Values.ToArray())); }