Open j-gooding opened 5 years ago
Well, this TEXTUAL-CONVENTION
does not include DISPLAY-HINT
clause -- this is the statement that drives human-friendly representation of the values. I came across this RFC on the floats. Though it does not seem to explain why there is no DISPLAY-HINT
in there...
Compiler-wise, it seems to behave as it should.
I've looked at the RFC and and those definitions while similar are not what my MIB uses, and even then that RFC still doesn't have a display hint defined for it. I am also not able to find any actual, working examples of using display hints with octet streams and not integers.
Further, I'm not entirely sure what you mean by the compiler is doing what it should? Is my MIB definition incomplete? I feel something is wrong here, or perhaps in pysnmp? Net-SNMP and two different proprietary applications not based on Net-SNMP are able to decode the Float type automatically without any issues.
The description of TEXTUAL-CONVENTION suggests that value interpretation should happen at implementation time. That makes me think that we need to add rfc6340.py module to pysnmp/smi/mibs with hand written code parsing and possibly building Float values.
My MIB file defines the following:
And pyasn1 generates the following code in the pysnmp compiled MIB file:
preforming an SNMP get on on values that use this data type return the following:
This is not what I expected, I expected a human readable number based off of the specification and the library generated Class. How do I display the decoded number? snap-get seems to handle this seamlessly.