
In dump-xsd.c, in the function fprintElement, these lines occur:
fprintAnnotationElem( f, smiNode ); if( ! hint ) { fprintTypedef( f, smiType, NULL ); } else { fprintTypeWithHint( f, smiNode, smiType, hint ); }
In the function fprintIndexAttr, we instead find
if( ! hint ) { fprintAnnotationElem( f, smiNode ); fprintTypedef( f, smiType, NULL ); } else { fprintTypeWithHint( f, smiNode, smiType, hint ); }
I think that also in the latter case should fprintAnnotationElem be called before the test. What happens otherwise is that the description of an index element will not be output if the element has a display hint.
MIB for testing:
TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS MODULE-IDENTITY, enterprises, Integer32, OBJECT-TYPE, IpAddress, Unsigned32 FROM SNMPv2-SMI DisplayString, TruthValue, RowStatus FROM SNMPv2-TC;
testMib MODULE-IDENTITY LAST-UPDATED "200801140000Z" ORGANIZATION "org" CONTACT-INFO "here" DESCRIPTION "desc" REVISION "200801140000Z" DESCRIPTION "desc" ::= { enterprises 100 }
testObjects OBJECT IDENTIFIER ::= { testMib 1 }
testTable OBJECT-TYPE SYNTAX SEQUENCE OF TestEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "desc Table" ::= { testObjects 1 }
testEntry OBJECT-TYPE SYNTAX TestEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "desc Entry" INDEX { testProgramId } ::= {testTable 1 }
TestEntry ::= SEQUENCE { testProgramId DisplayString, testMajorName DisplayString }
testProgramId OBJECT-TYPE SYNTAX DisplayString(SIZE(0..12)) MAX-ACCESS not-accessible STATUS current DESCRIPTION "desc ProgramId" ::= { testEntry 1 }
testMajorName OBJECT-TYPE SYNTAX DisplayString(SIZE(0..32)) MAX-ACCESS read-create STATUS current DESCRIPTION "desc MajorName" ::= { testEntry 2 }
END

Hi Arndt!
Arndt Jonasson wrote:
In dump-xsd.c, in the function fprintElement, these lines occur:
fprintAnnotationElem( f, smiNode ); if( ! hint ) { fprintTypedef( f, smiType, NULL ); } else { fprintTypeWithHint( f, smiNode, smiType, hint ); }
In the function fprintIndexAttr, we instead find
if( ! hint ) { fprintAnnotationElem( f, smiNode ); fprintTypedef( f, smiType, NULL ); } else { fprintTypeWithHint( f, smiNode, smiType, hint ); }
I think that also in the latter case should fprintAnnotationElem be called before the test. What happens otherwise is that the description of an index element will not be output if the element has a display hint.
Yes, I agree with you. Thanks for pointing this out. I submitted the modified version to the svn repository.
Best regards, Torsten
participants (2)
-
Arndt Jonasson
-
Torsten Klie