From: Martin H. <ma...@he...> - 2004-03-14 22:14:50
|
Hi again, > - another way is using ioctl : in fact there's no direct ioctl for > wireless extensions, the stats are merged with "generic" stats (see > include/linux/netdevice.h and include/net/iw_handler.h), works with all > kernels (the new API is from 2002), but it handles too the 'normal' eth > devices, so why not calling this plugin_net and delete plugin_netdev ? Second thoughts - after looking at the kernel stuff (the other end of the IOCTL calls), I'd even say it's smart to keep those separated. So far, I've been unable to locate _any_ location in the kernel, where one can get the the same device-stats (rx_bytes, tx_bytes and so on) via ioctl calls as one gets via parsing the output of /proc/net/dev. If we keep things separate, it should keep things nice and simple: * plugin_net_dev for printing traffic stats - afterall, displaying bytes sent/received is pretty much independant of the actual implementation of the device) * plugin_wireless (or whatever name we decide to use), for extra info (like channel, operation mode, sensitivity, transmit power, link quality, signal level, noise level and so on). All of those are very "wifi-specific", so keeping this separate should help keep things compact, once we go to dynamic loading of plugins. If, on the other hand, you've found a way to get the same info via ioctl calls as one can get from /proc/net/dev, please do tell me - I'd love to know a way to get around having to parse that potentially large string (one of my test boxes has 10 different interfaces in /proc/net/dev - not only physical ones, but also logical ones, for VPNs and stuff like that). Martin |