Commit 16498b62 authored by Brickner_cp's avatar Brickner_cp

DNS

Code coverage 93.95%
parent a31b8194
...@@ -47,7 +47,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -47,7 +47,7 @@ namespace PcapDotNet.Packets.Dns
Data.Equals(other.Data); Data.Equals(other.Data);
} }
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return Equals(obj as DnsDataResourceRecord); return Equals(obj as DnsDataResourceRecord);
} }
......
...@@ -291,6 +291,16 @@ namespace PcapDotNet.Packets.Dns ...@@ -291,6 +291,16 @@ namespace PcapDotNet.Packets.Dns
} }
} }
public IEnumerable<DnsResourceRecord> ResourceRecords
{
get { return Queries.Cast<DnsResourceRecord>().Concat(DataResourceRecords); }
}
public IEnumerable<DnsDataResourceRecord> DataResourceRecords
{
get { return Answers.Concat(Authorities).Concat(Additionals); }
}
public DnsOptResourceRecord OptionsRecord public DnsOptResourceRecord OptionsRecord
{ {
get get
......
...@@ -43,7 +43,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -43,7 +43,7 @@ namespace PcapDotNet.Packets.Dns
{ {
if (hostIdentityTag.Length > byte.MaxValue) if (hostIdentityTag.Length > byte.MaxValue)
throw new ArgumentOutOfRangeException("hostIdentityTag", hostIdentityTag.Length, string.Format("Cannot be bigger than {0}.", byte.MaxValue)); throw new ArgumentOutOfRangeException("hostIdentityTag", hostIdentityTag.Length, string.Format("Cannot be bigger than {0}.", byte.MaxValue));
if (hostIdentityTag.Length > ushort.MaxValue) if (publicKey.Length > ushort.MaxValue)
throw new ArgumentOutOfRangeException("publicKey", publicKey.Length, string.Format("Cannot be bigger than {0}.", ushort.MaxValue)); throw new ArgumentOutOfRangeException("publicKey", publicKey.Length, string.Format("Cannot be bigger than {0}.", ushort.MaxValue));
HostIdentityTag = hostIdentityTag; HostIdentityTag = hostIdentityTag;
PublicKeyAlgorithm = publicKeyAlgorithm; PublicKeyAlgorithm = publicKeyAlgorithm;
......
...@@ -127,7 +127,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -127,7 +127,7 @@ namespace PcapDotNet.Packets.Dns
Other.Equals(other.Other); Other.Equals(other.Other);
} }
public override bool Equals(DnsResourceData other) public override bool Equals(DnsResourceData other)
{ {
return Equals(other as DnsResourceDataTransactionKey); return Equals(other as DnsResourceDataTransactionKey);
} }
......
...@@ -30,7 +30,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -30,7 +30,7 @@ namespace PcapDotNet.Packets.Dns
TypesExist.SequenceEqual(other.TypesExist); TypesExist.SequenceEqual(other.TypesExist);
} }
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return Equals(obj as DnsTypeBitmaps); return Equals(obj as DnsTypeBitmaps);
} }
......
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