
Juergen Schoenwaelder writes:
On Fri, Nov 02, 2007 at 04:12:54PM +0100, Arndt Jonasson wrote:
In the file tools/fortopat.c is this code:
for (range = smiRange, lp = 0; range; range = smiGetNextRange(range)) { lengths[lp++] = smiRange->minValue.value.unsigned32; lengths[lp++] = smiRange->maxValue.value.unsigned32;
This ought to be
for (range = smiRange, lp = 0; range; range = smiGetNextRange(range)) { lengths[lp++] = range->minValue.value.unsigned32; lengths[lp++] = range->maxValue.value.unsigned32;
or the ranges after the first one will effectively be ignored.
Thanks and fixed in the SVN.
Note that the format string to xsd pattern translation algorithm is actually broken and needs to be rewritten. This became clear when I started to add support for YANG; so I assume that not many people really have actually used the XSD mapping since we never received a bug report that the translation generates broken XSD (in the sense that you can't use it to validate instance documents).
I have been using a local adaptation of dump-xsd.c to generate our own XML schema format, and (with some fixes which I have reported) it seems to work at least for all the standard IETF mibs. Understanding it fully hasn't been my primary concern, though, and there may be lurking bugs.
Here is one more diff, which I forgot to report earlier. Also in fortopat.c:
if( iterDH->separator ) { /* iterDH->repTerm = hint[ pos++ ]; // repeat not supported */ pos++; } else { if( hint[ pos++ ] == '.' ) { iterDH->separator[0] = '\'; iterDH->separator[1] = '.'; } else iterDH->separator[0] = hint[ pos ]; }
should be
if( iterDH->separator[0] ) { /* iterDH->repTerm = hint[ pos++ ]; // repeat not supported */ pos++; } else { iterDH->separator[0] = hint[ pos++ ]; if (iterDH->separator[0] == '.') { iterDH->separator[0] = '\'; iterDH->separator[1] = '.'; } }