Exemple #1
0
        internal override bool EqualsData(DnsOption other)
        {
            DnsOptionLongLivedQuery castedOther = (DnsOptionLongLivedQuery)other;

            return(Version.Equals(castedOther.Version) &&
                   OpCode.Equals(castedOther.OpCode) &&
                   ErrorCode.Equals(castedOther.ErrorCode) &&
                   Id.Equals(castedOther.Id) &&
                   LeaseLife.Equals(castedOther.LeaseLife));
        }
        internal override bool EqualsData(DnsOption other)
        {
            DnsOptionLongLivedQuery optionLongLivedQuery = (DnsOptionLongLivedQuery)other;

            if (this.Version.Equals(optionLongLivedQuery.Version) && this.OpCode.Equals((object)optionLongLivedQuery.OpCode) && this.ErrorCode.Equals((object)optionLongLivedQuery.ErrorCode) && this.Id.Equals(optionLongLivedQuery.Id))
            {
                return(this.LeaseLife.Equals(optionLongLivedQuery.LeaseLife));
            }
            return(false);
        }
Exemple #3
0
        internal static DnsOption CreateInstance(DnsOptionCode code, DataSegment data)
        {
            switch (code)
            {
            case DnsOptionCode.LongLivedQuery:
                return((DnsOption)DnsOptionLongLivedQuery.Read(data));

            case DnsOptionCode.UpdateLease:
                return((DnsOption)DnsOptionUpdateLease.Read(data));

            default:
                return((DnsOption) new DnsOptionAnything(code, data));
            }
        }
        internal static DnsOption CreateInstance(DnsOptionCode code, DataSegment data)
        {
            switch (code)
            {
            case DnsOptionCode.LongLivedQuery:
                return(DnsOptionLongLivedQuery.Read(data));

            case DnsOptionCode.UpdateLease:
                return(DnsOptionUpdateLease.Read(data));

            case DnsOptionCode.ClientSubnet:
                return(DnsOptionClientSubnet.Read(data));

            case DnsOptionCode.NameServerIdentifier:
            default:
                return(new DnsOptionAnything(code, data));
            }
        }