How to find underlying device node of network interface using C?

Viewed 100

USB device can be interacted with using ioctl(). I want to send ioctl() to USB Ethernet Adapter, but the only thing I know is network interface name. One method is to traverse /sys/bus/usb subtree and find node with net/<ifname> directory, but it seems to be not so reliable.

Is there more straight method?

0 Answers
Related