Commit 31d31dec authored by Brickner_cp's avatar Brickner_cp

DNS

parent 7ec2cf6d
...@@ -247,12 +247,15 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -247,12 +247,15 @@ namespace PcapDotNet.Packets.TestUtils
return new DnsResourceDataOptions(random.NextDnsOptions()); return new DnsResourceDataOptions(random.NextDnsOptions());
case DnsType.Apl: case DnsType.Apl:
return return new DnsResourceDataAddressPrefixList(
new DnsResourceDataAddressPrefixList( ((Func<DnsAddressPrefix>)
((Func<DnsAddressPrefix>) (() =>
(() => new DnsAddressPrefix(random.NextEnum<AddressFamily>(), random.NextByte(), random.NextBool(),
new DnsAddressPrefix(random.NextEnum<AddressFamily>(), random.NextByte(), random.NextBool(), random.NextDataSegment(random.Next(0, 128))))).GenerateArray(random.Next(10)));
random.NextDataSegment(random.Next(0, 128))))).GenerateArray(random.Next(10)));
case DnsType.Ds:
return new DnsResourceDataDelegationSigner(random.NextUShort(), random.NextEnum<DnsAlgorithm>(), random.NextEnum<DnsDigestType>(),
random.NextDataSegment(random.Next(50)));
default: default:
return new DnsResourceDataAnything(random.NextDataSegment(random.Next(100))); return new DnsResourceDataAnything(random.NextDataSegment(random.Next(100)));
......
...@@ -89,7 +89,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -89,7 +89,7 @@ namespace PcapDotNet.Packets.Dns
select new select new
{ {
attribute.Type, attribute.Type,
Prototype = (DnsResourceData)Activator.CreateInstance(type), Prototype = (DnsResourceData)Activator.CreateInstance(type, true),
}; };
return prototypes.ToDictionary(prototype => prototype.Type, prototype => prototype.Prototype); return prototypes.ToDictionary(prototype => prototype.Type, prototype => prototype.Prototype);
...@@ -145,11 +145,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -145,11 +145,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.A)] [DnsTypeRegistration(Type = DnsType.A)]
public sealed class DnsResourceDataIpV4 : DnsResourceDataSimple, IEquatable<DnsResourceDataIpV4> public sealed class DnsResourceDataIpV4 : DnsResourceDataSimple, IEquatable<DnsResourceDataIpV4>
{ {
public DnsResourceDataIpV4()
: this(IpV4Address.Zero)
{
}
public DnsResourceDataIpV4(IpV4Address data) public DnsResourceDataIpV4(IpV4Address data)
{ {
Data = data; Data = data;
...@@ -167,6 +162,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -167,6 +162,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataIpV4); return Equals(other as DnsResourceDataIpV4);
} }
internal DnsResourceDataIpV4()
: this(IpV4Address.Zero)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return IpV4Address.SizeOf; return IpV4Address.SizeOf;
...@@ -204,11 +204,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -204,11 +204,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.DName)] [DnsTypeRegistration(Type = DnsType.DName)]
public sealed class DnsResourceDataDomainName : DnsResourceData, IEquatable<DnsResourceDataDomainName> public sealed class DnsResourceDataDomainName : DnsResourceData, IEquatable<DnsResourceDataDomainName>
{ {
public DnsResourceDataDomainName()
: this(DnsDomainName.Root)
{
}
public DnsResourceDataDomainName(DnsDomainName data) public DnsResourceDataDomainName(DnsDomainName data)
{ {
Data = data; Data = data;
...@@ -226,6 +221,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -226,6 +221,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataDomainName); return Equals(other as DnsResourceDataDomainName);
} }
internal DnsResourceDataDomainName()
: this(DnsDomainName.Root)
{
}
internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns) internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
{ {
return Data.GetLength(compressionData, offsetInDns); return Data.GetLength(compressionData, offsetInDns);
...@@ -288,11 +288,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -288,11 +288,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = Offset.MinimumTtl + sizeof(uint); private const int ConstantPartLength = Offset.MinimumTtl + sizeof(uint);
public DnsResourceDataStartOfAuthority()
: this(DnsDomainName.Root, DnsDomainName.Root, 0, 0, 0, 0, 0)
{
}
public DnsResourceDataStartOfAuthority(DnsDomainName mainNameServer, DnsDomainName responsibleMailBox, public DnsResourceDataStartOfAuthority(DnsDomainName mainNameServer, DnsDomainName responsibleMailBox,
SerialNumber32 serial, uint refresh, uint retry, uint expire, uint minimumTtl) SerialNumber32 serial, uint refresh, uint retry, uint expire, uint minimumTtl)
{ {
...@@ -359,6 +354,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -359,6 +354,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataStartOfAuthority); return Equals(other as DnsResourceDataStartOfAuthority);
} }
internal DnsResourceDataStartOfAuthority()
: this(DnsDomainName.Root, DnsDomainName.Root, 0, 0, 0, 0, 0)
{
}
internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns) internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
{ {
return MainNameServer.GetLength(compressionData, offsetInDns) + return MainNameServer.GetLength(compressionData, offsetInDns) +
...@@ -430,11 +430,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -430,11 +430,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = Offset.BitMap; private const int ConstantPartLength = Offset.BitMap;
public DnsResourceDataWellKnownService()
: this(IpV4Address.Zero, IpV4Protocol.Ip, DataSegment.Empty)
{
}
public DnsResourceDataWellKnownService(IpV4Address address, IpV4Protocol protocol, DataSegment bitMap) public DnsResourceDataWellKnownService(IpV4Address address, IpV4Protocol protocol, DataSegment bitMap)
{ {
Address = address; Address = address;
...@@ -470,6 +465,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -470,6 +465,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataWellKnownService); return Equals(other as DnsResourceDataWellKnownService);
} }
internal DnsResourceDataWellKnownService()
: this(IpV4Address.Zero, IpV4Protocol.Ip, DataSegment.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + BitMap.Length; return ConstantPartLength + BitMap.Length;
...@@ -554,11 +554,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -554,11 +554,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.X25)] [DnsTypeRegistration(Type = DnsType.X25)]
public sealed class DnsResourceDataString : DnsResourceDataSimple, IEquatable<DnsResourceDataString> public sealed class DnsResourceDataString : DnsResourceDataSimple, IEquatable<DnsResourceDataString>
{ {
public DnsResourceDataString()
: this(DataSegment.Empty)
{
}
public DnsResourceDataString(DataSegment str) public DnsResourceDataString(DataSegment str)
{ {
String = str; String = str;
...@@ -577,6 +572,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -577,6 +572,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataString); return Equals(other as DnsResourceDataString);
} }
internal DnsResourceDataString()
: this(DataSegment.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return GetStringLength(String); return GetStringLength(String);
...@@ -611,11 +611,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -611,11 +611,6 @@ namespace PcapDotNet.Packets.Dns
{ {
private const int NumStrings = 2; private const int NumStrings = 2;
public DnsResourceDataHostInformation()
: this(DataSegment.Empty, DataSegment.Empty)
{
}
public DnsResourceDataHostInformation(DataSegment cpu, DataSegment os) public DnsResourceDataHostInformation(DataSegment cpu, DataSegment os)
: base(cpu, os) : base(cpu, os)
{ {
...@@ -625,6 +620,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -625,6 +620,11 @@ namespace PcapDotNet.Packets.Dns
public DataSegment Os { get { return Strings[1]; } } public DataSegment Os { get { return Strings[1]; } }
internal DnsResourceDataHostInformation()
: this(DataSegment.Empty, DataSegment.Empty)
{
}
internal override DnsResourceData CreateInstance(DataSegment data) internal override DnsResourceData CreateInstance(DataSegment data)
{ {
List<DataSegment> strings = ReadStrings(data, NumStrings); List<DataSegment> strings = ReadStrings(data, NumStrings);
...@@ -704,7 +704,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -704,7 +704,7 @@ namespace PcapDotNet.Packets.Dns
{ {
private const int NumDomains = 2; private const int NumDomains = 2;
public DnsResourceData2DomainNames(DnsDomainName first, DnsDomainName second) internal DnsResourceData2DomainNames(DnsDomainName first, DnsDomainName second)
: base(first, second) : base(first, second)
{ {
} }
...@@ -742,11 +742,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -742,11 +742,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.MInfo)] [DnsTypeRegistration(Type = DnsType.MInfo)]
public sealed class DnsResourceDataMailingListInfo : DnsResourceData2DomainNames public sealed class DnsResourceDataMailingListInfo : DnsResourceData2DomainNames
{ {
public DnsResourceDataMailingListInfo()
: this(DnsDomainName.Root, DnsDomainName.Root)
{
}
public DnsResourceDataMailingListInfo(DnsDomainName mailingList, DnsDomainName errorMailBox) public DnsResourceDataMailingListInfo(DnsDomainName mailingList, DnsDomainName errorMailBox)
: base(mailingList, errorMailBox) : base(mailingList, errorMailBox)
{ {
...@@ -767,6 +762,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -767,6 +762,11 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public DnsDomainName ErrorMailBox { get { return Second; } } public DnsDomainName ErrorMailBox { get { return Second; } }
internal DnsResourceDataMailingListInfo()
: this(DnsDomainName.Root, DnsDomainName.Root)
{
}
internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length) internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
{ {
DnsDomainName mailingList; DnsDomainName mailingList;
...@@ -876,11 +876,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -876,11 +876,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Mx)] [DnsTypeRegistration(Type = DnsType.Mx)]
public sealed class DnsResourceDataMailExchange : DnsResourceDataUShortDomainName public sealed class DnsResourceDataMailExchange : DnsResourceDataUShortDomainName
{ {
public DnsResourceDataMailExchange()
: this(0, DnsDomainName.Root)
{
}
public DnsResourceDataMailExchange(ushort preference, DnsDomainName mailExchangeHost) public DnsResourceDataMailExchange(ushort preference, DnsDomainName mailExchangeHost)
: base(preference, mailExchangeHost) : base(preference, mailExchangeHost)
{ {
...@@ -897,6 +892,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -897,6 +892,11 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public DnsDomainName MailExchangeHost { get { return DomainName; } } public DnsDomainName MailExchangeHost { get { return DomainName; } }
internal DnsResourceDataMailExchange()
: this(0, DnsDomainName.Root)
{
}
internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length) internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
{ {
ushort preference; ushort preference;
...@@ -918,10 +918,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -918,10 +918,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Txt)] [DnsTypeRegistration(Type = DnsType.Txt)]
public sealed class DnsResourceDataText : DnsResourceDataStrings public sealed class DnsResourceDataText : DnsResourceDataStrings
{ {
public DnsResourceDataText()
{
}
public DnsResourceDataText(ReadOnlyCollection<DataSegment> strings) public DnsResourceDataText(ReadOnlyCollection<DataSegment> strings)
: base(strings) : base(strings)
{ {
...@@ -929,6 +925,10 @@ namespace PcapDotNet.Packets.Dns ...@@ -929,6 +925,10 @@ namespace PcapDotNet.Packets.Dns
public ReadOnlyCollection<DataSegment> Text { get { return Strings; } } public ReadOnlyCollection<DataSegment> Text { get { return Strings; } }
internal DnsResourceDataText()
{
}
internal override DnsResourceData CreateInstance(DataSegment data) internal override DnsResourceData CreateInstance(DataSegment data)
{ {
List<DataSegment> strings = ReadStrings(data); List<DataSegment> strings = ReadStrings(data);
...@@ -948,11 +948,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -948,11 +948,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Rp)] [DnsTypeRegistration(Type = DnsType.Rp)]
public sealed class DnsResourceDataResponsiblePerson : DnsResourceData2DomainNames public sealed class DnsResourceDataResponsiblePerson : DnsResourceData2DomainNames
{ {
public DnsResourceDataResponsiblePerson()
: this(DnsDomainName.Root, DnsDomainName.Root)
{
}
public DnsResourceDataResponsiblePerson(DnsDomainName mailBox, DnsDomainName textDomain) public DnsResourceDataResponsiblePerson(DnsDomainName mailBox, DnsDomainName textDomain)
: base(mailBox, textDomain) : base(mailBox, textDomain)
{ {
...@@ -973,6 +968,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -973,6 +968,11 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public DnsDomainName TextDomain { get { return Second; } } public DnsDomainName TextDomain { get { return Second; } }
internal DnsResourceDataResponsiblePerson()
: this(DnsDomainName.Root, DnsDomainName.Root)
{
}
internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length) internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
{ {
DnsDomainName mailBox; DnsDomainName mailBox;
...@@ -999,11 +999,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -999,11 +999,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.AfsDb)] [DnsTypeRegistration(Type = DnsType.AfsDb)]
public sealed class DnsResourceDataAfsDb : DnsResourceDataUShortDomainName public sealed class DnsResourceDataAfsDb : DnsResourceDataUShortDomainName
{ {
public DnsResourceDataAfsDb()
: this(0, DnsDomainName.Root)
{
}
public DnsResourceDataAfsDb(ushort subType, DnsDomainName hostname) public DnsResourceDataAfsDb(ushort subType, DnsDomainName hostname)
: base(subType, hostname) : base(subType, hostname)
{ {
...@@ -1013,6 +1008,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1013,6 +1008,11 @@ namespace PcapDotNet.Packets.Dns
public DnsDomainName Hostname { get { return DomainName; } } public DnsDomainName Hostname { get { return DomainName; } }
internal DnsResourceDataAfsDb()
: this(0, DnsDomainName.Root)
{
}
internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length) internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
{ {
ushort subType; ushort subType;
...@@ -1039,11 +1039,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1039,11 +1039,6 @@ namespace PcapDotNet.Packets.Dns
private const int MinNumStrings = 1; private const int MinNumStrings = 1;
private const int MaxNumStrings = 2; private const int MaxNumStrings = 2;
public DnsResourceDataIsdn()
: this(DataSegment.Empty)
{
}
public DnsResourceDataIsdn(DataSegment isdnAddress) public DnsResourceDataIsdn(DataSegment isdnAddress)
: base(isdnAddress) : base(isdnAddress)
{ {
...@@ -1067,6 +1062,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1067,6 +1062,11 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public DataSegment SubAddress { get { return Strings.Count == MaxNumStrings ? Strings[1] : null; } } public DataSegment SubAddress { get { return Strings.Count == MaxNumStrings ? Strings[1] : null; } }
internal DnsResourceDataIsdn()
: this(DataSegment.Empty)
{
}
internal override DnsResourceData CreateInstance(DataSegment data) internal override DnsResourceData CreateInstance(DataSegment data)
{ {
List<DataSegment> strings = ReadStrings(data, MaxNumStrings); List<DataSegment> strings = ReadStrings(data, MaxNumStrings);
...@@ -1095,11 +1095,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1095,11 +1095,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Rt)] [DnsTypeRegistration(Type = DnsType.Rt)]
public sealed class DnsResourceDataRouteThrough : DnsResourceDataUShortDomainName public sealed class DnsResourceDataRouteThrough : DnsResourceDataUShortDomainName
{ {
public DnsResourceDataRouteThrough()
: this(0, DnsDomainName.Root)
{
}
public DnsResourceDataRouteThrough(ushort preference, DnsDomainName intermediateHost) public DnsResourceDataRouteThrough(ushort preference, DnsDomainName intermediateHost)
: base(preference, intermediateHost) : base(preference, intermediateHost)
{ {
...@@ -1117,6 +1112,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1117,6 +1112,11 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public DnsDomainName IntermediateHost { get { return DomainName; } } public DnsDomainName IntermediateHost { get { return DomainName; } }
internal DnsResourceDataRouteThrough()
: this(0, DnsDomainName.Root)
{
}
internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length) internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
{ {
ushort preference; ushort preference;
...@@ -1164,11 +1164,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1164,11 +1164,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = MinAreaAddressLength + OffsetAfterArea.Selector + sizeof(byte); private const int ConstantPartLength = MinAreaAddressLength + OffsetAfterArea.Selector + sizeof(byte);
public DnsResourceDataNetworkServiceAccessPoint()
: this(new DataSegment(new byte[MinAreaAddressLength]), 0, 0)
{
}
public DnsResourceDataNetworkServiceAccessPoint(DataSegment areaAddress, UInt48 systemIdentifier, byte selector) public DnsResourceDataNetworkServiceAccessPoint(DataSegment areaAddress, UInt48 systemIdentifier, byte selector)
{ {
if (areaAddress.Length < MinAreaAddressLength) if (areaAddress.Length < MinAreaAddressLength)
...@@ -1214,6 +1209,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1214,6 +1209,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataNetworkServiceAccessPoint); return Equals(other as DnsResourceDataNetworkServiceAccessPoint);
} }
internal DnsResourceDataNetworkServiceAccessPoint()
: this(new DataSegment(new byte[MinAreaAddressLength]), 0, 0)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + AreaAddress.Length - MinAreaAddressLength; return ConstantPartLength + AreaAddress.Length - MinAreaAddressLength;
...@@ -1376,11 +1376,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1376,11 +1376,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = Offset.SignersName; private const int ConstantPartLength = Offset.SignersName;
public DnsResourceDataSig()
: this(DnsType.A, DnsAlgorithm.None, 0, 0, 0, 0, 0, DnsDomainName.Root, DataSegment.Empty)
{
}
public DnsResourceDataSig(DnsType typeCovered, DnsAlgorithm algorithm, byte labels, uint originalTtl, SerialNumber32 signatureExpiration, public DnsResourceDataSig(DnsType typeCovered, DnsAlgorithm algorithm, byte labels, uint originalTtl, SerialNumber32 signatureExpiration,
SerialNumber32 signatureInception, ushort keyTag, DnsDomainName signersName, DataSegment signature) SerialNumber32 signatureInception, ushort keyTag, DnsDomainName signersName, DataSegment signature)
{ {
...@@ -1495,6 +1490,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1495,6 +1490,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataSig); return Equals(other as DnsResourceDataSig);
} }
internal DnsResourceDataSig()
: this(DnsType.A, DnsAlgorithm.None, 0, 0, 0, 0, 0, DnsDomainName.Root, DataSegment.Empty)
{
}
internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns) internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
{ {
return ConstantPartLength + SignersName.GetLength(compressionData, offsetInDns) + Signature.Length; return ConstantPartLength + SignersName.GetLength(compressionData, offsetInDns) + Signature.Length;
...@@ -1699,11 +1699,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1699,11 +1699,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = Offset.FlagsExtension; private const int ConstantPartLength = Offset.FlagsExtension;
public DnsResourceDataKey()
: this(false, false, DnsKeyNameType.ZoneKey, DnsKeySignatory.Zone, DnsKeyProtocol.All, DnsAlgorithm.None, null, DataSegment.Empty)
{
}
public DnsResourceDataKey(bool authenticationProhibited, bool confidentialityProhibited, DnsKeyNameType nameType, DnsKeySignatory signatory, public DnsResourceDataKey(bool authenticationProhibited, bool confidentialityProhibited, DnsKeyNameType nameType, DnsKeySignatory signatory,
DnsKeyProtocol protocol, DnsAlgorithm algorithm, ushort? flagsExtension, DataSegment publicKey) DnsKeyProtocol protocol, DnsAlgorithm algorithm, ushort? flagsExtension, DataSegment publicKey)
{ {
...@@ -1780,6 +1775,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1780,6 +1775,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataKey); return Equals(other as DnsResourceDataKey);
} }
internal DnsResourceDataKey()
: this(false, false, DnsKeyNameType.ZoneKey, DnsKeySignatory.Zone, DnsKeyProtocol.All, DnsAlgorithm.None, null, DataSegment.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + (FlagsExtension != null ? sizeof(ushort) : 0) + PublicKey.Length; return ConstantPartLength + (FlagsExtension != null ? sizeof(ushort) : 0) + PublicKey.Length;
...@@ -1857,11 +1857,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1857,11 +1857,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = Offset.Map822; private const int ConstantPartLength = Offset.Map822;
public DnsResourceDataX400Pointer()
: this(0, DnsDomainName.Root, DnsDomainName.Root)
{
}
public DnsResourceDataX400Pointer(ushort preference, DnsDomainName map822, DnsDomainName mapX400) public DnsResourceDataX400Pointer(ushort preference, DnsDomainName map822, DnsDomainName mapX400)
{ {
Preference = preference; Preference = preference;
...@@ -1899,6 +1894,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -1899,6 +1894,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataX400Pointer); return Equals(other as DnsResourceDataX400Pointer);
} }
internal DnsResourceDataX400Pointer()
: this(0, DnsDomainName.Root, DnsDomainName.Root)
{
}
internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns) internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
{ {
return ConstantPartLength + Map822.GetLength(compressionData, offsetInDns) + MapX400.GetLength(compressionData, offsetInDns); return ConstantPartLength + Map822.GetLength(compressionData, offsetInDns) + MapX400.GetLength(compressionData, offsetInDns);
...@@ -1957,11 +1957,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -1957,11 +1957,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.GPos)] [DnsTypeRegistration(Type = DnsType.GPos)]
public sealed class DnsResourceDataGeographicalPosition : DnsResourceDataSimple, IEquatable<DnsResourceDataGeographicalPosition> public sealed class DnsResourceDataGeographicalPosition : DnsResourceDataSimple, IEquatable<DnsResourceDataGeographicalPosition>
{ {
public DnsResourceDataGeographicalPosition()
: this(string.Empty, string.Empty, string.Empty)
{
}
public DnsResourceDataGeographicalPosition(string longitude, string latitude, string altitude) public DnsResourceDataGeographicalPosition(string longitude, string latitude, string altitude)
{ {
Longitude = longitude; Longitude = longitude;
...@@ -2004,6 +1999,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2004,6 +1999,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataGeographicalPosition); return Equals(other as DnsResourceDataGeographicalPosition);
} }
internal DnsResourceDataGeographicalPosition()
: this(string.Empty, string.Empty, string.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return Encoding.ASCII.GetByteCount(Longitude) + 1 + return Encoding.ASCII.GetByteCount(Longitude) + 1 +
...@@ -2061,11 +2061,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2061,11 +2061,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Aaaa)] [DnsTypeRegistration(Type = DnsType.Aaaa)]
public sealed class DnsResourceDataIpV6 : DnsResourceDataSimple, IEquatable<DnsResourceDataIpV6> public sealed class DnsResourceDataIpV6 : DnsResourceDataSimple, IEquatable<DnsResourceDataIpV6>
{ {
public DnsResourceDataIpV6()
: this(IpV6Address.Zero)
{
}
public DnsResourceDataIpV6(IpV6Address data) public DnsResourceDataIpV6(IpV6Address data)
{ {
Data = data; Data = data;
...@@ -2083,6 +2078,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2083,6 +2078,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataIpV6); return Equals(other as DnsResourceDataIpV6);
} }
internal DnsResourceDataIpV6()
: this(IpV6Address.Zero)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return IpV6Address.SizeOf; return IpV6Address.SizeOf;
...@@ -2134,11 +2134,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2134,11 +2134,6 @@ namespace PcapDotNet.Packets.Dns
public const int Length = Offset.Altitude + sizeof(uint); public const int Length = Offset.Altitude + sizeof(uint);
public DnsResourceDataLocationInformation()
: this(0, 0, 0, 0, 0, 0, 0)
{
}
public DnsResourceDataLocationInformation(byte version, ulong size, ulong horizontalPrecision, ulong verticalPrecision, uint latitude, uint longitude, public DnsResourceDataLocationInformation(byte version, ulong size, ulong horizontalPrecision, ulong verticalPrecision, uint latitude, uint longitude,
uint altitude) uint altitude)
{ {
...@@ -2236,6 +2231,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2236,6 +2231,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataLocationInformation); return Equals(other as DnsResourceDataLocationInformation);
} }
internal DnsResourceDataLocationInformation()
: this(0, 0, 0, 0, 0, 0, 0)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return Length; return Length;
...@@ -2327,11 +2327,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2327,11 +2327,6 @@ namespace PcapDotNet.Packets.Dns
public const int MaxTypeBitMapLength = 16; public const int MaxTypeBitMapLength = 16;
public const DnsType MaxTypeBitMapDnsType = (DnsType)(8 * MaxTypeBitMapLength); public const DnsType MaxTypeBitMapDnsType = (DnsType)(8 * MaxTypeBitMapLength);
public DnsResourceDataNextDomain()
: this(DnsDomainName.Root, DataSegment.Empty)
{
}
public DnsResourceDataNextDomain(DnsDomainName nextDomainName, DataSegment typeBitMap) public DnsResourceDataNextDomain(DnsDomainName nextDomainName, DataSegment typeBitMap)
{ {
if (typeBitMap.Length > MaxTypeBitMapLength) if (typeBitMap.Length > MaxTypeBitMapLength)
...@@ -2407,6 +2402,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2407,6 +2402,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataNextDomain); return Equals(other as DnsResourceDataNextDomain);
} }
internal DnsResourceDataNextDomain()
: this(DnsDomainName.Root, DataSegment.Empty)
{
}
internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns) internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
{ {
return NextDomainName.GetLength(compressionData, offsetInDns) + TypeBitMap.Length; return NextDomainName.GetLength(compressionData, offsetInDns) + TypeBitMap.Length;
...@@ -2475,11 +2475,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2475,11 +2475,6 @@ namespace PcapDotNet.Packets.Dns
public const int ConstantPartLength = Offset.Target; public const int ConstantPartLength = Offset.Target;
public DnsResourceDataServerSelection()
: this(0, 0, 0, DnsDomainName.Root)
{
}
public DnsResourceDataServerSelection(ushort priority, ushort weight, ushort port, DnsDomainName target) public DnsResourceDataServerSelection(ushort priority, ushort weight, ushort port, DnsDomainName target)
{ {
Priority = priority; Priority = priority;
...@@ -2545,6 +2540,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2545,6 +2540,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataServerSelection); return Equals(other as DnsResourceDataServerSelection);
} }
internal DnsResourceDataServerSelection()
: this(0, 0, 0, DnsDomainName.Root)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + Target.NonCompressedLength; return ConstantPartLength + Target.NonCompressedLength;
...@@ -2617,11 +2617,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2617,11 +2617,6 @@ namespace PcapDotNet.Packets.Dns
public const int ConstantPartLength = Offset.Address; public const int ConstantPartLength = Offset.Address;
public DnsResourceDataAtmAddress()
: this(DnsAtmAddressFormat.AtmEndSystemAddress, DataSegment.Empty)
{
}
public DnsResourceDataAtmAddress(DnsAtmAddressFormat format, DataSegment address) public DnsResourceDataAtmAddress(DnsAtmAddressFormat format, DataSegment address)
{ {
Format = format; Format = format;
...@@ -2655,6 +2650,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2655,6 +2650,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataAtmAddress); return Equals(other as DnsResourceDataAtmAddress);
} }
internal DnsResourceDataAtmAddress()
: this(DnsAtmAddressFormat.AtmEndSystemAddress, DataSegment.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + Address.Length; return ConstantPartLength + Address.Length;
...@@ -2710,11 +2710,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2710,11 +2710,6 @@ namespace PcapDotNet.Packets.Dns
private const int ConstantPartLength = Offset.Flags; private const int ConstantPartLength = Offset.Flags;
public DnsResourceDataNamingAuthorityPointer()
: this(0, 0, DataSegment.Empty, DataSegment.Empty, DataSegment.Empty, DnsDomainName.Root)
{
}
public DnsResourceDataNamingAuthorityPointer(ushort order, ushort preference, DataSegment flags, DataSegment services, DataSegment regexp, DnsDomainName replacement) public DnsResourceDataNamingAuthorityPointer(ushort order, ushort preference, DataSegment flags, DataSegment services, DataSegment regexp, DnsDomainName replacement)
{ {
if (!IsLegalFlags(flags)) if (!IsLegalFlags(flags))
...@@ -2811,6 +2806,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2811,6 +2806,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataNamingAuthorityPointer); return Equals(other as DnsResourceDataNamingAuthorityPointer);
} }
internal DnsResourceDataNamingAuthorityPointer()
: this(0, 0, DataSegment.Empty, DataSegment.Empty, DataSegment.Empty, DnsDomainName.Root)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + GetStringLength(Flags) + GetStringLength(Services) + GetStringLength(Regexp) + Replacement.NonCompressedLength; return ConstantPartLength + GetStringLength(Flags) + GetStringLength(Services) + GetStringLength(Regexp) + Replacement.NonCompressedLength;
...@@ -2887,11 +2887,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -2887,11 +2887,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Kx)] [DnsTypeRegistration(Type = DnsType.Kx)]
public sealed class DnsResourceDataKeyExchanger : DnsResourceDataUShortDomainName public sealed class DnsResourceDataKeyExchanger : DnsResourceDataUShortDomainName
{ {
public DnsResourceDataKeyExchanger()
: this(0, DnsDomainName.Root)
{
}
public DnsResourceDataKeyExchanger(ushort preference, DnsDomainName keyExchanger) public DnsResourceDataKeyExchanger(ushort preference, DnsDomainName keyExchanger)
: base(preference, keyExchanger) : base(preference, keyExchanger)
{ {
...@@ -2908,6 +2903,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -2908,6 +2903,11 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public DnsDomainName KeyExchangeHost { get { return DomainName; } } public DnsDomainName KeyExchangeHost { get { return DomainName; } }
internal DnsResourceDataKeyExchanger()
: this(0, DnsDomainName.Root)
{
}
internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length) internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
{ {
ushort preference; ushort preference;
...@@ -3034,11 +3034,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -3034,11 +3034,6 @@ namespace PcapDotNet.Packets.Dns
public const int ConstantPartLength = Offset.Certificate; public const int ConstantPartLength = Offset.Certificate;
public DnsResourceDataCertificate()
: this(DnsCertificateType.Pkix, 0, DnsAlgorithm.None, DataSegment.Empty)
{
}
public DnsResourceDataCertificate(DnsCertificateType certificateType, ushort keyTag, DnsAlgorithm algorithm, DataSegment certificate) public DnsResourceDataCertificate(DnsCertificateType certificateType, ushort keyTag, DnsAlgorithm algorithm, DataSegment certificate)
{ {
CertificateType = certificateType; CertificateType = certificateType;
...@@ -3089,6 +3084,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -3089,6 +3084,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataCertificate); return Equals(other as DnsResourceDataCertificate);
} }
internal DnsResourceDataCertificate()
: this(DnsCertificateType.Pkix, 0, DnsAlgorithm.None, DataSegment.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + Certificate.Length; return ConstantPartLength + Certificate.Length;
...@@ -3138,11 +3138,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -3138,11 +3138,6 @@ namespace PcapDotNet.Packets.Dns
public const int ConstantPartLength = Offset.AddressSuffix; public const int ConstantPartLength = Offset.AddressSuffix;
public DnsResourceDataA6()
: this(0, IpV6Address.Zero, DnsDomainName.Root)
{
}
public DnsResourceDataA6(byte prefixLength, IpV6Address addressSuffix, DnsDomainName prefixName) public DnsResourceDataA6(byte prefixLength, IpV6Address addressSuffix, DnsDomainName prefixName)
{ {
PrefixLength = prefixLength; PrefixLength = prefixLength;
...@@ -3186,6 +3181,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -3186,6 +3181,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataA6); return Equals(other as DnsResourceDataA6);
} }
internal DnsResourceDataA6()
: this(0, IpV6Address.Zero, DnsDomainName.Root)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + AddressSuffixLength + PrefixName.NonCompressedLength; return ConstantPartLength + AddressSuffixLength + PrefixName.NonCompressedLength;
...@@ -3598,11 +3598,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -3598,11 +3598,6 @@ namespace PcapDotNet.Packets.Dns
public const int ConstantPartLength = Offset.Data; public const int ConstantPartLength = Offset.Data;
public DnsResourceDataSink()
: this(DnsSinkCodingSubcoding.Asn1SnmpBer, DataSegment.Empty)
{
}
public DnsResourceDataSink(DnsSinkCodingSubcoding codingSubcoding, DataSegment data) public DnsResourceDataSink(DnsSinkCodingSubcoding codingSubcoding, DataSegment data)
: this((DnsSinkCoding)((ushort)codingSubcoding >> 8), (byte)((ushort)codingSubcoding & 0x00FF), data) : this((DnsSinkCoding)((ushort)codingSubcoding >> 8), (byte)((ushort)codingSubcoding & 0x00FF), data)
{ {
...@@ -3656,6 +3651,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -3656,6 +3651,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataSink); return Equals(other as DnsResourceDataSink);
} }
internal DnsResourceDataSink()
: this(DnsSinkCodingSubcoding.Asn1SnmpBer, DataSegment.Empty)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + Data.Length; return ConstantPartLength + Data.Length;
...@@ -4045,11 +4045,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -4045,11 +4045,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Opt)] [DnsTypeRegistration(Type = DnsType.Opt)]
public sealed class DnsResourceDataOptions : DnsResourceDataSimple, IEquatable<DnsResourceDataOptions> public sealed class DnsResourceDataOptions : DnsResourceDataSimple, IEquatable<DnsResourceDataOptions>
{ {
public DnsResourceDataOptions()
: this(DnsOptions.None)
{
}
public DnsResourceDataOptions(DnsOptions options) public DnsResourceDataOptions(DnsOptions options)
{ {
Options = options; Options = options;
...@@ -4068,6 +4063,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -4068,6 +4063,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataOptions); return Equals(other as DnsResourceDataOptions);
} }
internal DnsResourceDataOptions()
: this(DnsOptions.None)
{
}
internal override int GetLength() internal override int GetLength()
{ {
return Options.NumBytes; return Options.NumBytes;
...@@ -4403,11 +4403,6 @@ namespace PcapDotNet.Packets.Dns ...@@ -4403,11 +4403,6 @@ namespace PcapDotNet.Packets.Dns
[DnsTypeRegistration(Type = DnsType.Apl)] [DnsTypeRegistration(Type = DnsType.Apl)]
public sealed class DnsResourceDataAddressPrefixList: DnsResourceDataSimple, IEquatable<DnsResourceDataAddressPrefixList> public sealed class DnsResourceDataAddressPrefixList: DnsResourceDataSimple, IEquatable<DnsResourceDataAddressPrefixList>
{ {
public DnsResourceDataAddressPrefixList()
: this(new DnsAddressPrefix[0])
{
}
public DnsResourceDataAddressPrefixList(IList<DnsAddressPrefix> items) public DnsResourceDataAddressPrefixList(IList<DnsAddressPrefix> items)
{ {
Items = items.AsReadOnly(); Items = items.AsReadOnly();
...@@ -4433,6 +4428,11 @@ namespace PcapDotNet.Packets.Dns ...@@ -4433,6 +4428,11 @@ namespace PcapDotNet.Packets.Dns
return Equals(other as DnsResourceDataAddressPrefixList); return Equals(other as DnsResourceDataAddressPrefixList);
} }
internal DnsResourceDataAddressPrefixList()
: this(new DnsAddressPrefix[0])
{
}
internal override int GetLength() internal override int GetLength()
{ {
return Length; return Length;
...@@ -4459,4 +4459,128 @@ namespace PcapDotNet.Packets.Dns ...@@ -4459,4 +4459,128 @@ namespace PcapDotNet.Packets.Dns
return new DnsResourceDataAddressPrefixList(items); return new DnsResourceDataAddressPrefixList(items);
} }
} }
public enum DnsDigestType : byte
{
/// <summary>
/// RFC 3658.
/// SHA-1.
/// </summary>
Sha1 = 1,
/// <summary>
/// RFC 4509.
/// SHA-256.
/// </summary>
Sha256 = 2,
/// <summary>
/// RFC 5933.
/// GOST R 34.11-94.
/// </summary>
GostR341194 = 3,
}
/// <summary>
/// RFC 3658.
/// <pre>
/// 0 Or more of:
/// +-----+---------+-----------+-------------+
/// | bit | 0-15 | 16-23 | 24-31 |
/// +-----+---------+-----------+-------------+
/// | 0 | key tag | algorithm | Digest type |
/// +-----+---------+-----------+-------------+
/// | 32 | digest |
/// | ... | |
/// +-----+-----------------------------------+
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.Ds)]
public sealed class DnsResourceDataDelegationSigner : DnsResourceDataSimple, IEquatable<DnsResourceDataDelegationSigner>
{
public static class Offset
{
public const int KeyTag = 0;
public const int Algorithm = KeyTag + sizeof(ushort);
public const int DigestType = Algorithm + sizeof(byte);
public const int Digest = DigestType + sizeof(byte);
}
public const int ConstPartLength = Offset.Digest;
public DnsResourceDataDelegationSigner(ushort keyTag, DnsAlgorithm algorithm, DnsDigestType digestType, DataSegment digest)
{
KeyTag = keyTag;
Algorithm = algorithm;
DigestType = digestType;
Digest = digest;
}
/// <summary>
/// Lists the key tag of the DNSKEY RR referred to by the DS record.
/// The Key Tag used by the DS RR is identical to the Key Tag used by RRSIG RRs.
/// Calculated as specified in RFC 2535.
/// </summary>
public ushort KeyTag { get; private set; }
/// <summary>
/// Algorithm must be allowed to sign DNS data.
/// </summary>
public DnsAlgorithm Algorithm { get; private set; }
/// <summary>
/// An identifier for the digest algorithm used.
/// </summary>
public DnsDigestType DigestType { get; private set; }
/// <summary>
/// Calculated over the canonical name of the delegated domain name followed by the whole RDATA of the KEY record (all four fields).
/// digest = hash(canonical FQDN on KEY RR | KEY_RR_rdata)
/// KEY_RR_rdata = Flags | Protocol | Algorithm | Public Key
/// </summary>
public DataSegment Digest { get; private set; }
public bool Equals(DnsResourceDataDelegationSigner other)
{
return other != null &&
KeyTag.Equals(other.KeyTag) &&
Algorithm.Equals(other.Algorithm) &&
DigestType.Equals(other.DigestType) &&
Digest.Equals(other.Digest);
}
public override bool Equals(DnsResourceData other)
{
return Equals(other as DnsResourceDataDelegationSigner);
}
internal DnsResourceDataDelegationSigner()
: this(0, DnsAlgorithm.None, DnsDigestType.Sha1, DataSegment.Empty)
{
}
internal override int GetLength()
{
return ConstPartLength + Digest.Length;
}
internal override void WriteDataSimple(byte[] buffer, int offset)
{
buffer.Write(offset + Offset.KeyTag, KeyTag, Endianity.Big);
buffer.Write(offset + Offset.Algorithm, (byte)Algorithm);
buffer.Write(offset + Offset.DigestType, (byte)DigestType);
Digest.Write(buffer, offset + Offset.Digest);
}
internal override DnsResourceData CreateInstance(DataSegment data)
{
ushort keyTag = data.ReadUShort(Offset.KeyTag, Endianity.Big);
DnsAlgorithm algorithm = (DnsAlgorithm)data[Offset.Algorithm];
DnsDigestType digestType = (DnsDigestType)data[Offset.DigestType];
DataSegment digest = data.SubSegment(Offset.Digest, data.Length - ConstPartLength);
return new DnsResourceDataDelegationSigner(keyTag, algorithm, digestType, digest);
}
}
} }
...@@ -306,6 +306,7 @@ ...@@ -306,6 +306,7 @@
/// <summary> /// <summary>
/// RFCs 3658, 4034. /// RFCs 3658, 4034.
/// Delegation Signer. /// Delegation Signer.
/// Payload type: DnsResourceDataDelegationSigner.
/// </summary> /// </summary>
Ds = 43, Ds = 43,
......
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