Пример #1
0
 protected override void Parse(Stream s)
 {
     _priority = DnsDatagram.ReadUInt16NetworkOrder(s);
     _weight   = DnsDatagram.ReadUInt16NetworkOrder(s);
     _port     = DnsDatagram.ReadUInt16NetworkOrder(s);
     _target   = DnsDatagram.DeserializeDomainName(s);
 }
Пример #2
0
 protected override void Parse(Stream s)
 {
     _masterNameServer  = DnsDatagram.DeserializeDomainName(s);
     _responsiblePerson = DnsDatagram.DeserializeDomainName(s);
     _serial            = DnsDatagram.ReadUInt32NetworkOrder(s);
     _refresh           = DnsDatagram.ReadUInt32NetworkOrder(s);
     _retry             = DnsDatagram.ReadUInt32NetworkOrder(s);
     _expire            = DnsDatagram.ReadUInt32NetworkOrder(s);
     _minimum           = DnsDatagram.ReadUInt32NetworkOrder(s);
 }
        public DnsResourceRecord(Stream s)
        {
            _name  = DnsDatagram.DeserializeDomainName(s);
            _type  = (DnsResourceRecordType)DnsDatagram.ReadUInt16NetworkOrder(s);
            _class = (DnsClass)DnsDatagram.ReadUInt16NetworkOrder(s);
            _ttl   = DnsDatagram.ReadUInt32NetworkOrder(s);

            switch (_type)
            {
            case DnsResourceRecordType.A:
                _data = new DnsARecord(s);
                break;

            case DnsResourceRecordType.NS:
                _data = new DnsNSRecord(s);
                break;

            case DnsResourceRecordType.CNAME:
                _data = new DnsCNAMERecord(s);
                break;

            case DnsResourceRecordType.SOA:
                _data = new DnsSOARecord(s);
                break;

            case DnsResourceRecordType.PTR:
                _data = new DnsPTRRecord(s);
                break;

            case DnsResourceRecordType.MX:
                _data = new DnsMXRecord(s);
                break;

            case DnsResourceRecordType.TXT:
                _data = new DnsTXTRecord(s);
                break;

            case DnsResourceRecordType.AAAA:
                _data = new DnsAAAARecord(s);
                break;

            case DnsResourceRecordType.SRV:
                _data = new DnsSRVRecord(s);
                break;

            case DnsResourceRecordType.CAA:
                _data = new DnsCAARecord(s);
                break;

            default:
                _data = new DnsUnknownRecord(s);
                break;
            }
        }
Пример #4
0
 protected override void Parse(Stream s)
 {
     _ptrDomainName = DnsDatagram.DeserializeDomainName(s);
 }
Пример #5
0
 public DnsQuestionRecord(Stream s)
 {
     _name  = DnsDatagram.DeserializeDomainName(s);
     _type  = (DnsResourceRecordType)DnsDatagram.ReadUInt16NetworkOrder(s);
     _class = (DnsClass)DnsDatagram.ReadUInt16NetworkOrder(s);
 }
Пример #6
0
 protected override void Parse(Stream s)
 {
     _preference = DnsDatagram.ReadUInt16NetworkOrder(s);
     _exchange   = DnsDatagram.DeserializeDomainName(s);
 }
Пример #7
0
        public DnsResourceRecord(Stream s)
        {
            _datagramOffset = Convert.ToInt32(s.Position);

            _name  = DnsDatagram.DeserializeDomainName(s);
            _type  = (DnsResourceRecordType)DnsDatagram.ReadUInt16NetworkOrder(s);
            _class = (DnsClass)DnsDatagram.ReadUInt16NetworkOrder(s);
            _ttl   = DnsDatagram.ReadUInt32NetworkOrder(s);

            switch (_type)
            {
            case DnsResourceRecordType.A:
                _data = new DnsARecord(s);
                break;

            case DnsResourceRecordType.NS:
                _data = new DnsNSRecord(s);
                break;

            case DnsResourceRecordType.CNAME:
                _data = new DnsCNAMERecord(s);
                break;

            case DnsResourceRecordType.SOA:
                _data = new DnsSOARecord(s);
                break;

            case DnsResourceRecordType.PTR:
                _data = new DnsPTRRecord(s);
                break;

            case DnsResourceRecordType.HINFO:
                _data = new DnsHINFORecord(s);
                break;

            case DnsResourceRecordType.MX:
                _data = new DnsMXRecord(s);
                break;

            case DnsResourceRecordType.TXT:
                _data = new DnsTXTRecord(s);
                break;

            case DnsResourceRecordType.AAAA:
                _data = new DnsAAAARecord(s);
                break;

            case DnsResourceRecordType.SRV:
                _data = new DnsSRVRecord(s);
                break;

            case DnsResourceRecordType.DNAME:
                _data = new DnsDNAMERecord(s);
                break;

            case DnsResourceRecordType.CAA:
                _data = new DnsCAARecord(s);
                break;

            case DnsResourceRecordType.ANAME:
                _data = new DnsANAMERecord(s);
                break;

            case DnsResourceRecordType.FWD:
                _data = new DnsForwarderRecord(s);
                break;

            case DnsResourceRecordType.APP:
                _data = new DnsApplicationRecord(s);
                break;

            case DnsResourceRecordType.TSIG:
                _data = new DnsTSIGRecord(s);
                break;

            default:
                _data = new DnsUnknownRecord(s);
                break;
            }
        }