Re: Returning a double value

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2008/7/4 Victor Palacio <[email protected]>:
> Float is not a problem, using Float from NET-SNMP-TC, and returning a
> ASN_OPAQUE_FLOAT from agent code.


> But what can I do for returning a double precision parameter?

Use ASN_OPAQUE_DOUBLE


> 1st problem) In example mibs does not exists a Double value

There isn't a TC definition for double, so you would need to
define one yourself.  But the library code is geared up to
handle double-precision values.


> 2nd problem) prototype functions for returning values works with long type,
> which is a 4 bytes type. Double use 8 bytes representations.

Eh?   Values are typically handled via generic pointers,
which can therefore handle any type (or size) of value.
Alternatively, the 'netsnmp_vardata' union (which is used
in varbinds) includes fields for both 'floatVal' and 'doubleVal'.

I'm not sure what prototype functions you are referring to.

Dave

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.