
I have a table entry with an index that happens to be an enumeration. An excerpt from the mib follows. When I run smidump on the mib, the enumerations are lost. The generated type is "Enumeration". I would have expected there to be a Type of integer with an enumeration of restrictions just as if the index was any other element in the entry. I assume this is either a bug or functionality that hasn't been completed. I would expect to see the restriction information in the XSD file. Am I wrong?
Steve
MIB:
subsysEntry OBJECT-TYPE SYNTAX SubsysEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The information about a Subsystem." INDEX { subsysId } ::= { subsysTable 1 }
subsysId OBJECT-TYPE SYNTAX INTEGER { platform(1), management(2), ss7(3), auth(4), radius(5), clientIf(6), sessionMgr(7), accounting(8) } MAX-ACCESS not-accessible STATUS current DESCRIPTION "The SubSystem ID." ::= { subsysEntry 1 }
Generated XSD:
<xsd:attribute name="subsysId" type="Enumeration"> xsd:annotation xsd:appinfo <maxAccess>not-accessible</maxAccess> <status>current</status> <oid>1.3.6.1.4.1.14707.1.1.5.1.1.1</oid> </xsd:appinfo> xsd:documentation The SubSystem ID. </xsd:documentation> </xsd:annotation> </xsd:attribute>

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

Hi Steve!
On Fri, Dec 06, 2002 at 09:52:15AM -0500, Steve Bucknam wrote:
I have a table entry with an index that happens to be an enumeration. An excerpt from the mib follows. When I run smidump on the mib, the enumerations are lost. The generated type is "Enumeration". I would have expected there to be a Type of integer with an enumeration of restrictions just as if the index was any other element in the entry. I assume this is either a bug or functionality that hasn't been completed. I would expect to see the restriction information in the XSD file. Am I wrong?
No, you are absolutely right. The code for index attributes was still missing. I have extended the corresponding code and commited it to the CVS.
Regards, Torsten
participants (3)
-
Frank Strauss
-
Steve Bucknam
-
Torsten Klie