Re: DisplayString type as table index

Juergen Schoenwaelder (schoenw@gaertner.de)
Tue, 13 May 1997 20:21:17 +0200

mani@sj.fore.com (Mani Chinnappan) said:

Mani> I've a question on using fixed or variable length
Mani> DisplayString type as a table index.

Mani> What I've is a mib table that is indexed by name which
Mani> is defined as DisplayString type. My specific question is:

Mani> how do I specify the DisplayString type instance
Mani> information to scotty?

Mani> I was sending the index OIDs in the following format which
Mani> didn't work:

Mani> oid.foo (where oid is in dotted notation)

Mani> However, when I converted each ascii character of the name
Mani> (example name used below: foo) to decimal and specified them
Mani> in dotted notation as follows, it seemed to work:

Mani> oid.102.111.111

Mani> Do scotty apply textual conventions for index variables that
Mani> are defined as DisplayString?

Scotty does not apply textual conventions for index variables. You
have to do the conversion yourself. The usual hack is to mis-use the
mib scan command. Assuming that $oid is the OID for a DisplayString
type instance index stored in $foo. You would write:

$oid:[mib scan $oid $foo]

This works for IMPLIED DisplayStrings. You have to add the length
otherwise:

$oid.[string length $foo]:[mib scan $oid $foo]

Ugly, but it works.
Juergen

-- 
Juergen Schoenwaelder     <schoenw@gaertner.de>     (Tel: +49-531-23873-0)
Gaertner Datensysteme, Hamburger Strasse 273a, 38114 Braunschweig, Germany
--
!! 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.