minix/etc
David van Moolenbroek 6f3e0bcd3d MIB/libsys: support for remote MIB (RMIB) subtrees
Most of the nodes in the general sysctl tree will be managed directly
by the MIB service, which obtains the necessary information as needed.
However, in certain cases, it makes more sense to let another service
manage a part of the sysctl tree itself, in order to avoid replicating
part of that other service in the MIB service.  This patch adds the
basic support for such delegation: remote services may now register
their own subtrees within the full sysctl tree with the MIB service,
which will then forward any sysctl(2) requests on such subtrees to the
remote services.

The system works much like mounting a file system, but in addition to
support for shadowing an existing node, the MIB service also supports
creating temporary mount point nodes.  Each have their own use cases.
A remote "kern.ipc" would use the former, because even when such a
subtree were not mounted, userland would still expect some of its
children to exist and return default values.  A remote "net.inet"
would use the latter, as there is no reason to precreate nodes for all
possible supported networking protocols in the MIB "net" subtree.

A standard remote MIB (RMIB) implementation is provided for services
that wish to make use of this functionality.  It is essentially a
simplified and somewhat more lightweight version of the MIB service's
internals, and works more or less the same from a programmer's point
of view.  The most important difference is the "rmib" prefix instead
of the "mib" prefix.  Documentation will hopefully follow later.

Overall, the RMIB functionality should not be used lightly, for
several reasons.  First, despite being more lightweight than the MIB
service, the RMIB module still adds substantially to the code
footprint of the containing service.  Second, the RMIB protocol not
only adds extra IPC for sysctl(2), but has also not been optimized for
performance in other ways.  Third, and most importantly, the RMIB
implementation also several limitations.  The main limitation is that
remote MIB subtrees must be fully static.  Not only may the user not
create or destroy nodes, the service itself may not either, as this
would clash with the simplified remote node versioning system and
the cached subtree root node child counts.  Other limitations exist,
such as the fact that the root of a remote subtree may only be a
node-type node, and a stricter limit on the highest node identifier
of any child in this subtree root (currently 4095).

The current implementation was born out of necessity, and therefore
it leaves several improvements to future work.  Most importantly,
support for exit and crash notification is missing, primarily in the
MIB service.  This means that remote subtrees may not be cleaned up
immediately, but instead only when the MIB service attempts to talk
to the dead remote service.  In addition, if the MIB service itself
crashes, re-registration of remote subtrees is currently left up to
the individual RMIB users.  Finally, the MIB service uses synchronous
(sendrec-based) calls to the remote services, which while convenient
may cause cascading service hangs.  The underlying protocol is ready
for conversion to an asynchronous implementation already, though.

A new test set, testrmib.sh, tests the basic RMIB functionality.  To
this end it uses a test service, rmibtest, and also reuses part of
the existing test87 MIB service test.

Change-Id: I3378fe04f2e090ab231705bde7e13d6289a9183e
2016-06-18 12:46:59 +00:00
..
defaults Move all services to /service 2014-07-31 16:00:31 +02:00
devmand Much USB code for ARM USB support 2014-08-29 18:52:49 +02:00
fonts support for ukranian (charse koi8-u) contributed by Roman Ignatov. 2010-06-08 01:04:52 +00:00
mtree MIB/libsys: support for remote MIB (RMIB) subtrees 2016-06-18 12:46:59 +00:00
rc.capes Move all services to /service 2014-07-31 16:00:31 +02:00
root NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
skel Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
usr rc: start syslogd with -s (no UDP sockets) 2016-02-29 16:28:16 +00:00
boot.cfg.default some small changes 2014-08-28 18:49:03 +02:00
crontab version /usr/lib/crontab too 2007-04-02 16:18:46 +00:00
csh.cshrc Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
csh.login Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
csh.logout Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
gettytab big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
group Switch to NetBSD passwd format 2011-11-14 14:47:42 +00:00
hostname.file Made things a little more boot-cd friendly (specifically readonly /usr). 2005-05-03 08:56:01 +00:00
inet.conf Initial revision 2005-04-21 14:53:53 +00:00
Makefile Install xorg.conf which loads all extensions. 2016-01-13 20:32:24 +01:00
Makefile.params NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
man.conf NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
master.passwd Removing /home/bin 2014-08-07 14:01:30 +02:00
mk.conf mk.conf: workaround for pkgin sourcing it 2013-05-16 11:13:00 +00:00
motd Set the motd to point to a wiki page. 2014-09-13 23:56:50 +02:00
newfstab.sh mainstream-format fstab format 2011-11-14 14:47:28 +00:00
profile Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
protocols NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
rc Boot-to-ramdisk image generation scripts 2016-03-21 21:01:20 +01:00
rc.cd New image framework generation 2015-10-10 19:09:35 +02:00
rc.conf NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
rc.daemons.dist Import NetBSD rcmd, rcp, rsh, rshd 2015-09-23 12:03:06 +00:00
rc.shutdown big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
rc.subr NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
resolv.conf add /etc/resolv.conf pointing to minix nonamed 2011-07-26 18:03:04 +02:00
rs.inet rs: New RS. 2015-09-16 15:30:48 +00:00
rs.single Removed args debugging line 2007-02-16 15:58:05 +00:00
services NetBSD re-synchronization of the source tree 2016-01-13 20:32:14 +01:00
shells Add /bin/false to /etc/shells 2014-07-28 17:05:22 +02:00
shrc Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
syslog.conf Import NetBSD syslogd(8) 2015-07-26 11:57:04 +00:00
system.conf moved service configuration out of system.conf 2016-02-07 19:17:43 +01:00
termcap Remove revision IDs from files 2010-11-04 01:13:59 +00:00
termcap.big Remove revision IDs from files 2010-11-04 01:13:59 +00:00
ttys big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
utmp Initial revision 2005-04-21 14:53:53 +00:00
xorg.conf Install xorg.conf which loads all extensions. 2016-01-13 20:32:24 +01:00