-----Original Message----- From: Dave Shield [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 03, 2005 5:49 AM To: Toth, Gregory S Cc: net-snmp-coders@lists.sourceforge.net Subject: RE: How to implement tables in 5.0.6
On Fri, 2005-04-29 at 23:31, Toth, Gregory S wrote: > >> oid my_oid[] ={ 1,2,3,4,5,6,7,1}; > >> vptr = put_index_data; > >> snmp_set_var_value(vptr,(u_char *)my_oid,8); > > >No. > >Try: > > long this_index = 1; // (1,x) elements > > vptr = put_index_data; > > snmp_set_var_value( vptr, (u_char*)&this_index, > sizeof(this_index)); > > return put_index_data; > > This caused the agent to coredump on the snmp_set_var_value call. Hmmm... What was the value of 'put_index_data' ? Where was this code? In the 'get_first' routine, the 'get_next' routine or what? It might be helpful to see the full code for these two routines. Dave Here is the actual code for the method that failed, put_index_data came from the caller, is there anything in put_index_data I should look at?: netsnmp_variable_list * temperatureTable_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; long this_index = 1; vptr = put_index_data; snmp_set_var_value(vptr, (u_char *) this_index , sizeof(this_index) ); return put_index_data; } ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders