Closed CarlHenrik closed 1 week ago
Hi @CarlHenrik - thanks for raising this. I haven't been able to find a steer in either RFC 1155 (SMIv1) or RFC 2578 (SMIv2) on whether out-of-order references should be supported or not.
So in the absence of RFC guidance, I agree that this would be good to support. I'm open to a PR here, or to implementing this myself.
I'll see if I can find time to create a PR within the next few days.
Created pull request #254 to resolve this issue.
Thanks heaps @CarlHenrik - I've merged #254 now and published in version 3.13.0 of the npm.
Issue
MIBs that have object identifiers out of order fails to compile correctly, as the OID at some point fails to mount onto parent. Example:
The
powerMIB
object fails to get an OID, since the parentglobal
object has not yet been parsed. https://github.com/markabrahams/node-net-snmp/blob/ce3691a01ca2e5a5ac8993f3dc96861f337421bb/lib/mib.js#L768-L788I assume you are already aware of this, as comments on line 782-783 mention this particular scenario. I have provided a real MIB with this exact issue (again from Emerson...), and this compiles fine in other MIB tools: M530S-power.mib.txt
I don't know if this out of order dependency is violating the SMI standard, but since other tools can handle it so should probably this one as well.
How to reproduce
powerMIB
object in module store.Proposed solution
looseEnds
for tracking.looseEnds
.looseEnds
is not empty.