[AGENT++] SNMP++ on 64-bit architecture

Jochen Katz katz at agentpp.com
Mon Aug 11 23:00:13 CEST 2008


Hi Alex,

> The Vb class has get_value() and set_value() methods that take
> parameter of type "long" or "unsigned long" and set/get the SMI INT32
> or UNIT32 values respectively. However on 64-bit platform "long" is
> defined as 64-bit number (as opposed to "int" that is defined as
> 32-bit number both on 32-bit and 64-bit). So it should probably be
> more appropriate to use "int" and "unsigned int" types instead. In
> fact, Vb class has corresponding methods with "int" type, but not
> with "unsigned int" type...

ok, I 've added the function for unsigned int.

But it seems, that snmp++ has some more inconsitencies on 64 bit 
platform: The 32 bit value classes (like SnmpUInt32) use a long to store 
the value. Therefore you can set and get 64 bit long values to these 
classes without data loss. At least the ASN functions truncate the 
values before encoding the pdu. But I think the higher classes should 
only handle 32 bit values.

Regards,
   Jochen



More information about the AGENTPP mailing list