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;
}
}