std::string err;
if (ipsStr.empty())
{
- err = "Incorrect IP address.";
- throw(err);
+ return ips;
}
if (ipsStr[0] == '*' && ipsStr.size() == 1)
if (strIp == NULL)
{
err = "Incorrect IP address " + ipsStr;
- throw(err);
+ return ips;
}
strMask = strtok(NULL, "/");
if (im.ip == INADDR_NONE)
{
err = "Incorrect IP address: " + std::string(strIp);
- throw(err);
+ return ips;
}
im.mask = 32;
if (str2x(strMask, m) != 0)
{
err = "Incorrect mask: " + std::string(strMask);
- throw(err);
+ return ips;
}
im.mask = m;
if (im.mask > 32)
{
err = "Incorrect mask: " + std::string(strMask);
- throw(err);
+ return ips;
}
if ((im.ip & ips.CalcMask(im.mask)) != im.ip)
{
err = "Address does'n match mask: " + std::string(strIp) + "/" + std::string(strMask);
- throw(err);
+ return ips;
}
}
ips.ips.push_back(im);
}
//-------------------------------------------------------------------------
#endif //USER_IPS_H
-
-