[erlang-questions] snmpc: Error when compiling RFC 4669 MIB and others

Daniel Goertzen daniel.goertzen@REDACTED
Tue Dec 20 16:20:58 CET 2016


I think the relevant piece of compiler code is this:

https://github.com/erlang/otp/blob/maint/lib/snmp/src/compile/snmpc_mib_gram.yrl#L385-L395

The way I read this is that size refinement is allowed on a usertype, but
enumeration refinement is not implemented, but should be.  The RFC talking
about this is https://tools.ietf.org/html/rfc2578#section-9

I suggest filing this at https://bugs.erlang.org





On Tue, Dec 20, 2016 at 6:48 AM Kenneth Lakin <kennethlakin@REDACTED>
wrote:

On 12/19/2016 09:11 AM, Daniel Goertzen wrote:
> On the lines that have errors, does it help if you change the type to
> INTEGER? (ie InetAddressType becomes INTEGER).

It does. If I change the type of that object to either INTEGER or
InetAddress, the MIB is accepted by the compiler.

I have a minimal MIB that the compiler chokes on. Other than complaints
about unused imports and about how an object of type "InetAddress" isn't
preceded by an object of type "InetAddressType", other MIB checkers
don't appear to see any problems with it. See:

https://gist.github.com/kennethlakin/c4b17c94ea1d9a97d4db1c35c0b64b78
or
https://gist.githubusercontent.com/kennethlakin/c4b17c94ea1d9a97d4db1c35c0b64b78/raw/10fa8078f33fa402d07b6613445597b35e94564d/TEST-MIB.mib

Switch the type of testObj from InetAddressType to InetAddress to get a
file that'll pass through the snmpc MIB compiler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161220/ff874f26/attachment.htm>


More information about the erlang-questions mailing list