Esempio n. 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));
        }
Esempio n. 2
0
        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));
            }
        }