[AGENT++] NoSuchInstance in case of an unavailable row within a table

Frank Fock fock at agentpp.com
Wed Jul 21 19:14:24 CEST 2004


Hi Marcus,

You will have to overwrite the MibTable::find_next(const Oidx&) method
and return 0 if you cannot find a successor in your table. Normally you
would have overwritten MibEntry::find_succ(const Oidx&), but MibTable
is handled different than other MibEntry subclasses (for historic reasons).
This should/will be sort out in a future release. By overwriting find_next
today you will be safe in any case.

If you do not want to overwrite MibTable::find_next because the information
you need to decide whether an instance is available or not is rather 
local to
your MibLeafs than to the table, then you could overwrite the 
MibLeaf::get_access()
method too and return NOACCESS in case you want to skip it.

Best regards,
Frank

Fehde, Marcus wrote:

>Hi!
> 
>I've a table of MibTable with derived MibLeaf instances as columns.
>The get-method is overloaded and retrieves always the current value of something.
>If I can't retrieve the current value a want to return a noSuchInstance exception to mark the row or single cell as currently unavailable.
>I did it this way: vb.set_syntax( sNMP_SYNTAX_NOSUCHINSTANCE ) : vb was taken from request
> 
>The problem is that the agent does not try to retrieve the next available instance, but responses the OID contained in the GETNEXT-request. The result is that my MIB browser does an endless loop.
>The exception is included in the response varbind.
> 
>Can somebody tell me what the problem is?
> 
>Best regards/Mit freundlichen Gruessen 
>
>Marcus Fehde
>Dipl. Ing. Technische Informatik (FH)
>
>Research & Development 
>Business Unit Anaesthesia 
>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>
>DRÄGER MEDICAL 
>
>Dräger Medical AG & Co. KGaA 
>Moislinger Allee 53-55 
>D-23542 Lübeck 
>
>Tel:  + 49-451-882-3646 
>Fax: + 49-451-882-4410 
>E-mail: marcus.fehde at draeger.com 
>www.draeger-medical.com 
>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>
> 
> 
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://agentpp.org/mailman/listinfo/agentpp
>  
>





More information about the AGENTPP mailing list