Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] SNMP: libsmi state and how to add MIB files to the distribut

From: Wes Hardaker <wjhns36@xxxxxxxxxxxxx>
Date: Wed, 05 Sep 2007 09:24:33 -0700
>>>>> "LEO" == Luis EG Ontanon <luis.ontanon@xxxxxxxxx> writes:

LEO> I went to libsmi mainly because I could not find any documentation on
LEO> how to traverse the already loaded MIB in Net-SNMP.

Ah.  It's certainly possible, just FYI, since
net-snmp/apps/snmptranslate traverses the loaded MIBs to display the
results in all sorts of output formats.

But anyway, libsmi is designed to be a library to do what you want so
it's a great choice too (I've used it numerous times to build things
with as well).

One comment, just for thought...  I'd make sure you define you filter
expression carefully so you can distinguish what part is a MIB and what
is an object.  That way when you get an unknown component, you can
recognize and possibly try to load it (even ask for a path, if you're
braving the dialog box world as well).  IE:

IF-MIB.ifEntry.ifIndex == 3 

Is the MIB name always required to be first?  (Net-SNMP's API is very
flexible and could handle just ifIndex == 3 if the IF-MIB was
pre-loaded)

Common MIB syntax, by the way, which is understood by many operators is
IF-MIB::ifIndex == 3
-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett