
Greetings,
2009/1/10 Juergen Schoenwaelder j.schoenwaelder@jacobs-university.de:
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.
How do I retrieve all MIB modules inside one MIB file? How do I count modules? How I retrieve first one?
(all questions are in context multiple MIB modules inside one MIB file)
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.
I was talking in the context of loading multiple MIB modules contained inside one MIB file. When I call method smiGetFirstNode(Module*, ANY) it returns NULL. Why is this so?
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:
I agree with you and I apologise for ambiguity.
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.)
Can you "tell" me in one sentence. I read the RFC, but have no clue at this time how to name it correctly. Would it be better to say: keyword, macro or clause ?
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.
Thanks for your time and to correct me, greatly appreciated. When I was talking about MIB, I was referring to MIB file (one MIB file).
How is it possible to load MIB file with multiple MIB modules contained is one MIB file (with libsmi)? Does it make a difference if source (MIB file) is written in SMIv1,SMIv2,SMIvg - regarding parser behaviour? I looked at some examples/tools in source tree (SVN trunk), but have not found any example how to do this (load multiple modules). Any pointer - file name, or short snippet.
to a) So what are you saying is that MIB file with multiple DEFINITION "statements" is not valid MIB (when talking about SMIv2). to b) I guess this is answered with paragraph c. to c) Please one short example
Is there any documentation like data model relations (what is parent, what is child, ...)?
BTW: Would it be possible to rename function argument in file smi.h:646 from class to (let say) klass? I had trouble with linking it inside C++.
/js
-- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1, 28759 Bremen, Germany Fax: +49 421 200 3103 http://www.jacobs-university.de/
Best regards, Miroslav