<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
In my report during last night's mailing list storm I mentioned
needing to change the architecture of ntpsnmpd slightly. This email
is a description of how it works now for
updation/clarification/documentation/sanity checkification purposes.<br>
<br>
In ntpsnmpd there is a class which manages the MIB tree (and
currently data retrieval as well), the tree itself takes the form of
a series of nested dicts with each dict-key forming part of an OID
name. Previously each node consisted of a tuple with the callback
for read/write, and the nested dict for that branch of the tree. I
defined it as a tree because it made some things easier to define,
and reduces the chance of accidentally forgetting an entry or
mis-ordering them, during init the manager class would then flatten
the tree down to a list for ease of search. This worked fine so long
as the tree never changed, and since I didn't understand how
sequences are implemented in MIB trees I worked with that
assumption. That assumption was false.<br>
<br>
Now each node consists of a dict with the keys "static", "callback",
"subids". If "static"==True it behaves as before: "subids" contains
the child nodes of the tree, and "callback" contains the data
read/write function. However if "static"==False "subids" contains a
function which is called by the new walkMIBTree generator to build
that part of the tree on the fly (which is more elegant even for
static trees than the code it replaced). From the perspective of the
calling code everything works as before: call functions to get an
OID, and it returns whatever one is necessary.<br>
<br>
Since most parts of the MIB are static it is still useful to have
the Dicts of Doom, and then splice in the dynamic entries exactly
when needed.<br>
<br>
<div class="moz-signature">-- <br>
<i>"In the end; what separates a Man, from a Slave? Money? Power?
No. A Man Chooses, a Slave Obeys."</i> -- Andrew Ryan
<p>
<i>"Utopia cannot precede the Utopian.
It will exist the moment we are fit to occupy it."</i> --
Sophia Lamb
</p>
</div>
</body>
</html>