
Hi!
Joerg> I noticed that smidump creates the same method twice when it Joerg> dumps jax output for an entry in my MIB. I saw the same Joerg> behaviour also with other (surely correctly formatted MIBs).
Joerg> For example, my MIB looks like this:
Joerg> .... Joerg> allOpsEntry OBJECT-TYPE Joerg> SYNTAX AllOpsEntry Joerg> MAX-ACCESS not-accessible Joerg> STATUS current Joerg> DESCRIPTION "" Joerg> INDEX { identifier } Joerg> ::= { allOpsTable 1 }
Joerg> AllOpsEntry ::= SEQUENCE { Joerg> identifier Integer32, Joerg> sender DisplayString, Joerg> recipient DisplayString Joerg> } Joerg> ....
Joerg> No errors are reported by smidump, but the generated code for Joerg> AllOpsEntry goes like:
Joerg> ... Joerg> public int get_identifier() Joerg> { Joerg> return identifier; Joerg> }
Joerg> public int get_identifier() Joerg> { Joerg> return identifier; Joerg> } Joerg> ...
Joerg> I would be happy if someone could help me, Joerg> Joerg.
I guess, your definition of `identifier' through an OBJECT-TYPE says that it is *not* `not-accessible', although it should be, see RFC 2578, Section 7.7. and what it says on auxiliary objects. However, what smidump generates in this case is obviously wrong. Please apply the attached patch. It will also be integrated with the next libsmi release.
Thanks for this bug report,
-frank
Index: dump-jax.c =================================================================== RCS file: /usr/home/strauss/.cvs-repository/libsmi/tools/dump-jax.c,v retrieving revision 1.35 diff -u -r1.35 dump-jax.c --- dump-jax.c 2001/02/15 17:08:16 1.35 +++ dump-jax.c 2001/03/15 17:30:48 @@ -636,14 +636,22 @@ columnNode = smiGetNextChildNode(columnNode)) { smiType = smiGetNodeType(columnNode); if (columnNode->access >= SMI_ACCESS_NOTIFY) { - fprintf(f, - " public %s get_%s()\n" - " {\n" - " return %s;\n" - " }\n" - "\n", - getJavaType(smiType), - columnNode->name, columnNode->name); + for (element = smiGetFirstElement(smiNode); + element; + element = smiGetNextElement(element)) { + indexNode = smiGetElementNode(element); + if (indexNode == columnNode) break; + } + if (!element) { + fprintf(f, + " public %s get_%s()\n" + " {\n" + " return %s;\n" + " }\n" + "\n", + getJavaType(smiType), + columnNode->name, columnNode->name); + } } if (columnNode->access == SMI_ACCESS_READ_WRITE) { fprintf(f, -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.