bugMibble MIB Parser - Bugs: bug #8862, The "Import" clause in...


bug #8862: The "Import" clause in MIB should try to load files with names other than the imported key

Submitter:  None
Submitted:  Mon 10 May 2004 04:59:28 PM UTC
Severity:  5 - Major Item Group:  Future Improvement
Status:  Fixed Privacy:  Public
Assigned to:  cederberg Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup

Thu 27 May 2004 01:26:08 PM UTC, comment #5: 

Version 2.4 has been released. Closing bug.

Per Cederberg <cederberg>
Group administrator
Thu 27 May 2004 12:13:00 AM UTC, comment #4: 

Fixed. The MibLoader first attempts to locate a MIB by file name and if that fails it then automatically checks all files in the directory search path until a match is found.

This fix will be part of the 2.4 release.

Per Cederberg <cederberg>
Group administrator
Tue 11 May 2004 07:58:10 PM UTC, comment #3: 

Ok, now I understand. Mibble currently doesn't do this for you. It attempts to find the MIB file based on the file name, assuming that the MIB file and the MIB has the same name (minus any additional extension). It currently isn't "clever" enough to find MIB files based names that are only present inside the file.

I'm adding this to my todo-list for the next version of Mibble. I guess the solution will be to read the first couple of lines of text in each file in the MIB path and checking the module name inside the file. This search should only be performed for files with a certain extension, though, or things risk becoming very slow.

In the meantime the workaround for this is to preload the MIB file that will be imported. That is, in version 2.3 Mibble checks the module names of loaded MIB files, so if the imported MIB has already been loaded it will be localized correctly. So if you first load the imported MIB with the same MibLoader and then the MIB you really wanted to load, things should work out correctly. Otherwise you could also change the file name, as you pointed out.

Per Cederberg <cederberg>
Group administrator
Mon 10 May 2004 09:07:03 PM UTC, comment #2: 

I will look into these two classes. Maybe I am supposed to add the file filter.

I have a few motorola mibs which i have been using as examples. Please find the attached mib files. I only add the directory to the MIB search path and tried to load the files (with .mib extensions), the import references the mib files using their mib definition names. I put these files in a folder where the standard mibs reside and tried to load one of the motorola mib files, it threw an exception, but when I renamed the files to their corresponding mib definition names, i was able to load them, without explicitly loading the MIBS.

Vivek S Srivastav <yantriki>
Mon 10 May 2004 06:53:36 PM UTC, comment #1: 

Mibble already attempts to load MIB files regardless of the file extension (be it .mib, .txt or any other). It is, however, currently case-sensitive on platforms that support it (i.e Unix). That is, loaded files should normally be named in UPPER-CASE if the MIB name is specified in that way.

See the MibLoader.locate() and the MibFileFilter classes for more details on the implementation of this.

Per Cederberg <cederberg>
Group administrator
Mon 10 May 2004 04:59:28 PM UTC, original submission:  

The Import syntax in the refers to "MIB definitions name" the original file that contain the MIB definitions being imported could have ".mib" or ".txt" extensions (common conventions). The import should try and look for such files before throwing not found exceptions.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #1296:  motorola.zip added by yantriki (75KiB - application/x-zip-compressed)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.


Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-05-27 cederberg Open/ClosedOpen Closed
2004-05-27 cederberg StatusNone Fixed
2004-05-11 cederberg Assigned toNone cederberg
2004-05-10 yantriki Attached File- Added motorola.zip, #1288
    Carbon-Copy- Added vsrivastav --AT-- optinel --DOT-- com

Back to the top

Powered by Savane 3.13-c373.
Corresponding source code