>>>>> On Wed, 12 May 2010 09:32:59 +0200 (CEST), Tomas Macek <[email protected]> 
>>>>> said:

TM> i64 = vp->val.counter64->low;
TM> i64 |= vp->val.counter64->high << 32;
TM> the proper implementation on 64bit system? Or how should I work with 
TM> counter64?

Well, that will work but you should be using an unsigned long for i64
rather than a long.  If you're sure that all your systems will support
an unsigned long being 64 bits then you can use that.  The reason the
base code doesn't is that we support many systems without 64 bit
support.  There are other functions in the snmplib/int64.c file that you
can use for manipulating the counter64 struct (such as printing, adding,
...)

TM> Or is there any function, that writes the value to the buffer? The 
TM> function snprint_variable() writes more than only the number, so it's 
TM> IMHO useless for my purpose.

printU64 is what you're looking for (U64 is a struct counter64).
-- 
Wes Hardaker
Please mail all replies to [email protected]

------------------------------------------------------------------------------

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to