Subject: Re: Retrieval of interface stats
To: Harmen van der Linde <H.van.Linde@inter.nl.net>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 07/31/1996 11:15:29
On Wed, 31 Jul 1996 15:58:24 +0200 
 Harmen van der Linde <H.van.Linde@Inter.NL.net> wrote:

 > I hope someone can help me with this. I want to retrieve
 > interface configuration information and statistics from the
 > kernel. Basically, the same information as provided by the 
 > "ifconfig" command (e.g., if_name, if_mtu etc.). I know that
 > this information is contained in the ifnet structure (->
 > /usr/include/net/if.h) but I don't know how to retrieve this
 > information. I suppose that you have to use the nlist command
 > but I couldn't find any documentation on this.

Well, yah... take a look at src/usr.bin/netstat/... if.c accesses the 
ifnet structures, and prints some info about them.  It uses the kvm(3) 
library to do this...

 -- save the ancient forests - http://www.bayarea.net/~thorpej/forest/ -- 
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939