
Hi,
In order to be able to parse all our mibs, I have made some changes to libsmi. Here are my proposed changes. (See attached patches).
1) I have added SMI_ACCESS_WRITE_ONLY, because in SMIv1 this is also a valid access. 2) I have added SMI_BASETYPE_CHOICE. If the CHOICE type was SMI_BASETYPE_UNKNOWN, an import of that type caused a failure. 3) For the enum values of SMI_BASETYPE_ENUM, also the lists of the parent types are checked. 4) In SMIv1 'INTEGER(0..4294967295)' is vallid. In order to be able to parse this, a selection between SMI_BASETYPE_INTEGER32, SMI_BASETYPE_UNSIGNED64 and SMI_BASETYPE_UNSIGNED32 is made, based on the range of the integerSubType. 5) For SMIv1, the status 'mandatory', 'deprecated', 'obsolete' and 'optional' are parsed, and set to SMI_STATUS_MANDATORY, SMI_STATUS_DEPRECATED, SMI_STATUS_OBSOLETE and SMI_STATUS_OPTIONAL. 6) I have changed the check '(a->value.unsigned32> 1)&& (a->value.unsigned32-1> 2147483647))' into '(a->value.unsigned32>= 0x80000000u)'. This does not give any overflow, because it's an unsigned comparison (Notice the 'u' at the end of 0x80000000u. 7) In the last if statement, the result of compareValues was wrong, the parameters of the subtraction had to be switched.
I have tested this with 'smi_dump -f xml' and the output is much better now.
I hope my changes can contribute.
:-) Koen Van Hoof
participants (1)
-
Koen Van Hoof