From owner-freebsd-net@FreeBSD.ORG Fri Jul 22 13:31:25 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D0BD16A46E for ; Fri, 22 Jul 2005 13:31:25 +0000 (GMT) (envelope-from mime@traveller.cz) Received: from ss.eunet.cz (ss.eunet.cz [193.85.228.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2392343D6B for ; Fri, 22 Jul 2005 13:30:58 +0000 (GMT) (envelope-from mime@traveller.cz) Received: from localhost.i.cz (ss.eunet.cz [193.85.228.13]) by ss.eunet.cz (8.13.1/8.13.1) with ESMTP id j6MDUchj084595; Fri, 22 Jul 2005 15:30:38 +0200 (CEST) (envelope-from mime@traveller.cz) From: Michal Mertl To: Anders Persson Content-Type: multipart/mixed; boundary="=-aECT6uAwSk87pHWGHBa6" Date: Fri, 22 Jul 2005 15:30:36 +0200 Message-Id: <1122039036.1260.32.camel@genius1.i.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org Subject: Re: interface cleanup X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2005 13:31:25 -0000 --=-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--