
The python & perl smidump modules (and possibly others) don't generate useful code for size/range constraint unions. For example, an object defined with syntax: SYNTAX OCTET STRING (SIZE (1|8)) will result in the following dumped python code:
"syntax" : { "type" : { "basetype" : "OctetString", "range" : { "min" : "1", "max" : "1" } "range" : { "min" : "8", "max" : "8" }, }, }
This isn't very useful, since the second assignment to the 'range' dictionary key blows away the first one.
I have written a patch for the python & perl dumpers to fix this problem. It creates a new key called 'ranges' which references a list of range dictionaries. To ensure backward compatibility, the last 'range' key/value pair is retained.
With this patch, the above syntax clause will now get dumped as:
"syntax" : { "type" : { "basetype" : "OctetString", "ranges" : [ { "min" : "1", "max" : "1" }, { "min" : "8", "max" : "8" }, ], "range" : { "min" : "8", "max" : "8" }, }, },
This allows knowledgeable apps to iterate through the 'ranges' list and properly deal with constraint unions, while older apps can still use the original, but possibly incorrect, 'range' key.
thanks, --randy