I am developing linux snmp agent using net-snmp 5.1.1 and i am really new to snmp agent.Now i am implementing a simple table ,just for studying.After use mib2c with mib2c.iterate.conf as a config file, i got two .h file and one .c file: myTable.c , myTable.h, myTable_columns.h.Then implement methods generated by mib2c.But i meet problems when implements get_first_data_point and get_next_data_point.I write them followed example:netSnmpHostTable.

Because the table is very simple ,so my_loop_context don't exist, in get_next_data_point method i just use an int as a counter , and after a call get_next_data_point, the counter added itself by 1.my code:(counter is also the index of the table)

counter = 1;

put_index_data get_next_data_point(.....) {
counter++;


   snmp_set_var(put_index_data, counter, sizeof(int));

   if(counter <= 8) {
       return put_indexdata;
   }

   return NULL;
}

so i think when i using tablewalk to walk the table, agent should return me eight rows data but actually i got only one. i dont know why......Help!

_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
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

Reply via email to