mibble-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mibble-users] mib loader


From: Per Cederberg
Subject: Re: [Mibble-users] mib loader
Date: Mon, 16 Feb 2004 17:42:30 +0100

On Fri, 2004-02-13 at 00:55, Yun Freund wrote:
> Hi, Mibble-users, I have two questions:
>
> 1)       when mibloader is loading import, is it looking for the file
> name match, not the mib definition name inside the file. For example,
> I have a mib that is looking for 
> 
> IMPORTS
>     fooMibs
> FROM FOO-NETWORKS-ROOT-MIB;
> 
> But the mib file defining that is called foo_root_mib. Is there a way
> I can customize the loader to have the loader looking for the
> definition name inside the file, instead of the file name?

This is a known issue in MibLoader. I'm planning to fix it for
version 2.3 but haven't gotten around to do it yet. See bug 
#6959 for details:
https://savannah.nongnu.org/bugs/?func=detailitem&item_id=6959

One way to fix this, I think, would be to make a small patch
to the MibLoader class. If you like, try adding something like 
this to the internal locate() method (untested code below):

private MibSource locate(String name) {
    ... previous variables ...
    Mib   mib;

    mib = getMib(name);
    if (mib != null) {
        return new MibSource(mib.getFile());
    }
    ... remaining code (two for loops)...
}

In the end, things may be a bit more complex than this, especially
if we're going to add support for loading MIBs from other sources
(see below).

> 2)       is it possible to load all the mibs from a jar file? For
> example, we want to package all the mibs into a jar file when we
> distribute the software and perhaps pass the loader a inputstream.

Ever thought about how Mibble distributes the default IANA and 
IETF MIBs?  ;-)

Actually, the main reason for the mibble.jar being so large is
because it contains *lots* of default MIBs inside. Now, being
the lazy person I am, I never got around to add any external 
API for loading MIBs as resources from the CLASSPATH (which is 
what you do when you load things from the jar).

As before, however, there is a simple way to patch Mibble to do
what you want it to. Add the jar directory name to the 
RESOURCE_BASE array in MibLoader and it will automatically look
in that (jar) directory. Files *must* be named like Mibble 
expects when present here, however, as the previous patch only
works for files.

Anyway, I've added a future improvement request for this (#7746):
https://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=7746

Cheers,

/Per






reply via email to

[Prev in Thread] Current Thread [Next in Thread]