Date: Wed, 18 Apr 2001 04:47:34 +1000 (EST) From: Darren Reed <darrenr@reed.wattle.id.au> To: bright@wintelcom.net (Alfred Perlstein) Cc: hackers@FreeBSD.ORG Subject: Re: User-defined bit in sysctl flags ? Message-ID: <200104171847.EAA26963@avalon.reed.wattle.id.au> In-Reply-To: <20010416180809.N976@fw.wintelcom.net> from Alfred Perlstein at "Apr 16, 1 06:08:09 pm"
index | next in thread | previous in thread | raw e-mail
In some email I received from Alfred Perlstein, sie wrote:
> * Darren Reed <darrenr@reed.wattle.id.au> [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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104171847.EAA26963>
