Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
 /// <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
 }
Beispiel #3
0
 /// <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);
 }
Beispiel #4
0
        /// <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; 
        }
Beispiel #5
0
 /// <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
            );
 }
Beispiel #6
0
 /// <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
 }
Beispiel #7
0
 /// <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);
 }