Thanks Dave for your response, I tried modifying the
code something like this with SNMP_MALLOC_TYPEDEF
method, but still it returns "No Entries" error.
Kindly let me know if I am missing anything else.
netsnmp_variable_list *
myTestTable_get_first_data_point(void
**my_loop_context,
void
**my_data_context,
netsnmp_variable_list *
put_index_data,
netsnmp_iterator_info
*mydata)
{
netsnmp_variable_list *vptr;
struct myTable_info *node;
node = SNMP_MALLOC_TYPEDEF(myTable_info);
memset(node, 0, sizeof(myTable_info));
vptr = put_index_data;
*my_loop_context = node;
*my_data_context = node;
node->myIndex1 = 1;
node->myIndex2 = 1;
node->myIndex3 = 1;
node->myTableObject1 = 1;
node->myTableObject2 = 1;
snmp_set_var_value(vptr, (u_char *)
&node->myIndex1,sizeof(node->myIndex1));
vptr = vptr->next_variable;
snmp_set_var_value(vptr, (u_char *)
&node->myIndex2,sizeof(node->myIndex2));
vptr = vptr->next_variable;
snmp_set_var_value(vptr, (u_char *)
&node->myIndex3,sizeof(node->myIndex3));
vptr = vptr->next_variable;
return put_index_data;
}
--- [EMAIL PROTECTED] wrote:
> > I am trying to implement a table with two objects
> and
> > three indices. I am just trying to fill the stub
> > values for testing purpose...
> > .... Kindly look at the code and comment whether
> I am
> > implementing the "get_first_data_point()" function
> > correctly or not
>
>
> No - that code looks basically correct.
> Normally I'd expect the 'node' structure to be
> defined
> and initialised outside the get_{first,next}
> routine.
> Perhaps looking at some globally-scoped linked list,
> or loaded from some other subsystem.
> But since you say you're just working with stub
> values,
> I presume this is part of your initial simple tests.
>
> The one thing that does seem wrong is that you never
> actually allocate memory for this structure. You
> seem
> to be allocating values into thin air.
> Shouldn't you "malloc" space for this structure
> somewhere?
>
> Dave
>
>
----------------------------------------------------------------
> This message was sent using IMP, the Internet
> Messaging Program.
>
>
____________________________________________________________________________________
Sponsored Link
Get an Online or Campus degree
Associate's, Bachelor's, or Master's - in less than one year.
http://www.findtherightschool.com
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders