Hi I am trying to implement a table using net-snmp5.1. I have a simple array that I want to rertieve from this table. When I do a walk on this table it loops forever in my get_next entry function. I have attached relevant part of my code. It would be of great help if you could suggest me any thing wrong there.
-- -- Example Tables MIB defination -- lnbCustom2Table OBJECT-TYPE SYNTAX SEQUENCE OF LnbCustom2Entry MAX-ACCESS not-accessible STATUS current DESCRIPTION "" ::= { lnbTypeCustom2 3 } lnbCustom2Entry OBJECT-TYPE SYNTAX LnbCustom2Entry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A row describing a given working group" INDEX { lnbEntryLoBand } ::= {lnbCustom2Table 1 } LnbCustom2Entry ::= SEQUENCE { lnbEntryLoBand Counter32, lnbEntryHiBand Counter32, lnbEntryOscFreq Counter32, lnbEntryPolar INTEGER, lnbEntryTone INTEGER, lnbEntryVoltage INTEGER } ///////Agent implementation //////// /////My structure/////////// typedef struct { unsigned int loBand; unsigned int hiBand; unsigned int localOscFreq; TUNER_polarization_t polarization; TUNER_tone_t tone; TUNER_voltage_t voltage; } __attribute__ ((packed)) TUNER_bandinfo_t; TUNER_bandinfo_t custom2table[4]; ***during initialization of the table I load this table with appropiate value and make sure they are ok. ////My get (first/next function)//////////// netsnmp_variable_list * lnbCustom2Table_get_first_data_point( void **my_loop_context, void **my_data_context, netsnmp_variable_list *put_index_data, netsnmp_iterator_info *mydata) { *my_loop_context = 0 ; return lnbCustom2Table_get_next_data_point (my_loop_context, my_data_context, put_index_data, mydata); } netsnmp_variable_list * lnbCustom2Table_get_next_data_point( void **my_loop_context, void **my_data_context, netsnmp_variable_list *put_index_data, netsnmp_iterator_info *mydata) { int i = (int)*my_loop_context; DEBUGMSGTL(("lnbCustom2Table", "lnbCustom2Table_get_next_data_point \n")); netsnmp_variable_list *vptr; vptr = put_index_data; snmp_set_var_value(vptr, (u_char *)&custom2table[i].loBand, sizeof(custom2table[i].loBand) ); DEBUGMSGTL(("lnbCustom2Table", "lnbCustom2Table_get_next_data_point loBand\n")); *my_data_context = (void*)&custom2table[i]; *my_loop_context = (void*)++i; DEBUGMSGTL(("lnbCustom2Table", "lnbCustom2Table_get_next_data_point end\n")); return put_index_data; } ////Following is my Debug Output////// Turning on AgentX master support. NET-SNMP version 5.1 lnbCustom2Table: lnbCustom2Table_get_first_data_point lnbCustom2Table: lnbCustom2Table_get_next_data_point lnbCustom2Table: lnbCustom2Table_get_next_data_point loBand lnbCustom2Table: lnbCustom2Table_get_next_data_point end lnbCustom2Table: lnbCustom2Table_get_next_data_point lnbCustom2Table: lnbCustom2Table_get_next_data_point loBand lnbCustom2Table: lnbCustom2Table_get_next_data_point end lnbCustom2Table: lnbCustom2Table_get_next_data_point lnbCustom2Table: lnbCustom2Table_get_next_data_point loBand lnbCustom2Table: lnbCustom2Table_get_next_data_point end lnbCustom2Table: lnbCustom2Table_get_next_data_point lnbCustom2Table: lnbCustom2Table_get_next_data_point loBand lnbCustom2Table: lnbCustom2Table_get_next_data_point end lnbCustom2Table: lnbCustom2Table_get_next_data_point lnbCustom2Table: lnbCustom2Table_get_next_data_point loBand lnbCustom2Table: lnbCustom2Table_get_next_data_point end Thanks Sabina __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ Net-snmp-users mailing list [EMAIL PROTECTED] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users