On Wed, 17 Nov 2004 18:09:36 -0800 Fong wrote:
FT> I am trying to fetch a value for variable(a known OID). 
FT>  
FT> What I know is (oid * name, size_t namelen), from it I want to get
FT> (findVar of  struct variable *)  to find the value for the OID. Here is
FT> what I did:
FT> tree_ptr = netsnmp_subtree_find(name, namelen, NULL, "");
FT> 
FT>  I've tried to use tree_ptr->variables but it is nothing there.  I only
FT> see tree_ptr->reginfo->handler->myvoid. How can I get a struct variable
FT> * from this tree_ptr? Is it the right way to get the data?

The agent doesn't keep data in memory in the tree. The hander must be called to
get the data. It would be rather tricky to try and properly set up all the
parameters to do this directly, so I'd suggest that you use the callback
mechanism to send a SNMP request to the agent. See the disman code
for an example of how to do this (start looking in mteTriggerTable.c). Of
course, this won't work during set processing.

Alternatively, if the other table is one of your own, just access the data
directly. This is the only option if you need the data during set processing.

-- 
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. 


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to