How to find the device name for ioctl(sd, SIOCGIFINDEX, &ifr) call
Hi I am trying to add the device by using followig code strip and it says that eth1 is not defind in the code.
strncpy(ifr.ifr_name,eth1,IFNAMSIZ);
if (ioctl(sd, SIOCGIFINDEX, &ifr) == -1) {
return 0;
}
How do I write down the DEVICE name in the ifr.ifr_name structure ?
-Thanks
|