Skip to contentSkip to conversation

A better way to get driver stats than parsing /proc/net/dev ?

DISCUSSION Ben Greear 3 participants 4 messages Apr 11, 2003 – May 21, 2003

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

Is there an ioctl or some other binary means of getting the info that /proc/net/dev provides?

Thanks,
Ben

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#1 lore raw
Quoted 2 lines · [email protected] said:

Is there an ioctl or some other binary means of getting the info that /proc/net/dev provides?

You can do it with netlink sockets. See print_linkinfo() in the iproute2 code.

Jason

author
#2 lore raw
Quoted 8 lines · Jason Lunz
Quoted 2 lines · [email protected] said:

Is there an ioctl or some other binary means of getting the info that /proc/net/dev provides?

You can do it with netlink sockets. See print_linkinfo() in the iproute2 code.

Seems that a lot of code is needed just to read the stats :(
And every man page I read says use libnetlink instead, but I can't find any docs on libnetlink itself (and the .ru ftp link for iproute2 seems down).

Do you know of any pointers as to how to use libnetlink, or if it really makes netlink easier to use?

Quoted 3 lines

Jason

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#3 lore raw

On Fri, 11 Apr 2003 10:26:57 -0700, Ben Greear wrote

Quoted 10 lines
Quoted 7 lines · Jason Lunz
Quoted 2 lines · [email protected] said:

Is there an ioctl or some other binary means of getting the info that /proc/net/dev provides?

You can do it with netlink sockets. See print_linkinfo() in the iproute2 code.

Seems that a lot of code is needed just to read the stats :(

Maybe it is easier to parse the output from "ip -s -s link show [iface]". At least you get all the counters, which you don't from /proc/net/dev.

Signature · 2 lines
Regards,
Rask Ingemann Lambertsen