Dave,

 Thanks for your help. It is working fine for me :-).

Another issue I am having is problem during get and set of string values.

First if I set "test" to a string type oid , snmpget results in "test".
Again if I set "try" to the same oid, the result of snmpget is "tryt"
ie., the length of the
variable holding this string is growing dynamically.

Pls see the attached sample code(containing handler function and
varaible declaration alone) I am using for one particular scalar
string type oid.

Thanks

On 6/21/05, Dave Shield <[EMAIL PROTECTED]> wrote:
> 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
> 
> 
>

Attachment: sample.c
Description: Binary data

Reply via email to