Re: changing the %I error index substitution

Cameron Laird (claird@Starbase.NeoSoft.COM)
Sat, 5 Jul 1997 21:09:43 -0500 (CDT)

From owner-tkined@ibr.cs.tu-bs.de Sat Jul 5 17:34:22 1997
Date: Sat, 5 Jul 1997 17:44:36 -0400 (EDT)
From: Jurgen Schonwalder <jschon@research.bell-labs.com>
Interesting address. Is there a story we'd like to know?
.
.
.
The current scotty version allows to access the error_index from an
SNMP response PDU through the %I substitution in an asynchronous
request. The current implementation does this by simply converting
error_index into a string. The problem here is that SNMP starts to
count the first varbind list element with 1 while Tcl lists use 0 for
the first index. It is therefore not possible to get the varbind
directly out of the Tcl varbind list, e.g.

set vb [lindex "%V" %I]

does not work. Something like

set vb [lindex "%V" [expr %I - 1]]

does the job, but it looks a bit strange to me. I would like to change
the %I substitution so that you get the Tcl list index and not the
value from the error_index SNMP PDU field. I would substitute %I with
-1 if there was no error. This change would make the first lindex
example work in all cases. Any comments on such a change?
.
.
.
I'd probably welcome it. Most important is
to document *quite* clearly that this is NOT
the SNMP index, but differs from it by one.
I've been thinking about this point myself,
independently, for several weeks, and I see
it just as you describe.

Cameron Laird http://starbase.neosoft.com/~bodi/nesi.html
Network Engineered Solutions +1 713 763 8366
claird@NeoSoft.com +1 281 996 8546 FAX
Houston WWW Business Guide: http://starbase.neosoft.com/~bodi/HouGuide.html

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.