how to fetch the collum and row from oid?

Frank Fock Frank.Fock____t-online.de
Mon Mar 11 23:08:07 CET 2002


Hi Kjersti,

Please find my comments inline:

Kjersti Grønnevik wrote:

> when I have an oid, how can I get the collum and row out of it?

First, you will have to determine the MibEntry instance (i.e. MibTable)
that is managing the OID:

MibEntry* foundEntry;
Mib::find_managing_object(.., foundEntry) // see HTML docs for a description

Then to get the MibLeaf instance managing the OID call:
MibLeaf* leaf = ((MibTable*)foundEntry)->find(request->get_oid(ind));

>
> I know the collum is the last number in the oid, is ther a function that can fetch it out for me?
>

Caution, the last subidentifier is part of the index of an row. In addition, column
subidentifier do not need to match with the column position of an object!

>
> In the myMib.cpp(generated by agentGen) there are get_request functions that shall send the value of the oid back to manager. Is the parameter ind the row ? If not what is the parameter ind?

See HTML docs or the header file (mibentry.h). The ind parameter is the
variable binding (subrequest) in a request that is currently being processed.

>
>
> I fint it difficult to see how I can fetch the oid from the request, are there any examples anyone can email me?

Request::get_oid(int)

Best regards,
Frank





More information about the AGENTPP mailing list