/// <summary> /// Formats and writes this header to the specified query writer. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public virtual void Write(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteUInt16((ushort)this.Id); byte b3 = 0; if (!this.IsQuery) { b3 |= 0x80; } b3 |= (byte)(((byte)this.OpCode & 0x0F) << 3); if (this.IsAuthorative) { b3 |= 0x04; } if (this.IsTruncated) { b3 |= 0x02; } if (this.IsRecursionDesired) { b3 |= 0x01; } writer.WriteByte(b3); byte b4 = (byte)this.ResponseCode; if (this.IsRecursionAllowed) { b4 |= 0x80; } writer.WriteByte(b4); writer.WriteUInt16(this.QuestionCount); writer.WriteUInt16(this.AnswerCount); writer.WriteUInt16(this.AuthorityCount); writer.WriteUInt16(this.AdditionalCount); }
/// <summary> /// Writes the RDATA of this resource record to the specified /// <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public override void WriteData(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteName(this.Domain); }
/// <summary> /// Writes the RDATA of this resource record to the specified /// <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public override void WriteData(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteBytes(this.Data); }
/// <summary> /// Writes the RDATA of this resource record to the specified /// <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public override void WriteData(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteIPAddress(this.Address); }
/// <summary> /// Writes the RDATA of this resource record to the specified /// <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> <see langword="null"/>. /// </exception> public override void WriteData(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteName(this.NewMailbox); }
/// <summary> /// Writes the RDATA of this resource record to the specified /// <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public override void WriteData(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteCharString(this.Text); }
/// <summary> /// When overriden in a dervied class; the RDATA section of the resource /// record is written to the specified <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public abstract void WriteData(IDnsWriter writer);
/// <summary> /// Writes the RDATA of this resource record to the specified /// <see cref="AK.Net.Dns.IDnsWriter"/>. /// </summary> /// <param name="writer">The writer.</param> /// <exception cref="System.ArgumentNullException"> /// Thrown when <paramref name="writer"/> is <see langword="null"/>. /// </exception> public override void WriteData(IDnsWriter writer) { Guard.NotNull(writer, "writer"); writer.WriteCharString(this.Specification); }