mibble-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mibble-users] Reverse usage of mibble


From: Per Cederberg
Subject: Re: [Mibble-users] Reverse usage of mibble
Date: Mon, 15 Mar 2004 11:12:53 +0100

On Mon, 2004-03-15 at 10:44, Louis GOUNOT wrote:
> Hi,
> 
> > Yes, tables are problematic. As far as I have seen, most of the
> > tableEntry symbols in the MIBs are declared to have an oid ending
> > with .1 (not .0) so that might help in some cases.
> In my point of view, as I've read about in different RFCs, tableEntry
> symbols are compound of :
>           the tableEntry OID,
>           a dot character,
>           the row index in the table.
> But it seems to be different in some other cases (I don't remember them, but
> somteimes you have a concatenation of an OID and of an IP address)

Yes, maybe I should've expressed myself a bit clearer. When
you retrieve something from a table with SNMP you use an OID
like "1.2.3.<rowFromZero>.13" where 13 in this case is the
particular field (or column if you like).

In the MIB file, however, things usually look like this:

helloTable  ... ::= { symbol 3 }

helloEntry  ... ::= { helloTable 1 }     <-- Using 1 not 0

helloColumn ... ::= { helloEntry 13 }

So this is what I mean by the row index being 1 in the MIB
file. Basically that most people seem to use the magical
number 1 for declaring the row value symbol. I don't know
if this is defined somewhere or if it is just tradition,
but it does make sense as you won't find any other OID:s
with a 0 in them.

BTW, my code doesn't use this assumption. Rather it checks
if there is only one child to an OID and returns that. It
just ocurred to me that this may also happen in some other
cases (rarely though), so one might add some check to see
if the symbol really is a table symbol (type is SEQUENCE OF)
also.

But as long as you're not using tables, the method
Mib.getSymbolByValue() is just fine.

Cheers,

/Per






reply via email to

[Prev in Thread] Current Thread [Next in Thread]