A MibTable::prepare_set_request() question

Alex Finogenov afinogenov____malibunet.com
Fri Aug 24 04:25:57 CEST 2001


Frank,

Using DEFVAL is an elegant workaround, but I am not sure if it is a valid
requirement.

I am describing a case when agent++ rejects a SET-CREATE request that
contains all of the required varbinds. It seems to me that the problem is in
the way that the agent++ validates this type of request: it requires the
column's value either to be initialized prior to committing the request, or
differ from the value of the relevant varbind.

Why the validation of the presence of all required columns, and validation
of the values themselves done in MibTable::check_creation() is not enough?
Why should the varbinds and required columns be either initialized or have a
different value before the commit, when the values are actually set?

Unless I miss something, the requirement that a varbind value must be
different from the default value of the column means that this is an
implementation dependent issue, because in an agent implemented in an
arbitrary language and running on an arbitrary architecture columns could be
initialized to arbitrary values. 

I would like to understand the logic behind this piece of the code. I worked
around this problem by forcing the default values for columns of integral
types to pass the validity test in MibTable::ready(). Technically, I believe
I am not breaking any rules since a comment on MibLeaf's validity states
that client code is free to use spare validity bits to track client-specific
states.

Thanks,
Alex

> -----Original Message-----
> From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
> Sent: Thursday, August 23, 2001 4:24 PM
> To: Alex Finogenov
> Cc: 'agentpp-dl____agentpp.com'
> Subject: Re: A MibTable::prepare_set_request() question
> 
> 
> Alex,
> 
> The standard says that each object that has no default value must
> be explicitly written by a manager in order to change a RowStatus
> from notReady to notInService. If your 0 value is a proper default
> value why not defining it as DEFVAL?
> 
> Hope this helps.
> 
> Best regards,
> Frank
> 
> Alex Finogenov wrote:
> 
> > Frank and Jochen,
> >
> > I have noticed, that a create request on a table with a required
> > no-default-value column of an unsigned int type FAILS when 
> the value of the
> > column's varbind is 0, even though it is a valid value and 
> varbinds for all
> > other required columns are present with respectively valid values.
> >
> > The culprit seems to be the statement:
> >
> > if(!l->valid() && (l->get_value() == pvbs[i]))
> > {
> >     ...
> >     return FALSE;
> > }
> >
> > It is located inside MibTable::ready(), that is invoked at 
> the end of
> > MibTable::check_creation(), that is called by
> > MibTable::prepare_set_request(). At the time of the failure 
> the leaf is NOT
> > valid because it is not a DEFVAL and has not passed through
> > MibTable::commit_set_request(). Since the initial value for 
> it is 0, and it
> > equals to the new value (pvbs[i]), the condition fails altogether.
> >
> > Do you have any comments or suggestions?
> >
> > Thanks,
> > Alex
> 



More information about the AGENTPP mailing list