예제 #1
0
 internal SOARecord(DnsReader br)
 {
     _mname      = br.ReadDomain();
     _rname      = br.ReadDomain();
     _serial     = br.ReadInt32();
     _refresh    = br.ReadInt32();
     _retry      = br.ReadInt32();
     _expire     = br.ReadInt32();
     _minimumTtl = br.ReadInt32();
 }
예제 #2
0
        internal ResourceRecord(DnsReader br)
        {
            _domain = br.ReadDomain();
            _qtype  = (DnsType)br.ReadInt16();
            _qclass = (DnsClass)br.ReadInt16();
            _ttl    = br.ReadInt32();

            int recordLength = br.ReadInt16();

            if (recordLength != 0)
            {
                switch (_qtype)
                {
                case DnsType.A:     _record = new ARecord(br);      break;

                case DnsType.CNAME: _record = new CNAMERecord(br);  break;

                case DnsType.MX:    _record = new MXRecord(br);     break;

                case DnsType.NS:    _record = new NSRecord(br);     break;

                case DnsType.SOA:   _record = new SOARecord(br);    break;

                case DnsType.TXT:   _record = new TXTRecord(br);    break;

                case DnsType.PTR:       _record = new PTRERecord(br);   break;

                // NetBIOS related records
                case DnsType.NB:    _record = new NBRecord(br);     break;

                default:
                    br += recordLength;
                    break;
                }
            }
        }