On Thu, Feb 11, 2010 at 12:22 PM, Josef Moellers
<[email protected]> wrote:
> Stephen Hemminger wrote:
>> On Wed, 10 Feb 2010 12:02:44 +0100
>> Josef Moellers <[email protected]> wrote:
>> [ ... ]
>> Ugh, I would prefer that you use one of the other API's
>> to get information (like netlink IFLA_STATS) rather than open each sysfs
>> file.
>
> I agree that any method requiring less than opening a handful of files
> is better, but I've tried to look into IFLA_STATS and I fail to make any
> sense out of anything I've found to use it.
> Anyone have a link to a decent description how to use IFLA_STATS?

Should be documented in the documentation of libnl, which you can find
here: http://www.infradead.org/~tgr/libnl/.

>> The other alternative is reading /proc/net/dev
>
> Our original implementation (we provided an external agent) did just that.
> However, somewhere I recall that /sys is preferred over /proc.

/sys is preferred over /proc for new kernel code that exports
information from kernel space to user space. Most existing /proc
entries won't be removed ever to retain backwards compatibility with
user space software. So reading /proc from userspace code is fine.

Bart.

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to