Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jul 2005 15:30:36 +0200
From:      Michal Mertl <mime@traveller.cz>
To:        Anders Persson <anders@cs.ucla.edu>
Cc:        freebsd-net@freebsd.org
Subject:   Re: interface cleanup
Message-ID:  <1122039036.1260.32.camel@genius1.i.cz>

next in thread | raw e-mail | index | archive | help

--=-aECT6uAwSk87pHWGHBa6
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

> Currently I am going through netstat and  
> rewriting some of the functions to rely on sysctl rather than kvm.  
> The hope is to completely remove kvm from netstat, and parts that  
> solely depend on it, like the core dump analysis would be factored  
> out and moved to a more suitable place (kgdb?)

I also worked on it a bit. I didn't find a way to get the "IP interface"
statistics with a sysctl. I wrote a small patch to kernel to include it
which you may find usefull. 

Attached are the patches and a program that uses the new function. It's
used pretty similarly to if_mib. I can't find the modifications to
netstat to use it :-(.

I'also played a bit with route printing through sysctl but it's nothing
fancy. I can give you the result of this if you'd like to.

Att

--=-aECT6uAwSk87pHWGHBa6
Content-Disposition: attachment; filename=in_mib.patch
Content-Type: text/x-patch; name=in_mib.patch; charset=ISO-8859-2
Content-Transfer-Encoding: 7bit

Index: conf/files
===================================================================
RCS file: /home/fcvs/cvs/src/sys/conf/files,v
retrieving revision 1.975
diff -u -r1.975 files
--- conf/files	9 Dec 2004 13:54:28 -0000	1.975
+++ conf/files	16 Dec 2004 23:37:03 -0000
@@ -1477,6 +1477,7 @@
 netinet/igmp.c		optional inet
 netinet/in.c		optional inet
 netinet/in_gif.c	optional gif inet
+netinet/in_mib.c	optional inet
 netinet/ip_gre.c	optional gre inet
 netinet/ip_id.c		optional inet
 netinet/in_pcb.c	optional inet

--=-aECT6uAwSk87pHWGHBa6--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1122039036.1260.32.camel>