strange persistence problem

Frank Fock Frank.Fock____t-online.de
Fri Sep 27 00:13:51 CEST 2002


Hi Dave,

Are you sure that the syntax was Gauge32 when the object
has been written to disk?

May be the syntax had been changed accidentally by calling
replace_value?

The syntax is not checked when data is loaded, so if the
syntax of an object changes, one has to write conversion
routines to be able to use the old configuration files.

Hope this helps.

Best regards,
Frank

Dave Mason wrote:
> Hi,
> I have a problem where the syntax of an object appears to change after 
> the persistence data is read in.  Here is a code fragment from 
> agent.cpp.  In the MIB, wsSeqNum has SYNTAX Unsigned32, DEFVAL 0. 
> AgentGen Pro appears to translate this to Gauge32.
> 
>    // add supported objects
>    init(*mib);
>    // add user modules
>    module_init(mib);
> 
>    int rc;
>    unsigned long seqNum;
>    rc = wsSeqNum::instance->get_value(seqNum);
>    // load persitent objects from disk
>    mib->init();
>    rc = wsSeqNum::instance->get_value(seqNum);
> 
> The first get_value works fine, leaving seqNum with the initial default 
> value of 0.  The return code rc is 0.  However, after the mib->init(), 
> the same get_value fails because it now thinks the object syntax is a 
> signed integer.  The return code is -10.  Interestingly enough, the 
> second get_value works if I delete the persistence data files.  Any ideas?
> 
> Regards,
> Dave
> 
> 
> 







More information about the AGENTPP mailing list