Subject: Replacing the sysctl() interface.
To: None <>
From: Darren Reed <>
List: tech-kern
Date: 06/05/2000 05:21:14
I'm musing over working on replacing the current sysctl with something
that's much more flexible and supports (at the very least) it being
dynamic in nature.

Some of changes I think are worthwhile making:

- do lookups on name, not integer (except for backward compat.)

- support min/default/max/modulus(?) parameters for each sysctl entry.
  This would let you enforce 0/1 on "boolean" sysctl entries such as
  ip_forwarding, etc.  I'm thinking about modulus so that you can
  enforce things like u-sec timers to be in lots of 1000, etc.  For
  string types that are rw, this would be limited to default.  Some
  other properties for nodes I'm thinking of are "ownership" (based
  on user/group) and permissions (rwxrwxrwx) so you can setup read
  only, read-write and write only sysctl nodes.

- where possible, remove up foo_sysctl() routines which just
  deal with basic types and handle basic types in a more centralised

- support run-time additions and removals from entries on the sysctl

- the base sysctl "tree" would be somewhat bare (kern only?), with
  various subsystem init functions being responsible for populating it.

- given it would be dynamic in nature, providing a compatible interface
  with sysctl as it is now would require walking the entire tree.

- what needs to be done, if anything, to make it into a "MIB" that is
  more suited to SNMP means ?

...any other ideas ?

If I can get some useful feedback (I may have picked a bad time for
this O:) I'll post back in a week or so about what I'd like to do
(proposal) for further comment before embarking on making it happen.
I would engvisage it easily being done before 1.6 :)