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

GetIp() private method

private GetIp ( Interception interception ) : IPAddress
interception Interception
return System.Net.IPAddress
        private IPAddress GetIp(Interception interception)
        {
            string configuredIp = GetConfiguredIp(interception);
            if(String.IsNullOrWhiteSpace(configuredIp))
            {
                state_.Logger.Debug("No IP configured, take the default one: {0}", defaultIp_);
                return defaultIp_;
            }

            try
            {
                return state_.AllocateIP(interception.Name, IPAddress.Parse(configuredIp));
            }
            catch(FormatException)
            {
                state_.Logger.Error("{0} is not a valid IP address", configuredIp);
                return null;
            }
        }