public DNSQuery(String DomainName, Boolean RecursionDesired, params UInt16[] DNSResourceRecordTypes) { if (DNSResourceRecordTypes == null || DNSResourceRecordTypes.Length == 0) { QueryTypes = new UInt16[1] { 255 } } ; else { QueryTypes = DNSResourceRecordTypes; } if (QueryTypes.Length > 2305) // Just because of the number ;) { throw new ArgumentException("Too many DNSResourceRecordTypes!"); } this._DomainName = DomainName; this._TransactionId = new Random().Next(55555); this._RecursionDesired = RecursionDesired; this.QueryClass = DNSQueryClasses.IN; }
public AAAA(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, IPv6Address IPv6Address) : base(Name, TypeId, Class, TimeToLive, IPv6Address.ToString()) { this._IPv6Address = IPv6Address; }
public CNAME(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, String RText) : base(Name, TypeId, Class, TimeToLive, RText) { this._Text = RText; }
public MX(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, Int32 Preference, String Exchange) : base(Name, TypeId, Class, TimeToLive) { this._Preference = Preference; this._Exchange = Exchange; }
public AAAA(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, IPv6Address IPv6Address) : base(Name, TypeId, Class, TimeToLive, IPv6Address.ToString()) { this._IPv6Address = IPv6Address; }
public TXT(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, String RText) : base(Name, TypeId, Class, TimeToLive, RText) { this._Text = RText; }
protected ADNSResourceRecord(String Name, UInt16 Type, DNSQueryClasses Class, TimeSpan TimeToLive) { this._Name = Name; this._Type = Type; this._Class = Class; this._TimeToLive = TimeToLive; this._EndOfLife = DateTime.Now + _TimeToLive; }
protected ADNSResourceRecord(String Name, UInt16 Type, DNSQueryClasses Class, TimeSpan TimeToLive) { this._Name = Name; this._Type = Type; this._Class = Class; this._TimeToLive = TimeToLive; this._EndOfLife = DateTime.Now + _TimeToLive; }
protected ADNSResourceRecord(String Name, UInt16 Type, Stream DNSStream) { this._Name = Name; this._Type = Type; this._Class = (DNSQueryClasses)((DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._TimeToLive = TimeSpan.FromSeconds((DNSStream.ReadByte() & byte.MaxValue) << 24 | (DNSStream.ReadByte() & byte.MaxValue) << 16 | (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._EndOfLife = DateTime.Now + _TimeToLive; var RDLength = (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue; }
protected ADNSResourceRecord(String Name, UInt16 Type, Stream DNSStream) { this._Name = Name; this._Type = Type; this._Class = (DNSQueryClasses) ((DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._TimeToLive = TimeSpan.FromSeconds((DNSStream.ReadByte() & byte.MaxValue) << 24 | (DNSStream.ReadByte() & byte.MaxValue) << 16 | (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._EndOfLife = DateTime.Now + _TimeToLive; var RDLength = (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue; }
public MX(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, Int32 Preference, String Exchange) : base(Name, TypeId, Class, TimeToLive) { this._Preference = Preference; this._Exchange = Exchange; }
public SSHFP(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, SSHFP_Algorithm Algorithm, SSHFP_FingerprintType Typ, String Fingerprint) : base(Name, TypeId, Class, TimeToLive) { this._Algorithm = Algorithm; this._Typ = Typ; this._Fingerprint = Fingerprint; }
protected ADNSResourceRecord(Stream DNSStream, UInt16 Type) { this._Name = DNSTools.ExtractName(DNSStream); this._Type = Type; //this._Type = (DNSResourceRecordTypes) ((DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); //if (_Type != Type) // throw new ArgumentException("Invalid DNS RR Type!"); this._Class = (DNSQueryClasses) ((DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._TimeToLive = TimeSpan.FromSeconds((DNSStream.ReadByte() & byte.MaxValue) << 24 | (DNSStream.ReadByte() & byte.MaxValue) << 16 | (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._EndOfLife = DateTime.Now + _TimeToLive; var RDLength = (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue; }
protected ADNSResourceRecord(Stream DNSStream, UInt16 Type) { this._Name = DNSTools.ExtractName(DNSStream); this._Type = Type; //this._Type = (DNSResourceRecordTypes) ((DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); //if (_Type != Type) // throw new ArgumentException("Invalid DNS RR Type!"); this._Class = (DNSQueryClasses)((DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._TimeToLive = TimeSpan.FromSeconds((DNSStream.ReadByte() & byte.MaxValue) << 24 | (DNSStream.ReadByte() & byte.MaxValue) << 16 | (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue); this._EndOfLife = DateTime.Now + _TimeToLive; var RDLength = (DNSStream.ReadByte() & byte.MaxValue) << 8 | DNSStream.ReadByte() & byte.MaxValue; }
public DNSQuery(String DomainName, Boolean RecursionDesired, params UInt16[] DNSResourceRecordTypes) { if (DNSResourceRecordTypes == null || DNSResourceRecordTypes.Length == 0) QueryTypes = new UInt16[1] { 255 }; else QueryTypes = DNSResourceRecordTypes; if (QueryTypes.Length > 2305) // Just because of the number ;) throw new ArgumentException("Too many DNSResourceRecordTypes!"); this._DomainName = DomainName; this._TransactionId = new Random().Next(55555); this._RecursionDesired = RecursionDesired; this.QueryClass = DNSQueryClasses.IN; }
public SOA(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, String Server, String Email, Int64 Serial, Int64 Refresh, Int64 Retry, Int64 Expire, Int64 Minimum) : base(Name, TypeId, Class, TimeToLive) { this._Server = Server; this._Email = Email; this._Serial = Serial; this._Refresh = Refresh; this._Retry = Retry; this._Expire = Expire; this._Minimum = Minimum; }
public SOA(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, String Server, String Email, Int64 Serial, Int64 Refresh, Int64 Retry, Int64 Expire, Int64 Minimum) : base(Name, TypeId, Class, TimeToLive) { this._Server = Server; this._Email = Email; this._Serial = Serial; this._Refresh = Refresh; this._Retry = Retry; this._Expire = Expire; this._Minimum = Minimum; }
public SSHFP(String Name, DNSQueryClasses Class, TimeSpan TimeToLive, SSHFP_Algorithm Algorithm, SSHFP_FingerprintType Typ, String Fingerprint) : base(Name, TypeId, Class, TimeToLive) { this._Algorithm = Algorithm; this._Typ = Typ; this._Fingerprint = Fingerprint; }