1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
char *str_apc_ip;
char execute_cmd[255];
if(p_opt->len) //Pour tester sur l'existance d'une option de la provenance du client
{
if(strcmp(p_opt->data, OPTION_43_CLIENT_VALUE)==0) // tester si l'option envoyé par le client est valide
{
str_apc_ip = read_ip_from_file(); // lire l'address du serveur si elle existe
if((strcmp(str_apc_ip,"")==0)) // si l'address su serveur n'existe pas
{
printf("Saved IP not valid \n");
}
else // sinon si l'addresse su serveur existe
{
sprintf(execute_cmd, "ping %s", str_apc_ip);
int ret = system(execute_cmd);
if(ret>0)
{
printf("Ping : No response Saving New IP\n");
}
}
}
printf("Adding Option\n");
add_option_43(&p_server_options[DHO_VENDOR_ENCAPSULATED_OPTIONS]);
} |
Partager