[AGENT++] MibTable Problem: Destroy a non-existing Row
Frank Fock
fock at agentpp.com
Wed Feb 22 20:56:58 CET 2006
Hello Jens,
The MibTable does not have the described problem by default.
(At least I cannot reproduce it with the ATM-MIB example
agent)
Did you modify the MibTable sources or add a special listener?
Thanks,
Frank
Jens Engel wrote:
> Hello,
>
> the MibTable implementation has a problem when a SNMP client tries to
> destroy a non-existing row, ala:
>
> snmpset myRowStatus.123 = destroy
>
> The row is marked as destroyed but will never be removed.
> In addition, it is not possible to destroy anymore by trying it a second
> time (causes a SNMP response error).
>
> PATCH: file:agent_pp/mib.cpp
> int MibTable::set_value(Request* req, int reqind)
> {
> int status = SNMP_ERROR_SUCCESS;
> Oidx tmpoid(req->get_oid(reqind));
> MibLeaf* o;
>
> if ((o = find(tmpoid)) != 0) {
> // -- ROW-EXISTS:
> ...
> }
> else {
> // -- UNKNOWN-ROW: Row does not exist yet.
> ...
> if (row_status) {
> Oidx ind(index(tmpoid));
> MibTableRow* row = find_index(ind);
> // check for status upgrade only if it is nessesary
> if (get_row_status(row) == rowNotReady) {
> ... // Do propagation to notInService if
> possible.
> }
> #if JE_AGENTPP_USE_DESTROY_DEAD_NEWBORN_ROW
> else if (get_row_status(row) == rowDestroy) {
> // -- CHECK: New-born row should be destroyed
> again.
> remove_row(ind);
> notify_change(ind, REMOVE);
> }
> #endif
> }
> }
> return status;
> }
>
>
> NOTES:
> The patch is simplistic.
> This means for the syndrome described above, a row is created and then
> destroyed again.
> In general, I would assume that you would want to omit the row creation in
> this case.
> But at least the row is not kept DEAD and hanging around in the MIbTable.
>
> Ciao,
> Jens Engel
>
>
>
> _______________________________________________
> 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