Example #1
0
        internal void Serialize(DnsBuffer buffer)
        {
            buffer.AddUshort(UniqueID);

            buffer.AddByte((byte)((this.IsRequest ? 0x00 : 0x80) |
                                  ((byte)OpCode << 3) |
                                  (this.IsAuthoritativeAnswer ? 0x04 : 0x00) |
                                  (this.IsTruncated ? 0x02 : 0x00) |
                                  (this.IsRecursionDesired ? 0x01 : 0x00)));

            buffer.AddByte((byte)((this.IsRecursionAvailable ? 0x80 : 0x00) | (byte)this.ResponseCode));

            buffer.AddShort(this.QuestionCount);
            buffer.AddShort(this.AnswerCount);
            buffer.AddShort(this.NameServerAnswerCount);
            buffer.AddShort(this.AdditionalAnswerCount);
        }
Example #2
0
        internal void Serialize(DnsBuffer buffer)
        {
            buffer.AddUshort(UniqueID);

            buffer.AddByte((byte)((this.IsRequest ? 0x00 : 0x80) |
                                  ((byte)OpCode << 3) |
                                  (this.IsAuthoritativeAnswer ? 0x04 : 0x00) |
                                  (this.IsTruncated ? 0x02 : 0x00) |
                                  (this.IsRecursionDesired ? 0x01 : 0x00)));

            buffer.AddByte((byte)((this.IsRecursionAvailable ? 0x80 : 0x00) | (byte) this.ResponseCode));
            
            buffer.AddShort(this.QuestionCount);
            buffer.AddShort(this.AnswerCount);
            buffer.AddShort(this.NameServerAnswerCount);
            buffer.AddShort(this.AdditionalAnswerCount);
        }
Example #3
0
 /// <summary>
 /// Writes this RR in DNS wire format to the <paramref name="buffer"/>
 /// </summary>
 /// <param name="buffer">The buffer to which DNS wire data are written</param>
 protected override void SerializeRecordData(DnsBuffer buffer)
 {
     buffer.AddShort(this.Preference);
     buffer.AddDomainName(m_exchange);
 }
Example #4
0
 /// <summary>
 /// Writes this RR in DNS wire format to the <paramref name="buffer"/>
 /// </summary>
 /// <param name="buffer">The buffer to which DNS wire data are written</param>
 protected override void SerializeRecordData(DnsBuffer buffer)
 {
     buffer.AddShort(this.Preference);
     buffer.AddDomainName(m_exchange);
 }