Advtools.AdvInterceptor.DnsProcessQuery.ProcessQuery C# (CSharp) Method

ProcessQuery() private method

private ProcessQuery ( ARSoft.Tools.Net.Dns.DnsQuestion question ) : List
question ARSoft.Tools.Net.Dns.DnsQuestion
return List
        internal List<DnsRecordBase> ProcessQuery(DnsQuestion question)
        {
            IPAddress ip = null;

            if(state_.Config.Dns.CatchAll)
                ip = CatchAllProcessQuery(question);
            else
            {
                Interception interception = state_.Config.GetInterception(question.Name);
                if(interception == null)
                {
                    state_.Logger.Debug("No interception for '{0}' found", question.Name);
                    return null;
                }

                ip = GetIp(interception);
            }

            if(null == ip)
            {
                state_.Logger.Information("No IP found for '{0}'", question.Name);
                return null;
            }

            List<DnsRecordBase> result = new List<DnsRecordBase>();
            state_.Logger.Information("DNS {1} {0} TTL {2}", ip, question.Name, state_.Config.Dns.AnswerTtl);
            result.Add(new ARecord(question.Name, state_.Config.Dns.AnswerTtl, ip));
            return result;
        }

Usage Example

        private List <DnsRecordBase> ProcessQuestion(DnsQuestion question)
        {
            if (!intercept_)
            {
                return(null);
            }

            switch (question.RecordType)
            {
            case RecordType.A:
                return(processAQuery_.ProcessQuery(question));

            case RecordType.Aaaa:
                //records = processAaaaQuery_.ProcessQuery(question);
                break;

            default:
                break;
            }

            return(null);
        }