コード例 #1
0
ファイル: DnsMessage.cs プロジェクト: DM-TOR/nhin-d
 /// <summary>
 /// Instantiates a message with the given header and question
 /// </summary>
 /// <param name="header">the header - take as is, assumed configured correctly</param>
 /// <param name="question">question to ask</param>        
 protected DnsMessage(DnsHeader header, DnsQuestion question)
 {
     if (header == null || question == null)
     {
         throw new ArgumentNullException();
     }
     m_header = header;
     m_header.QuestionCount = 1;
     m_question = question;
 }
コード例 #2
0
ファイル: DnsMessage.cs プロジェクト: DM-TOR/nhin-d
 /// <summary>
 /// Instantiates a Dns message
 /// </summary>
 /// <param name="question"></param>
 protected DnsMessage(DnsQuestion question)
     : this(new DnsHeader(), question)
 {
     m_header.Init();  // Since we created the header, we'll init it with some defaults
 }
コード例 #3
0
ファイル: DnsMessage.cs プロジェクト: DM-TOR/nhin-d
 /// <summary>
 /// Deserialize this message
 /// </summary>
 /// <param name="reader"></param>        
 protected virtual void Deserialize(ref DnsBufferReader reader)
 {
     m_header = new DnsHeader(ref reader);
     m_question = new DnsQuestion(ref reader);
 }
コード例 #4
0
ファイル: DnsQuestion.cs プロジェクト: DM-TOR/nhin-d
        /// <summary>
        /// Initializes an instance from the specified question parameter. 
        /// </summary>
        /// <param name="question">
        /// The question used to initialize the new question instance.
        /// </param>
        public DnsQuestion(DnsQuestion question)
        {
            if (question == null)
            {
                throw new ArgumentNullException("question"); 
            }

            this.Domain = question.Domain;
            this.Type = question.Type;
            this.Class = question.Class; 
        }
コード例 #5
0
ファイル: DnsQuestion.cs プロジェクト: DM-TOR/nhin-d
 /// <summary>
 /// Tests this instance for equality with the other <paramref name="question"/>
 /// </summary>
 /// <param name="question">The other question.</param>
 /// <returns><c>true</c> if the instances represent the same question, <c>false</c> otherwise.</returns>
 public bool Equals(DnsQuestion question)
 {
     if (question == null)
     {
         return false;
     }
     
     return (
                DnsStandard.Equals(question.Domain, this.Domain)
                &&  question.Type == this.Type
                &&  question.Class == this.Class
            );
 }
コード例 #6
0
ファイル: DnsMessage.cs プロジェクト: nagyistge/nhin-d.net35
 /// <summary>
 /// Instantiates a Dns message
 /// </summary>
 /// <param name="question"></param>
 protected DnsMessage(DnsQuestion question)
     : this(new DnsHeader(), question)
 {
     m_header.Init();  // Since we created the header, we'll init it with some defaults
 }
コード例 #7
0
ファイル: DnsMessage.cs プロジェクト: nagyistge/nhin-d.net35
 /// <summary>
 /// Deserialize this message
 /// </summary>
 /// <param name="reader"></param>
 protected virtual void Deserialize(ref DnsBufferReader reader)
 {
     m_header   = new DnsHeader(ref reader);
     m_question = new DnsQuestion(ref reader);
 }