[AGENT++] MibComplexEntry::find_succ() override called at least twice

Frank Fock fock at agentpp.com
Tue Nov 1 12:29:02 CET 2011


Hi Paul,

I am aware of that design issue that could lead to unnecessary calls
of the find_succ() method. However, without changing major parts
of the AGENT++ architecture, the second call cannot be eliminated
(if remember my investigation on this subject years ago correctly).

Neverthelles, I will put your issue into our JIRA system for the 3.6
release. May be we can find a solution. The ticket ID is "APP-17".

Best regards,
Frank

Am 27.10.2011 18:38, schrieb Stath, Paul:
> While evaluating Agent++ as an embedded SNMP agent for our device, I was implementing a enterprise table as a subclass of MibComplexEntry.
>
> While debugging my implementation, I discovered that the find_succ() method is being called a minimum of two times for each subrequest in the PDU.
>
> Note:  Agent++ v3.5.31 compiled with _SNMPv3 defined.
>
> In looking at the code, I can see that in the method Mib::process_request(Request *req, int reqind),
> a call is made to Mib::find_next(MibContext* context, Oidx&  oid, MibEntryPtr&  entry, Request* req, const int).
>
> For MibEntry subclasses where is_complex_node() is true, a call is made to entry->find_succ(), to simply determine IF there IS a "next" value.  (The returned "next" OID is discarded.)
> Then, in the next_access_control() method, the entry->find_succ() method is called a second time, producing the same results as above.
>
> It does appear that the next_access_control() method will not return until an OID that is viewable is found there is no "next" OID, so the problem
> appears to be a single extra call to entry->find_succ() per MibEntry subclass, rather than N * 2 entry->find_succ() calls.
>
> Would it be possible to refactor the Mib::process_request() method so that find_succ() doesn't end up being called more times than necessary?
>
> -- Paul Stath
> ________________________________
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp




More information about the AGENTPP mailing list