Using TRAP-TYPE instead of OBJECT-TYPE nodes as parent nodes

We've written a tiny MIB module to describe a single trap we send from one of our applications. Apart from the trap itself, the only objects in the module were there to provide variables carried in the trap notification.
To avoid adding "unnecessary" object types, I hung all the variables off the trap e.g.:
eltrap TRAP-TYPE ENTERPRISE trapObjs VARIABLES {v1, v2 } DESCRIPTION "blah blah" ::= 1
v1 OBJECT-TYPE SYNTAX DisplayString ... ::= { eltrap 1 }
Before sending this to a customer, we ran it through smilint. There were no errors or warnings reported. The customer's MIB compiler (from SNMP Research) objected as the parent node of v1 was a TRAP-TYPE instead of an OBJECT-TYPE.
Having the opportunity (:-)) to reconsider what I'd done, I see the error of my ways. However, was it an error? If so, is it a bug in smilint/libsmi that the error wasn't reported?
The version is libsmi 0.3.0 on Linux.

Hi!
Pat> We've written a tiny MIB module to describe a single trap we send from Pat> one of our applications. Apart from the trap itself, the only objects Pat> in the module were there to provide variables carried in the trap Pat> notification.
Pat> To avoid adding "unnecessary" object types, I hung all the variables Pat> off the trap e.g.:
Pat> eltrap TRAP-TYPE Pat> ENTERPRISE trapObjs Pat> VARIABLES {v1, v2 } Pat> DESCRIPTION Pat> "blah blah" Pat> ::= 1
Pat> v1 OBJECT-TYPE Pat> SYNTAX DisplayString Pat> ... Pat> ::= { eltrap 1 }
Pat> Before sending this to a customer, we ran it through smilint. There Pat> were no errors or warnings reported. The customer's MIB compiler (from Pat> SNMP Research) objected as the parent node of v1 was a TRAP-TYPE Pat> instead of an OBJECT-TYPE.
Pat> Having the opportunity (:-)) to reconsider what I'd done, I see the Pat> error of my ways. However, was it an error? If so, is it a bug in Pat> smilint/libsmi that the error wasn't reported?
Pat> The version is libsmi 0.3.0 on Linux.
Yes. This should be reported as an error by smilint. I'll take a closer look and hope to get parent node checks added in the next libsmi release. Thanks for pointing this out.
-frank

Hi!
Pat> [...] The customer's MIB compiler (from SNMP Research) objected Pat> as the parent node of v1 was a TRAP-TYPE instead of an Pat> OBJECT-TYPE. [...] is it a bug in smilint/libsmi that the error Pat> wasn't reported?
Frank> Yes. This should be reported as an error by smilint. [...]
I've added appropriate checks to libsmi. You can retrieve it from the anonymous CVS repository.
-frank
participants (2)
-
Frank Strauss
-
Pat Knight