summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
77ba2f5)
исключений (в Stragazer'е сейчас перехват исключений де-факто не
используется)
std::string err;
if (ipsStr.empty())
{
std::string err;
if (ipsStr.empty())
{
- err = "Incorrect IP address.";
- throw(err);
}
if (ipsStr[0] == '*' && ipsStr.size() == 1)
}
if (ipsStr[0] == '*' && ipsStr.size() == 1)
if (strIp == NULL)
{
err = "Incorrect IP address " + ipsStr;
if (strIp == NULL)
{
err = "Incorrect IP address " + ipsStr;
}
strMask = strtok(NULL, "/");
}
strMask = strtok(NULL, "/");
if (im.ip == INADDR_NONE)
{
err = "Incorrect IP address: " + std::string(strIp);
if (im.ip == INADDR_NONE)
{
err = "Incorrect IP address: " + std::string(strIp);
if (str2x(strMask, m) != 0)
{
err = "Incorrect mask: " + std::string(strMask);
if (str2x(strMask, m) != 0)
{
err = "Incorrect mask: " + std::string(strMask);
}
im.mask = m;
if (im.mask > 32)
{
err = "Incorrect mask: " + std::string(strMask);
}
im.mask = m;
if (im.mask > 32)
{
err = "Incorrect mask: " + std::string(strMask);
}
if ((im.ip & ips.CalcMask(im.mask)) != im.ip)
{
err = "Address does'n match mask: " + std::string(strIp) + "/" + std::string(strMask);
}
if ((im.ip & ips.CalcMask(im.mask)) != im.ip)
{
err = "Address does'n match mask: " + std::string(strIp) + "/" + std::string(strMask);
}
}
ips.ips.push_back(im);
}
}
ips.ips.push_back(im);
}
//-------------------------------------------------------------------------
#endif //USER_IPS_H
}
//-------------------------------------------------------------------------
#endif //USER_IPS_H