How to implement Counter64

Vinh Nguyen <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi all,

Does anyone know how to implement a Counter64 variable (in a subagent) 
using net-snmp?
The mib2c code automatically sets the type to long (wrong, 32 bit 
integer), but together with a note saying that I need to check the type.

 From the source code, there seems to be a special struct U64 but there 
is no examples or tut that mentions this so I'm not sure how to use it. 
Could someone give me a pointer or let me know of any existing examples?

Also, if instead of using that U64 type, I store my data as an "unsigned 
long long" (64bit) in C++, and on retrieving data for snmp GET, use 
pointer to this variable + set type to ASN_COUNTER64, would it work?
I mean something like this (C++ code)

//store data in 64 bit integer
static unsigned long long myvar;

//give this data to handler function on GET request
snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER64, (u_char *) 
& myvar, sizeof(myval));


Lots of thanks,
Vinh




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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.