[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Mibble-users] mib loader
From: |
Yun Freund |
Subject: |
RE: [Mibble-users] mib loader |
Date: |
Mon, 16 Feb 2004 10:00:50 -0800 |
Hi, Per, thanks very much for the reply. First of all, it is ok to
modify your MibLoader and included into our product? (you are GPL
licensed, right?)
Secondly, I tried to modify MibLoader but some of the classes like
DefaultContext is not defined as public and so it is hard to modify only
MibLoader without include other source file.
So if you could patch the mibloader, it would be much easier for us to
use. Do you know if you have any timeline for version 2.3 and as well as
the improvement request?
Yun
-----Original Message-----
From: Per Cederberg [mailto:address@hidden
Sent: Monday, February 16, 2004 8:43 AM
To: Announcements, support,and forum for Mibble users
Subject: Re: [Mibble-users] mib loader
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
_______________________________________________
Mibble-users mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/mibble-users