HI,

This is a long running frequently asked question that
comes up every few months.

SNMP is what it is. It is NOT ASN.1. It is NOT a
SUBSET of ASN.1. 

The ASN.1 types of BOOLEAN, FLOAT, DOUBLE, etc don't
exist in SNMP. There were many attempts to add them
and unsigned64, signed64, and discriminated unions.

So, the best course of action for the highest level
of interoperability is to encode the values in
text (making sure you support the special FLOAT
values such as "not a number" and "plus infinity".)
Text means a base type of OCTET STRING.
I'm guessing that is not the most desirable choice
for you, but it is the BEST choice at this time.

Send me private email if you have further questions.

Regards,
/david t. perkins

On Mon, 29 May 2006 [EMAIL PROTECTED] wrote:
> I am developing an SNMP-enabled application using the NET-SNMP libraries
> and have encountered a number of problems regarding support for "standard"
> ASN.1 types.
> 
> Specifically, I wish to use BOOLEAN and REAL values for representing data
> generated within my application (Agent-side). I believe these to be
> standard types as discussed in:
> 
>       http://www.itu.int/ITU-T/studygroups/com17/languages/X.680-0207.pdf
> 
> Specifically, the net-snmp libraries allow me to generate code that sets
> the value of a MIB attribute using any of the types that are defined in the
> asn1_defs.h header file, and yet some of these apparently supported types
> are not actually fully supported when parsing a MIB, i.e. ASN_BOOLEAN,
> ASN_FLOAT and ASN_DOUBLE (please, please, please, do not tell me about
> using the net-snmp special Opaque types!!!)
> 
> I wish/need to generate both agent and client side code and, using the perl
> scripts and configuration files as a template (as is suggested in the
> accompanying documentation) wish to perform some type-checking for sets and
> get-responses on each side. Consequently I wish to set the type of the
> variable within the agent code (as ASN_FLOAT, for example) and have the
> auto-generated client-side code perform a type check of $i.type (where I
> use @foreach $i scalar@ against the type in the netsnmp-variable
> definition.
> 
> How can I acheive this?
> 
> I have been playing around with some of the debug settings etc. in the perl
> script (for the SNMP.pm module) and it appears that the source code in
> parse.c (used to build the snmp.dll loaded and used by the perl script)
> does not recognise FLOAT, DOUBLE or REAL as valid ASN1 types (even though
> REAL is supported, and FLOAT and DOUBLE are defined in the ASN1 definitions
> header file).
> 
> Any comments?
> 
> Martin Cooke
> 
> 
> 
> -------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat certifications in
> the hosting industry. Fanatical Support. Click to learn more
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
> _______________________________________________
> Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
> 



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to