Пример #1
0
        public ResourceRecord(DnsReader br)
        {
            _domain = br.ReadDomain();
            _qtype = (RecordType)br.ReadInt16();
            _qclass = (RecordClass)br.ReadInt16();
            _ttl = br.ReadInt32();

            int recordLength = br.ReadInt16();
            if (recordLength != 0)
            {
                switch (_qtype)
                {
                    case RecordType.A:     _record = new ARecord(br);      break;
                    case RecordType.CNAME: _record = new CNAMERecord(br);  break;
                    case RecordType.MX:    _record = new MXRecord(br);     break;
                    case RecordType.NS:    _record = new NSRecord(br);     break;
                    case RecordType.SOA:   _record = new SOARecord(br);    break;
                    case RecordType.TXT:   _record = new TXTRecord(br);    break;
                    case RecordType.PTR:   _record = new PTRERecord(br);	break;

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

                    default:
                        br += recordLength;
                        break;
                }
            }
        }
Пример #2
0
        public ResourceRecord(DnsReader br)
        {
            _domain = br.ReadDomain();
            _qtype = (RecordType)br.ReadInt16();
            _qclass = (RecordClass)br.ReadInt16();
            _ttl = br.ReadInt32();

            int recordLength = br.ReadInt16();
            if (recordLength != 0)
            {
                switch (_qtype)
                {
                    case RecordType.A:     _record = new ARecord(br);      break;
                    case RecordType.CNAME: _record = new CNAMERecord(br);  break;
                    case RecordType.MX:    _record = new MXRecord(br);     break;
                    case RecordType.NS:    _record = new NSRecord(br);     break;
                    case RecordType.SOA:   _record = new SOARecord(br);    break;
                    case RecordType.TXT:   _record = new TXTRecord(br);    break;
					case RecordType.PTR:   _record = new PTRERecord(br);	break;

                    // NetBIOS related records
                    case RecordType.NB:    _record = new NBRecord(br);     break;
                    
                    default:
                        br += recordLength;
                        break;
                }
            }
        }
Пример #3
0
 internal Question(DnsReader br)
 {
     _domain = br.ReadDomain();
     _qtype  = (RecordType)br.ReadInt16();
     _qclass = (RecordClass)br.ReadInt16();
 }
Пример #4
0
 internal Question(DnsReader br)
 {
     _domain = br.ReadDomain();
     _qtype = (RecordType)br.ReadInt16();
     _qclass = (RecordClass)br.ReadInt16();
 }
Пример #5
0
 public MXRecord(DnsReader br)
 {
     _preference = br.ReadInt16();
     _domainName = br.ReadDomain();
 }