STATUS ip_valid_check(const char* v_p_Str)
{
int i;
int tmp;
char* p = NULL;
if(strlen(v_p_Str) > 15)
{
return ERROR;
}
p = (char*)v_p_Str;
tmp = atoi(p);
if(tmp > 255 || tmp < 0)
{
return ERROR;
}
for(i = 0; i < 3; i++)
{
if(NULL == (p = strchr(p, '.')))
{
return ERROR;
}
p++;
tmp = atoi(p);
if(tmp > 255 || tmp < 0)
{
return ERROR;
}
}
return OK;
}