Ejemplo n.º 1
0
 public RecordNXT(RecordReader rr)
 {
     ushort length = rr.ReadUInt16(-2);
     NEXTDOMAINNAME = rr.ReadDomainName();
     length -= (ushort)rr.Position;
     BITMAP = new byte[length];
     BITMAP = rr.ReadBytes(length);
 }
Ejemplo n.º 2
0
 public RecordNAPTR(RecordReader rr)
 {
     ORDER = rr.ReadUInt16();
     PREFERENCE = rr.ReadUInt16();
     FLAGS = rr.ReadString();
     SERVICES = rr.ReadString();
     REGEXP = rr.ReadString();
     REPLACEMENT = rr.ReadDomainName();
 }
Ejemplo n.º 3
0
 public RecordTSIG(RecordReader rr)
 {
     ALGORITHMNAME = rr.ReadDomainName();
     TIMESIGNED = rr.ReadUInt32() << 32 | rr.ReadUInt32();
     FUDGE = rr.ReadUInt16();
     MACSIZE = rr.ReadUInt16();
     MAC = rr.ReadBytes(MACSIZE);
     ORIGINALID = rr.ReadUInt16();
     ERROR = rr.ReadUInt16();
     OTHERLEN = rr.ReadUInt16();
     OTHERDATA = rr.ReadBytes(OTHERLEN);
 }
Ejemplo n.º 4
0
 public RecordTKEY(RecordReader rr)
 {
     ALGORITHM = rr.ReadDomainName();
     INCEPTION = rr.ReadUInt32();
     EXPIRATION = rr.ReadUInt32();
     MODE = rr.ReadUInt16();
     ERROR = rr.ReadUInt16();
     KEYSIZE = rr.ReadUInt16();
     KEYDATA = rr.ReadBytes(KEYSIZE);
     OTHERSIZE = rr.ReadUInt16();
     OTHERDATA = rr.ReadBytes(OTHERSIZE);
 }
Ejemplo n.º 5
0
 public RecordSIG(RecordReader rr)
 {
     TYPECOVERED = rr.ReadUInt16();
     ALGORITHM = rr.ReadByte();
     LABELS = rr.ReadByte();
     ORIGINALTTL = rr.ReadUInt32();
     SIGNATUREEXPIRATION = rr.ReadUInt32();
     SIGNATUREINCEPTION = rr.ReadUInt32();
     KEYTAG = rr.ReadUInt16();
     SIGNERSNAME = rr.ReadDomainName();
     SIGNATURE = rr.ReadString();
 }
Ejemplo n.º 6
0
 public RecordPTR(RecordReader rr)
 {
     PTRDNAME = rr.ReadDomainName();
 }
Ejemplo n.º 7
0
 public RecordCNAME(RecordReader rr)
 {
     CNAME = rr.ReadDomainName();
 }
Ejemplo n.º 8
0
 public RecordPX(RecordReader rr)
 {
     PREFERENCE = rr.ReadUInt16();
     MAP822 = rr.ReadDomainName();
     MAPX400 = rr.ReadDomainName();
 }
Ejemplo n.º 9
0
 public RecordAFSDB(RecordReader rr)
 {
     SUBTYPE = rr.ReadUInt16();
     //HOSTNAME = rr.ReadString();
     HOSTNAME = rr.ReadDomainName();
 }
Ejemplo n.º 10
0
        /// <summary>
        /// read domain name from record, expanding compression if applied
        /// </summary>
        /// <returns></returns>
        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
                    RecordReader newRecordReader = new RecordReader(m_Data, (length & 0x3f) << 8 | ReadByte());

                    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();
        }
Ejemplo n.º 11
0
 /// <summary>
 /// .ctor using record (from response)
 /// </summary>
 /// <param name="rr"></param>
 public Question(RecordReader rr)
 {
     QName = rr.ReadDomainName();
     QType = (QType)rr.ReadUInt16();
     QClass = (QClass)rr.ReadUInt16();
 }
Ejemplo n.º 12
0
 public RecordSRV(RecordReader rr)
 {
     PRIORITY = rr.ReadUInt16();
     WEIGHT = rr.ReadUInt16();
     PORT = rr.ReadUInt16();
     TARGET = rr.ReadDomainName();
 }
Ejemplo n.º 13
0
 public RecordMINFO(RecordReader rr)
 {
     RMAILBX = rr.ReadDomainName();
     EMAILBX = rr.ReadDomainName();
 }
Ejemplo n.º 14
0
 public RecordMX(RecordReader rr)
 {
     PREFERENCE = rr.ReadUInt16();
     EXCHANGE = rr.ReadDomainName();
 }
Ejemplo n.º 15
0
 public RecordMG(RecordReader rr)
 {
     MGMNAME = rr.ReadDomainName();
 }
Ejemplo n.º 16
0
 public RecordDNAME(RecordReader rr)
 {
     TARGET = rr.ReadDomainName();
 }
Ejemplo n.º 17
0
 public RecordSOA(RecordReader rr)
 {
     MNAME = rr.ReadDomainName();
     RNAME = rr.ReadDomainName();
     SERIAL = rr.ReadUInt32();
     REFRESH = rr.ReadUInt32();
     RETRY = rr.ReadUInt32();
     EXPIRE = rr.ReadUInt32();
     MINIMUM = rr.ReadUInt32();
 }
Ejemplo n.º 18
0
 public RecordRT(RecordReader rr)
 {
     PREFERENCE = rr.ReadUInt16();
     INTERMEDIATEHOST = rr.ReadDomainName();
 }
Ejemplo n.º 19
0
 public RecordMR(RecordReader rr)
 {
     NEWNAME = rr.ReadDomainName();
 }
Ejemplo n.º 20
0
 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;
 }
Ejemplo n.º 21
0
 public RecordNS(RecordReader rr)
 {
     NSDNAME = rr.ReadDomainName();
 }
Ejemplo n.º 22
0
 public RecordMF(RecordReader rr)
 {
     MADNAME = rr.ReadDomainName();
 }
Ejemplo n.º 23
0
 public RecordRP(RecordReader rr)
 {
     //MBOXDNAME = rr.ReadString();
     MBOXDNAME = rr.ReadDomainName();
     TXTDNAME = rr.ReadDomainName();
 }