Just use the open socket file descriptor using the device name in the structure ifreqpassed in ioctl(), provided that your program has the appropriate permissions to do this.
From the docs:
Linux supports some standard ioctls for configuring network devices. They can be used in any descriptor socket file regardless of family or type. They pass the ifreq structure:
- . fd ( , ), , , ioctl() .
. man 7 netdevice , (, manpages-dev manpages-devel, )
net-tools, - . ifconfig (Debian/Ubuntu ).
, , ( , , , ).