On Wed, 23 Feb 2005 22:30:23 +0530 (IST) madanagopal wrote:
M> > M> If [the response] has not come, i set "SNMP_ERR_NOSUCHNAME" to 
M> > M> requests->status and unmark the request as delegated. But i get another
M> > M> 
M> > M> request for the next registered mib tree.
M> > M> [...]
M> > M> when i don't delegate the request but still set "SNMP_ERR_NOSUCHNAME",
M> > M> the agent returns no such instance and doesn't generate another request
M> > M> for the next registered mib tree. Why is this inconsistent? I am using
M> > M> table handler in net-snmp version 5.1.
M> > 
M> > What kind of request is this? A get, or a getnext (walk)?
M> 
M> This is a getnext request mostly part of a walk.

If no instance is found by a handler, the agent should move on to the next row,
column or handler. This is actually not an error case, so you shouldn't set an
error at all. simply return without processing the variable.

M> I have registered a handler for a set of oids(tables). When any request 
M> for any of them come, i check whether the required data is available in
M> local cache that i maintain using my own data structures. If it is available
M> i use them. For some specific columns i explicitly set "SNMP_ERR_NOSUCHNAME"
M> since the other process doesn't currently support them.

Two things. First, you can set up the valid_columns structure of the table
handler, and you will not get called for those columns. Second, the correct
error is SNMP_ERR_NOSUCHOBJECT. This should result in your handler being called
again for the next column.

M> Else i sent the 
M> request to the other process using sockets and delegate it. In the alarm 
M> callback function if the data is not yet received i set the error 
M> "SNMP_ERR_NOSUCHNAME" and unmark as delegated. 

Again, lack of data is not an error. Simply return so that the agent can move
on to the next table.

M> Also i would like to add one more thing. Since the communication to the 
M> other process takes time and most of the walks are for columns, i tried 
M> setting explicitly "SNMP_ERR_NOSUCHNAME" after the column ends so that no 
M> request is generated for the next column. This works if don't delegate the 
M> request. If i delegate and then later set this error, it generates new 
M> request for the next mib tree(table). Even though this is not complying 
M> with SNMP is this achievable?

I don't understand what you are trying to achieve. If communication time is the
problem, you are better off caching, instead of not following the protocol
rules.

M> I am using table handler directly without using mib2c. I want to use 
M> SNMPv3 contexts. Since data is external, i have to use iterator helper. 

That's not necessarily true. With a little work you can use caching
to work with array-user. If you upgrade to 5.2.1, you can use the new mfd
helper too.

M> But since the get_first and get_next data point functions don't support 
M> contexts i couldn't use them.

They don't, but you can fake it. simply register each table with a unique
get_first and get_next routine, and those unique routines identify the context,
and can then call more generic routines to do the work.

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to