|
|
@ -613,18 +613,27 @@ inline bool findIpInFile(const char *filename, string ip)
|
|
|
|
ifstream File(filename);
|
|
|
|
ifstream File(filename);
|
|
|
|
if(!File.is_open())
|
|
|
|
if(!File.is_open())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << "error while opening file" << endl;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string line = "";
|
|
|
|
string line = "";
|
|
|
|
|
|
|
|
int iFound = 0;
|
|
|
|
while(getline(File, line))
|
|
|
|
while(getline(File, line))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(boost::iequals(ip, line) == true)
|
|
|
|
if(boost::iequals(ip, line) == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//cout << ip << " found in " << filename << "!" << endl;
|
|
|
|
//cout << ip << " found in " << filename << endl;
|
|
|
|
|
|
|
|
cout << "Found." << endl;
|
|
|
|
|
|
|
|
iFound = 1;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(iFound == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << "Not found." << endl;
|
|
|
|
|
|
|
|
//cout << ip << " not found in " << filename << endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
File.close();
|
|
|
|
File.close();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|