Exemple #1
0
        internal static DnsResourceData Read(DnsDatagram dns, DnsType type, int offsetInDns, int length)
        {
            DnsResourceData prototype = DnsResourceData.TryGetPrototype(type);

            if (prototype != null)
            {
                return(prototype.CreateInstance(dns, offsetInDns, length));
            }
            return((DnsResourceData) new DnsResourceDataAnything(dns.Subsegment(offsetInDns, length)));
        }
Exemple #2
0
        public static Type GetDnsResourceDataType(DnsType dnsType)
        {
            DnsResourceData prototype = DnsResourceData.TryGetPrototype(dnsType);

            if (prototype == null)
            {
                return((Type)null);
            }
            return(prototype.GetType());
        }