From owner-freebsd-questions@FreeBSD.ORG Thu Sep 25 16:20:43 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7F0D1065689 for ; Thu, 25 Sep 2008 16:20:43 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 87E338FC14 for ; Thu, 25 Sep 2008 16:20:43 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 8B9F8AFBC01; Thu, 25 Sep 2008 08:20:42 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Thu, 25 Sep 2008 18:20:39 +0200 User-Agent: KMail/1.9.7 References: <20080925155203.GB3284@dan.emsphone.com> In-Reply-To: <20080925155203.GB3284@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200809251820.41064.fbsd.questions@rachie.is-a-geek.net> Cc: "Vonarburg, David" , Dan Nelson , Erik Osterholm Subject: Re: AW: ethernet statistics X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2008 16:20:43 -0000 On Thursday 25 September 2008 17:52:07 Dan Nelson wrote: > In the last episode (Sep 25), Vonarburg, David said: > > netstat -i is ok for a user to get system statictics. I'd like get > > exactly this information but as a function call inside a "C" language > > application > > netstat -i still digs into kernel memory to get those stats, I think, > so you can't directly access those numbers as a regular user. All those vars are available through sysctl. For an example, look in src/in_sysctl.c from net/bmon port. -- Mel Problem with today's modular software: they start with the modules and never get to the software part.