This commit is contained in:
Connection Refused
2019-12-02 19:51:12 +08:00
commit b2ea730984
229 changed files with 86605 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Net;
namespace DnsClient.Protocol
{
/// <summary>
/// Base class for <see cref="DnsResourceRecord"/>s transporting an <see cref="IPAddress"/>.
/// </summary>
/// <seealso cref="ARecord"/>
/// <seealso cref="AaaaRecord"/>
public class AddressRecord : DnsResourceRecord
{
/// <summary>
/// Gets the <see cref="IPAddress"/>.
/// </summary>
/// <value>
/// The address.
/// </value>
public IPAddress Address { get; }
/// <summary>
/// Initializes a new instance of the <see cref="AddressRecord"/> class.
/// </summary>
/// <param name="info">The information.</param>
/// <param name="address">The address.</param>
/// <exception cref="ArgumentNullException">If <paramref name="info"/> is null.</exception>
/// <exception cref="System.ArgumentNullException">If <paramref name="address"/> or <paramref name="info"/> is null</exception>
public AddressRecord(ResourceRecordInfo info, IPAddress address)
: base(info)
{
Address = address ?? throw new ArgumentNullException(nameof(address));
}
private protected override string RecordToString()
{
return Address.ToString();
}
}
}