From owner-freebsd-hackers Tue Apr 17 11:48: 0 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from CPE-61-9-164-106.vic.bigpond.net.au (CPE-61-9-138-241.vic.bigpond.net.au [61.9.138.241]) by hub.freebsd.org (Postfix) with ESMTP id 12F1F37B423 for ; Tue, 17 Apr 2001 11:47:50 -0700 (PDT) (envelope-from darrenr@reed.wattle.id.au) Received: (from root@localhost) by CPE-61-9-164-106.vic.bigpond.net.au (8.11.0/8.11.0) id f3HIleK07299; Wed, 18 Apr 2001 04:47:40 +1000 (EST) From: Darren Reed Message-Id: <200104171847.EAA26963@avalon.reed.wattle.id.au> Subject: Re: User-defined bit in sysctl flags ? In-Reply-To: <20010416180809.N976@fw.wintelcom.net> from Alfred Perlstein at "Apr 16, 1 06:08:09 pm" To: bright@wintelcom.net (Alfred Perlstein) Date: Wed, 18 Apr 2001 04:47:34 +1000 (EST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL37 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In some email I received from Alfred Perlstein, sie wrote: > * Darren Reed [010416 13:37] wrote: > > > > What do people think about having a range of bits in oid_kind that are > > not used by FreeBSD but are only to be used by ``private'' sysctl handlers? > > > > e.g. > > > > #define CTLFLAG_PRIVATE 0x000ffff0 > > > > Do I need elaborate any further ? > > I think a half-paragraph explaining what this does would help. :) > > I'm assuming this allows someone to have thier own private numbered > mib in the sysctl tree, my question is why are you using hardcoded > numbers rather than names? Uh, no. The idea is so you can do this: #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \ ptr, val, sysctl_ipf_int, "I", descr); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpidletimeout, CTLFLAG_RW|CTL_PRIV, &fr_tcpidletimeout, 0, ""); and have CTL_PRIV be a bit which sysctl_ipf_int understands and not have to worry about the value of CTL_PRIV ever being afflicted with double-use by a FreeBSD flag because CTL_PRIV is part of CTLFLAG_PRIVATE. Darren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message