From owner-freebsd-questions@FreeBSD.ORG Fri Mar 24 14:22:04 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A830916A422 for ; Fri, 24 Mar 2006 14:22:04 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5441F43D6D for ; Fri, 24 Mar 2006 14:22:04 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 677 invoked from network); 24 Mar 2006 14:22:04 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 24 Mar 2006 14:22:03 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id E1D6428425; Fri, 24 Mar 2006 09:22:02 -0500 (EST) Sender: lowell@be-well.ilk.org To: "Valerio daelli" References: <27dbfc8c0603230745i4a339eb6v552205cad85705a5@mail.gmail.com> From: Lowell Gilbert Date: 24 Mar 2006 09:22:02 -0500 In-Reply-To: <27dbfc8c0603230745i4a339eb6v552205cad85705a5@mail.gmail.com> Message-ID: <44d5gbgbxx.fsf@be-well.ilk.org> Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: FreeBSD Questions Subject: Re: Number of routing tables 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: Fri, 24 Mar 2006 14:22:04 -0000 "Valerio daelli" writes: > Hello > I would like to know if exists a sysctl to get the number of > routing tables in the kernel. > I don't want the list of the routing tables, I just want the number. > The command 'netstat -rn|wc -l' could be a good candidate, > but since I want to implement this command on a very busy router, > I don't want it to go 100% CPU just to get a simple count. > If it doesn't exist I will create something based on netstat's source. > Thanks a million (routes) I don't think there's a count maintained. [And as a developer of large commercial routers, I haven't had a customer ask for a feature like that, although I do have them for debugging purposes.] If you're worried about the processing load of the brute force solution, just lower the scheduling priority.