mibble-users
[Top][All Lists]
Advanced

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

Re: [Mibble-users] newbie question about using mibble


From: Per Cederberg
Subject: Re: [Mibble-users] newbie question about using mibble
Date: Thu, 20 Sep 2012 06:25:09 +0200

Check the bundled source code for the MibbleBrowser app. It performs reverse lookups on the OIDs returned in GetNext SNMP responses.

Cheers,

/Per

On Wednesday, September 19, 2012, Lloyd Parkes wrote:

On 19/09/2012, at 1:26 PM, diffuser78 <address@hidden> wrote:

> Quick question: Which class should I use if I want to get the OID by giving Symbol, i.e getOID(ifMIB) will return me "1.3.6.1.2.1.31" ?

I avoided talking about this in my earlier message because it's hard and the reason it's hard is because ASN.1 is hard.

In ASN.1 symbols don't have to refer to OIDs. SNMP users (like me) live in a world that only has SNMP variables, which alway do have an OID, but ASN.1 symbols and are not equivalent to SNMP variable names. When I had to work this out, I spent some time in a Java debugger traversing the links between all the objects and noting the useful information I found on a whiteboard.

I don't think I needed to do what you want to do, so I don't have any code on hand for it, but what I think you need to do once get a MibValueSymbol is to call its getValue() method and cast the result to an ObjectIdentifierValue. You should use instanceof to verify that the object really is an ObjectIdentifierValue before casting of course. The ObjectIdentifierValue class as a method toAsn1String() that returns the string you are after.

Cheers,
Lloyd


_______________________________________________
Mibble-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/mibble-users

reply via email to

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