network interface information through ioctlsHi all, I need to find the network interfaces which are present in the system. after finding that list I need to discriminate whether that interface is wire or wireless, and I need to find which device driv

Dan Williams dcbw at redhat.com
Thu Jan 24 08:11:25 EST 2008


On Thu, 2008-01-24 at 18:08 +0530, Sukku wrote:
> Hi all,
> 
> I need to find the network interfaces which are present in the system.
> after finding that list I need to discriminate whether that interface
> is wire or wireless, and I need to find which device driver was binded
> for that network card.
> 
> I able to find that network interface list by using IOCTL commands.
> But I am not able to find that difference in wire or wireless and
> driver related information.
> 
> Is there any kernel level structure which contain this information.

You can try executing the wireless ioctl SIOCGIWRANGE on the device, and
if it returns an error, that device is not wireless (or there is some
other major issue with it).

For the driver name, you need to look in /sys.  Start
in /sys/class/net/eth0, and the sys hierarchy can provide you with quite
a few bits of information.

Dan




More information about the HostAP mailing list