Re: What's the handiest way

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Sun, 19 Jan 1997 18:28:05 +0100

Cameron Laird <claird@Starbase.NeoSoft.COM> said:

Cameron> to convert from colon-separated OCTET STRING to
Cameron> display code? Well, yes,

Cameron> set string {73:79:73:4c:6f:...}
Cameron> mib format sysDescr $string

Cameron> will be the handiest, but what if I have no guarantee
Cameron> that any MIB has defined sysDescr? Surely there's an
Cameron> easy scotty command to do just this, but what is it?

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.

1. I can provide a Tcl API to apply DISPLAY-HINTs, e.g.

mib dformat "255a" $string

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"

3. A third option would allow to bind Tcl procedures to MIB nodes, e.g.

mib bind $oid format { some tcl code here }

All alternatives have strengths and weaknesses. The first is probably
the simplest one to implement. Option number two could be generalized
so that all MIBs are loaded by reading Tcl files. This would allow to
convert the MIB parser into a stand-alone utility that creates those
Tcl input files from MIB definitions. However, loading times might
become a problem with this approach. Option number three allows at lot
of flexibility, although it might be much more expensive to call a Tcl
function to format a value than applying a formatting rule like a
display hint.
Juergen

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