
Hello all,
I have some MIB files that actually define multiple modules in one file. I would like to retrieve these modules, and only these modules. Currently, If I load the file and get all the modules with getFirstModule/getNextModule I also get all of the modules that were imported by this file (which is a lot). Is there any way to get only the defined modules in a single file? Thanks.
\|// (O O) -- --------------------oOOo~(_)~oOOo---------------------------------------- Keith Dart mailto:kdart@kdart.com http://www.kdart.com/ ---------------------------------------------------------------------------- Ever since my brain transplant I ... ============================================================================
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

On Mon, 23 Jul 2001, Keith Dart wrote:
Hello all,
I have some MIB files that actually define multiple modules in one file. I would like to retrieve these modules, and only these modules. Currently, If I load the file and get all the modules with getFirstModule/getNextModule I also get all of the modules that were imported by this file (which is a lot). Is there any way to get only the defined modules in a single file? Thanks.
Oh, never mind. 8-) I found I can pre-process them with smistrip. Hm, interesting shell/awk script. I should duplicate this in Python...
\|// (O O) -- --------------------oOOo~(_)~oOOo---------------------------------------- Keith Dart mailto:kdart@kdart.com http://www.kdart.com/ ---------------------------------------------------------------------------- Ever since my brain transplant I ... ============================================================================
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Hi!
Keith> I have some MIB files that actually define multiple modules in one Keith> file. I would like to retrieve these modules, and only these Keith> modules. Currently, If I load the file and get all the modules with Keith> getFirstModule/getNextModule I also get all of the modules that were Keith> imported by this file (which is a lot). Is there any way to get only Keith> the defined modules in a single file? Thanks.
No.
Files cannot be used as a key for module lookup. In fact, you can only directly access a specific module (other other kind of item) or iterate via getFirst/getNext.
What you can do is to iterate over all modules and check the SmiModule.path attribute of each module and then retrieve the relevant contents only from those modules that have a matching filename.
-frank -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.
participants (2)
-
Frank Strauss
-
Keith Dart