Agent++/Snmp++ on Solaris8 64bit

Frank Fock Frank.Fock____t-online.de
Wed Feb 13 19:28:45 CET 2002


Hello Christian,

Thanks for sorting this out. I will look into the code to fix this problem.
Especially the very old code from CMU has some bad casts and
presumptions about data type sizes. It stands to reason since 64bit
architectures were not existent that time.

Best regards,
Frank

"Bettendorf, Cristian" wrote:

> Hello Frank,
>
> My short investigation, shows that the code is not 64bit compatible. Please
> take a look and give me feedback.
>
> 1. the code works on Tru64 /Digital UX but this is a positive side effect
> and shows only that the serialization looks to be ok, not the full code...
>
> 2. the Tru64 use a little endian hardware architecture, this hide the real
> problems in the code
>
> 3. the Sol8 64bit use a big endian hardware architecture, sizes here
> (identical with Tru64):
> long      : 8
> pointer   : 8
> short     : 2
> int       : 4
> char      : 1
> long long : 8
>
> Now I have analysed why the snmpGet don't work and find a type cast into the
> code
> file: snmp++/src/snmpmsg.cpp, fct int SnmpMessage::load(...)
>
> (int *) &bufflen
>
> Now, buflen is defined as 'unsigned long', this cast here to the high 4
> bytes of the buflen! Then other calls will break with error since the value
> is wrong...
> On win32, solaris 32bit the sizeof int == size of long == 4 bytes, also
> identical -> no problem; on tru64 due the little endian architecture the
> cast works too since get the 4 low bytes from buflen and the value can be
> represented only using this 4 bytes.
>
> I have stopped here the analysis since this is the first problem which kill
> snmpGet.
>
> Do I miss something?
>
> Cristian





More information about the AGENTPP mailing list