On Tue, 2005-06-21 at 08:12, aakansha rajvi wrote:
> I am having an issue while implementing table type oids.
> I compiled the MIB using mib2c.create-dataset.conf
> If I do snmpget with multiple oids...
> Only the result of first oid is shown and for the second oid
> "No Such name in the MIB" is displayed.
That's because your handler routine is only processing the first
varbind from the PDU. The "netsnmp_request_info *requests"
parameter is a *list* of varbinds, but you're not processing
the rest of this list.
The bulk of your pethPsePortTable_handler routine needs to
be contained in a loop:
for (request=requests; request; request=request->next) {
table_info = netsnmp_extract_table_info(request);
row=RowFromOidorig(request->requestvb->name, ...);
c =ColFromOidorig(request->requestvb->name, ...);
// etc, etc
}
and similarly change "requests" to "request" throughout the rest
of the routine.
I'm also not sure why you're doing quite so much processing yourself.
The whole point of using the dataset helper is that it will take
care of most of this for you.
And you seem to be duplicating standard routines. For example,
the requested column number is available in the 'table_info->colnum'
field, and the row indexing via the 'table_info->indexes' list.
The routines 'XxxFromOidorig()' seem unnecessary.
But the fundamental problem is that you're not processing the full
request list.
Dave
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders