char * paddr;
IP_MASK im;
std::vector<std::string> ipMask;
-std::string err;
if (ipsStr.empty())
{
return ips;
strIp = strtok(str, "/");
if (strIp == NULL)
{
- err = "Incorrect IP address " + ipsStr;
return ips;
}
strMask = strtok(NULL, "/");
im.ip = inet_addr(strIp);
if (im.ip == INADDR_NONE)
{
- err = "Incorrect IP address: " + std::string(strIp);
return ips;
}
int m = 0;
if (str2x(strMask, m) != 0)
{
- err = "Incorrect mask: " + std::string(strMask);
return ips;
}
im.mask = m;
if (im.mask > 32)
{
- err = "Incorrect mask: " + std::string(strMask);
return ips;
}
if ((im.ip & ips.CalcMask(im.mask)) != im.ip)
{
- err = "Address does'n match mask: " + std::string(strIp) + "/" + std::string(strMask);
return ips;
}
}