Skip site navigation (1)Skip section navigation (2)
Date:      24 Mar 2006 09:22:02 -0500
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        "Valerio daelli" <valerio.daelli@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Number of routing tables
Message-ID:  <44d5gbgbxx.fsf@be-well.ilk.org>
In-Reply-To: <27dbfc8c0603230745i4a339eb6v552205cad85705a5@mail.gmail.com>
References:  <27dbfc8c0603230745i4a339eb6v552205cad85705a5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Valerio daelli" <valerio.daelli@gmail.com> 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.



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