예제 #1
0
        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;
        }
예제 #2
0
파일: AAAA.cs 프로젝트: Vanaheimr/Hermod
 public AAAA(String           Name,
             DNSQueryClasses  Class,
             TimeSpan         TimeToLive,
             IPv6Address      IPv6Address)
     : base(Name, TypeId, Class, TimeToLive, IPv6Address.ToString())
 {
     this._IPv6Address  = IPv6Address;
 }
예제 #3
0
파일: CNAME.cs 프로젝트: Vanaheimr/Hermod
 public CNAME(String           Name,
              DNSQueryClasses  Class,
              TimeSpan         TimeToLive,
              String           RText)
     : base(Name, TypeId, Class, TimeToLive, RText)
 {
     this._Text  = RText;
 }
예제 #4
0
파일: MX.cs 프로젝트: Vanaheimr/Hermod
 public MX(String           Name,
           DNSQueryClasses  Class,
           TimeSpan         TimeToLive,
           Int32            Preference,
           String           Exchange)
     : base(Name, TypeId, Class, TimeToLive)
 {
     this._Preference  = Preference;
     this._Exchange    = Exchange;
 }
예제 #5
0
        public AAAA(String Name,
                    DNSQueryClasses Class,
                    TimeSpan TimeToLive,
                    IPv6Address IPv6Address)

            : base(Name, TypeId, Class, TimeToLive, IPv6Address.ToString())

        {
            this._IPv6Address = IPv6Address;
        }
예제 #6
0
        public TXT(String Name,
                   DNSQueryClasses Class,
                   TimeSpan TimeToLive,
                   String RText)

            : base(Name, TypeId, Class, TimeToLive, RText)

        {
            this._Text = RText;
        }
예제 #7
0
 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;
 }
예제 #8
0
 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;
 }
예제 #9
0
        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;
        }
예제 #10
0
        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;
        }
예제 #11
0
파일: MX.cs 프로젝트: bpaziaud/Hermod
        public MX(String Name,
                  DNSQueryClasses Class,
                  TimeSpan TimeToLive,
                  Int32 Preference,
                  String Exchange)

            : base(Name, TypeId, Class, TimeToLive)

        {
            this._Preference = Preference;
            this._Exchange   = Exchange;
        }
예제 #12
0
        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;
        }
예제 #13
0
        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;
        }
예제 #14
0
        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;
        }
예제 #15
0
        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;
        }
예제 #16
0
파일: SOA.cs 프로젝트: Vanaheimr/Hermod
 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;
 }
예제 #17
0
파일: SOA.cs 프로젝트: bpaziaud/Hermod
        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;
        }
예제 #18
0
파일: SSHFP.cs 프로젝트: Vanaheimr/Hermod
 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;
 }