
On Sun, Jan 11, 2009 at 12:27:21AM +0100, Miroslav Berani?? ml. wrote:
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)
There are no API functions to do this sort of thing. In general, I recommend to put just one module into a MIB file; this will also help with the resolution of imports.
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?
Sorry, I can't help with this.
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 ?
RFC 2578 calls it a keyword.
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.
Assume file DOUBLE-MIB contains the following:
A-MIB DEFINITIONS ::= BEGIN END
B-MIB DEFINITIONS ::= BEGIN END
You can now do things like smidump -p /tmp/DOUBLE-MIB A-MIB or also smidump -p /tmp/DOUBLE-MIB B-MIB.
to a) So what are you saying is that MIB file with multiple DEFINITION "statements" is not valid MIB (when talking about SMIv2).
No, I was talking about MIB modules.
to b) I guess this is answered with paragraph c. to c) Please one short example
See above.
Is there any documentation like data model relations (what is parent, what is child, ...)?
Maybe.
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++.
Sure.
/js