int num, i; sock_fd = socket(PF_INET, SOCK_DGRAM, 0); if(sock_fd < 0){ perror("socket"); return -1; } conf.ifc_len = BUFSIZE; conf.ifc_buf = buff; ioctl(sock_fd, SIOCGIFCONF, &conf); num = conf.ifc_len / sizeof(struct ifreq); ifr = conf.ifc_req; for(i = 0; ...