/*Jugde whether the net card status is up */
if (buf[intrface].ifr_flags & IFF_UP)
{
//puts("the interface status is UP");
a[i].status = 1;
}
else
{
//puts("the interface status is DOWN");
a[i].status = 0;
}
/*Get IP of the net card */
if (!(ioctl(fd, SIOCGIFADDR, (char *) &buf[intrface])))
{
//puts("IP address is:");
/*puts(inet_ntoa(((struct sockaddr_in *)
(&buf[intrface].ifr_addr))->sin_addr));
*/
//puts("");
//puts (buf[intrface].ifr_addr.sa_data);
memset(a[i].IP,0,sizeof(a[i].IP));
sprintf(a[i].IP,"%s",inet_ntoa(((struct sockaddr_in *)
(&buf[intrface].ifr_addr))->sin_addr));
}
else
{
/*char str[256];