RE: COUNTER64 Error

<[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Thanks for ur inputs

I tried somthing like this 
long long lval;
struct counter64 count;
count.low = lval&0x00000000ffffffff;
count.high = lval&0xffffffff00000000;
this is also working.


Rgards,
Sasikumar.



-----Original Message-----
From: Dave Shield [mailto:[email protected]]
Sent: Tue 2/14/2006 8:06 PM
To: Sasikumar Bodathula (WT01 - Broadband Networks)
Cc: [email protected]
Subject: RE: COUNTER64 Error
 
On Tue, 2006-02-14 at 19:08 +0530, [email protected] wrote:
>     IN the "struct counter64" it has two value low and high as
> attributes.

That's correct - being the lower and upper 32-bits of the 64-bit
value respectively.


>  Is there any example code which comes with net-snmp src package
> which i can refer.

Try something like:

    long long        single64;
    struct counter64 two32s;

    two32s.high = (single64 >> 32) & 0xffff; 
    two32s.low  = (single64)       & 0xffff; 

    single64 = (two32s.high << 32) + two32s.low;

Dave
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.