[AGENT++] Failing to validate MibLeaf object with latest version of the agent?
Frank Fock
fock at agentpp.com
Thu Dec 8 22:31:11 CET 2005
Hi Feja,
Your approach is OK. The standard approach is to define a DEFVAL clause
for any object the can be created.
Best regards,
Frank
Fedja Jeleskovic wrote:
>Well, I am still in process of fixing all of the bugs that showed up since my upgrade from 3.5.16 to 3.5.24 and I have found the following issue and I was wondering what to do about it. Basically, new code from
>MibLeaf::get_request (see below) is checking now for the validity of the object (wasn't before) and my table ends up short for those objects that are not initialized to even dummy values. So, if I initialize those missing values in the TableEntry constructor, then values get valid and I could use my previous way of getting data successfully (in the get_request, I would call set_state with the correct value and that would be successfully returned).
>
>So, am I doing the right thing now, or there is better way to initialize the table and return those values?
>
>Thanks
>
>
>Fedja
>
>
>ps. snippet of the new code from the mib.cpp:
>void MibLeaf::get_request(Request* req, int ind)
>{
> if (get_access() >= READONLY) {
> if ((my_table) && (valid() == 0)) {
> Vbx vb(req->get_oid(ind));
> vb.set_syntax(sNMP_SYNTAX_NOSUCHINSTANCE);
> req->finish(ind, vb);
> }
> else {
> req->finish(ind, get_value());
> }
> }
> else {
> req->error(ind, SNMP_ERROR_NO_ACCESS);
> }
>}
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/agentpp
>
>
>
>
--
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com
More information about the AGENTPP
mailing list