Wes, 

Thanks! So my situation is...I have built a mib which is a list of scalars 
(can't use tables due to customer limitation). The MIB looks like this:

....
device1   OBJECT IDENTIFIER ::= { xpressObjects 1 }
point1    OBJECT TYPE
    SYNTAX OCTET STRING
    MAX-ACCESS read-only
    STATUS current
    ::= { device1 1 }

point2    OBJECT TYPE
    SYNTAX OCTET STRING
    MAX-ACCESS read-only
    STATUS current
    ::= { device1 2 }
....

Note the xpressObjects oid is .1.3.6.1.4.1.2286.85.1.1.4

So when a GET request comes in I do a get_tree on the oid (.1.3.6.1.4.1.2286.85.
1.1.4.1.1.0). This returns the "point1" node. I get the label of that and the 
label of the parent (device1) and send a async network query to another server 
to get the value of point1 on device1. This all works fine with the delegated 
flag.

The problem is when I receive a GETNEXT request for the same oid (.1.3.6.1.4.1.
2286.85.1.1.4.1.1.0) I want to return the .1.3.6.1.4.1.2286.85.1.1.4.1.2.0 oid 
and value. So I do the same thing, get_tree on the incoming oid (.1.3.6.1.4.1.
2286.85.1.1.4.1.1.0) unfortunatly the next pointer of that node is not the .1.2.
0. Is there a way to use the tree struct to fingure that info out, what is the 
next node given an oid? I am not sure how the table_iterator or table_array 
helpers will help me here.

  Thanks

    Glenn

Quoting Wes Hardaker <[EMAIL PROTECTED]>:

> >>>>> On Wed,  9 Jun 2004 08:39:07 -0700, Glenn MacGregor
> <[EMAIL PROTECTED]> said:
> 
> Glenn> I am writing a subagent for net-snmp-5.1.1. Just getting into
> Glenn> handling the getnext request. I am not too sure how to handle
> Glenn> this... I have a mib and I get the struct tree for the oid that
> Glenn> is asked for, is there a way to get the next oid in the tree
> Glenn> from that?
> 
> Glenn> Is there some alogrithm that I can implement to simplify this
> Glenn> process?
> 
> I'm not sure what API mechanism you're working with in the agent, but
> it sounds like you might look into one of our "helper" APIs that take
> the burden off of you for implement proper GETNEXT ordering.  The
> table_iterator has been the most popular helper in these types of
> problems if the data is stored somewhere outside the agent (in the
> kernel, file, etc).  The array helper has been the most popular if you can
> actually keep the data stored within the mib code itself.
> 
> 
> -- 
> Wes Hardaker
> Sparta
> 


Glenn MacGregor
HighStreet Networks

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to