public static LogMessage ResolutionSucceded( DnsDomain domain, DnsClient.DNS.QTYPE question, IEnumerable <DnsClient.DNS.RR> requestedAnswerRecords) { // must be true: // requestedAnswerRecords.Any() int count = requestedAnswerRecords.Count(); if (count == 1) { DnsClient.DNS.RR rr = requestedAnswerRecords.First(); DnsClient.DNS.Records.Address address; DnsClient.DNS.Records.PTR pointer; if (!Object.ReferenceEquals(null, (address = rr as DnsClient.DNS.Records.Address))) { // "The name '{0}' was successfully resolved to {1}." return(RESPONSE.INFO.SingleAddressResolutionSucceeded(domain, address.ADDRESS)); } if (!Object.ReferenceEquals(null, (pointer = rr as DnsClient.DNS.Records.PTR))) { // "Pointer resolution succeeded with the name '{0}'." return(RESPONSE.INFO.SinglePointerResolutionSucceeded(pointer.PTRDNAME)); } // "A Resouce Records of type {0} was found." return(RESPONSE.INFO.RecordResolutionSucceeded(question)); } // "{1} Resouce Records of type {0} were found." return(RESPONSE.INFO.RecordResolutionSucceeded(question, count)); }
// sub iterators: Address / CName protected ResolutionIterator(DomainResolver resolver, DnsClient.DNS.QTYPE question, Caching.AddressCache addressCache, int nestingLevel) : base(resolver, question, addressCache) { this.NestingLevel = nestingLevel; }
internal ResolutionIterator(DomainResolver resolver, DnsClient.DNS.QTYPE question, Caching.AddressCache addressCache) : base(resolver, question, addressCache) { NestingLevel = 0; }
/// <summary> /// Create a new request iterator for resolving the specified question. /// </summary> /// <param name="question">The question to resolve.</param> /// <returns></returns> public Iterators.ResolutionIterator GetIterator(DnsClient.DNS.QTYPE question) { return(new Iterators.ResolutionIterator(this, question, new Caching.AddressCache())); }
internal NameServerEventArgs(NameServer server, DnsClient.DNS.QTYPE question, string domain) { _NameServer = server; _QuestionType = question; _Domain = domain; }
public QueryProcessor(DnsDomain sname, DnsClient.DNS.QTYPE stype, DnsClient.Response response) { this.SNAME = sname; this.STYPE = stype; this.Response = response; }
internal ResolutionIteratorBase(DomainResolver resolver, DnsClient.DNS.QTYPE question, Caching.AddressCache addressCache) { _Resolver = resolver; _Question = question; AddressCache = addressCache; }
public static LogMessage QueryNotImplemented(DnsClient.DNS.QTYPE question) { return(Create(Resources.LogMessages.QueryNotImplemented, new object[] { question })); }
public static LogMessage MissingRecords(DnsClient.DNS.QTYPE question) { return(Create(Resources.LogMessages.MissingRecords, new object[] { question })); }
public static LogMessage RecordResolutionSucceeded(DnsClient.DNS.QTYPE qtype, int count) { return(Create(Resources.LogMessages.RecordResolutionSucceeded2, new object[] { qtype, count })); }
//public static IEnumerable<DnsClient.DNS.RR> Select(this IEnumerable<DnsClient.DNS.RR> records, DnsClient.DNS.QTYPE type) //{ // return records.Where(rr => type.Equals(rr.Base.TYPE)); //} public static IEnumerable <DnsClient.DNS.RR> OfQuestion(this IEnumerable <DnsClient.DNS.RR> records, DnsClient.DNS.QTYPE question) { if (question == DnsClient.DNS.QTYPE.ANY) { return(records); } return(records.Where(rr => rr.Base.TYPE.Equals(question))); }