
Hi!
Steve> I have a table entry with an index that happens to be an Steve> enumeration. An excerpt from the mib follows. When I run Steve> smidump on the mib, the enumerations are lost. The generated Steve> type is "Enumeration". I would have expected there to be a Steve> Type of integer with an enumeration of restrictions just as if Steve> the index was any other element in the entry. I assume this is Steve> either a bug or functionality that hasn't been completed. I Steve> would expect to see the restriction information in the XSD Steve> file. Am I wrong?
I assume, you are using an older version of libsmi. The xsd output driver is one of the parts on which we work quite frequently these days. So, I'd suggest to use the libsmi version from the anonymous CVS repository.
I don't know your full MIB, so I couldn't compile it. So here is an excerpt from the current "mibdump -f xsd DIFFSERV-MIB" output. The DIFFSERV-MIB uses the enumeration type IfDirection for indexing.
<xsd:element name="diffServDataPathEntry" minOccurs="0" maxOccurs="unbounded"> [...] <xsd:attribute name="diffServDataPathIfDirection" type="IfDirection"> [...]
<xsd:simpleType name="IfDirection"> [...] <xsd:restriction base="xsd:NMTOKEN"> <xsd:enumeration value="inbound"> xsd:annotation xsd:appinfo <intVal>1</intVal> </xsd:appinfo> </xsd:annotation> </xsd:enumeration> <xsd:enumeration value="outbound"> xsd:annotation xsd:appinfo <intVal>2</intVal> </xsd:appinfo> </xsd:annotation> </xsd:enumeration> </xsd:restriction> </xsd:simpleType>
As you can see, the enumeration type IfDirection is now used in the indexing attribute and the type is defined as an XSD simpleType of base type NMTOKEN with restrictions that allow the names of the SMI named-numbers. The according integer values are just retained as <appinfo> data. We prefer this way (instead of using integer as the underlying base type), because we want to get an XML representation that is as human (and XML-) friendly as possible.
-frank