public SoaRecord(DataBuffer buffer) { primaryNameServer = buffer.ReadDomainName(); responsibleMailAddress = buffer.ReadDomainName(); serial = buffer.ReadInt(); refresh = buffer.ReadInt(); retry = buffer.ReadInt(); expire = buffer.ReadInt(); defaultTtl = buffer.ReadInt(); }
/// <summary> /// Implementation Reference RFC 2782 /// </summary> /// <param name="buffer"></param> public SrvRecord(DataBuffer buffer) { priority = buffer.ReadShortInt(); weight = buffer.ReadShortUInt(); port = buffer.ReadShortUInt(); domain = buffer.ReadDomainName(); }
/// <summary> /// Implementation Reference RFC 3363 /// </summary> /// <param name="buffer"></param> public A6Record(DataBuffer buffer) { prefixLength = buffer.ReadByte(); if (prefixLength == 0) //Only Address Present { ipAddress = buffer.ReadIPv6Address(); } else if (prefixLength == 128) //Only Domain Name Present { domain = buffer.ReadDomainName(); } else //Address and Domain Name Present { ipAddress = buffer.ReadIPv6Address(); domain = buffer.ReadDomainName(); } }
public TSigRecord(DataBuffer buffer) { algorithm = buffer.ReadDomainName(); timeSigned = buffer.ReadLongInt(); fudge = buffer.ReadShortUInt(); macSize = buffer.ReadShortUInt(); mac = buffer.ReadBytes(macSize); originalId = buffer.ReadShortUInt(); error = buffer.ReadShortUInt(); otherLen = buffer.ReadShortUInt(); otherData = buffer.ReadBytes(otherLen); }
/// <summary> /// Implementation References RFC 2930 /// </summary> /// <param name="buffer"></param> public TKeyRecord(DataBuffer buffer) { algorithm = buffer.ReadDomainName(); inception = buffer.ReadUInt(); expiration = buffer.ReadUInt(); mode = buffer.ReadShortUInt(); error = buffer.ReadShortUInt(); keySize = buffer.ReadShortUInt(); keyData = buffer.ReadBytes(keySize); otherSize = buffer.ReadShortUInt(); otherData = buffer.ReadBytes(otherSize); }
/// <summary> /// Implementation Reference RFC 2535 /// </summary> /// <param name="buffer"></param> /// <param name="length"></param> public SigRecord(DataBuffer buffer, int length) { int pos = buffer.Position; coveredType = buffer.ReadShortInt(); algorithm = buffer.ReadByte(); numLabels = buffer.ReadByte(); expiration = buffer.ReadUInt(); inception = buffer.ReadUInt(); keyTag = buffer.ReadShortInt(); signer = buffer.ReadDomainName(); buffer.Position = pos - length; }
/// <summary> /// Implementation Reference RFC 1183 /// </summary> /// <param name="buffer"></param> public RPRecord(DataBuffer buffer) { responsibleMailbox = buffer.ReadDomainName(); textDomain = buffer.ReadDomainName(); }
public PXRecord(DataBuffer buffer) : base(buffer) { x400Domain = buffer.ReadDomainName(); }
/// <summary> /// Base class for all Record Types that have RDATA consisting of a single domain name /// </summary> /// <param name="buffer"></param> public DomainNameOnly(DataBuffer buffer) { domain = buffer.ReadDomainName(); }
public MInfoRecord(DataBuffer buffer) { responsibleMailbox = buffer.ReadDomainName(); errorMailbox = buffer.ReadDomainName(); }
/// <summary> /// Create a DNSEntry record and dispatch to data constructor /// for thast record type /// </summary> /// <param name="buffer"></param> public DnsEntry(DataBuffer buffer) { try { domain = buffer.ReadDomainName(); byte b = buffer.ReadByte(); recType = (RecordType)buffer.ReadShortInt(); classType = buffer.ReadShortInt(); ttl = buffer.ReadInt(); int length = buffer.ReadByte(); switch (recType) { case RecordType.A: data = new ARecord(buffer); break; case RecordType.NS: data = new NSRecord(buffer); break; case RecordType.CNAME: data = new CNameRecord(buffer); break; case RecordType.SOA: data = new SoaRecord(buffer); break; case RecordType.MB: data = new MBRecord(buffer); break; case RecordType.MG: data = new MGRecord(buffer); break; case RecordType.MR: data = new MRRecord(buffer); break; case RecordType.NULL: data = new NullRecord(buffer, length); break; case RecordType.WKS: data = new WksRecord(buffer, length); break; case RecordType.PTR: data = new PtrRecord(buffer); break; case RecordType.HINFO: data = new HInfoRecord(buffer, length); break; case RecordType.MINFO: data = new MInfoRecord(buffer); break; case RecordType.MX: data = new MXRecord(buffer); break; case RecordType.TXT: data = new TxtRecord(buffer, length); break; case RecordType.RP: data = new RPRecord(buffer); break; case RecordType.AFSDB: data = new AfsdbRecord(buffer); break; case RecordType.X25: data = new X25Record(buffer); break; case RecordType.ISDN: data = new IsdnRecord(buffer); break; case RecordType.RT: data = new RTRecord(buffer); break; case RecordType.NSAP: data = new NsapRecord(buffer, length); break; case RecordType.SIG: data = new SigRecord(buffer, length); break; case RecordType.KEY: data = new KeyRecord(buffer, length); break; case RecordType.PX: data = new PXRecord(buffer); break; case RecordType.AAAA: data = new AAAARecord(buffer); break; case RecordType.LOC: data = new LocRecord(buffer); break; case RecordType.SRV: data = new SrvRecord(buffer); break; case RecordType.NAPTR: data = new NaptrRecord(buffer); break; case RecordType.KX: data = new KXRecord(buffer); break; case RecordType.A6: data = new A6Record(buffer); break; case RecordType.DNAME: data = new DNameRecord(buffer); break; case RecordType.DS: data = new DSRecord(buffer, length); break; case RecordType.TKEY: data = new TKeyRecord(buffer); break; case RecordType.TSIG: data = new TSigRecord(buffer); break; default: throw new DnsQueryException("Invalid DNS Record Type in DNS Response", null); } } catch (Exception ex) { data = new ExceptionRecord(ex.Message); throw ex; } }
/// <summary> /// Create data record for AFSDB type from data buffer /// </summary> /// <param name="buffer"></param> public AfsdbRecord(DataBuffer buffer) { subType = buffer.ReadShortInt(); domain = buffer.ReadDomainName(); }
/// <summary> /// Create a Question record for Dns Answer /// </summary> /// <param name="buffer"></param> public Question(DataBuffer buffer) { domain = buffer.ReadDomainName(); recType = (RecordType)buffer.ReadBEShortInt(); classType = buffer.ReadBEShortInt(); }
/// <summary> /// Common class for all record types that contain a preference and a domain name /// </summary> /// <param name="buffer"></param> public PrefAndDomain(DataBuffer buffer) { preference = buffer.ReadBEShortInt(); domain = buffer.ReadDomainName(); }