How does the agent determine the table instance that the user wants

Frank Fock Frank.Fock____t-online.de
Wed Nov 15 19:24:21 CET 2000



"Vasay, Al" wrote:

> 1) I have a question about the second parameter of this method -- get_request(Request* req, int ind).  I noticed that it is always zero.  I thought that it would equal to the instance (or index) that I select from my MIB Browser.
>

ind in the get_request denotes the index of the subrequest that is currently
being processed. Thus, if your GET request issued from your browser has
only one subreqest, then this parameter will always be 0.

>
> In my agent, I need to be able to know the instance (or index) that the user wants to get because my information is stored in an array and the only way I can access the data is through index.  And I thought the second parameter will give me that index.  But in my debugging, it is always equal to zero no matter what instance I select from the browser.
>

That is the desired behavior. See above.

>
> My question is -- What is that second parameter supposed to be? How can I determine the user-selected instance?
>

Within the leaf, you have to choices:
1. Call my_row->get_index() which returns the OID of the
index of the row the columnar resides in.
2. Call my_table->get_index(req->get_oid()) which returns
the same value as 1.

>
> 2) My next question is pretty much related to the first.  I was afraid that the reason why I get zero for the second parameter of the get_request method is because I'm creating my rows incorrectly.  So, how do I initialize a table with more than one row?  This is what I did:

You created the rows correctly!

Hope my answer helps.

Best regards,
Frank

--
Frank Fock - AGENT++
Email: frank____fock.de
Fax: +49 7195 177108





More information about the AGENTPP mailing list