
On Sat, Jan 10, 2009 at 11:04:40PM +0100, Miroslav Berani?? ml. wrote:
Hi,
is it possible to parse MIB file that contains multiple DEFINITIONs (SMIv1, SMIv2, SMIng) statements?
yes
Currently smiLoadModule(char* mibFile) returns name of last DEFINITION (it seems that way) in MIB file.
It returns the name of the last MIB module.
When calling smiGetFirstNode(modile, ANY) method returns NULL.
A question concerning the result of a function call without telling us anything about the context of the call can't be answered.
IS MIB with multiple DEFITION statements valid MIB?
The term "MIB" is ambiguous here - you have to work on terminology to get things straight. Some true statements:
a) A valid SMIv2 MIB module has exactly one DEFINITION "statement". (It is actually not a "statement" but I spare you the details of ASN.1 here.)
b) The SMIv2 specification never talks about MIB files; the spec only defines how MIB modules are structured, not how they are stored in files. As a consequence, the notion of MIB files is implementation specific.
c) Libsmi is able to parse files containing multiple MIB modules and smiLoadModule() returns the name of the last parsed MIB module contained in a MIB file.
/js