From: Xavier V. <xav...@fr...> - 2004-03-14 18:10:07
|
Hello list, especially Martin and Michael. Let's continue our dicussion about plugin_wifi : I see three solutions to the claim : - the first is parsing /proc/net/wireless (which exists for both 2.4 and 2.6) as /proc/net/dev, there are all the informations (unlike /proc/net/dev which shows only a few info). - 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 ? - the last way which won't please to Martin : all statistics ('normal' + wireless extensions) are exported in /sys/class/net/$interface_name/statistics, so we can access them easilly, just as plugin_i2c_sensors does ! But as you may guess, sysfs is only on 2.6. Now my point of view: the last two ways overpower plugin_netdev which can be removed then, and the plugin would be called plugin_net instead of plugin_wifi. But then, which one to use ? Using sysfs would be very easy and I can write the plugin in about 2hours from plugin_i2c_sensors, but some people will complain about their old, deprecated, outdated, superseeded, ..., 2.4 kernel not being supported :/ We may in that case keep plugin_netdev and write rapidly a plugin_net_wireless which parses /proc/net/wireless (easilly writen too) so they can delay once more the migration to the best kernel ever released ( until 2.8 is out :D ) The best solution would be ioctl, but I don't know how to do this, and I don't know if it's worth the price to do this manner. If you know ioctl and wants to dig this way, just raise your hand :) Bye ! -- Xavier VELLO <xav...@fr...> |