/// <summary> /// Two DnsResourceDataHostIdentityProtocol are equal iff their host identity tag, public key algorithm, public key and rendezvous servers fields /// are equal. /// </summary> public bool Equals(DnsResourceDataHostIdentityProtocol other) { return(other != null && HostIdentityTag.Equals(other.HostIdentityTag) && PublicKeyAlgorithm.Equals(other.PublicKeyAlgorithm) && PublicKey.Equals(other.PublicKey) && RendezvousServers.SequenceEqual(RendezvousServers)); }
internal override int WriteData(byte[] buffer, int offset) { buffer.Write(offset + Offset.HostIdentityTagLength, (byte)HostIdentityTag.Length); buffer.Write(offset + Offset.PublicKeyAlgorithm, (byte)PublicKeyAlgorithm); buffer.Write(offset + Offset.PublicKeyLength, (ushort)PublicKey.Length, Endianity.Big); HostIdentityTag.Write(buffer, offset + Offset.HostIdentityTag); int numBytesWritten = ConstantPartLength + HostIdentityTag.Length; PublicKey.Write(buffer, offset + numBytesWritten); numBytesWritten += PublicKey.Length; foreach (DnsDomainName rendezvousServer in RendezvousServers) { rendezvousServer.WriteUncompressed(buffer, offset + numBytesWritten); numBytesWritten += rendezvousServer.NonCompressedLength; } return(numBytesWritten); }