From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 1 18:43:03 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 215CE16A405 for ; Thu, 1 Feb 2007 18:43:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DC3A613C4AC for ; Thu, 1 Feb 2007 18:43:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l11IeoFW062692; Thu, 1 Feb 2007 11:40:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 01 Feb 2007 11:41:21 -0700 (MST) Message-Id: <20070201.114121.110116525.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86k5z3jylp.fsf@dwp.des.no> References: <45BB72D6.9070809@pacbell.net> <86k5z3jylp.fsf@dwp.des.no> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Thu, 01 Feb 2007 11:40:52 -0700 (MST) Cc: freebsd-hackers@freebsd.org, dr2867@pacbell.net Subject: Re: sysctl(3) interface X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2007 18:43:03 -0000 In message: <86k5z3jylp.fsf@dwp.des.no> des@des.no (Dag-Erling Sm=F8rgrav) writes: : Daniel Rudy writes: : > I've been taking apart and analyzing the sysctl(8) program to gain = a : > better insight into how to use the sysctl(3) interface. [...] : > It's using an oid of 0 and 2 to get something, then it comes up wit= h 440 : > and then a sequence of numbers that are incrementing in a peculiar : > pattern. : = : sysctl(8) uses undocumented interfaces to a) enumerate the nodes in : the sysctl tree and b) obtain the name of a node, given its OID. : = : > So, my question is, how do I walk the tree to get the PnP info for = all : > the devices in the system? : = : man 3 devinfo devinfo -v will also give that information. Warner