Commit 0ad9add1 authored by Brickner_cp's avatar Brickner_cp

Warnings, Code Analysis and Documentation. 335 warnings left.

parent 35ef2046
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// Defines when and how to compress DNS domain names when creating a DNS datagram.
/// </summary>
public enum DnsDomainNameCompressionMode
{
/// <summary>
/// Compress any domain name if possible.
/// </summary>
All,
/// <summary>
/// Never compress domain names.
/// </summary>
Nothing
}
}
\ No newline at end of file
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// RFC 2671.
/// The implementation level of whoever sets it for the OPT resource record.
/// </summary>
public enum DnsOptVersion : byte
{
/// <summary>
/// Full conformance with the specification.
/// </summary>
Version0 = 0,
}
}
\ No newline at end of file
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// The ATM address format values.
/// </summary>
public enum DnsAtmAddressFormat : byte
{
/// <summary>
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// The certificate type for cetificate DNS resource records.
/// </summary>
public enum DnsCertificateType : ushort
{
/// <summary>
/// No certificate type defined.
/// Should not be used.
/// </summary>
None = 0,
/// <summary>
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// The type of digest that is used to create a digest value.
/// </summary>
public enum DnsDigestType : byte
{
/// <summary>
/// No definition for digest type.
/// Should not be used.
/// </summary>
None = 0,
/// <summary>
......
......@@ -4,21 +4,43 @@ using PcapDotNet.Packets.IpV6;
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// Represents a gateway to which an IPsec tunnel may be created in order to reach the entity named by an IPsec resource record.
/// </summary>
public abstract class DnsGateway : IEquatable<DnsGateway>
{
/// <summary>
/// An instance that represents that no gateway exists.
/// </summary>
public static DnsGatewayNone None { get { return _none; } }
/// <summary>
/// The gateway represnetation type.
/// </summary>
public abstract DnsGatewayType GatewayType { get; }
/// <summary>
/// The number of bytes the gateway represnetation takes.
/// </summary>
public abstract int Length { get; }
/// <summary>
/// Two gateway representations are equal if they are of the same type and the value is the same.
/// </summary>
public abstract bool Equals(DnsGateway other);
/// <summary>
/// Two gateway representations are equal if they are of the same type and the value is the same.
/// </summary>
public override bool Equals(object obj)
{
return Equals(obj as DnsGateway);
}
/// <summary>
/// Serves as a hash function for a particular type.
/// </summary>
/// <returns>A hash code for the current gateway represnetation.</returns>
public override int GetHashCode()
{
return GatewayType.GetHashCode() ^ DataGetHashCode();
......
......@@ -2,31 +2,52 @@
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// A gateway that is represented using a domain name.
/// </summary>
public class DnsGatewayDomainName : DnsGateway, IEquatable<DnsGatewayDomainName>
{
/// <summary>
/// Creates the gateway using the given domain name.
/// </summary>
public DnsGatewayDomainName(DnsDomainName value)
{
Value = value;
}
/// <summary>
/// Returns the domain name value.
/// </summary>
public DnsDomainName Value { get; private set; }
/// <summary>
/// The gateway represnetation type.
/// </summary>
public override DnsGatewayType GatewayType
{
get { return DnsGatewayType.DomainName; }
}
/// <summary>
/// The number of bytes the gateway represnetation takes.
/// </summary>
public override int Length
{
get { return Value.NonCompressedLength; }
}
/// <summary>
/// Two DnsGatewayDomainName are equal if their domain name values are equal.
/// </summary>
public bool Equals(DnsGatewayDomainName other)
{
return other != null &&
Value.Equals(other.Value);
}
/// <summary>
/// Two gateway representations are equal if they are of the same type and the value is the same.
/// </summary>
public override bool Equals(DnsGateway other)
{
return Equals(other as DnsGatewayDomainName);
......
......@@ -3,31 +3,52 @@ using PcapDotNet.Packets.IpV4;
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// Represents an IPv4 gateway to which an IPsec tunnel may be created in order to reach the entity named by an IPsec resource record.
/// </summary>
public class DnsGatewayIpV4 : DnsGateway, IEquatable<DnsGatewayIpV4>
{
/// <summary>
/// Creates a gateway using the given IPv4 address.
/// </summary>
public DnsGatewayIpV4(IpV4Address value)
{
Value = value;
}
/// <summary>
/// The IPv4 address value of the gateway.
/// </summary>
public IpV4Address Value { get; private set; }
/// <summary>
/// The gateway represnetation type.
/// </summary>
public override DnsGatewayType GatewayType
{
get { return DnsGatewayType.IpV4; }
}
/// <summary>
/// The number of bytes the gateway represnetation takes.
/// </summary>
public override int Length
{
get { return IpV4Address.SizeOf; }
}
/// <summary>
/// Two DnsGatewayIpV4 are equal if their IPv4 addresses are equal.
/// </summary>
public bool Equals(DnsGatewayIpV4 other)
{
return other != null &&
Value.Equals(other.Value);
}
/// <summary>
/// Two gateway representations are equal if they are of the same type and the value is the same.
/// </summary>
public override bool Equals(DnsGateway other)
{
return Equals(other as DnsGatewayIpV4);
......
......@@ -3,31 +3,52 @@ using PcapDotNet.Packets.IpV6;
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// Represents an IPv6 gateway to which an IPsec tunnel may be created in order to reach the entity named by an IPsec resource record.
/// </summary>
public class DnsGatewayIpV6 : DnsGateway, IEquatable<DnsGatewayIpV6>
{
/// <summary>
/// Creates a gateway using the given IPv6 address.
/// </summary>
public DnsGatewayIpV6(IpV6Address value)
{
Value = value;
}
/// <summary>
/// The IPv6 address value of the gateway.
/// </summary>
public IpV6Address Value { get; private set; }
/// <summary>
/// The gateway represnetation type.
/// </summary>
public override DnsGatewayType GatewayType
{
get { return DnsGatewayType.IpV6; }
}
/// <summary>
/// The number of bytes the gateway represnetation takes.
/// </summary>
public override int Length
{
get { return IpV6Address.SizeOf; }
}
/// <summary>
/// Two DnsGatewayIpV6 are equal if their IPv6 addresses are equal.
/// </summary>
public bool Equals(DnsGatewayIpV6 other)
{
return other != null &&
Value.Equals(other.Value);
}
/// <summary>
/// Two gateway representations are equal if they are of the same type and the value is the same.
/// </summary>
public override bool Equals(DnsGateway other)
{
return Equals(other as DnsGatewayIpV6);
......
......@@ -2,23 +2,38 @@
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// A gateway representation that represents that no gateway is present.
/// </summary>
public class DnsGatewayNone : DnsGateway, IEquatable<DnsGatewayNone>
{
/// <summary>
/// The gateway represnetation type.
/// </summary>
public override DnsGatewayType GatewayType
{
get { return DnsGatewayType.None; }
}
/// <summary>
/// The number of bytes the gateway represnetation takes.
/// </summary>
public override int Length
{
get { return 0; }
}
/// <summary>
/// Two DnsGatewayNone are always equal.
/// </summary>
public bool Equals(DnsGatewayNone other)
{
return other != null;
}
/// <summary>
/// Two gateway representations are equal if they are of the same type and the value is the same.
/// </summary>
public override bool Equals(DnsGateway other)
{
return Equals(other as DnsGatewayNone);
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// The DNS LLQ Error code values.
/// </summary>
public enum DnsLongLivedQueryErrorCode : ushort
{
/// <summary>
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// The option code for a DNS option.
/// </summary>
public enum DnsOptionCode : ushort
{
/// <summary>
/// No code defined.
/// Should not be used.
/// </summary>
None = 0,
/// <summary>
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// A DNS resource record type that any domain name that it contains should not be compressed when written.
/// </summary>
public abstract class DnsResourceDataNoCompression : DnsResourceData
{
internal sealed override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// A DNS resource record type that any domain name that it contains should not be compressed when written and cannot decompress them when reads them.
/// </summary>
public abstract class DnsResourceDataSimple : DnsResourceDataNoCompression
{
internal sealed override int WriteData(byte[] buffer, int offset)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment