bugMibble MIB Parser - Bugs: bug #37218, Cannot read multiple MIB...

 
 

bug #37218: Cannot read multiple MIB definitions in one mib file

Submitted by:  Noritaka Sekiyama <moomindani>
Submitted on:  Wed 29 Aug 2012 08:04:12 AM UTC  
 
Severity: 2 - NormalItem Group: Software
Status: InvalidPrivacy: Public
Assigned to: Per Cederberg <cederberg>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 14 Oct 2012 02:53:17 PM UTC, comment #1:

The MibLoader actually loads both MIB:s, but always only returns the first MIB loaded from the specified source. See API docs for MibLoader.getMib(File) for instance:

"Note that if the file contained several MIB modules, this method will only return the first one."

In order to access all MIB:s loaded, use the method getAllMibs() instead. Note that this will also return "dependency" MIB:s. I.e. the IETF MIB:s that were referenced by the loaded MIB file.

The MibbleBrowser app doesn't handle this case correctly, however. So I've added a new bug for that:
https://github.com/cederberg/mibble/issues/7

Per Cederberg <cederberg>
Project AdministratorIn charge of this item.
Wed 29 Aug 2012 08:04:12 AM UTC, original submission:

In case that multiple MIB definitions (multiple BEGIN - END tokens) are in one mib file,
MibLoader(net.percederberg.mibble.MibLoader) cannot read MIB definitions except the first definition.

Following is the debug code.

---

MibLoader loader = null;
Mib mib = null;

...

loader = new MibLoader();
loader.reset();

mib = loader.load(new File(mibFileName));
Collection symbols = mib.getAllSymbols();
Iterator<MibSymbol> itr = symbols.iterator();

while(itr.hasNext()){
MibSymbol symbol = itr.next();

...
}

Noritaka Sekiyama <moomindani>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #26441:  TEST-MIB-AB.txt added by moomindani (3KiB - text/plain - Mib file containing multiple MIB definitions)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cederberg (Posted a comment)
  • -unavailable- added by moomindani (Submitted the item)
  • -unavailable- added by moomindani
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 14 Oct 2012 02:53:17 PM UTCcederbergSeverity5 - Major=>2 - Normal
      StatusNone=>Invalid
      Assigned toNone=>cederberg
      Open/ClosedOpen=>Closed
    Wed 29 Aug 2012 08:04:12 AM UTCmoomindaniAttached File-=>Added TEST-MIB-AB.txt, #26441
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1