short get_flags(const char *dev)
{
struct ifreq ifr;
bzero((char *)&ifr, sizeof(ifr));
strcpy(ifr.ifr_name, dev);
if (ioctl(ioctl_sockid,SIOCGIFFLAGS, (char *)&ifr) < 0)
return(0);
return(ifr.ifr_flags);
}
flags = get_flags(ifx->d_name);
if ((flags & IFF_RUNNING) == 0)
没网线
阅读(905) | 评论(0) | 转发(0) |