On Wed, Jan 17, 2007 at 12:01:19AM +0100, Alef Veld wrote:
> Thanks Wes.
> I figured out the 1 part. I'm not sure what you mean exactly by
> number 2 though. Do you mean
> that the long is defined 32bits on my machine ? If so, are you
> implying i need an even bigger number to host the long * ? I just
> need a proper way to stuff the long * dereferenced value into
> my char * pointer. I'm probably just missing something though that
> will pop op one of these days :-)
The largest 32-bit integer is 4294967296, and this forms:
4294967296 ticks @ 100th of a sec
42949672 seconds
715827 minutes
11930 hours
497 days
If the device is up for more than 497 days, it wraps around to zero, and
you can't really tell directly whether it was a reboot or a counter wrap
(though it's probably possible to intuit this via other means, such as
noting that the interface counters didn't reset).
But if it's a Windows, machine, this won't ever come up ;-)
Steve
---
Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561
www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED]
> >>>>>> "AV" == Alef Veld <[EMAIL PROTECTED]> writes:
> >
> > AV> The other question i have is, how do i calculate the uptime in
> > days,
> > AV> because all i have is the number of timeticks. Or can you actually
> > AV> read out the days. I don't think so, so there must be some
> > algorithm
> > AV> for that.
> >
> > 2 points:
> >
> > 1) sysuptime is in 1/100s of a second. So you can calculate the
> > number of days by sysUpTime/100/60/60/24.
> >
> > 2) it is defined as a 32 bit integer. Thus it does wrap after that
> > and you can't determine if it's been up longer than the wrap time.
> > --
> > Wes Hardaker
> > Sparta, Inc.
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
--
Stephen J Friedl | Security Consultant | UNIX Wizard | +1 714 544-6561
www.unixwiz.net | Tustin, Calif. USA | Microsoft MVP | [EMAIL PROTECTED]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders