From: Vinh N. <vi...@sp...> - 2007-10-09 01:53:53
|
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 |