public RR(RecordReader rr) { TimeLived = 0; NAME = rr.ReadDomainName(); Type = (Type)rr.ReadUInt16(); Class = (Class)rr.ReadUInt16(); TTL = rr.ReadUInt32(); RDLENGTH = rr.ReadUInt16(); RECORD = rr.ReadRecord(Type); RECORD.RR = this; }
public string ReadDomainName() { StringBuilder name = new StringBuilder(); int length = 0; // get the length of the first label while ((length = ReadByte()) != 0) { // top 2 bits set denotes domain name compression and to reference elsewhere if ((length & 0xc0) == 0xc0) { // work out the existing domain name, copy this pointer int nextLoc = (length & 0x3f) << 8 | ReadByte(); if (nextLoc != m_Position - 2) { RecordReader newRecordReader = new RecordReader(m_Data, nextLoc); name.Append(newRecordReader.ReadDomainName()); } return(name.ToString()); } // if not using compression, copy a char at a time to the domain name while (length > 0) { name.Append(ReadChar()); length--; } name.Append('.'); } if (name.Length == 0) { return("."); } else { return(name.ToString()); } }
public RecordNS(RecordReader rr) { NSDNAME = rr.ReadDomainName(); }
public Question(RecordReader rr) { QName = rr.ReadDomainName(); QType = (QType)rr.ReadUInt16(); QClass = (QClass)rr.ReadUInt16(); }
public RecordDNAME(RecordReader rr) { TARGET = rr.ReadDomainName(); }
public RecordMX(RecordReader rr) { PREFERENCE = rr.ReadUInt16(); EXCHANGE = rr.ReadDomainName(); }
public RecordCNAME(RecordReader rr) { CNAME = rr.ReadDomainName(); }
public RecordPTR(RecordReader rr) { PTRDNAME = rr.ReadDomainName(); }