On Wed, 25 Aug 2004 09:06:01 +0100 Dave wrote:
DS> Richard> All of interface.c uses ulong and long for the values. Hence if
DS> Richard> the kernel reports > (2^32)-1 then you get that value reported
DS> Richard> upwards.
DS> 
DS> Ummm...
DS> What would happen if the "snmp_set_var_value" API call (and similar)
DS> applied a 32-bit mask to any integer-based value that it received?
DS> Would that help any, or might it introduce other problems?

Shouldn't it occur lower in the library, so it is applied more places? I'd
think the asn code would be the place to do it.

DS> I'd suggest that the first thing would be to make sure that we have
DS> suitable 32-bit types available - either defining new project-specific
DS> types, or pick on a "standard" one and make sure it's defined
DS> e.g.
DS>     #ifndef HAVE_32BIT_INT
DS>     typedef uin32_t   whatever_int;
DS>     #endif

I'd vote for the <inttypes.h>/<stdint.h> style (more C99 headers). I'd like to
avoid project specific types...

I poked around a bit on Linux and FreeBSD, and couldn't find a good way to tell
if 64 bit types were available. On Linux you can check if __WORDSIZE == 64. On
Sun, if I recall, you can check ifdef __ILP64__.  Couldn't find anything on
FreeBSD.

DS> That's probably something that could go in for 5.2,
DS> which would then provide the groundwork for starting to make use of it
DS> in later releases.

Should we change/define one variable somewhere in snmplib to use it, to catch
platforms where it isn't defined?  Currently there are some [u]int32_t vars
sprinkled throughout the code, but I think they are protected by ifdefs or are
in non-default modules.

So the question is, when do we want to take the hit of discovering which
platforms need configure changes to check for additional headers?


-- 
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to