Re: What's the handiest way

Louis A. Mamakos (louie@TransSys.COM)
Mon, 20 Jan 1997 00:14:50 -0500

> There is no easy scotty command to do this except the command shown
> above. The Tnm extension simply applies DISPLAY-HINTs. There is
> currently no Tcl API to apply formatting rules directly or to change
> the default formatting rules. (Some people wanted this feature to
> control the rendering of TimeTick values.) There are sevaral options.

Yes, that would be me included in that group..

> 1. I can provide a Tcl API to apply DISPLAY-HINTs, e.g.
>
> mib dformat "255a" $string

Thinking about this in the case of having a mib variable like sysUpTime,
you'd have to ensure that $string is encoded in some suitable, generic
format. I'm not sure how you'd arrange this.

> 2. I can provide a Tcl API to define MIB properties like display hints
> at run-time and not only a MIB loading time, e.g.
>
> mib define $oid displayhint "255a"

This would be cool. Very cool.

> 3. A third option would allow to bind Tcl procedures to MIB nodes, e.g.
>
> mib bind $oid format { some tcl code here }

As you mention, this might be more expensive than some of the other
alternatives. However, if it's an operation that's frequently invoked
it can be coded in C, rather than in Tcl and much of that overhead
disappears. In fact, you're probably still ahead of the current
situation when trying to convert timeticks back into quantities which
you can do arithmetic on.

FYI, another situation I just ran across was trying to use the CISCO
PING mib. In that mib, there is a variable which is an octet string
which contains the address of the network element to be pinged. Note
that it's not an IpAddress, as it's intended to be applicable across
multiple protocols (there's another mib variable which allows you
to select IP, CLNS, XNS, etc.) In this situation, it was necessary to
split and format and build an octet string to use when setting the variable.

There's a needs for some "cast" operation to naturally convert between
representations. The "do what I mean" operation.. :-)

louie

--
!! 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.