Re: How to support GetNextRequest in scotty agent where rows come and go?

Peder Chr. Norgaard (pcn@tbit.dk)
Fri, 28 Jul 1995 15:29:54 +0200 (CDT)

Hi again,

Now I have spent some time reading the snmp/agent.c file - am
I right in assuming that almost all the stuff relevant to this discussion
is located to that file?

So now I at least understand your problems with accomodating
rows that come and go over time. I will try to do some thinking about
useful solutions during the next days...

> Again, if you know that there is an instance foo before the 'dynamic
> table' fooTable, you can do the right thing just by inspecting the
> oids before the varbind list is processed:
>
> proc UpdateInstances {vbl t} {
> foreach vb $vbl {
> switch $t {
> getnext {
> switch -glob [lindex $vb 0] \
> [mib oid foo]* { UpdateFooTable } \
> [mib oid fooTable]* { UpdateFooTable }
> }
> default {
> switch -glob [lindex $vb 0] \
> [mib oid fooTable]* { UpdateFooTable }
> }
> }
> }
> }
>
> $s bind "" begin { UpdateInstances "%V" "%T" }

You are right in the sense that this would work in some cases.

But there are two aspects of this solution that I don't like.

First, the solution is not general - for the SMI does not specify that
tables are to be interspersed with scalar instances! (The tables in
my MIB aren't....)

Second, what you really are doing is to move part of the lexicographic
navigation machinery out of the basic SNMP support into the Tcl-level
callback functions where the navigation and sorting tools are not so
simple and efficient to use.

>
> If you do not care about updating the table a bit too much, you can
> even use any instance before the dynamic table that is known to exist
> all the time.

I am afraid that I do care; some of my tables are rather big, and there
are quite a lot of them, many of which are empty most of the time. So
for a reasonable implementation I need to be quite circumspect in the
use of my private management request.

> I have hacked some support for this solution yesterday by adding a
> begin and an end binding that is called before PDU processing starts
> and after PDU processing has finished. It should not be too difficult
> to add another escape substitution %T which expands to the PDU type.
>
> This may not be the ideal solution, but this one is easy to implement
> and does not add complexity to the agent for all those cases where you
> do not have this problem. Comments?

I am very willing to try it out in a small part of my MIB and see if
it can help; but as argued above, I don't think this can be anything
like a real solution to the problem of dynamic rows.

Thank you for your interest in the problem - have a nice week-end

--peder chr.