Re: mib format

Thorsten Geelhaar (tgeelhaa@funghi.Materna.DE)
Fri, 11 Apr 1997 08:57:57 +0200

Hi,
> does anyone know if/how you can get not only enumerations but
> ranges out of a MIB variable with 'mib format'?
>
> e.g.
>
> fooBar OBJECT-TYPE
> SYNTAX INTEGER {
> foo (1),
> bar (2)
> }
> i'd want to get the enums 1 and 2
>
> - or -
>
> vooDoo OBJECT-TYPE
> SYNTAX INTEGER (1..10)
> ....
> i'd want to get the range 1-10.
>
> thanks.
>
> lee
>
> --
> Lee Slaughter, network management development - submarine stuff
> Navy R & D, Point Loma, San Diego, CA 619-553-5486
> "Giving credence to his ramblings indicates a cognitive disorder..."
> - Lee's psychiatrist, circa 1952
> --
> !! 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.

You can get the enums with cnt like this

enum_list [ lindex [mib tc foobar] 3]

you get something like this

enum_list : {foo 1} { bar 2 }

to get the range do : set range [llength $enum_list]

to get the enums :
foreach elem $enum_list {
lappend list_of_elem [lindex $elem 0]
}

list_of_elem : foo bar

to get the number of the enums :

foreach elem $enum_list {
lappend list_of_number [lindex $elem 1]
}

list_of_number : 1 2

cu
Thorsten

-----------------------------------------------------------------
Thorsten Geelhaar Telefon: +49 231 5599 399 |\/\/\/|
Dr. Materna GmbH Fax : +49 231 5599 100 | |
| |
Vosskuhle 37 e-mail : Thorsten.Geelhaar@materna.de | (o)(o)
C _)
D-44141 Dortmund GERMANY | ,___|
| /
"We're all mad here. I'm mad, You're mad." /____:
"How do you know I'm mad?" said Alice.
"You must be" said the Cat, "or you wouldn't have come here."

------------------------------------------------------------------

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