示例#1
0
        internal override DnsResourceData CreateInstance(DataSegment data)
        {
            DnsSecNSec3HashAlgorithm hashAlgorithm;
            DnsSecNSec3Flags         flags;
            ushort      iterations;
            DataSegment salt;

            if (!DnsResourceDataNextDomainSecure3Base.TryReadParameters(data, out hashAlgorithm, out flags, out iterations, out salt))
            {
                return((DnsResourceData)null);
            }
            int parametersLength = DnsResourceDataNextDomainSecure3Base.GetParametersLength(salt.Length);

            if (data.Length - parametersLength < 1)
            {
                return((DnsResourceData)null);
            }
            int offset = parametersLength + 1;
            int length = (int)data[parametersLength];

            if (data.Length - offset < length)
            {
                return((DnsResourceData)null);
            }
            DataSegment    nextHashedOwnerName = data.Subsegment(offset, length);
            int            num      = offset + length;
            DnsTypeBitmaps instance = DnsTypeBitmaps.CreateInstance(data.Buffer, data.StartOffset + num, data.Length - num);

            if (instance == null)
            {
                return((DnsResourceData)null);
            }
            return((DnsResourceData) new DnsResourceDataNextDomainSecure3(hashAlgorithm, flags, iterations, salt, nextHashedOwnerName, instance));
        }
 internal bool EqualsParameters(DnsResourceDataNextDomainSecure3Base other)
 {
     if (other != null && this.HashAlgorithm.Equals((object)other.HashAlgorithm) && this.Flags.Equals((object)other.Flags) && this.Iterations.Equals(other.Iterations))
     {
         return(this.Salt.Equals(other.Salt));
     }
     return(false);
 }
 internal bool EqualsParameters(DnsResourceDataNextDomainSecure3Base other)
 {
     return(other != null &&
            HashAlgorithm.Equals(other.HashAlgorithm) &&
            Flags.Equals(other.Flags) &&
            Iterations.Equals(other.Iterations) &&
            Salt.Equals(other.Salt));
 }
 internal bool EqualsParameters(DnsResourceDataNextDomainSecure3Base other)
 {
     return other != null &&
            HashAlgorithm.Equals(other.HashAlgorithm) &&
            Flags.Equals(other.Flags) &&
            Iterations.Equals(other.Iterations) &&
            Salt.Equals(other.Salt);
 }
        internal override DnsResourceData CreateInstance(DataSegment data)
        {
            DnsSecNSec3HashAlgorithm hashAlgorithm;
            DnsSecNSec3Flags         flags;
            ushort      iterations;
            DataSegment salt;

            if (!DnsResourceDataNextDomainSecure3Base.TryReadParameters(data, out hashAlgorithm, out flags, out iterations, out salt))
            {
                return((DnsResourceData)null);
            }
            if (data.Length != DnsResourceDataNextDomainSecure3Base.GetParametersLength(salt.Length))
            {
                return((DnsResourceData)null);
            }
            return((DnsResourceData) new DnsResourceDataNextDomainSecure3Parameters(hashAlgorithm, flags, iterations, salt));
        }